当前位置: 首页>>代码示例>>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;未经允许,请勿转载。