Skip to content

Instantly share code, notes, and snippets.

@Willy-Kimura
Last active December 8, 2017 11:55
Show Gist options
  • Save Willy-Kimura/049df0df9fcf14ec43d8b67c624fd32f to your computer and use it in GitHub Desktop.
Save Willy-Kimura/049df0df9fcf14ec43d8b67c624fd32f to your computer and use it in GitHub Desktop.
This assists us in managing all the five steps in the Dashboard's verification process.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Verifications
{
public partial class VerificationProcess : UserControl
{
// This contains an enumerable list of the verification steps to undergo.
public enum VerificationSteps
{
None,
First,
Second,
Third,
Fourth,
Fifth,
Finished
};
public VerificationProcess()
{
InitializeComponent();
}
// This stores the selected "CurrentStep" value.
private VerificationSteps current_step;
// This gets/sets the selected step or position in the verification process.
[Description("Set the current step or position in the verification process.")]
public VerificationSteps CurrentStep
{
get {
// Get the currently set step-value for the user.
return current_step;
}
// Set the currently set step-value for the user.
// Likewise ensure the control actively previews the changes to the verification process.
// As you have noticed, the code is more of the same, only that some changes have been made based on the step within the process that the user is currently in.
// You can always add or modify the code as shown below in order to add or include better images and/or steps further.
set
{
current_step = value;
if (current_step == VerificationSteps.None)
{
// The designmode refers to the time at which the developer is modifying the control while the
// other mode (at runtime), refers to the time when the Dashboard is actually being previewed.
if (DesignMode)
{
step_one.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
step_two.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
step_three.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
step_four.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
step_five.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
}
else
{
step_one.Image = Image.FromFile("new-step.png");
step_two.Image = Image.FromFile("new-step.png");
step_three.Image = Image.FromFile("new-step.png");
step_four.Image = Image.FromFile("new-step.png");
step_five.Image = Image.FromFile("new-step.png");
}
link_one.LineColor = Color.FromArgb(209, 212, 221);
link_two.LineColor = Color.FromArgb(209, 212, 221);
link_three.LineColor = Color.FromArgb(209, 212, 221);
link_four.LineColor = Color.FromArgb(209, 212, 221);
}
else if (current_step == VerificationSteps.First)
{
if (DesignMode)
{
step_one.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\current-step.png");
step_two.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
step_three.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
step_four.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
step_five.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
}
else
{
step_one.Image = Image.FromFile("current-step.png");
step_two.Image = Image.FromFile("new-step.png");
step_three.Image = Image.FromFile("new-step.png");
step_four.Image = Image.FromFile("new-step.png");
step_five.Image = Image.FromFile("new-step.png");
}
link_one.LineColor = Color.FromArgb(209, 212, 221);
link_two.LineColor = Color.FromArgb(209, 212, 221);
link_three.LineColor = Color.FromArgb(209, 212, 221);
link_four.LineColor = Color.FromArgb(209, 212, 221);
}
else if (current_step == VerificationSteps.Second)
{
if (DesignMode)
{
step_one.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_two.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\current-step.png");
step_three.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
step_four.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
step_five.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
}
else
{
step_one.Image = Image.FromFile("cleared-step.png");
step_two.Image = Image.FromFile("current-step.png");
step_three.Image = Image.FromFile("new-step.png");
step_four.Image = Image.FromFile("new-step.png");
step_five.Image = Image.FromFile("new-step.png");
}
link_one.LineColor = Color.FromArgb(51, 151, 247);
link_two.LineColor = Color.FromArgb(209, 212, 221);
link_three.LineColor = Color.FromArgb(209, 212, 221);
link_four.LineColor = Color.FromArgb(209, 212, 221);
}
else if (current_step == VerificationSteps.Third)
{
if (DesignMode)
{
step_one.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_two.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_three.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\current-step.png");
step_four.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
step_five.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
}
else
{
step_one.Image = Image.FromFile("cleared-step.png");
step_two.Image = Image.FromFile("cleared-step.png");
step_three.Image = Image.FromFile("current-step.png");
step_four.Image = Image.FromFile("new-step.png");
step_five.Image = Image.FromFile("new-step.png");
}
link_one.LineColor = Color.FromArgb(51, 151, 247);
link_two.LineColor = Color.FromArgb(51, 151, 247);
link_three.LineColor = Color.FromArgb(209, 212, 221);
link_four.LineColor = Color.FromArgb(209, 212, 221);
}
else if (current_step == VerificationSteps.Fourth)
{
if (DesignMode)
{
step_one.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_two.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_three.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_four.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\current-step.png");
step_five.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\new-step.png");
}
else
{
step_one.Image = Image.FromFile("cleared-step.png");
step_two.Image = Image.FromFile("cleared-step.png");
step_three.Image = Image.FromFile("cleared-step.png");
step_four.Image = Image.FromFile("current-step.png");
step_five.Image = Image.FromFile("new-step.png");
}
link_one.LineColor = Color.FromArgb(51, 151, 247);
link_two.LineColor = Color.FromArgb(51, 151, 247);
link_three.LineColor = Color.FromArgb(51, 151, 247);
link_four.LineColor = Color.FromArgb(209, 212, 221);
}
else if (current_step == VerificationSteps.Fifth)
{
if (DesignMode)
{
step_one.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_two.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_three.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_four.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_five.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\current-step.png");
}
else
{
step_one.Image = Image.FromFile("cleared-step.png");
step_two.Image = Image.FromFile("cleared-step.png");
step_three.Image = Image.FromFile("cleared-step.png");
step_four.Image = Image.FromFile("cleared-step.png");
step_five.Image = Image.FromFile("current-step.png");
}
link_one.LineColor = Color.FromArgb(51, 151, 247);
link_two.LineColor = Color.FromArgb(51, 151, 247);
link_three.LineColor = Color.FromArgb(51, 151, 247);
link_four.LineColor = Color.FromArgb(51, 151, 247);
}
else if (current_step == VerificationSteps.Finished)
{
if (DesignMode)
{
step_one.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_two.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_three.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_four.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
step_five.Image = Image.FromFile(@"C:\Users\Kenboi\Pictures\UI Inspirations\Crypteo - Bitcoin Ethereum Exchange Dashboard\Icons\cleared-step.png");
}
else
{
step_one.Image = Image.FromFile("cleared-step.png");
step_two.Image = Image.FromFile("cleared-step.png");
step_three.Image = Image.FromFile("cleared-step.png");
step_four.Image = Image.FromFile("cleared-step.png");
step_five.Image = Image.FromFile("cleared-step.png");
}
link_one.LineColor = Color.FromArgb(51, 151, 247);
link_two.LineColor = Color.FromArgb(51, 151, 247);
link_three.LineColor = Color.FromArgb(51, 151, 247);
link_four.LineColor = Color.FromArgb(51, 151, 247);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment