public void RefreshData(ColorSchema colorSchema)
 {
     foreach (var day in _dayControls)
     {
         day.RefreshData(colorSchema);
     }
 }
Ejemplo n.º 2
0
        public static void Draw3DSurface(PictureBox pBox)
        {
            //set up objects
            Bitmap   bitmap   = new Bitmap(width, height);
            Graphics graphics = Graphics.FromImage(bitmap);

            renderer3d = new Surface3DRenderer(observableXYZ.x, observableXYZ.y, observableXYZ.z, screenXY.X, screenXY.Y, width, height, zoom, 0, 0);
            renderer3d.MultiThreaded = MultiThreaded;

            //set mouse events
            pBox.Paint              += Draw3DSurface_Paint;
            pBox.MouseWheel         += Draw3DSurface_MouseWheel;
            pBox.MouseDown          += Draw3DSurface_MouseDown;
            pBox.MouseUp            += Draw3DSurface_MouseUp;
            pBox.MouseMove          += Draw3DSurface_MouseMove;
            CapturingMouse_3DSurface = true;

            if (BlackAndWhite)
            {
                renderer3d.ColorSchema = ColorSchema.Greyscale();
            }
            else
            {
                renderer3d.ColorSchema = ColorSchema.Hsv;
            }

            //render surface
            renderer3d.RenderSurface(graphics, pixelMatrix, AdjustmentValue);
            graphics.Dispose();
            pBox.Image = bitmap;
        }
Ejemplo n.º 3
0
        public async Task <IHttpActionResult> PutColorSchema(int id, ColorSchema colorSchema)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != colorSchema.Id)
            {
                return(BadRequest());
            }

            db.Entry(colorSchema).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ColorSchemaExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 4
0
    public override void DrawItemGizmo(Vector3 position)
    {
        Gizmos.color = ColorSchema.GetColor(itemColor);
        MeshFilter mf = GetComponentInChildren <MeshFilter>();

        Gizmos.DrawMesh(mf.sharedMesh, position, mf.transform.rotation, mf.transform.lossyScale);
    }
