Mono.Terminal.Dialog.ErrorColors C# (CSharp) Method

ErrorColors() public method

Makes the default style for the dialog use the error colors.
public ErrorColors ( ) : void
return void
        public void ErrorColors()
        {
            ContainerColorNormal = Application.ColorError;
            ContainerColorFocus = Application.ColorErrorFocus;
            ContainerColorHotFocus = Application.ColorErrorHotFocus;
            ContainerColorHotNormal = Application.ColorErrorHot;
        }

Usage Example

Exemplo n.º 1
0
Arquivo: util.cs Projeto: txdv/mc
        public static Result Query(Result flags, string errormsg, string condition, string file)
        {
            var s = String.Format (condition, file);
            int len = Math.Min (s.Length, Application.Cols-8);

            var d = new Dialog (len, 8, "Error");
            d.ErrorColors ();
            d.Add (new Label (1, 1, errormsg));
            d.Add (new Label (1, 2, String.Format (condition, file.Ellipsize (len-condition.Length))));

            Result result = Result.Ignore;
            Button b;
            if ((flags & Result.Retry) == Result.Retry) {
                b = new Button (0, 0, "Retry", true);
                b.Clicked += delegate {
                    result = Result.Retry;
                    d.Running = false;
                };
                d.Add (b);
            }
            if ((flags & Result.Ignore) == Result.Ignore) {
                b = new Button (0, 0, "Ignore", true);
                b.Clicked += delegate {
                    result = Result.Ignore;
                    d.Running = false;
                };
                d.Add (b);
            }
            if ((flags & Result.Cancel) == Result.Cancel) {
                b = new Button (0, 0, "Cancel", true);
                b.Clicked += delegate {
                    result = Result.Cancel;
                    d.Running = false;
                };
                d.Add (b);
            }
            Application.Run (d);
            return result;
        }
All Usage Examples Of Mono.Terminal.Dialog::ErrorColors