/// <summary> /// Creates the process framework node wrapper for the specified the <paramref name="user" />. /// </summary> /// <param name="extension">The extension.</param> /// <param name="user">The current user.</param> /// <returns> /// Returns <see cref="Boolean" /> representing <c>true</c> if the node was successfully created; otherwise /// <c>false</c>. /// </returns> protected override bool Initialize(IMMSessionManager extension, IMMPxUser user) { string createUser = user.Name; _Session = extension.CreateSession(); _Session.set_CreateUser(ref createUser); return(_Session != null); }
/// <summary> /// Initializes the process framework node wrapper using the specified <paramref name="nodeId" /> for the node. /// </summary> /// <param name="extension">The extension.</param> /// <param name="nodeId">The node identifier.</param> /// <returns> /// Returns <see cref="Boolean" /> representing <c>true</c> if the node was successfully initialized; otherwise /// <c>false</c>. /// </returns> protected override bool Initialize(IMMSessionManager extension, int nodeId) { if (_Session != null && _Session.get_ID() == nodeId) { return(true); } bool ro = false; _Session = extension.GetSession(ref nodeId, ref ro); return(_Session != null); }
/// <summary> /// Releases unmanaged and - optionally - managed resources /// </summary> /// <param name="disposing"> /// <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only /// unmanaged resources. /// </param> protected override void Dispose(bool disposing) { if (disposing) { if (_Session != null) { while (Marshal.ReleaseComObject(_Session) > 0) { // Loop until reference counter zero. } } _Session = null; } base.Dispose(true); }
/// <summary> /// Initializes a new instance of the <see cref="Session" /> class. /// </summary> /// <param name="pxApp">The process framework application reference.</param> /// <param name="session">The session.</param> public Session(IMMPxApplication pxApp, IMMSession session) : base(pxApp, NodeTypeName, session.get_ID()) { _Session = session; }