Ejemplo n.º 5
0
        /// <summary>
        /// Defines a Color schema to the box
        /// </summary>
        /// <param name="color"></param>
        private void setColorSchema(ColorSchema color)
        {
            switch (color)
            {
            case ColorSchema.Regular:
                Console.BackgroundColor = ConsoleColor.Black;
                Console.ForegroundColor = ConsoleColor.White;
                break;

            case ColorSchema.Info:
                Console.BackgroundColor = ConsoleColor.DarkBlue;
                Console.ForegroundColor = ConsoleColor.White;
                break;

            case ColorSchema.Warning:
                Console.BackgroundColor = ConsoleColor.DarkYellow;
                Console.ForegroundColor = ConsoleColor.White;
                break;

            case ColorSchema.Danger:
                Console.BackgroundColor = ConsoleColor.DarkRed;
                Console.ForegroundColor = ConsoleColor.White;
                break;

            case ColorSchema.System:
                Console.BackgroundColor = ConsoleColor.White;
                Console.ForegroundColor = ConsoleColor.Black;
                break;
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Draws a box with two options to answer (Yes/No)
        /// Left/Right arrows to move between options
        /// Enter to select option
        /// </summary>
        /// <param name="schema">Color Schema</param>
        /// <param name="txtYes">Text to Yes option</param>
        /// <param name="txtNo">Text to No option</param>
        /// <param name="defaultAnswer">true=yes/false=no</param>
        /// <returns>true=yes/false=no</returns>
        public bool DrawYesNo(ColorSchema schema = ColorSchema.Regular, string txtYes = "Yes", string txtNo = "No", bool defaultAnswer = false)
        {
            Draw(schema);
            setColorSchema(schema);
            bool answer    = defaultAnswer;
            int  CursorYes = PosLeft + MarginLeft;
            int  CursorNo  = PosLeft + Width - (2 * MarginLeft);
            int  Line      = (PosTop + Height - MarginTop);

            ConsoleKeyInfo keypress;

            do
            {
                Console.SetCursorPosition(CursorYes + 1, Line);
                Console.Write(txtYes);
                Console.SetCursorPosition(CursorNo + 1, Line);
                Console.Write(txtNo);

                Console.SetCursorPosition(CursorYes, Line);
                Console.Write(answer ? AnswerChar : EmptyChar);
                Console.SetCursorPosition(CursorNo, Line);
                Console.Write(!answer ? AnswerChar : EmptyChar);
                keypress = Console.ReadKey(false);

                if ((keypress.Key == ConsoleKey.LeftArrow) || (keypress.Key == ConsoleKey.RightArrow))
                {
                    answer = !answer;
                }
            } while (keypress.Key != ConsoleKey.Enter);
            setColorSchema(ColorSchema.Regular);
            return(answer);
        }
        public void RefreshData(ColorSchema colorSchema)
        {
            foreach (var week in _weekControls)
            {
                week.RefreshData(colorSchema);
            }

            pnMonday.BackColor                         =
                pnTuesday.BackColor                    =
                    pnWednesday.BackColor              =
                        pnThursday.BackColor           =
                            pnFriday.BackColor         =
                                pnSaturday.BackColor   =
                                    pnSunday.BackColor = colorSchema.LineColor;
            laMonday.BackColor                         =
                laTuesday.BackColor                    =
                    laWednesday.BackColor              =
                        laThursday.BackColor           =
                            laFriday.BackColor         =
                                laSaturday.BackColor   =
                                    laSunday.BackColor = colorSchema.HeaderBackColor;
            laMonday.ForeColor                         =
                laTuesday.ForeColor                    =
                    laWednesday.ForeColor              =
                        laThursday.ForeColor           =
                            laFriday.ForeColor         =
                                laSaturday.ForeColor   =
                                    laSunday.ForeColor = colorSchema.HeaderForeColor;
        }
Ejemplo n.º 8
0
    // Update is called once per frame
    void Update()
    {
        Dictionary <ColorPalette, float> cooldownValues = itemGeneratorController.GetCooldownValues();
        List <ColorPalette> colorsInGenerator           = new List <ColorPalette>(cooldownValues.Keys);
        List <ColorPalette> colorsInRadials             = new List <ColorPalette>(colorRadials.Keys);

        colorsInGenerator.Remove(ColorPalette.All);
        colorsInRadials.Remove(ColorPalette.All);
        foreach (ColorPalette color in colorsInGenerator)
        {
            if (!colorRadials.ContainsKey(color))
            {
                GameObject       newUIElement = Instantiate(radialControllerPrefab.gameObject, transform.position, transform.rotation, transform);
                RadialController newRadial    = newUIElement.GetComponent <RadialController>();
                colorRadials.Add(color, newRadial);
                newUIElement.transform.SetSiblingIndex(0);
                newRadial.Initialize(ColorSchema.GetColor(color));
            }
            colorRadials[color].SetTimeRemaining(cooldownValues[color]);
        }
        foreach (ColorPalette color in colorsInRadials)
        {
            if (!cooldownValues.ContainsKey(color))
            {
                GameObject radialWithoutCooldown = colorRadials[color].gameObject;
                Destroy(radialWithoutCooldown);
                colorRadials.Remove(color);
            }
        }
    }
Ejemplo n.º 9
0
        public void Draw(ColorSchema schema = ColorSchema.Regular)
        {
            setColorSchema(schema);

            var headLine = new Char[Width];
            var bodyLine = new Char[Width];

            for (var i = 0; i < Width; ++i)
            {
                headLine[i] = i == 0 || i == Width - 1 ? BorderStyle.VerticalChar : BorderStyle.HorizontalChar;
                bodyLine[i] = i == 0 || i == Width - 1 ? BorderStyle.VerticalChar : EmptyChar;
            }

            for (int i = PosTop; i < Height + PosTop; i++)
            {
                Console.SetCursorPosition(PosLeft, i);
                Console.Write(i == PosTop || i == Height + PosTop - 1 ? headLine : bodyLine);
            }

            DrawCorners();
            if (!String.IsNullOrEmpty(Title))
            {
                drawTitle();
            }
            if (!String.IsNullOrEmpty(Body))
            {
                drawBody();
            }

            setColorSchema(ColorSchema.Regular);
        }
Ejemplo n.º 10
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            ColorSchema colorSchema = await db.ColorSchemaSet.FindAsync(id);

            db.ColorSchemaSet.Remove(colorSchema);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 11
0
    private void Awake()
    {
        ps          = GetComponentsInChildren <ParticleSystem>();
        springyMove = GetComponent <SpringyMove>();
        Color      color = ColorSchema.GetColor(itemColor);
        GameObject child = transform.GetChild(0).gameObject;

        child.GetComponent <Renderer>().material.color = color;
    }
Ejemplo n.º 12
0
        public MotionTrackVM(ISky sky, ISettings settings, TrackCalc trackCalc)
        {
            this.sky       = sky;
            this.trackCalc = trackCalc;

            ColorSchema   = settings.Get <ColorSchema>("Schema");
            OkCommand     = new Command(Ok);
            CancelCommand = new Command(Close);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// This method Creates an input so the user can answer things
        /// </summary>
        /// <param name="schema"></param>
        /// <returns>string containing the user answer</returns>
        public string DrawInput(ColorSchema schema = ColorSchema.Regular)
        {
            Draw(schema);
            setColorSchema(schema);
            Console.SetCursorPosition((PosLeft + MarginLeft), (PosTop + Height - MarginTop));
            Console.Write($"{AnswerChar} ");
            string answer = Console.ReadLine();

            setColorSchema(ColorSchema.Regular);
            return(answer);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// This method draws the box, and wait the user press any key to continue
        /// </summary>
        /// <param name="schema">Color schema</param>
        /// <param name="txtOk">Text to appear on the bottom of the box</param>
        public void DrawOk(ColorSchema schema = ColorSchema.Regular, string txtOk = "Press any key to continue...")
        {
            Draw(schema);
            setColorSchema(schema);
            int CursorOk = PosLeft + MarginLeft;
            int Line     = (PosTop + Height - MarginTop);

            Console.SetCursorPosition(CursorOk, Line);
            Console.Write($"{AnswerChar}{txtOk}");
            Console.ReadKey();
        }
Ejemplo n.º 15
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,colorOne,colorTwo,colorThree,colorFive,colorFour")] ColorSchema colorSchema)
        {
            if (ModelState.IsValid)
            {
                db.Entry(colorSchema).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(colorSchema));
        }
Ejemplo n.º 16
0
        public async Task <IHttpActionResult> GetColorSchema(int id)
        {
            ColorSchema colorSchema = await db.ColorSchemaSet.FindAsync(id);

            if (colorSchema == null)
            {
                return(NotFound());
            }

            return(Ok(colorSchema));
        }
Ejemplo n.º 17
0
    public void SetParticleColor()
    {
        ps = GetComponentsInChildren <ParticleSystem>();
        GameObject child = transform.GetChild(0).gameObject;
        Color      color = ColorSchema.GetColor(itemColor);
        var        col   = ps[0].colorOverLifetime;
        Gradient   grad  = new Gradient();

        grad.SetKeys(new GradientColorKey[] { new GradientColorKey(color, 0.0f), new GradientColorKey(color, 1.0f) }, new GradientAlphaKey[] { new GradientAlphaKey(0.0f, 0.0f), new GradientAlphaKey(0.5f, 0.1f), new GradientAlphaKey(0.0f, 1.0f) });
        col.color = grad;
    }
Ejemplo n.º 18
0
        public async Task <IHttpActionResult> PostColorSchema(ColorSchema colorSchema)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ColorSchemaSet.Add(colorSchema);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = colorSchema.Id }, colorSchema));
        }
