Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Bryan Scarborough
    How do I set an IGlobalContext variableAnswered
    Topic posted June 12, 2019 by Bryan ScarboroughRed Ribbon: 250+ Points 
    26 Views, 1 Comment
    Title:
    How do I set an IGlobalContext variable
    Content:

    Hello, 

    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

    Version:
    18D
    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:

    http://documentation.custhelp.com/euf/assets/devdocs/unversioned/Connect_AddIn_Framework/Default.htm

    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!

    Comment