public unsafe Instance(ObjectRef objectRef, params string[] dataRefs) { if (dataRefs == null) { throw new ArgumentNullException(nameof(dataRefs)); } _dataRefCount = dataRefs.Length; var refs = stackalloc byte *[dataRefs.Length + 1]; for (int i = 0; i < dataRefs.Length; i++) { refs[i] = (byte *)Marshal.StringToCoTaskMemUTF8(dataRefs[i]); } refs[dataRefs.Length] = null; _instanceRef = InstanceAPI.CreateInstance(objectRef, refs); for (int i = dataRefs.Length - 1; i >= 0; i--) { Marshal.FreeCoTaskMem((IntPtr)refs[i]); } }
public TridentExecutor(TridentManager manager) { this.registryConnection = manager.registryConnection; this.user = manager.User; //// Initializing the trident api object tridentApi = new InstanceAPI(registryConnection); }
private void InitializeConnectors() { InitializeRegistry(); AuthenticateConnector(); TridentHelper = new SVC.UIDesigner.UIHelper(this.registryConnection); WorklfowService = new WorkflowManagerService(this.registryConnection); RegistryService = new RegistryManagerService(this.registryConnection); CategoriesComposer.CreateUser(TridentAuthentication.LoggedUserInUserName, registryConnection); this.User = TridentAuthentication.LoggedInUser; //put else where so we don't auth multiple times? tridentAPI = new InstanceAPI(registryConnection); }