コード例 #1
0
ファイル: Pipeline.cs プロジェクト: chihsiliu1966/lcmsNET
        public Stage Unlink(StageLoc location)
        {
            EnsureNotDisposed();

            IntPtr ptr = IntPtr.Zero;

            Interop.PipelineUnlinkStage(_handle, Convert.ToInt32(location), ref ptr);
            return((ptr != IntPtr.Zero) ? new Stage(ptr) : null);
        }
コード例 #2
0
ファイル: Pipeline.cs プロジェクト: chihsiliu1966/lcmsNET
        public bool Insert(Stage stage, StageLoc location)
        {
            EnsureNotDisposed();

            bool inserted = Interop.PipelineInsertStage(_handle, stage.Handle, Convert.ToInt32(location)) != 0;

            if (inserted)
            {
                stage.Release();
            }
            return(inserted);
        }
コード例 #3
0
        /// <summary>
        /// Removes a <see cref="Stage"/> from the start or end of the pipeline.
        /// </summary>
        /// <param name="location">The location from where the stage is to be removed.</param>
        /// <returns>The <see cref="Stage"/> that has been removed. Can be null.</returns>
        /// <exception cref="ObjectDisposedException">
        /// The pipeline has already been disposed.
        /// </exception>
        /// <remarks>
        /// The caller is responsible for disposing any <see cref="Stage"/> removed using this method.
        /// </remarks>
        public Stage Unlink(StageLoc location)
        {
            EnsureNotClosed();

            IntPtr ptr = IntPtr.Zero;

            Interop.PipelineUnlinkStage(handle, Convert.ToInt32(location), ref ptr);

            if (ptr != IntPtr.Zero)
            {
                IntPtr  handle  = Interop.GetStageContextID(ptr);
                Context context = handle != IntPtr.Zero ? Context.CopyRef(handle) : null;
                return(new Stage(ptr, context));
            }

            return(null);
        }
コード例 #4
0
ファイル: Pipeline.cs プロジェクト: chihsiliu1966/lcmsNET
        public void UnlinkAndDispose(StageLoc location)
        {
            EnsureNotDisposed();

            Interop.PipelineUnlinkStage(_handle, Convert.ToInt32(location));
        }