Ejemplo n.º 19
0
    private void Awake()
    {
        int randomNumber = rnd.Next(ColorSchema.standardColors.Length);

        itemColor   = ColorSchema.standardColors[randomNumber];
        ps          = GetComponentsInChildren <ParticleSystem>();
        springyMove = GetComponent <SpringyMove>();
        Color      color = ColorSchema.GetColor(itemColor);
        GameObject child = transform.GetChild(0).gameObject;

        child.GetComponent <Renderer>().material.color = color;
    }
Ejemplo n.º 20
0
        public async Task <ActionResult> Create([Bind(Include = "Id,colorOne,colorTwo,colorThree,colorFive,colorFour")] ColorSchema colorSchema)
        {
            if (ModelState.IsValid)
            {
                db.ColorSchemaSet.Add(colorSchema);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(colorSchema));
        }
Ejemplo n.º 21
0
 private void SetColorSchema(ColorSchema schema)
 {
     Current.Resources.MergedDictionaries[0].Source = new Uri($@"pack://application:,,,/Planetarium.Types;component/Themes/Colors{(schema == ColorSchema.Red ? "Red" : "Default")}.xaml");
     if (schema == ColorSchema.Red)
     {
         CursorsHelper.SetCustomCursors();
     }
     else
     {
         CursorsHelper.SetSystemCursors();
     }
 }
