Пример #1
0
 public override PS.BufferCell[,] GetBufferContents(Rectangle rectangle)
 {
     FN.BufferCell[,] r1 = Far.Api.UI.GetBufferContents(ToPlace(rectangle));
     PS.BufferCell[,] r2 = new PS.BufferCell[r1.GetLength(0), r1.GetLength(1)];
     for (int i = 0; i < r1.GetLength(0); ++i)
     {
         for (int j = 0; j < r1.GetLength(1); ++j)
         {
             r2[i, j] = ToBufferCell(r1[i, j]);
         }
     }
     return(r2);
 }
Пример #2
0
        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;
        }
Пример #3
0
        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);
            //    });
            //}
        }
Пример #4
0
 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);
     //     });
     // }
 }
        ScrollBufferContents
        (
            Rectangle source,
            Coordinates destination,
            Rectangle clip,
            BufferCell fill
        )
        {
            if (_externalRawUI == null)
            {
                ThrowNotInteractive();
            }

            _externalRawUI.ScrollBufferContents(source, destination, clip, fill);
        }
 /// <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");
 }
 /// <summary>
 /// This functionality is not currently implemented. The call fails with an exception.
 /// </summary>
 /// <param name="origin">Unused</param>
 /// <param name="contents">Unused</param>
 public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
 {
     throw new NotImplementedException("The method or operation is not implemented.");
 }
        SetBufferContents(Coordinates origin, BufferCell[,] contents)
        {
            if (_externalRawUI == null)
            {
                ThrowNotInteractive();
            }

            _externalRawUI.SetBufferContents(origin, contents);
        }
 public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
 {
     throw new NotImplementedException();
 }
Пример #10
0
 public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, PS.BufferCell fill)
 {
     Far.Api.UI.ScrollBufferContents(ToPlace(source), ToPoint(destination), ToPlace(clip), ToBufferCell(fill));
 }
Пример #11
0
 public BufferCell[,] NewBufferCellArray(Size size, BufferCell contents)
 {
     return this.NewBufferCellArray(size.Width, size.Height, contents);
 }
Пример #12
0
		public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill)
		{
			throw new NotSupportedException(Resources.PSHostRawUserInterfaceScrollBufferContentsNotSupported);
		}
 public override void ScrollBufferContents(System.Management.Automation.Host.Rectangle source, System.Management.Automation.Host.Coordinates destination, System.Management.Automation.Host.Rectangle clip, System.Management.Automation.Host.BufferCell fill)
 {
     // throw new NotImplementedException();
 }
 public override void SetBufferContents(System.Management.Automation.Host.Rectangle rectangle, System.Management.Automation.Host.BufferCell fill)
 {
     // throw new NotImplementedException();
     return(null);
 }
Пример #15
0
 public abstract void SetBufferContents(Rectangle rectangle, BufferCell fill);
Пример #16
0
 public abstract void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill);
Пример #17
0
 public BufferCell[,] NewBufferCellArray(int width, int height, BufferCell contents)
 {
     throw new NotImplementedException();
 }
Пример #18
0
		public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
		{
			throw new NotSupportedException(Resources.PSHostRawUserInterfaceSetBufferContentsNotSupported);
		}
Пример #19
0
 public BufferCell[,] NewBufferCellArray(string[] contents, ConsoleColor foregroundColor, ConsoleColor backgroundColor)
 {
     if (contents == null)
     {
         throw PSTraceSource.NewArgumentNullException("contents");
     }
     byte[][] bufferArray = new byte[contents.Length][];
     int num = 0;
     for (int i = 0; i < contents.Length; i++)
     {
         if (!string.IsNullOrEmpty(contents[i]))
         {
             int num3 = 0;
             bufferArray[i] = new byte[contents[i].Length];
             for (int k = 0; k < contents[i].Length; k++)
             {
                 bufferArray[i][k] = (byte) this.LengthInBufferCells(contents[i][k]);
                 num3 += bufferArray[i][k];
             }
             if (num < num3)
             {
                 num = num3;
             }
         }
     }
     if (num <= 0)
     {
         throw PSTraceSource.NewArgumentException("contents", "MshHostRawUserInterfaceStrings", "AllNullOrEmptyStringsErrorTemplate", new object[0]);
     }
     var cellArray = new BufferCell[contents.Length, num];
     for (int j = 0; j < contents.Length; j++)
     {
         int num6 = 0;
         int index = 0;
         while (index < contents[j].Length)
         {
             if (bufferArray[j][index] == 1)
             {
                 cellArray[j, num6] = new BufferCell(contents[j][index], foregroundColor, backgroundColor, BufferCellType.Complete);
             }
             else if (bufferArray[j][index] == 2)
             {
                 cellArray[j, num6] = new BufferCell(contents[j][index], foregroundColor, backgroundColor, BufferCellType.Leading);
                 num6++;
                 cellArray[j, num6] = new BufferCell('\0', foregroundColor, backgroundColor, BufferCellType.Trailing);
             }
             index++;
             num6++;
         }
         while (num6 < num)
         {
             cellArray[j, num6] = new BufferCell(' ', foregroundColor, backgroundColor, BufferCellType.Complete);
             num6++;
         }
     }
     return cellArray;
 }
