Example #1
0
        public static void Print(string str, EnumColor color)
        {
            switch (color)
            {
            case EnumColor.Green:
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine(str);
                break;

            case EnumColor.Black:
                Console.ForegroundColor = ConsoleColor.Black;
                Console.WriteLine(str);
                break;

            case EnumColor.Yellow:
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine(str);
                break;

            case EnumColor.Red:
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(str);
                break;

            default:
                Console.WriteLine("Такого цвета нету в базе!");
                break;
            }
        }
 /// <summary>
 /// Construtor para criar uma casa com cor.
 /// </summary>
 /// <param name="tileColor"> Cor da casa. </param>
 /// <param name="tileType"> Tipo da casa. </param>
 public Tile(EnumColor tileColor, EnumTileType tileType)
 {
     TileColor   = tileColor;
     TileType    = tileType;
     ghostOnTile = null;
     pos         = new Position();
 }
Example #3
0
        private void LogTxt(string logTxt, EnumColor color = EnumColor.Black)
        {
            this.LogBox.BeginInvoke(new Action(() =>
            {
                if (this.LogBox.Lines.Length > 2000)
                {
                    this.LogBox.Text = "";
                }
                string logAppend = DateTime.Now.ToString("[HH:mm:ss]: ") + logTxt + "\r\n";
                this.LogBox.AppendText(logAppend);
                this.LogBox.Select((this.LogBox.Text.Length - logAppend.Length) + 1, logAppend.Length - 1);
                switch (color)
                {
                case EnumColor.Black:
                    this.LogBox.SelectionColor = System.Drawing.SystemColors.Desktop;
                    break;

                case EnumColor.Red:
                    this.LogBox.SelectionColor = Color.DarkRed;
                    break;

                case EnumColor.Blue:
                    this.LogBox.SelectionColor = System.Drawing.SystemColors.HotTrack;
                    break;
                }
                this.LogBox.SelectionFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.LogBox.ScrollToCaret();
                this.LogBox.SelectionStart = this.LogBox.Text.Length;
                //Util.LogTxt(logTxt, true);
            }));
        }
Example #4
0
 public Product(int id, string name, double price, EnumColor color)
 {
     Id    = id;
     Name  = name;
     Price = price;
     Color = color;
 }
        public void CarInstance()
        {
            //Arrange
            string       manufacturerNameEx = "NewManufacturer";
            Manufacturer manuEx             = new Manufacturer {
                Name = manufacturerNameEx
            };
            string       modelNameEx = "NewModel";
            double       engineEx    = 2;
            EnumCategory catEx       = EnumCategory.Intermediate;
            Model        model       = new Model {
                Name = modelNameEx, Manufacturer = manuEx, Engine = engineEx, Category = catEx
            };
            EnumColor colorEx = EnumColor.White;
            string    plateEx = "qwe1234";
            decimal   priceEx = 50;

            //Act
            Car found = new Car
            {
                CarColor     = colorEx,
                LicensePlate = plateEx,
                Model        = model,
                Price        = priceEx
            };

            //Assert
            Assert.AreEqual(colorEx, found.CarColor);
            Assert.AreEqual(plateEx, found.LicensePlate);
            Assert.AreEqual(priceEx, found.Price);
        }
Example #6
0
    //STRING
    public static string HTMLBagde(EnumColor parEnumColor, string message)
    {
        switch (parEnumColor)
        {
        case EnumColor.Primary:
            return("<span class=\"badge badge-pill badge-primary\">" + message + "</span>");

        case EnumColor.Secondary:
            return("<span class=\"badge badge-pill badge-secondary\">" + message + "</span>");

        case EnumColor.Success:
            return("<span class=\"badge badge-pill badge-success\">" + message + "</span>");

        case EnumColor.Danger:
            return("<span class=\"badge badge-pill badge-danger\">" + message + "</span>");

        case EnumColor.Warning:
            return("<span class=\"badge badge-pill badge-warning\">" + message + "</span>");

        case EnumColor.Info:
            return("<span class=\"badge badge-pill badge-info\">" + message + "</span>");

        case EnumColor.Light:
            return("<span class=\"badge badge-pill badge-light\">" + message + "</span>");

        case EnumColor.Dark:
            return("<span class=\"badge badge-pill badge-dark\">" + message + "</span>");

        default:
            return(string.Empty);
        }
    }
