PowerArgs.Cli.Dialog.ShowMessage C# (CSharp) Method

ShowMessage() public static method

public static ShowMessage ( ConsoleString message, System.Action doneCallback = null, int maxHeight = 12 ) : void
message ConsoleString
doneCallback System.Action
maxHeight int
return void
        public static void ShowMessage(ConsoleString message, Action doneCallback = null, int maxHeight = 12)
        {
            ShowMessage(message, (b) => { if (doneCallback != null) doneCallback(); },true,maxHeight, new DialogButton() { DisplayText = "ok" });
        }

Same methods

Dialog::ShowMessage ( ConsoleString message, Action resultCallback, bool allowEscapeToCancel = true, int maxHeight = 6 ) : void
Dialog::ShowMessage ( string message, System.Action doneCallback = null, int maxHeight = 12 ) : void

Usage Example

コード例 #1
0
        public ProgressOperationControl(ProgressOperationsManager manager, ProgressOperation operation)
        {
            this.Tag                  = operation;
            this.Operation            = operation;
            this.manager              = manager;
            this.Height               = 2;
            messageAndOperationsPanel = Add(new StackPanel()
            {
                Orientation = Orientation.Vertical
            }).Fill();

            messageLabel = messageAndOperationsPanel.Add(new Label()
            {
                Mode = LabelRenderMode.ManualSizing
            }).FillHorizontally();
            messageLabel.CanFocus = true;

            messageLabel.KeyInputReceived.SubscribeForLifetime((k) =>
            {
                if (k.Key == ConsoleKey.Enter)
                {
                    var msg = operation.Message;
                    if (operation.Details != null)
                    {
                        msg += "\n" + operation.Details;
                    }
                    Dialog.ShowMessage(msg);
                }
                else if (k.Key == ConsoleKey.Delete)
                {
                    var app = Application;
                    manager.Operations.Remove(operation);
                    app.FocusManager.TryMoveFocus();
                }
            }, this);


            actionPanel = messageAndOperationsPanel.Add(new StackPanel()
            {
                Orientation = Orientation.Horizontal, Height = 1, Margin = 2
            }).FillHorizontally(messageAndOperationsPanel);
            spinner = actionPanel.Add(new Spinner()
            {
                CanFocus = false
            });
            timeLabel = actionPanel.Add(new Label()
            {
                Mode = LabelRenderMode.SingleLineAutoSize, Text = operation.StartTime.ToFriendlyPastTimeStamp().ToConsoleString()
            });


            spinner.IsSpinning = operation.State == OperationState.InProgress;

            foreach (var action in operation.Actions)
            {
                BindActionToActionPanel(action);
            }

            AddedToVisualTree.SubscribeForLifetime(OnAddedToVisualTree, this);
        }
All Usage Examples Of PowerArgs.Cli.Dialog::ShowMessage