Integrations and APIs for Service

Get Involved. Join the Conversation.


    Bryan Scarborough
    How do I set an IGlobalContext variableAnswered
    Topic posted June 12, 2019 by Bryan ScarboroughBlue Ribbon: 750+ Points 
    30 Views, 1 Comment
    How do I set an IGlobalContext variable


    I'm trying to get the below example code working,   I know _globalContext is of type IGlobalContext and I am declaring that, but how do I go about setting it initially?  I am trying to create a WorkspaceRibbonButton Add-In if that makes a difference.

    Thank you

    Code Snippet:

    Best Comment

    Cynthia Knox

    IGlobalContext is passed into the public Initialize method:

    public bool Initialize(IGlobalContext context)

    You can see this in the documentation here:

    Search for "initialize", then select the "Automation from ribbon" in the search results:

    "For automation, a reference to an IAutomationContext is required. This reference can be obtained from the IGlobalContext reference provided to the add-in through the Initialize method."

    I hope this helps!