Example #7
0
    public static string HTMLDivAlert(EnumColor parEnumColor, string parMessageParent, string parMessageDetail)
    {
        switch (parEnumColor)
        {
        case EnumColor.Primary:
            return("<div class=\"alert alert-primary\" role=\"alert\"><strong>" + parMessageParent + "</strong> " + parMessageDetail + "</div>");

        case EnumColor.Secondary:
            return("<div class=\"alert alert-secondary\" role=\"alert\"><strong>" + parMessageParent + "</strong> " + parMessageDetail + "</div>");

        case EnumColor.Success:
            return("<div class=\"alert alert-success\" role=\"alert\"><strong>" + parMessageParent + "</strong> " + parMessageDetail + "</div>");

        case EnumColor.Danger:
            return("<div class=\"alert alert-danger\" role=\"alert\"><strong>" + parMessageParent + "</strong> " + parMessageDetail + "</div>");

        case EnumColor.Warning:
            return("<div class=\"alert alert-warning\" role=\"alert\"><strong>" + parMessageParent + "</strong> " + parMessageDetail + "</div>");

        case EnumColor.Info:
            return("<div class=\"alert alert-info\" role=\"alert\"><strong>" + parMessageParent + "</strong> " + parMessageDetail + "</div>");

        case EnumColor.Light:
            return("<div class=\"alert alert-light\" role=\"alert\"><strong>" + parMessageParent + "</strong> " + parMessageDetail + "</div>");

        case EnumColor.Dark:
            return("<div class=\"alert alert-dark\" role=\"alert\"><strong>" + parMessageParent + "</strong> " + parMessageDetail + "</div>");

        default:
            return(string.Empty);
        }
    }
Example #8
0
        internal static IEnumerable <Piece> createPieces(EnumColor color)
        {
            switch (color)
            {
            case EnumColor.Black:
                for (byte y = 0; y < 3; y++)
                {
                    for (byte x = 0; x < Board.GRID_SIZE; x++)
                    {
                        if (y % 2 != x % 2)
                        {
                            yield return(new Piece(new Point(x, y), PieceType.Man));
                        }
                    }
                }

                break;

            case EnumColor.White:
                for (byte y = 5; y < Board.GRID_SIZE; y++)
                {
                    for (byte x = 0; x < Board.GRID_SIZE; x++)
                    {
                        if (y % 2 != x % 2)
                        {
                            yield return(new Piece(new Point(x, y), PieceType.Man));
                        }
                    }
                }

                break;
            }
        }
Example #9
0
    public static string GetHexaDecimalColor(EnumColor parEnumColor)
    {
        switch (parEnumColor)
        {
        case EnumColor.Primary:
            return("#2196f3");

        case EnumColor.Secondary:
            return("#9e9e9e");

        case EnumColor.Success:
            return("#4db6ac");

        case EnumColor.Danger:
            return("#ef5350");

        case EnumColor.Warning:
            return("#ffd740");

        case EnumColor.Info:
            return("#4dd0e1");

        case EnumColor.Light:
            return("#f5f5f5");

        case EnumColor.Dark:
            return("#424242");

        default:
        {
            Random rd = new Random();
            return(String.Format("#{0:X6}", rd.Next(0x1000000)));
        }
        }
    }
Example #10
0
        private void ChangeColor(EnumColor _textColor)
        {
            ChangeColorCommand ccc;

            ccc = new ChangeColorCommand(Editor, _textColor);
            Commands.Push(ccc);
            ccc.Execute();
        }
Example #11
0
    public void askInitPlayerRPC(NetworkMessageInfo info)
    {
        //zone = asteroidsManager.choosePos();
        EnumColor col = asteroidsManager.chooseColor();

        asteroidsManager.nbPlayerConnected++;
        networkView.RPC("initPlayerRPC", info.sender, (int)col, new Vector3(0, 0, 0));
    }
