DesktopSDK 0.7 - PenComm Library (C#) Documentation
ContentsIndexHome
Get Set Package Attributes Example
Examples
    private void GetPackageAttribute(Smartpen pen, string className,
        out string categoryName, out string groupName, out string groupVersion, out byte isLocked, out byte isPrivate, out string versionString)
    {
        try
        {
            // Find package
            foreach (PackageItem item in pen.Packages.Items)
            {
                if (item.ClassName == className)// match the class name?
                {
                    // Get attributes
                    categoryName = item.CategoryName;
                    groupName = item.GroupName;
                    groupVersion = item.GroupVersion;
                    isLocked = item.Locked;
                    isPrivate = item.Private;
                    versionString = item.Version;
                    break;
                }
            }
        }
        catch (Exception e)
        {
            HandleError(e);
        }
    }

    private void SetPackageAttribute(Smartpen pen, string className,
        string categoryName, string groupName, string groupVersion, byte isLocked, byte isPrivate, string versionString)
    {
        try
        {
            // Find the package
            foreach (PackageItem item in pen.Packages.Items)
            {
                if (item.ClassName == className)// match the class name?
                {
                    // Set attributes
                    item.CategoryName = categoryName;
                    item.GroupName = groupName;
                    item.GroupVersion = groupVersion;
                    item.Locked = isLocked;
                    item.Private = isPrivate;
                    item.Version = versionString;

                    // Commit to pen
                    item.Save();
                    break;
                }
            }
        }
        catch (Exception e)
        {
            HandleError(e);
        }
    }
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright © 2010 Livescribe, Inc. All rights reserved.