本文整理汇总了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;
}
示例2: SetBufferContents
public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
{
throw new NotSupportedException(Resources.PSHostRawUserInterfaceSetBufferContentsNotSupported);
}
示例3: SetBufferContents
public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
{
throw new NotImplementedException();
}
示例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);
// });
// }
}
示例5: ScrollBufferContents
public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill)
{
throw new NotSupportedException(Resources.PSHostRawUserInterfaceScrollBufferContentsNotSupported);
}
示例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");
}
示例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);
// });
//}
}
示例8: NewBufferCellArray
public BufferCell[,] NewBufferCellArray(int width, int height, BufferCell contents) { throw new NotImplementedException(); }
示例9: ScrollBufferContents
public abstract void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill);
示例10: SetBufferContents
/// <summary>
/// Set buffer contents.
/// </summary>
public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
{
_serverMethodExecutor.ExecuteVoidMethod(RemoteHostMethodId.SetBufferContents2, new object[] { origin, contents });
}
示例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 });
}
示例12: ThrowNotInteractive
ScrollBufferContents
(
Rectangle source,
Coordinates destination,
Rectangle clip,
BufferCell fill
)
{
if (_externalRawUI == null)
{
ThrowNotInteractive();
}
_externalRawUI.ScrollBufferContents(source, destination, clip, fill);
}
示例13: SetBufferContents
public abstract void SetBufferContents(Coordinates origin, BufferCell[,] contents);
示例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");
}
示例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.");
}