コード例 #1
0
        private Color GetColor(ProgressBarColor color)
        {
            switch (color)
            {
            case ProgressBarColor.Red:
                return(new Color32(255, 0, 63, 255));

            case ProgressBarColor.Pink:
                return(new Color32(255, 152, 203, 255));

            case ProgressBarColor.Orange:
                return(new Color32(255, 128, 0, 255));

            case ProgressBarColor.Yellow:
                return(new Color32(255, 211, 0, 255));

            case ProgressBarColor.Green:
                return(new Color32(102, 255, 0, 255));

            case ProgressBarColor.Blue:
                return(new Color32(0, 135, 189, 255));

            case ProgressBarColor.Indigo:
                return(new Color32(75, 0, 130, 255));

            case ProgressBarColor.Violet:
                return(new Color32(127, 0, 255, 255));

            default:
                return(Color.white);
            }
        }
コード例 #2
0
 public ProgressBarAttribute(string name = "", string maxValueVar = "", ProgressBarColor color = ProgressBarColor.Blue)
 {
     Name             = name;
     MaxValue         = 0;
     Color            = color;
     this.maxValueVar = maxValueVar;
 }
コード例 #3
0
ファイル: ProgressBarIconSet.cs プロジェクト: nhannd/Xian
		public ProgressBarIconSet(string name, Size dimensions, decimal percent, ProgressBarColor color)
			: base(name)
		{
			_dimensions = dimensions;
			_percent = percent;
			_color = color;
		}
コード例 #4
0
 public ProgressBarIconSet(string name, Size dimensions, decimal percent, ProgressBarColor color)
     : base(name)
 {
     _dimensions = dimensions;
     _percent    = percent;
     _color      = color;
 }
コード例 #5
0
 public ProgressBarAttribute(string name            = "", float maxValue = 100,
                             ProgressBarColor color = ProgressBarColor.Blue)
 {
     Name     = name;
     MaxValue = maxValue;
     Color    = color;
 }
コード例 #6
0
        public void DownloadColor(ProgressBarColor color)
        {
            switch (color)
            {
            case ProgressBarColor.Green:

                progressBarPictureBox.BackgroundImage = Properties.Resources.DownloadProgressBarGreen;

                break;
            }
        }
コード例 #7
0
        /// <summary>
        ///     Creates a Bootstrap progress-bar with a defined
        ///     <paramref name="style" />, <paramref name="color" /> and
        ///     <paramref name="progress" />.
        /// </summary>
        /// <param name="style">The style of the progress bar</param>
        /// <param name="color">The color of the progress bar</param>
        /// <param name="progress">The current progress percentage</param>
        public MvcHtmlString ProgressBar(ProgressBarStyle style, ProgressBarColor color, double progress)
        {
            var progressTag = new TagBuilderExt("div");

            progressTag.AddCssClass("progress");

            switch (color)
            {
            case ProgressBarColor.Info:
                progressTag.AddCssClass("progress-info");
                break;

            case ProgressBarColor.Success:
                progressTag.AddCssClass("progress-success");
                break;

            case ProgressBarColor.Warning:
                progressTag.AddCssClass("progress-warning");
                break;

            case ProgressBarColor.Danger:
                progressTag.AddCssClass("progress-danger");
                break;
            }

            switch (style)
            {
            case ProgressBarStyle.Animated:
                progressTag.AddCssClass("active");
                break;

            case ProgressBarStyle.Striped:
                progressTag.AddCssClass("progress-striped");
                break;
            }

            var barTag = progressTag.CreateChildTag("div");

            barTag.AddCssClass("progress-bar");
            barTag.MergeAttribute("role", "progressbar");
            barTag.MergeAttribute("aria-valuenow", progress.ToString(CultureInfo.InvariantCulture));
            barTag.MergeAttribute("aria-valuemin", "0");
            barTag.MergeAttribute("aria-valuemax", "100");
            barTag.MergeAttribute("style", string.Format("width: {0}%", progress));
            return(progressTag.ToMvcHtmlString());
        }
コード例 #8
0
        /// <summary>
        /// This method is called at the end of the cell's rendering.
        /// </summary>
        /// <param name="cell">The current cell</param>
        /// <param name="position">The coordinates of the cell</param>
        /// <param name="canvases">An array of PdfContentByte to add text or graphics</param>
        /// <param name="attributes">Current cell's custom attributes</param>
        public void CellRendered(PdfPCell cell, Rectangle position, PdfContentByte[] canvases, CellAttributes attributes)
        {
            var contentByte = canvases[PdfPTable.BACKGROUNDCANVAS];

            contentByte.SaveState();
            if (ProgressBarColorFormula != null)
            {
                ProgressBarColor = ProgressBarColorFormula(attributes.RowData.TableRowData);
            }
            contentByte.SetColorFill(new BaseColor(ProgressBarColor.ToArgb()));
            contentByte.Rectangle(
                position.Left,
                position.Bottom,
                position.Width * getPercent(attributes) / 100,
                position.Height);
            contentByte.Fill();
            contentByte.RestoreState();
        }