Пример #20
0
 public BufferCell[,] NewBufferCellArray(Size size, BufferCell contents)
 {
     throw new NotImplementedException();
 }
 /// <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 });
 }
 /// <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.");
 }
 /// <summary>
 /// Set buffer contents.
 /// </summary>
 public override void SetBufferContents(Rectangle rectangle, BufferCell fill)
 {
     _serverMethodExecutor.ExecuteVoidMethod(RemoteHostMethodId.SetBufferContents1, new object[] { rectangle, fill });
 }
 /// <summary>
 ///  This functionality is not currently implemented. The call fails with an exception.
 /// </summary>
 /// <param name="rectangle">Unused</param>
 /// <param name="fill">Unused</param>
 public override void SetBufferContents(Rectangle rectangle, BufferCell fill)
 {
     throw new NotImplementedException("The method or operation is not implemented.");
 }
 /// <summary>
 /// Set buffer contents.
 /// </summary>
 public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
 {
     _serverMethodExecutor.ExecuteVoidMethod(RemoteHostMethodId.SetBufferContents2, new object[] { origin, contents });
 }
Пример #26
0
        SetBufferContents(Rectangle r, BufferCell fill)
        {
            if (_externalRawUI == null)
            {
                ThrowNotInteractive();
            }

            _externalRawUI.SetBufferContents(r, fill);
        }
Пример #27
0
 public BufferCell[,] NewBufferCellArray(Size size, BufferCell contents) { throw new NotImplementedException(); }
 /// <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");
 }
Пример #29
0
 public BufferCell[,] NewBufferCellArray(int width, int height, BufferCell contents) { throw new NotImplementedException(); }
 /// <summary>
 /// Sets the contents of the buffer at the given coordinate.
 /// </summary>
 /// <param name="origin">The coordinate at which the buffer will be changed.</param>
 /// <param name="contents">The new contents for the buffer at the given coordinate.</param>
 public override void SetBufferContents(
     Coordinates origin, 
     BufferCell[,] contents)
 {
     Logger.Write(
         LogLevel.Warning,
         "PSHostRawUserInterface.SetBufferContents was called");
 }
Пример #31
0
 public abstract void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill);
Пример #32
0
        public override void SetBufferContents(Rectangle rectangle, BufferCell fill)
        {
            _control.CompleteBackgroundWorkItems();
            if (rectangle.Left == -1 && rectangle.Right == -1)
            {
                _control.ClearScreen();
            }
            else

                // TODO: REIMPLEMENT PSHostRawUserInterface.SetBufferContents(Rectangle rectangle, BufferCell fill)
                throw new NotImplementedException("The SetBufferContents method is not (yet) implemented!");
            //if (_control.Dispatcher.CheckAccess())
            // {
            //     _control.SetBufferContents(rectangle, fill);
            // }
            // else
            // {
            //    _control.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)delegate
            //     {
            //         _control.SetBufferContents(rectangle, fill);
            //     });
            // }
        }
Пример #33
0
 public abstract void SetBufferContents(Coordinates origin, BufferCell[,] contents);
Пример #34
0
 public override void SetBufferContents(Rectangle rectangle, BufferCell fill)
 {
     throw new NotImplementedException();
 }
Пример #35
0
 public abstract void SetBufferContents(Rectangle rectangle, BufferCell fill);
Пример #36
0
		public override void SetBufferContents(Rectangle rectangle, BufferCell fill)
		{
			this.OnMessageCreated(new MessageCreatedEventArgs(new ClearBufferMessage(), false));
		}
Пример #37
0
 public override void SetBufferContents(Rectangle rectangle, PS.BufferCell fill)
 {
     Far.Api.UI.SetBufferContents(ToPlace(rectangle), ToBufferCell(fill));
 }
 public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip,
                                           BufferCell fill)
 {
     throw new NotImplementedException();
 }
Пример #39
0
 static FN.BufferCell ToBufferCell(PS.BufferCell cell)
 {
     return(new FN.BufferCell(cell.Character, cell.ForegroundColor, cell.BackgroundColor, (FN.BufferCellType)cell.BufferCellType));
 }
 public override void SetBufferContents(Rectangle rectangle, BufferCell fill)
 {
     this.Output.Clear();
 }
Пример #41
0
 public BufferCell[,] NewBufferCellArray(Size size, BufferCell contents)
 {
     return(this.NewBufferCellArray(size.Width, size.Height, contents));
 }