Example #12
0
 protected void Awake()
 {
     base.Awake();
     _enumColor = EnumColor.DEFAULT;
     _color[0]  = Color.red;
     _color[1]  = Color.green;
     _color[2]  = Color.blue;
 }
 /// <summary>
 /// Construtor que contem as propriedades do portal, como a cor,
 /// posição, direção, etc... .
 /// </summary>
 /// <param name="color"> Cor do portal. </param>
 /// <param name="startDirection"> A direção incial do portal. </param>
 /// <param name="X0"> X inicial. </param>
 /// <param name="Y0"> Y inicial. </param>
 public Portal(EnumColor color, EnumPortalDirection startDirection,
               int X0, int Y0)
 {
     _color     = color;
     Direction  = startDirection;
     pos        = new Position(X0, Y0);
     freeGhosts = new List <Ghost>(0);
     posToCheck = new Position(pos.x, pos.y);
 }
 /// <summary>
 /// Construtor para criar um fantasma.
 /// </summary>
 /// <param name="ghostColour">Cor de o fantasma novo.</param>
 /// <param name="owner">A quem pertence este novo fantasma.</param>
 public Ghost(EnumColor ghostColour, Player owner)
 {
     pos         = new Position();
     color       = ghostColour;
     this.owner  = owner;
     inDungeon   = false;
     isOnBoard   = false;
     possiblePos = new List <Position>(4);
 }
Example #15
0
 /// <summary>
 /// Main settings constructor with parameters
 /// </summary>
 public MainS(int dotSize, EnumColor leftColor, EnumColor rightColor, bool showChart, int eventSize, int dotsToPaint, int channels, EnumAudio mono_stereo, EnumScreenSize screenSize)
 {
     this.dotSize     = dotSize;
     this.leftColor   = leftColor;
     this.rightColor  = rightColor;
     this.showChart   = showChart;
     this.eventSize   = eventSize;
     this.dotsToPaint = dotsToPaint;
     this.channels    = channels;
     this.mono_stereo = mono_stereo;
     this.screenSize  = screenSize;
 }
Example #16
0
 /// <summary>
 /// Main settings empty constructor
 /// </summary>
 public MainS()
 {
     this.dotSize     = 2;
     this.leftColor   = EnumColor.BLUE;
     this.rightColor  = EnumColor.ORANGE;
     this.showChart   = true;
     this.eventSize   = 32;
     this.dotsToPaint = 10;
     this.channels    = 64;
     this.mono_stereo = EnumAudio.STEREO;
     this.screenSize  = EnumScreenSize.s1366x768;
 }
Example #17
0
 public Bicycle()
 {
     this.serialNo        = 0;
     this.RimType         = EnumRimType.Undefined;
     this.color           = EnumColor.Undefined;
     this.madeBy          = "Undefined";
     this.price           = 0.00;
     this.speed           = 0;
     this.groundClearance = 0.00;
     this.seatHeight      = 0.00;
     this.suspensionType  = EnumSusType.Not_Applicable;
     this.model           = EnumModelType.Undefined;
 }
Example #18
0
 // Use this for initialization
 void Start()
 {
     upDownRange                 = 60f;
     leftRightRange              = 70f;
     mouseSensitivity            = 1f;
     cdShoot                     = 1f;
     cdMoveHorizontal            = 1f / 60f;
     cdMoveVertical              = cdMoveHorizontal;
     timeSinceLastShoot          = 0;
     timeSinceLastMoveVertical   = 0;
     timeSinceLastMoveHorizontal = 0;
     color = EnumColor.NONE;
 }
