Gets or sets a value indicating whether the password is saved when this
AnnObjectBase is serialized.
This is a dependency property.
Syntax
Visual Basic (Declaration) | |
---|
Public Property SerializePassword As Boolean |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As AnnObjectBase
Dim value As Boolean
instance.SerializePassword = value
value = instance.SerializePassword
|
C# | |
---|
public bool SerializePassword {get; set;} |
C++/CLI | |
---|
public:
property bool SerializePassword {
bool get();
void set (bool value);
} |
XAML Attributes Usage | |
---|
<object SerializePassword=bool .../> |
XAML Attributes Usage | |
---|
<object SerializePassword=bool .../> |
Return Value
true if this password is saved when this
AnnObjectBase is serialized; false otherwise.
Example
This example will implement copying/pasting all objects from a container to the clipboard.
Visual Basic | Copy Code |
---|
Private Shared ReadOnly clipboardFormatName As String = "LeadtoolsWindowsAnnotations"
Public Sub AnnObject_SerializePassword(ByVal container As AnnContainer)
Dim destObjects As System.Collections.ObjectModel.ObservableCollection(Of AnnObjectBase) = New System.Collections.ObjectModel.ObservableCollection(Of AnnObjectBase)()
For Each srcObj As AnnObjectBase In container.Children
Dim destObj As AnnObjectBase = CType(IIf(TypeOf srcObj.Clone() Is AnnObjectBase, srcObj.Clone(), Nothing), AnnObjectBase)
destObj.SerializePassword = False
destObjects.Add(destObj)
Next srcObj
Dim dataObj As DataObject = New DataObject(clipboardFormatName, destObjects)
Clipboard.SetDataObject(dataObj)
End Sub
Private Sub PasteObjectsFromClipboard(ByVal container As AnnContainer)
Dim data As IDataObject = Clipboard.GetDataObject()
If Not data Is Nothing Then
If data.GetDataPresent(clipboardFormatName) Then
Dim objects As System.Collections.ObjectModel.ObservableCollection(Of AnnObjectBase) = CType(IIf(TypeOf data.GetData(clipboardFormatName) Is System.Collections.ObjectModel.ObservableCollection(Of AnnObjectBase), data.GetData(clipboardFormatName), Nothing), System.Collections.ObjectModel.ObservableCollection(Of AnnObjectBase))
Do While objects.Count > 0
Dim obj As AnnObjectBase = objects(0)
objects.RemoveAt(0)
container.Children.Add(obj)
Loop
End If
End If
End Sub
|
C# | Copy Code |
---|
/// private static readonly string clipboardFormatName = "LeadtoolsWindowsAnnotations"; public void AnnObject_SerializePassword(AnnContainer container) { // first create a temporary object collection and copy all objects in the container into it System.Collections.ObjectModel.ObservableCollection<AnnObjectBase> destObjects = new System.Collections.ObjectModel.ObservableCollection<AnnObjectBase>(); foreach(AnnObjectBase srcObj in container.Children) { AnnObjectBase destObj = srcObj.Clone() as AnnObjectBase; // we do not want to save the password of locked objects to the clipbaord destObj.SerializePassword = false; destObjects.Add(destObj); } // copy this object collection to the clipboard DataObject dataObj = new DataObject(clipboardFormatName, destObjects); Clipboard.SetDataObject(dataObj); } private void PasteObjectsFromClipboard(AnnContainer container) { // check if the clipboard has LEADTOOLS annotations objects IDataObject data = Clipboard.GetDataObject(); if(data != null) { if(data.GetDataPresent(clipboardFormatName)) { // get the object collection from the clipboard System.Collections.ObjectModel.ObservableCollection<AnnObjectBase> objects = data.GetData(clipboardFormatName) as System.Collections.ObjectModel.ObservableCollection<AnnObjectBase>; // move the objects from this collection to the container while(objects.Count > 0) { AnnObjectBase obj = objects[0]; objects.RemoveAt(0); container.Children.Add(obj); } } } } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family
See Also