Leadtools.Annotations Namespace > AnnObject Class : Lock Method |
function Leadtools.Annotations.AnnObject.Lock( password )
Only unlocked objects can be locked. If an object is already locked, it will stay locked with its original password. You must pass the same password to Unlock to unlock this AnnObject.
If this method succeeds, password will be stored inside the object and can be retreived with the Password property.
An object must be unlocked in order to change that object in automated mode.
For more information, refer to Implementing Annotation Security.
Public Sub AnnObject_Lock(ByVal obj As AnnObject, ByVal password As String) If obj.IsLocked Then MessageBox.Show("Object is locked. It will be unlocked.") If String.Compare(password, obj.Password, False) <> 0 Then MessageBox.Show("Invalid password!!") Else obj.Unlock(password) End If Else MessageBox.Show("Object was not locked. It will be locked now.") obj.Lock(password) End If End Sub
public void AnnObject_Lock(AnnObject obj, string password) { if(obj.IsLocked) { MessageBox.Show("Object is locked. It will be unlocked."); if(string.Compare(password, obj.Password, false) != 0) MessageBox.Show("Invalid password!!"); else obj.Unlock(password); } else { MessageBox.Show("Object was not locked. It will be locked now."); obj.Lock(password); } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2