Debug - Split a line into multiple lines to determine the cause of an error.
Debug - Added logic so that focus is not given to an object that is being disposed.
This commit is contained in:
		@@ -57,7 +57,14 @@ namespace VEPROMS
 | 
			
		||||
				}
 | 
			
		||||
				else // Step Tab Panel
 | 
			
		||||
				{
 | 
			
		||||
					SelectedDVI = value.MyStepPanel.MyProcedureItemInfo.MyProcedure.ActiveParent as DocVersionInfo;
 | 
			
		||||
					// 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.ActiveParent as DocVersionInfo;
 | 
			
		||||
					// 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);
 | 
			
		||||
 
 | 
			
		||||
@@ -2161,8 +2161,16 @@ namespace Volian.Controls.Library
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public void ItemSelect()
 | 
			
		||||
		{
 | 
			
		||||
			_MyStepRTB.Focus();
 | 
			
		||||
			_MyStepRTB.Select(0, 0);
 | 
			
		||||
			// Was getting an Error that _MyStepRTB was Disposed RHM 20101217
 | 
			
		||||
			if (!_MyStepRTB.Disposing)
 | 
			
		||||
			{
 | 
			
		||||
				_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();
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user