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
RealizeAllRedactions Method
See Also 
Leadtools.Windows.Annotations Namespace > AnnAutomation Class : RealizeAllRedactions Method



The RealizeAllRedactions Method supports WPF/Silverlight.

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

Realizes all the AnnRedactionObject objects in this AnnAutomation. Supported in Silverlight, Windows Phone 7

Syntax

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

Example

Visual BasicCopy Code
Private Sub AnnAutomation_RealizeAllRedactions(ByVal automation As AnnAutomation)
   ' remove all objects from this automation
   automation.SelectAll()
   automation.Delete()
   ' see if we can realize or restore all the redaction objects (this should show a message informing you there are no redaction objects in this automation)
   RealizeRestoreAllRedactions(automation)

   ' first add a couple of 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)

   redaction = New AnnRedactionObject()
   redaction.Rect = New Rect(300, 300, 100, 100)
   automation.Container.Children.Add(redaction)


   ' see if we can realize/restore the objects (should realize the redactions)
   RealizeRestoreAllRedactions(automation)

   ' see if we can realize/restore the objects (should restore the redactions)
   RealizeRestoreAllRedactions(automation)
End Sub

Private Sub RealizeRestoreAllRedactions(ByVal automation As AnnAutomation)
   If automation.CanRealizeAllRedactions Then
      ' realize
      automation.RealizeAllRedactions()
      MessageBox.Show("Redaction objects have been realized")
   ElseIf automation.CanRestoreAllRedactions Then
      ' restore
      automation.RestoreAllRedactions()
      MessageBox.Show("Redaction objects have been restored")
   Else
      MessageBox.Show("Cannot realize or restore because no redaction object is currently in this automation")
   End If
End Sub
C#Copy Code
private void AnnAutomation_RealizeAllRedactions(AnnAutomation automation)
{
   // remove all objects from this automation
   automation.SelectAll();
   automation.Delete();
   // see if we can realize or restore all the redaction objects (this should show a message informing you there are no redaction objects in this automation)
   RealizeRestoreAllRedactions(automation);

   // first add a couple of new redaction object to the automation
   AnnRedactionObject redaction = new AnnRedactionObject();
   redaction.Rect = new Rect(100, 100, 100, 100);
   automation.Container.Children.Add(redaction);

   redaction = new AnnRedactionObject();
   redaction.Rect = new Rect(300, 300, 100, 100);
   automation.Container.Children.Add(redaction);


   // see if we can realize/restore the objects (should realize the redactions)
   RealizeRestoreAllRedactions(automation);

   // see if we can realize/restore the objects (should restore the redactions)
   RealizeRestoreAllRedactions(automation);
}

private void RealizeRestoreAllRedactions(AnnAutomation automation)
{
   if(automation.CanRealizeAllRedactions)
   {
      // realize
      automation.RealizeAllRedactions();
      MessageBox.Show("Redaction objects have been realized");
   }
   else if(automation.CanRestoreAllRedactions)
   {
      // restore
      automation.RestoreAllRedactions();
      MessageBox.Show("Redaction objects have been restored");
   }
   else
      MessageBox.Show("Cannot realize or restore because no redaction object is currently in this automation");
}
SilverlightCSharpCopy Code
private void AnnAutomation_RealizeAllRedactions(AnnAutomation automation)
{
   // remove all objects from this automation
   automation.SelectAll();
   automation.Delete();
   // see if we can realize or restore all the redaction objects (this should show a message informing you there are no redaction objects in this automation)
   RealizeRestoreAllRedactions(automation);

   // first add a couple of new redaction object to the automation
   AnnRedactionObject redaction = new AnnRedactionObject();
   redaction.Rect = new Rect(100, 100, 100, 100);
   automation.Container.Children.Add(redaction);

   redaction = new AnnRedactionObject();
   redaction.Rect = new Rect(300, 300, 100, 100);
   automation.Container.Children.Add(redaction);


   // see if we can realize/restore the objects (should realize the redactions)
   RealizeRestoreAllRedactions(automation);

   // see if we can realize/restore the objects (should restore the redactions)
   RealizeRestoreAllRedactions(automation);
}

private void RealizeRestoreAllRedactions(AnnAutomation automation)
{
   if(automation.CanRealizeAllRedactions)
   {
      // realize
      automation.RealizeAllRedactions();
      MessageBox.Show("Redaction objects have been realized");
   }
   else if(automation.CanRestoreAllRedactions)
   {
      // restore
      automation.RestoreAllRedactions();
      MessageBox.Show("Redaction objects have been restored");
   }
   else
      MessageBox.Show("Cannot realize or restore because no redaction object is currently in this automation");
}
SilverlightVBCopy Code
Private Sub AnnAutomation_RealizeAllRedactions(ByVal automation As AnnAutomation)
   ' remove all objects from this automation
   automation.SelectAll()
   automation.Delete()
   ' see if we can realize or restore all the redaction objects (this should show a message informing you there are no redaction objects in this automation)
   RealizeRestoreAllRedactions(automation)

   ' first add a couple of 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)

   redaction = New AnnRedactionObject()
   redaction.Rect = New Rect(300, 300, 100, 100)
   automation.Container.Children.Add(redaction)


   ' see if we can realize/restore the objects (should realize the redactions)
   RealizeRestoreAllRedactions(automation)

   ' see if we can realize/restore the objects (should restore the redactions)
   RealizeRestoreAllRedactions(automation)
End Sub

Private Sub RealizeRestoreAllRedactions(ByVal automation As AnnAutomation)
   If automation.CanRealizeAllRedactions Then
      ' realize
      automation.RealizeAllRedactions()
      MessageBox.Show("Redaction objects have been realized")
   Else If automation.CanRestoreAllRedactions Then
      ' restore
      automation.RestoreAllRedactions()
      MessageBox.Show("Redaction objects have been restored")
   Else
      MessageBox.Show("Cannot realize or restore because no redaction object is currently in this automation")
   End If
End Sub

Remarks

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

This method will call the AnnRedactionObject.Realize method for all AnnRedactionObject objects that have the AnnRedactionObject.IsRealized value set to false.

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

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