In my inventor addin I am doing some validation before changing state of a component in vault to Release.
I have event handler UpdateFileLifecycleStateEvents_GetRestrictions where I can do that. However i dont know how do i verify that the state being change to release cause that is the only time I need to validate. Here is some of my code.
public void Activate(ApplicationAddInSite addInSiteObject, bool firstTime)
_inventorApp = addInSiteObject.Application;
_fileUIEvents = _inventorApp.FileUIEvents;
DocumentServiceExtensions.UpdateFileLifecycleStateEvents.GetRestrictions += new EventHandler<UpdateFileLifeCycleStateCommandEventArgs>(UpdateFileLifecycleStateEvents_GetRestrictions);
The event args has the information you need but you usually need to make some API calls to gather all the information. You can find the FROM states by looking up the File object from the FileMasterIds. You can find more information about the TO state by looking up the LfCycState objects from the ToStateIds.
The easiest way to open up a connection to the Vault Server is to cast the sender object to IWebService object. Use it to create a new WebServiceCredentials, then create a new WebService object.