當前位置: 首頁>>代碼示例>>C#>>正文


C# Host.BufferCell類代碼示例

本文整理匯總了C#中System.Management.Automation.Host.BufferCell的典型用法代碼示例。如果您正苦於以下問題:C# BufferCell類的具體用法?C# BufferCell怎麽用?C# BufferCell使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BufferCell類屬於System.Management.Automation.Host命名空間,在下文中一共展示了BufferCell類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: NewBufferCellArray

        public BufferCell[,] NewBufferCellArray(int width, int height, BufferCell contents)
        {
            if (width <= 0)
            {
                throw PSTraceSource.NewArgumentOutOfRangeException("width", width, "MshHostRawUserInterfaceStrings", "NonPositiveNumberErrorTemplate", new object[] { "width" });
            }
            if (height <= 0)
            {
                throw PSTraceSource.NewArgumentOutOfRangeException("height", height, "MshHostRawUserInterfaceStrings", "NonPositiveNumberErrorTemplate", new object[] { "height" });
            }
            BufferCell[,] cellArray = new BufferCell[height, width];
            switch (this.LengthInBufferCells(contents.Character))
            {
                case 1:
                    for (int i = 0; i < cellArray.GetLength(0); i++)
                    {
                        for (int j = 0; j < cellArray.GetLength(1); j++)
                        {
                            cellArray[i, j] = contents;
                            cellArray[i, j].BufferCellType = BufferCellType.Complete;
                        }
                    }
                    return cellArray;

                case 2:
                {
                    int num4 = ((width % 2) == 0) ? width : (width - 1);
                    for (int k = 0; k < height; k++)
                    {
                        for (int m = 0; m < num4; m++)
                        {
                            cellArray[k, m] = contents;
                            cellArray[k, m].BufferCellType = BufferCellType.Leading;
                            m++;
                            cellArray[k, m] = new BufferCell('\0', contents.ForegroundColor, contents.BackgroundColor, BufferCellType.Trailing);
                        }
                        if (num4 < width)
                        {
                            cellArray[k, num4] = contents;
                            cellArray[k, num4].BufferCellType = BufferCellType.Leading;
                        }
                    }
                    break;
                }
            }
            return cellArray;
        }
開發者ID:nickchal,項目名稱:pash,代碼行數:47,代碼來源:PSHostRawUserInterface.cs

示例2: SetBufferContents

		public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
		{
			throw new NotSupportedException(Resources.PSHostRawUserInterfaceSetBufferContentsNotSupported);
		}
開發者ID:nickchal,項目名稱:pash,代碼行數:4,代碼來源:PowwaHostRawUserInterface.cs

示例3: SetBufferContents

 public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
 {
     throw new NotImplementedException();
 }
開發者ID:scjunkie,項目名稱:Console,代碼行數:4,代碼來源:ScriptingHostRawUserInterface.cs

示例4: SetBufferContents

 public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
 {
     // TODO: REIMPLEMENT PSHostRawUserInterface.SetBufferContents(Coordinates origin, BufferCell[,] contents)
     throw new NotImplementedException("The SetBufferContents method is not (yet) implemented!");
     //if (_control.Dispatcher.CheckAccess())
     // {
     //     _control.SetBufferContents(origin, contents);
     // }
     // else
     // {
     //    _control.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)delegate
     //     {
     //         _control.SetBufferContents(origin, contents);
     //     });
     // }
 }
開發者ID:Jaykul,項目名稱:PoshConsole,代碼行數:16,代碼來源:HostRawUI.cs

示例5: ScrollBufferContents

		public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill)
		{
			throw new NotSupportedException(Resources.PSHostRawUserInterfaceScrollBufferContentsNotSupported);
		}
開發者ID:nickchal,項目名稱:pash,代碼行數:4,代碼來源:PowwaHostRawUserInterface.cs

示例6: SetBufferContents

 /// <summary>
 /// Sets the contents of the buffer inside the specified rectangle.
 /// </summary>
 /// <param name="rectangle">The rectangle inside which buffer contents will be filled.</param>
 /// <param name="fill">The BufferCell which will be used to fill the requested space.</param>
 public override void SetBufferContents(
     Rectangle rectangle, 
     BufferCell fill)
 {
     Logger.Write(
         LogLevel.Warning,
         "PSHostRawUserInterface.SetBufferContents was called");
 }
