LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.31
RealizeRedaction Method
See Also 
Leadtools.Windows.Annotations Namespace > AnnAutomation Class : RealizeRedaction Method



The RealizeRedaction Method supports WPF/Silverlight.

The RealizeRedaction Method is available in LEADTOOLS Document and Medical Imaging toolkits.

Realizes the AnnRedactionObject object currently being edited (selected). Supported in Silverlight, Windows Phone 7

Syntax

Visual Basic (Declaration) 
Public Overridable Sub RealizeRedaction() 
Visual Basic (Usage)Copy Code
Dim instance As AnnAutomation
 
instance.RealizeRedaction()
C# 
public virtual void RealizeRedaction()
C++/CLI 
public:
virtual void RealizeRedaction(); 

Example

Visual BasicCopy Code
Private Sub AnnAutomation_RealizeRedaction(ByVal automation As AnnAutomation)
   ' first add a new redaction object to the automation
   Dim redaction As AnnRedactionObject = New AnnRedactionObject()
   redaction.Rect = New Rect(100, 100, 100, 100)
   automation.Container.Children.Add(redaction)
   ' make sure no objects are selected in the automation
   automation.SelectNone()

   ' see if we can realize or restore the object (this should show a message informing you that no objects are currently selected (bring edited)
   RealizeRestoreRedaction(automation)

   ' select (edit) the object we have just added
   automation.StartEditing(redaction, False)

   ' see if we can realize/restore the object (should realize the redaction)
   RealizeRestoreRedaction(automation)

   ' see if we can realize/restore the object (should restore the redaction)
   RealizeRestoreRedaction(automation)
End Sub

Private Sub RealizeRestoreRedaction(ByVal automation As AnnAutomation)
   ' first, check if we can realize or restore the object
   If automation.CanRealizeRedaction Then
      ' realize
      automation.RealizeRedaction()
      MessageBox.Show("Redaction object has been realized")
   ElseIf automation.CanRestoreRedaction Then
      ' restore this object
      automation.RestoreRedaction()
      MessageBox.Show("Redaction object has been restored")
   Else
      MessageBox.Show("Cannot realize or restore because no redaction object is currently being edited (selected)")
   End If
End Sub
C#Copy Code
private void AnnAutomation_RealizeRedaction(AnnAutomation automation)
{
   // first add a new redaction object to the automation
   AnnRedactionObject redaction = new AnnRedactionObject();
   redaction.Rect = new Rect(100, 100, 100, 100);
   automation.Container.Children.Add(redaction);
   // make sure no objects are selected in the automation
   automation.SelectNone();

   // see if we can realize or restore the object (this should show a message informing you that no objects are currently selected (bring edited)
   RealizeRestoreRedaction(automation);

   // select (edit) the object we have just added
   automation.StartEditing(redaction, false);

   // see if we can realize/restore the object (should realize the redaction)
   RealizeRestoreRedaction(automation);

   // see if we can realize/restore the object (should restore the redaction)
   RealizeRestoreRedaction(automation);
}

private void RealizeRestoreRedaction(AnnAutomation automation)
{
   // first, check if we can realize or restore the object
   if(automation.CanRealizeRedaction)
   {
      // realize
      automation.RealizeRedaction();
      MessageBox.Show("Redaction object has been realized");
   }
   else if(automation.CanRestoreRedaction)
   {
      // restore this object
      automation.RestoreRedaction();
      MessageBox.Show("Redaction object has been restored");
   }
   else
      MessageBox.Show("Cannot realize or restore because no redaction object is currently being edited (selected)");
}
SilverlightCSharpCopy Code
private void AnnAutomation_RealizeRedaction(AnnAutomation automation)
{
   // first add a new redaction object to the automation
   AnnRedactionObject redaction = new AnnRedactionObject();
   redaction.Rect = new Rect(100, 100, 100, 100);
   automation.Container.Children.Add(redaction);
   // make sure no objects are selected in the automation
   automation.SelectNone();

   // see if we can realize or restore the object (this should show a message informing you that no objects are currently selected (bring edited)
   RealizeRestoreRedaction(automation);

   // select (edit) the object we have just added
   automation.StartEditing(redaction, false);

   // see if we can realize/restore the object (should realize the redaction)
   RealizeRestoreRedaction(automation);

   // see if we can realize/restore the object (should restore the redaction)
   RealizeRestoreRedaction(automation);
}

private void RealizeRestoreRedaction(AnnAutomation automation)
{
   // first, check if we can realize or restore the object
   if(automation.CanRealizeRedaction)
   {
      // realize
      automation.RealizeRedaction();
      MessageBox.Show("Redaction object has been realized");
   }
   else if(automation.CanRestoreRedaction)
   {
      // restore this object
      automation.RestoreRedaction();
      MessageBox.Show("Redaction object has been restored");
   }
   else
      MessageBox.Show("Cannot realize or restore because no redaction object is currently being edited (selected)");
}
SilverlightVBCopy Code
Private Sub AnnAutomation_RealizeRedaction(ByVal automation As AnnAutomation)
   ' first add a new redaction object to the automation
   Dim redaction As AnnRedactionObject = New AnnRedactionObject()
   redaction.Rect = New Rect(100, 100, 100, 100)
   automation.Container.Children.Add(redaction)
   ' make sure no objects are selected in the automation
   automation.SelectNone()

   ' see if we can realize or restore the object (this should show a message informing you that no objects are currently selected (bring edited)
   RealizeRestoreRedaction(automation)

   ' select (edit) the object we have just added
   automation.StartEditing(redaction, False)

   ' see if we can realize/restore the object (should realize the redaction)
   RealizeRestoreRedaction(automation)

   ' see if we can realize/restore the object (should restore the redaction)
   RealizeRestoreRedaction(automation)
End Sub

Private Sub RealizeRestoreRedaction(ByVal automation As AnnAutomation)
   ' first, check if we can realize or restore the object
   If automation.CanRealizeRedaction Then
      ' realize
      automation.RealizeRedaction()
      MessageBox.Show("Redaction object has been realized")
   Else If automation.CanRestoreRedaction Then
      ' restore this object
      automation.RestoreRedaction()
      MessageBox.Show("Redaction object has been restored")
   Else
      MessageBox.Show("Cannot realize or restore because no redaction object is currently being edited (selected)")
   End If
End Sub

Remarks

Use the CanRealizeRedaction property to determine whether you can currently call this method.

This method will call the Realize method of the AnnRedactionObject class.

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also

RealizeRedaction requires a Document/Medical product license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features and Unlocking Special LEAD Features.