コード例 #9
0
        public frmSplash()
        {
            InitializeComponent();
            ProgressBarColor.SetState(progressBar1, 3);

            // Configurações para se tornar Splash Screen
            BackColor       = Color.Black;
            TransparencyKey = Color.Black;
            FormBorderStyle = FormBorderStyle.None;
            StartPosition   = FormStartPosition.CenterScreen;
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);

            // Coloca a Imagem que será a Splash Screen
            BackgroundImage = Properties.Resources.LogoSplash;



            Task.Factory.StartNew(() =>
            {
                for (int i = 0; i < 100; i++)
                {
                    System.Threading.Thread.Sleep(23);
                    Invoke(new Action(() => progressBar1.Increment(1)));
                }
            });


            // Inicia contagem para término da Splash Screen
            Task.Factory.StartNew(() =>
            {
                // Espera 2 segundos para iniciar o sistema
                System.Threading.Thread.Sleep(2700);

                Invoke(new Action(() =>
                {
                    // Abre a tela Inicial
                    Login frm = new Login();
                    frm.Show();
                    Hide();
                }));
            });
        }
コード例 #10
0
            private void UpdateDisplay(ConfigMessage message)
            {
                if (message.Severity == Severity.Success)
                {
                    Form.outputTextBox.AppendLine(message.Message, Color.Green);
                }
                else if (message.Severity == Severity.Warning)
                {
                    if (_currentColor == ProgressBarColor.Green)
                    {
                        _currentColor = ProgressBarColor.Orange;
                    }

                    Form.outputTextBox.AppendLine(message.Message, Color.Orange);
                    //Form.progressBar1.SetState(_currentColor);
                    //Form.progressBar1.Invalidate();
                    //Form.progressBar1.Update();
                    //Form.progressBar1.Refresh();
                }
                else if (message.Severity == Severity.Error)
                {
                    _currentColor = ProgressBarColor.Red;

                    Form.outputTextBox.AppendLine(message.Message, Color.Red);
                    //Form.progressBar1.SetState(_currentColor);
                    //Form.progressBar1.Invalidate();
                    //Form.progressBar1.Update();
                    //Form.progressBar1.Refresh();
                }
                else
                {
                    Form.outputTextBox.AppendLine(message.Message);
                }

                Form.outputTextBox.SelectionStart = Form.outputTextBox.Text.Length;
                Form.outputTextBox.ScrollToCaret();
            }
コード例 #11
0
 /// <summary>
 ///     Creates a Bootstrap progress-bar with a default
 ///     style, a specified <paramref name="color" /> and
 ///     <paramref name="progress" />.
 /// </summary>
 /// <param name="color">The color of the progress bar</param>
 /// <param name="progress">The current progress percentage</param>
 public MvcHtmlString ProgressBar(ProgressBarColor color, double progress)
 {
     return(ProgressBar(ProgressBarStyle.Default, color, progress));
 }
コード例 #12
0
 public static void SetState(this ProgressBar pBar, ProgressBarColor state)
 {
     SendMessage(pBar.Handle, 1040, (IntPtr)state, IntPtr.Zero);
 }
コード例 #13
0
 private void SetState(ProgressBar pBar, ProgressBarColor color)
 {
     WinAPI.SendMessage(pBar.Handle, 1040, (IntPtr)color, IntPtr.Zero); //Funktion aus der statischen Klasse "WinAPI" verwenden
 }
コード例 #14
0
 public ProgressDisplayer(MainForm form)
 {
     Form          = form;
     _currentColor = ProgressBarColor.Green;
 }
コード例 #15
0
 public static void SetProgressBarColor(ProgressBar pBar, ProgressBarColor pbColor)
 {
     SendMessage(pBar.Handle, 1040, (IntPtr)pbColor, IntPtr.Zero);
 }
コード例 #16
0
        public void DownloadColor(ProgressBarColor color)
        {
            switch (color)
            {
                case ProgressBarColor.Green:

                    progressBarPictureBox.BackgroundImage = Properties.Resources.DownloadProgressBarGreen;

                    break;
            }
        }
コード例 #17
0
 private void SetState(ProgressBar pBar, ProgressBarColor color)
 {
     WinAPI.SendMessage(pBar.Handle, 1040, (IntPtr)color, IntPtr.Zero); //Funktion aus der statischen Klasse "WinAPI" verwenden
 }