CM3D2.MaidFiddler.Plugin.Gui.LoadingBarGUI.LoadingBarGUI C# (CSharp) Method

LoadingBarGUI() public method

public LoadingBarGUI ( string title, string text, bool interval, Action action ) : System
title string
text string
interval bool
action Action
return System
        public LoadingBarGUI(string title, string text, bool interval, Action<LoadingBarGUI> action)
        {
            InitializeComponent();
            ControlBox = false;
            Text = title;
            TextLabel.Text = text;
            this.action = action;
            Shown += OnShown;

            if (interval)
            {
                Timer = new Timer();
                Timer.Interval = 50;
                Timer.Tick += (o, args) =>
                {
                    if (ProgressBar.Value >= ProgressBar.Maximum)
                        ProgressBar.Value = ProgressBar.Minimum;
                    ProgressBar.PerformStep();
                };
            }
            else
                Timer = null;
        }