Example #19
0
 public Bicycle(int serNo, EnumRimType rimTyp, EnumColor col, string madeby, double price,
                int speed, double groundClr, double seatHgt, EnumSusType susType, EnumModelType model)
 {
     this.serialNo        = serNo;
     this.RimType         = rimTyp;
     this.color           = col;
     this.madeBy          = madeby;
     this.price           = price;
     this.speed           = speed;
     this.groundClearance = groundClr;
     this.seatHeight      = seatHgt;
     this.suspensionType  = susType;
     this.model           = model;
 }
        public void Populate(int chosen)
        {
            int x;
            int y;
            int q;
            int r;
            int z = 0;

            for (x = 1; x <= 3; x++)     // shapes
            {
                for (y = 1; y <= 7; y++) // numbers
                {
                    for (r = 1; r <= 2; r++)
                    {
                        for (q = 1; q <= 2; q++) // how many of each
                        {
                            z += 1;
                            if (z == chosen)
                            {
                                Deck     = chosen;
                                CardType = EnumCardType.Regular;
                                Shape    = (EnumCardShape)x;
                                Value    = y;
                                Color    = (EnumColor)r;
                                return;
                            }
                        }
                    }
                }
            }
            for (x = 85; x <= 96; x++)
            {
                if (x == chosen)
                {
                    Deck     = chosen;
                    CardType = EnumCardType.Wild;
                    return;
                }
            }
            for (x = 97; x <= 100; x++)
            {
                if (x == chosen)
                {
                    Deck     = chosen;
                    CardType = EnumCardType.Reverse;
                    return;
                }
            }
            throw new Exception("Can't find the deck " + chosen);
        }
 public ExportEntityAttribute(EnumColor titleColor, EnumColor headColor, EnumColor contentColor, string title = "", int titleFontSize = 14, int headFontSize = 12, int contentFontSize = 10, bool isTitleBold = true, bool isHeadBold = true, bool isContentBold = false, int titleColumnSpan = 0)
 {
     this._TitleColor      = titleColor;
     this._HeadColor       = headColor;
     this._ContentColor    = contentColor;
     this._Title           = title;
     this._TitleFontSize   = titleFontSize;
     this._HeadFontSize    = headFontSize;
     this._ContentFontSize = contentFontSize;
     this._IsTitleBold     = isTitleBold;
     this._IsHeadBold      = isHeadBold;
     this._IsContentBold   = isContentBold;
     this._TitleColumnSpan = titleColumnSpan;
 }
Example #22
0
    // bool b indicates if it is activated or not
    public void init(Vector3 posSpawn, Vector3 cible, int health, int id, EnumColor color)
    {
        target             = cible;
        transform.position = posSpawn;
        hp      = health;
        isUsed  = true;
        this.id = id;
        //gameObject.renderer.enabled = true;

        setColor(color);

        // We activate the asteroid and add it to use asteroid
        gameObject.SetActive(true);
        asteroidManager.add(id, this);
    }
Example #23
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            index = this.listBoxDisplay.SelectedIndex;

            DialogResult result;

            result = MessageBox.Show("DO YOU WANT TO UPDATE?", "UPDATE", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                if (radioButtonRdBikes.Checked == true)
                {
                    long      serNum     = Convert.ToInt64(this.textBoxSrNum.Text);
                    string    make       = this.textBoxMd.Text;
                    float     price      = Convert.ToInt32(textBoxPrice.Text);
                    EnumColor color      = (EnumColor)positionColor;
                    double    speed      = Convert.ToInt32(this.textBoxSpd.Text);
                    int       year       = Convert.ToInt32(this.textBoxYear.Text);
                    double    SeatHeight = Convert.ToInt32(this.textBoxStHght.Text);
                    double    Weight     = Convert.ToInt32(this.textBoxWght.Text);
                    double    newSpeed   = Convert.ToInt32(this.textBoxNewSpeedRD.Text);

                    //MessageBox.Show("Radio Bike UPDATED");
                }

                else if (radioButtonMtnBikes.Checked == true)
                {
                    long           serNum     = Convert.ToInt64(this.textBoxSrNum.Text);
                    string         make       = this.textBoxMd.Text;
                    float          price      = Convert.ToInt32(textBoxPrice.Text);
                    EnumColor      color      = (EnumColor)positionColor;
                    double         speed      = Convert.ToInt32(this.textBoxSpd.Text);
                    int            year       = Convert.ToInt32(this.textBoxYear.Text);
                    double         Height     = Convert.ToInt32(this.textBoxHght.Text);
                    EnumSuspension Suspension = (EnumSuspension)positionSuspension;
                    EnumHeadlight  Headlight  = (EnumHeadlight)positionHdLight;
                    double         newSpeed   = Convert.ToInt32(this.textBoxNewSpeedMT.Text);

                    //MessageBox.Show("Mountain Bike UPDATED");
                }
            }
            else
            {
                MessageBox.Show("The Bike serial number - " + this.myList[index].SerNum + " is not updated");
            }

            FileHandler.WriteToXmlFile(myList);
        }
