Team Ai
Datasetpublic

MegaBites-AI/Windows-powershell

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes372downloads
IContentWriter.cs70 linesDownload Raw Back to namespaces
1// Copyright (c) Microsoft Corporation.2// Licensed under the MIT License.3 4using System.Collections;5using System.IO;6 7#nullable enable8namespace System.Management.Automation.Provider9{10    #region IContentWriter11 12    /// <summary>13    /// A Cmdlet provider that implements the IContentCmdletProvider interface must provide an14    /// object that implements this interface when GetContentWriter() is called.15    ///16    /// The interface allows for writing content to an item.17    /// </summary>18    public interface IContentWriter : IDisposable19    {20        /// <summary>21        /// Writes content to the item.22        /// </summary>23        /// <param name="content">24        /// An array of content "blocks" to be written to the item.25        /// </param>26        /// <returns>27        /// The blocks of content that were successfully written to the item.28        /// </returns>29        /// <remarks>30        /// A "block" of content is provider specific.  For the file system31        /// a "block" may be considered a byte, a character, or delimited string.32        ///33        /// The implementation of this method should treat each element in the34        /// <paramref name="content"/> parameter as a block. Each additional35        /// call to this method should append any new values to the content36        /// writer's current location until <see cref="IContentWriter.Close"/> is called.37        /// </remarks>38        IList Write(IList content);39 40        /// <summary>41        /// Moves the current "block" to be written to a position relative to a place42        /// in the writer.43        /// </summary>44        /// <param name="offset">45        /// An offset of the number of blocks to seek from the origin.46        /// </param>47        /// <param name="origin">48        /// The place in the stream to start the seek from.49        /// </param>50        /// <remarks>51        /// The implementation of this method moves the content writer <paramref name="offset"/>52        /// number of blocks from the specified <paramref name="origin"/>. See <see cref="System.Management.Automation.Provider.IContentWriter.Write(IList)"/>53        /// for a description of what a block is.54        /// </remarks>55        void Seek(long offset, SeekOrigin origin);56 57        /// <summary>58        /// Closes the writer. Further writes should fail if the writer59        /// has been closed.60        /// </summary>61        /// <remarks>62        /// The implementation of this method should close any resources held open by the63        /// writer.64        /// </remarks>65        void Close();66    }67 68    #endregion IContentWriter69}70