The StartEditing Method supports WPF/Silverlight.
The StartEditing Method is available in LEADTOOLS Document and Medical Imaging toolkits.
Starts editing the given
AnnObject.
Supported in Silverlight, Windows Phone 7
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As AnnAutomation
Dim annObject As AnnObject
Dim group As Boolean
instance.StartEditing(annObject, group) |
Parameters
- annObject
- An existing AnnObject to edit.
- group
- true to group this annObject with the object(s) currently being edited if(any); false otherwise.
Example
This example will add a new rectangle object to the active automation of an automation manager. It will then "select" this object and make it ready for editing.
Visual Basic | Copy Code |
---|
Private Sub AnnAutomation_StartEditing(ByVal manager As AnnAutomationManager)
' find the active automation
Dim automation As AnnAutomation = Nothing
Dim index As Integer = 0
Do While index < manager.Automations.Count AndAlso automation Is Nothing
If manager.Automations(index).Active Then
automation = manager.Automations(index)
End If
index += 1
Loop
If Not automation Is Nothing Then
' add a new rectangle object to this automation
Dim rectObj As AnnRectangleObject = New AnnRectangleObject()
rectObj.Rect = New Rect(100, 100, 200, 200)
rectObj.Stroke = Colors.Blue
rectObj.StrokeThickness = 2.0
rectObj.Fill = Colors.Yellow
' surround the changes to the automation by an undo
automation.BeginUndo()
automation.Container.Children.Add(rectObj)
' "select" this rectangle and make it ready for editing
automation.StartEditing(rectObj, False)
automation.EndUndo()
End If
End Sub |
C# | Copy Code |
---|
private void AnnAutomation_StartEditing(AnnAutomationManager manager)
{
// find the active automation
AnnAutomation automation = null;
for(int index = 0; index < manager.Automations.Count && automation == null; index++)
{
if(manager.Automations[index].Active)
automation = manager.Automations[index];
}
if(automation != null)
{
// add a new rectangle object to this automation
AnnRectangleObject rectObj = new AnnRectangleObject();
rectObj.Rect = new Rect(100, 100, 200, 200);
rectObj.Stroke = Colors.Blue;
rectObj.Fill = Colors.Yellow;
rectObj.StrokeThickness = 2.0;
// surround the changes to the automation by an undo
automation.BeginUndo();
automation.Container.Children.Add(rectObj);
// "select" this rectangle and make it ready for editing
automation.StartEditing(rectObj, false);
automation.EndUndo();
}
} |
SilverlightCSharp | Copy Code |
---|
private void AnnAutomation_StartEditing(AnnAutomationManager manager)
{
// find the active automation
AnnAutomation automation = null;
for(int index = 0; index < manager.Automations.Count && automation == null; index++)
{
if(manager.Automations[index].Active)
automation = manager.Automations[index];
}
if(automation != null)
{
// add a new rectangle object to this automation
AnnRectangleObject rectObj = new AnnRectangleObject();
rectObj.Rect = new Rect(100, 100, 200, 200);
rectObj.Stroke = Colors.Blue;
rectObj.Fill = Colors.Yellow;
rectObj.StrokeThickness = 2.0;
// surround the changes to the automation by an undo
automation.BeginUndo();
automation.Container.Children.Add(rectObj);
// "select" this rectangle and make it ready for editing
automation.StartEditing(rectObj, false);
automation.EndUndo();
}
} |
SilverlightVB | Copy Code |
---|
Private Sub AnnAutomation_StartEditing(ByVal manager As AnnAutomationManager)
' find the active automation
Dim automation As AnnAutomation = Nothing
Dim index As Integer = 0
Do While index < manager.Automations.Count AndAlso automation Is Nothing
If manager.Automations(index).Active Then
automation = manager.Automations(index)
End If
index += 1
Loop
If Not automation Is Nothing Then
' add a new rectangle object to this automation
Dim rectObj As AnnRectangleObject = New AnnRectangleObject()
rectObj.Rect = New Rect(100, 100, 200, 200)
rectObj.Stroke = Colors.Blue
rectObj.Fill = Colors.Yellow
rectObj.StrokeThickness = 2.0
' surround the changes to the automation by an undo
automation.BeginUndo()
automation.Container.Children.Add(rectObj)
' "select" this rectangle and make it ready for editing
automation.StartEditing(rectObj, False)
automation.EndUndo()
End If
End Sub |
Remarks
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