Example #24
0
        /// <summary>
        /// Main settings read from XML
        /// </summary>
        public void fromXML(XElement root)
        {
            CultureInfo ci = new CultureInfo("en-us");
            XElement    xe;

            xe          = root.Element("Main");
            dotSize     = Convert.ToInt16(xe.Attribute("dotSize").Value, ci);
            leftColor   = (EnumColor)Enum.Parse(typeof(EnumColor), xe.Attribute("leftColor").Value);
            rightColor  = (EnumColor)Enum.Parse(typeof(EnumColor), xe.Attribute("rightColor").Value);
            showChart   = Convert.ToBoolean(xe.Attribute("showChart").Value, ci);
            eventSize   = Convert.ToInt16(xe.Attribute("eventSize").Value, ci);
            dotsToPaint = Convert.ToInt16(xe.Attribute("dotsToPaint").Value, ci);
            channels    = Convert.ToInt16(xe.Attribute("channels").Value, ci);
            mono_stereo = (EnumAudio)Enum.Parse(typeof(EnumAudio), xe.Attribute("mono_stereo").Value);
            screenSize  = (EnumScreenSize)Enum.Parse(typeof(EnumScreenSize), xe.Attribute("screenSize").Value);
        }
Example #25
0
    private void ChangeColor(Color selfColor)
    {
        if (selfColor == Color.red)
        {
            _enumColor = EnumColor.RED;
        }

        if (selfColor == Color.green)
        {
            _enumColor = EnumColor.GREEN;
        }

        if (selfColor == Color.blue)
        {
            _enumColor = EnumColor.BLUE;
        }
    }
Example #26
0
        static void Main(string[] args)
        {
            Console.WriteLine("Введите текст:");
            string text = Console.ReadLine();

            Console.WriteLine("Выберите цвет:");
            for (EnumColor number = EnumColor.Green; number <= EnumColor.Red; number++)
            {
                Console.WriteLine($"{(byte)number} - {number}");
            }

            EnumColor color = (EnumColor)Convert.ToInt32(Console.ReadLine());

            TextColor.Print(text, color);

            Console.ReadKey();
        }
Example #27
0
 private bool HasSpecificCard(ICard thisCard, int number, EnumColor color)
 {
     if (thisCard.FirstValue == number && thisCard.Color == color)
     {
         return(true);
     }
     if (thisCard.SecondValue == number && thisCard.Color == color)
     {
         return(true);
     }
     if (thisCard.FirstValue == number && thisCard.Color == EnumColor.Any)
     {
         return(true);
     }
     if (thisCard.IsWild == true && thisCard.Color == color)
     {
         return(true);
     }
     return(false);
 }
Example #28
0
        public static void Change(object sender, object e)
        {
            if (count <= 10) // Если количество срабатываний метода превысит 10, то начнет мигать желтый цвет
            {
                count++;
                switch (CurrentColor)
                {
                case EnumColor.Stop:
                    CurrentColor = EnumColor.Ready;
                    break;

                case EnumColor.Ready:
                    CurrentColor = EnumColor.Go;
                    break;

                case EnumColor.Go:
                    CurrentColor = EnumColor.Wait;
                    break;

                case EnumColor.Wait:
                    CurrentColor = EnumColor.Stop;
                    break;
                }
            }
            else
            {
                switch (CurrentColor)
                {
                case EnumColor.Wait:
                    CurrentColor = EnumColor.None;
                    break;

                case EnumColor.None:
                    CurrentColor = EnumColor.Wait;
                    break;
                }
            }
        }
        /// <summary>
        /// Método para definir a cor do texto na consola.
        /// </summary>
        /// <param name="c"> Variável cor. </param>
        private void TextColorSwitcher(EnumColor c)
        {
            // Controla que cor deve ser representada na consola consoante a
            // cor dos fantasmas e portais.
            switch (c)
            {
            case EnumColor.Blue:
                Console.ForegroundColor = ConsoleColor.Cyan;
                break;

            case EnumColor.Red:
                Console.ForegroundColor = ConsoleColor.Red;
                break;

            case EnumColor.Yellow:
                Console.ForegroundColor = ConsoleColor.Yellow;
                break;

            default:
                Console.ForegroundColor = ConsoleColor.White;
                break;
            }
        }
Example #30
0
 public void setColor(EnumColor color)
 {
     this.color = color;
     blenderObject.renderer.material = matChoice[(int)color];
     radarDisplay.renderer.material  = matChoice[(int)color];
 }