/// <summary> /// If this function succeeds: /// status is set to an OK value, /// an Operation is added to the graph, /// a non-null value pointing to the added operation is returned /// -- this value is valid until the underlying graph is deleted. /// Otherwise: /// status is set to a non-OK value, /// the graph is not modified, /// a null value is returned. /// In either case, it deletes the OperationDescription. /// </summary> /// <param name="status">The status</param> /// <returns>If success, the Operation that is added to the graph, otherwise null.</returns> public Operation FinishOperation(Status status = null) { if (_ptr == IntPtr.Zero) { return(null); } using (StatusChecker checker = new StatusChecker(status)) { Operation op = new Operation(TfInvoke.tfeFinishOperation(_ptr, checker.Status)); _ptr = IntPtr.Zero; return(op); } }