Ejemplo n.º 22
0
        public static void Colorize(this Image image, ColorSchema colorSchema)
        {
            var attrs = GetImageAttributes(colorSchema);

            if (attrs != null)
            {
                using (Graphics g = Graphics.FromImage(image))
                {
                    g.DrawImage(image, new Rectangle(0, 0, image.Width, image.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attrs);
                }
            }
        }
Ejemplo n.º 23
0
        public void colorize(ColorSchema schema)
        {
            this.schema = schema;
            IHighlightingDefinition def = null;

            switch (schema)
            {
            case ColorSchema.ScriptMode:
            case ColorSchema.SBEScripts: {
                def = HighlightingManager.Instance.GetDefinition("SBEScripts");
                break;
            }

            case ColorSchema.Default:
            case ColorSchema.FilesMode: {
                def = HighlightingManager.Instance.GetDefinition("FilesMode");
                break;
            }

            case ColorSchema.OperationMode: {
                def = HighlightingManager.Instance.GetDefinition("OperationMode");
                break;
            }

            case ColorSchema.InterpreterMode: {
                def = HighlightingManager.Instance.GetDefinition("InterpreterMode");
                break;
            }

            case ColorSchema.MSBuildTargets: {
                def = HighlightingManager.Instance.GetDefinition("MSBuildTargets");
                break;
            }

            case ColorSchema.CSharpLang: {
                def = HighlightingManager.Instance.GetDefinition("CSharpLang");
                break;
            }

            case ColorSchema.CppLang: {
                def = HighlightingManager.Instance.GetDefinition("CppLang");
                break;
            }

            default: {
                Log.Debug("colorize: schema '{0}' is invalid", schema);
                return;
            }
            }
            _.SyntaxHighlighting = def;
            updateFoldings();
        }
Ejemplo n.º 24
0
        // GET: ColorSchemas/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ColorSchema colorSchema = await db.ColorSchemaSet.FindAsync(id);

            if (colorSchema == null)
            {
                return(HttpNotFound());
            }
            return(View(colorSchema));
        }
Ejemplo n.º 25
0
        public async Task <IHttpActionResult> DeleteColorSchema(int id)
        {
            ColorSchema colorSchema = await db.ColorSchemaSet.FindAsync(id);

            if (colorSchema == null)
            {
                return(NotFound());
            }

            db.ColorSchemaSet.Remove(colorSchema);
            await db.SaveChangesAsync();

            return(Ok(colorSchema));
        }
Ejemplo n.º 26
0
 /// <summary>
 /// Print the entire Screen, Use this to test your terminal
 /// </summary>
 public void TestSize(ColorSchema schema = ColorSchema.Info)
 {
     for (int i = 0; i < Height; i++)
     {
         for (int j = 0; j < Width; j++)
         {
             Console.SetCursorPosition(j, i);
             System.Console.Write("+");
         }
         Console.SetCursorPosition((Width / 2) - 6, i);
         setColorSchema(schema);
         System.Console.Write($"Line {i}");
         Console.ResetColor();
     }
 }
Ejemplo n.º 27
0
        public Color GetColor(ColorSchema schema)
        {
            switch (schema)
            {
            default:
            case ColorSchema.Night:
            case ColorSchema.Day:
                return(Night);

            case ColorSchema.Red:
                return(Red);

            case ColorSchema.White:
                return(White);
            }
        }