開發者ID:sunnyc7,項目名稱:PowerShellEditorServices,代碼行數:13,代碼來源:SessionPSHostRawUserInterface.cs

示例7: ScrollBufferContents

        public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill)
        {
            // TODO: REIMPLEMENT PSHostRawUserInterface.ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill)
            throw new NotImplementedException("The ScrollBufferContents method is not (yet) implemented!");

            //if (_control.Dispatcher.CheckAccess())
            //{
            //    _control.ScrollBufferContents(source, destination, clip, fill);
            //}
            //else
            //{
            //   _control.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)delegate
            //    {
            //        _control.ScrollBufferContents(source, destination, clip, fill);
            //    });
            //}
        }
開發者ID:Jaykul,項目名稱:PoshConsole,代碼行數:17,代碼來源:HostRawUI.cs

示例8: NewBufferCellArray

 public BufferCell[,] NewBufferCellArray(int width, int height, BufferCell contents) { throw new NotImplementedException(); }
開發者ID:mauve,項目名稱:Pash,代碼行數:1,代碼來源:PSHostRawUserInterface.cs

示例9: ScrollBufferContents

 public abstract void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill);
開發者ID:mauve,項目名稱:Pash,代碼行數:1,代碼來源:PSHostRawUserInterface.cs

示例10: SetBufferContents

 /// <summary>
 /// Set buffer contents.
 /// </summary>
 public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
 {
     _serverMethodExecutor.ExecuteVoidMethod(RemoteHostMethodId.SetBufferContents2, new object[] { origin, contents });
 }
開發者ID:40a,項目名稱:PowerShell,代碼行數:7,代碼來源:ServerRemoteHostRawUserInterface.cs

示例11: ScrollBufferContents

 /// <summary>
 /// Scroll buffer contents.
 /// </summary>
 public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill)
 {
     _serverMethodExecutor.ExecuteVoidMethod(RemoteHostMethodId.ScrollBufferContents, new object[] { source, destination, clip, fill });
 }
開發者ID:40a,項目名稱:PowerShell,代碼行數:7,代碼來源:ServerRemoteHostRawUserInterface.cs

示例12: ThrowNotInteractive

        ScrollBufferContents
        (
            Rectangle source,
            Coordinates destination,
            Rectangle clip,
            BufferCell fill
        )
        {
            if (_externalRawUI == null)
            {
                ThrowNotInteractive();
            }

            _externalRawUI.ScrollBufferContents(source, destination, clip, fill);
        }
開發者ID:40a,項目名稱:PowerShell,代碼行數:15,代碼來源:InternalHostRawUserInterface.cs

示例13: SetBufferContents

 public abstract void SetBufferContents(Coordinates origin, BufferCell[,] contents);
開發者ID:mauve,項目名稱:Pash,代碼行數:1,代碼來源:PSHostRawUserInterface.cs

示例14: ScrollBufferContents

 /// <summary>
 /// Scrolls the contents of the console buffer.
 /// </summary>
 /// <param name="source">The source rectangle to scroll.</param>
 /// <param name="destination">The destination coordinates by which to scroll.</param>
 /// <param name="clip">The rectangle inside which the scrolling will be clipped.</param>
 /// <param name="fill">The cell with which the buffer will be filled.</param>
 public override void ScrollBufferContents(
     Rectangle source, 
     Coordinates destination, 
     Rectangle clip, 
     BufferCell fill)
 {
     Logger.Write(
         LogLevel.Warning,
         "PSHostRawUserInterface.ScrollBufferContents was called");
 }
開發者ID:sunnyc7,項目名稱:PowerShellEditorServices,代碼行數:17,代碼來源:SessionPSHostRawUserInterface.cs

示例15: ScrollBufferContents

 /// <summary>
 /// This functionality is not currently implemented. The call fails with an exception.
 /// </summary>
 /// <param name="source">Unused</param>
 /// <param name="destination">Unused</param>
 /// <param name="clip">Unused</param>
 /// <param name="fill">Unused</param>
 public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill)
 {
     throw new NotImplementedException("The method or operation is not implemented.");
 }
開發者ID:dgrapp1,項目名稱:WindowsSDK7-Samples,代碼行數:11,代碼來源:MyRawUserInterface.cs


注:本文中的System.Management.Automation.Host.BufferCell類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。