Loupe - Log - Monitor - Resolve
Gibraltar.Agent Namespace / PackagerDialog Class
Members Example

In This Topic
    PackagerDialog Class
    In This Topic
    A wizard dialog version of the packager
    Syntax
    'Declaration
     
    
    Public NotInheritable Class PackagerDialog 
    public sealed class PackagerDialog 
    Remarks

    The user will be presented with a wizard user interface to complete the package and transmission process based on the package configuration in the application configuration file. The length of the wizard will depend on the application configuration settings and the specific method called on this class to start the process.

    There are two constructors for the dialog. The default constructor will package sessions for the current application based on its current product and application name. To send packages for a different application or for multiple applications in the same product use the constructor that accepts a product and (optional) application name.

    Product and Application names are determined automatically by inspecting the .NET assembly that was used to start the current process. If you want to override the product or application name you can do so in your application configuration file.

    Overriding product or application is typically necessary either because the values compiled into the assembly aren't optimal for this purpose or because the automatic values are incorrect due to the application being hosted within another process (like an ASP.NET application).

    Example
    The following example uses the PackagerDialog to display a wizard to the user to send data for the current process and logs to Trace if it doesn't complete successfully. The Packager automatically logs information to the Agent whenever there is a problem, so it isn't necessary to do additional logging.
    //create a new packager dialog for the user and start the process to send data
    //for the current application.
    PackagerDialog packagerDialog = new PackagerDialog();
    DialogResult result = packagerDialog.Send();
    if (result != DialogResult.OK)
    {
        //The user may have canceled (DialogResult.Cancel) or 
        //there may have been an error (DialogResult.Abort)
        if (result == System.Windows.Forms.DialogResult.Abort)
        {
            Trace.TraceWarning("Package and send process generated an error for the user.");
        }
        else
        {
            Trace.TraceInformation("Package not sent.  Reason: " + result);
        }
    }
    Inheritance Hierarchy

    System.Object
       Gibraltar.Agent.PackagerDialog

    Requirements

    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

    See Also