Ejemplo n.º 28
0
 public void RefreshData(ColorSchema colorSchema)
 {
     _allowToSave                    = false;
     _colorSchema                    = colorSchema;
     labelControlData.Text           = Day.Summary;
     pbLogo.Image                    = Day.Logo.TinyImage;
     pbLogo.Visible                  = Day.Logo.ContainsData;
     pbLogo.Height                   = Day.Logo.ContainsData ? Day.Logo.TinyImage.Height : 0;
     memoEditSimpleComment.EditValue = Day.Comment;
     toolStripMenuItemEdit.Visible   = true;
     toolStripMenuItemEdit.Enabled   = true;
     toolStripMenuItemDelete.Enabled = Day.ContainsData;
     pnCalendarNoteArea.Visible      = Day.HasNotes;
     RefreshColor();
     UpdateTooltip();
     _allowToSave = true;
 }
Ejemplo n.º 29
0
        public void changedTeam(string team)
        {
            if (team == "CT")
            {
                currentSchema = ctColor;
            }
            else if (team == "T")
            {
                currentSchema = ttColor;
            }
            else if (team != "")
            {
                currentSchema = idleColor;
            }

            updateColorSchema(currentSchema, currentSchema);
        }
Ejemplo n.º 30
0
        public string DrawList(List <String> options, ColorSchema schema = ColorSchema.Regular)
        {
            Draw(schema);
            setColorSchema(schema);
            int Line      = LastBodyHeight + MarginTop;
            int tmpCursor = 0;

            foreach (string s in options)
            {
                Console.SetCursorPosition(MarginLeft + PosLeft, Line);
                System.Console.Write($" {s}");
                Line++;
            }

            Line -= options.Count;

            ConsoleKeyInfo keypress;

            do
            {
                Console.SetCursorPosition(MarginLeft + PosLeft, Line + tmpCursor);
                Console.Write(AnswerChar);
                keypress = Console.ReadKey(true);
                if (keypress.Key == ConsoleKey.UpArrow)
                {
                    if (tmpCursor > 0)
                    {
                        Console.SetCursorPosition(MarginLeft + PosLeft, Line + tmpCursor);
                        Console.Write(EmptyChar);
                        tmpCursor--;
                    }
                }
                if (keypress.Key == ConsoleKey.DownArrow)
                {
                    if (tmpCursor < options.Count - 1)
                    {
                        Console.SetCursorPosition(MarginLeft + PosLeft, Line + tmpCursor);
                        Console.Write(EmptyChar);
                        tmpCursor++;
                    }
                }
            } while (keypress.Key != ConsoleKey.Enter);
            setColorSchema(ColorSchema.Regular);
            return(options[tmpCursor]);
        }
Ejemplo n.º 31
0
 public void colorize(ColorSchema schema)
 {
     this.schema = schema;
     IHighlightingDefinition def = null;
     switch(schema)
     {
         case ColorSchema.ScriptMode:
         case ColorSchema.SBEScript: {
             def = HighlightingManager.Instance.GetDefinition("SBEScripts");
             break;
         }
         case ColorSchema.Default:
         case ColorSchema.FilesMode: {
             def = HighlightingManager.Instance.GetDefinition("FilesMode");
             break;
         }
         case ColorSchema.OperationMode: {
             def = HighlightingManager.Instance.GetDefinition("OperationMode");
             break;
         }
         case ColorSchema.InterpreterMode: {
             def = HighlightingManager.Instance.GetDefinition("InterpreterMode");
             break;
         }
         case ColorSchema.MSBuildTargets: {
             def = HighlightingManager.Instance.GetDefinition("MSBuildTargets");
             break;
         }
         case ColorSchema.CSharpLang: {
             def = HighlightingManager.Instance.GetDefinition("CSharpLang");
             break;
         }
         default: {
             Log.Debug("colorize: schema '{0}' is invalid", schema);
             return;
         }
     }
     _.SyntaxHighlighting = def;
     updateFoldings();
 }