示例#1
0
        internal void OnMouseDown(ZedGraphControl sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left || e.Clicks != 1)
            {
                return;
            }

            m_HighLight?.Hide();

            var loc = Location;

            loc.Offset(sender.PointToScreen(sender.ClientRectangle.Location));

            m_HighLight = new HighLight(loc, Size);
            m_Start     = m_Last = e.Location;

            if (PaneIndex > 0 && sender.MasterPane != null && PaneIndex < sender.MasterPane.PaneList.Count - 1)
            {
                var before = sender.MasterPane.PaneList[PaneIndex - 1];
                var after  = sender.MasterPane.PaneList[PaneIndex + 1];

                var min = before.Location;
                var max = new Point((int)after.Rect.Right, (int)after.Rect.Bottom);

                m_Min = Vertical ? min.X : min.Y;
                m_Max = Vertical ? max.X : max.Y;
            }
        }
示例#2
0
 void RemoveText(HighLight h)
 {
     if (h.mText != null)
     {
         ChartItemEvents e = h.mText.GetComponent <ChartItemEvents>();
         h.mControl = h.mText.GetComponent <CharItemEffectController>();
         if (e != null && h.mControl != null)
         {
             e.OnMouseLeave.Invoke(e.gameObject);
             mRemoved.Add(h);
         }
         else
         {
             ChartCommon.SafeDestroy(h.mText);
         }
         e = h.mPoint.GetComponent <ChartItemEvents>();
         if (e != null)
         {
             e.OnMouseLeave.Invoke(e.gameObject);
         }
         else
         {
             ChartCommon.SafeDestroy(h.mPoint);
         }
     }
 }
    RenderFragment CodeComponent(string code) => builder =>
    {
        try
        {
            var key = typeof(SectionContent).Assembly.GetManifestResourceNames().FirstOrDefault(x => x.Contains($".{code}Code.html"));
            using (var stream = typeof(SectionContent).Assembly.GetManifestResourceStream(key))
                using (var reader = new StreamReader(stream))
                {
                    var read = reader.ReadToEnd();

                    if (!string.IsNullOrEmpty(HighLight))
                    {
                        if (HighLight.Contains(","))
                        {
                            var highlights = HighLight.Split(",");

                            foreach (var value in highlights)
                            {
                                read = Regex.Replace(read, $"{value}(?=\\s|\")", $"<mark>$&</mark>");
                            }
                        }
                        else
                        {
                            read = Regex.Replace(read, $"{HighLight}(?=\\s|\")", $"<mark>$&</mark>");
                        }
                    }

                    builder.AddMarkupContent(0, read);
                }
        }
        catch (Exception)
        {
            // todo: log this
        }
    };
示例#4
0
        /// <summary>
        /// Clear the target files
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnClear_Click(object sender, EventArgs e)
        {
            lstFiles.Clear();
            txtFiles.Clear();
            HighLight hl = new HighLight(txtFiles);

            hl.Reset2Default();
        }
示例#5
0
 public MySplitter()
 {
     base.SetStyle(ControlStyles.Selectable, false);
     this.TabStop  = false;
     this.minSize  = 0x19;
     this.minExtra = 0x19;
     this.Dock     = DockStyle.Left;
     highlight     = new HighLight();
 }
    // Use this for initialization
    void Start()
    {
        HighLight highlight = GetComponent <HighLight>();

        if (highlight != null)
        {
            highlight.StartHighlight();
        }
    }
示例#7
0
 internal void SetSquareHighLight(int square, HighLight highlight)
 {
     if (square < 0 || square > NumberSquares)
     {
         IntInterface.CallBack.Panic("Invalid square number: " + square);
     }
     Squares[square].HightLight = highlight;
     Squares[square].Refresh();
 }
示例#8
0
 internal void SetCellHightLight(int row, int col, HighLight hightlight)
 {
     if (row < 0 || row > Cells.Length ||
         col < 0 || col > Cells[row].Length)
     {
         IntInterface.CallBack.Panic("Invalid cell index : " + row + ", " + col);
     }
     Cells[row][col].HightLight = hightlight;
     Cells[row][col].Refresh();
 }
示例#9
0
 public Cell(CellState state, int square, int height, int width, HighLight highlight)
 {
     SquareNum = square;
     State     = state;
     Highlight = highlight;
     IsDirty   = true;
     Height    = height;
     Width     = width;
     Padding   = new Padding(0);
     Margin    = new Padding(0);
     InitializeComponent();
 }
示例#10
0
        /// <summary>
        /// Show the match result on tree.
        /// </summary>
        /// <param name="matches"></param>
        private void BindMatchTree(MatchCollection matches, Regex reg)
        {
            HighLight hl = new HighLight(txtInput);

            hl.Reset2Default();
            treeMatch.Nodes.Clear();
            foreach (Match match in matches)
            {
                hl.Highlight(match);

                TreeNode nodeMatch = treeMatch.Nodes.Add(match.Value);
                BindGroup(nodeMatch, match, reg);
            }
        }
示例#11
0
 private void DrawSplitHelper(int splitSize)
 {
     if (this.splitTarget != null)
     {
         Rectangle rectangle = this.CalcSplitLine(splitSize, 3);
         var       r         = this.Parent.RectangleToScreen(rectangle);
         if (!highlight.Visible)
         {
             HighLight.ShowInactiveTopmost(highlight);
         }
         highlight.Location = r.Location;
         highlight.Size     = r.Size;
     }
 }
示例#12
0
    protected void turnOnHighLights(Transform objectToSearch, EHighLightStatus status)
    {
        HighLight tempHL = null;

        for (int i = 0; i < objectToSearch.childCount; i++)
        {
            if (objectToSearch.GetChild(i).tag == HIGHLIGHT_TAG)
            {
                tempHL = objectToSearch.GetChild(i).gameObject.GetComponent <HighLight> ();
                if (tempHL.activateHighLight(currentType, status))
                {
                    activeHighLight.Add(tempHL);
                }
            }
        }
    }
示例#13
0
 public HighLight addHighlight(HighLight highlight)
 {
     using (var context = getContext())
     {
         try
         {
             highlight.Orden  = 1;
             highlight.Estado = true;
             context.HighLight.Add(highlight);
             context.SaveChanges();
             return(highlight);
         }
         catch (Exception e) {
             throw e;
         }
     }
 }
示例#14
0
        internal void OnMouseUp(ZedGraphControl sender, MouseEventArgs e)
        {
            m_HighLight?.Close();
            m_HighLight = null;

            var range = m_Max - m_Min;

            if (e.Location == m_Start || Vertical ? (e.Location.X <= m_Min || e.Location.X >= m_Max)
                                            : (e.Location.Y <= m_Min || e.Location.Y >= m_Max) ||
                range == 0)
            {
                return;
            }

            var ratio = (float)((Vertical ? e.Location.X : e.Location.Y) - m_Min) / range;

            sender.MasterPane.SetProportion(this, ratio);
            sender.Invalidate();
            sender.Refresh();
        }
        public ActionResult UpdateHighlight(HighLight highlight)
        {
            if (!this.currentUser())
            {
                return(RedirectToAction("Ingresar"));
            }
            PaginasBL paginasBL = new PaginasBL();

            ViewBag.PathNames = paginasBL.getPaginaById(highlight.IdPagina).PathNames;
            ViewBag.ClasesCss = ClasesCss.getLista();
            if (ModelState.IsValid)
            {
                if (paginasBL.updateHighlight(highlight))
                {
                    createResponseMessage(CONSTANTES.SUCCESS, CONSTANTES.SUCCESS_MESSAGE);
                    return(View("Highlight", highlight));
                }
            }
            createResponseMessage(CONSTANTES.ERROR, CONSTANTES.ERROR_MESSAGE);
            return(View("Highlight", highlight));
        }
        public ActionResult Highlight(int id)
        {
            if (!this.currentUser())
            {
                return(RedirectToAction("Ingresar"));
            }

            MenuNavBarSelected(1);

            PaginasBL paginasBL       = new PaginasBL();
            HighLight paginaHighlight = paginasBL.getHighlight(id);

            if (paginaHighlight == null)
            {
                paginaHighlight          = new HighLight();
                paginaHighlight.IdPagina = id;
                paginaHighlight          = paginasBL.addHighlight(paginaHighlight);
            }
            ViewBag.PathNames = paginasBL.getPaginaById(id).PathNames;
            ViewBag.ClasesCss = ClasesCss.getLista();
            return(View(paginaHighlight));
        }
示例#17
0
        /// <summary>
        /// Do File Replace
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOK_Click(object sender, EventArgs e)
        {
            HighLight hl = new HighLight(txtFiles);

            hl.Reset2Default();

            if (txtFiles.Lines.Length == 0)
            {
                txtFiles_DoubleClick(sender, e);
                return;
            }

            if (string.IsNullOrEmpty(cmbPattern.Text))
            {
                MessageBox.Show("Please select a pattern !");
                return;
            }

            ReplaceTemplate pattern = patternLoader[cmbPattern.Text];

            ReplaceFactory.ReplaceFiles(txtFiles.Lines, pattern, hl.Highlight);
        }
示例#18
0
        public bool updateHighlight(HighLight _highlight)
        {
            using (var context = getContext())
            {
                try
                {
                    HighLight highlight = context.HighLight.SingleOrDefault(x => x.IdPagina == _highlight.IdPagina);
                    highlight.Nombre      = _highlight.Nombre;
                    highlight.Descripcion = _highlight.Descripcion;
                    highlight.Resumen     = _highlight.Resumen;
                    highlight.Css         = _highlight.Css;
                    highlight.Image       = _highlight.Image;
                    highlight.Orden       = _highlight.Orden;
                    highlight.Estado      = _highlight.Estado;

                    context.SaveChanges();
                    return(true);
                }
                catch (Exception e) {
                    throw e;
                }
            }
        }
示例#19
0
		public void SetHighLights(HighLight[] hl) {
			highLights.Clear();
			highLights.AddRange(hl);
			Invalidate();
		}
示例#20
0
 public void SetHighLightSimplePasses()
 {
     highlight = new HighLight();
     // Use the Assert class to test conditions
 }
示例#21
0
    // Use this for initialization
    void Start()
    {
        highLightInfo = transform.parent.GetComponent <HighLight>();

        thisSprite = GetComponent <SpriteRenderer>();
    }
示例#22
0
 public void HighLightItem()
 {
     HighLight.Begin();
     HighLight.Completed += HighLight_Completed;
 }
 void Awake()
 {
     instance = this;
 }
示例#24
0
		public void AddHighLight(HighLight hl) {
			highLights.Add(hl);
			Invalidate();
		}
示例#25
0
        internal bool SetColorOnTop(CheckerColor color)
        {
            bool change = false;

            int squareOnTop = Cells[0][1].Square;

            if ((squareOnTop == 1 && color == CheckerColor.White) ||   //black on top
                (squareOnTop != 1 && color == CheckerColor.Black))
            {
                change            = true;
                Config.ColorOnTop = color;

                for (int square1 = 1; square1 <= (NumberSquares / 2); square1++)
                {
                    int square2 = NumberSquares - square1 + 1;

                    Cell      cell1      = Squares[square1];
                    int       number1    = Squares[square1].Square;
                    HighLight highLight1 = Squares[square1].HightLight;
                    CellState state1     = Squares[square1].CellState;

                    Cell      cell2      = Squares[square2];
                    int       number2    = Squares[square2].Square;
                    HighLight highLight2 = Squares[square2].HightLight;
                    CellState state2     = Squares[square2].CellState;

                    Squares[square1].Square     = number2;
                    Squares[square1].HightLight = highLight2;
                    Squares[square1].CellState  = state2;
                    Squares[square1].Refresh();

                    Squares[square2].Square     = number1;
                    Squares[square2].HightLight = highLight1;
                    Squares[square2].CellState  = state1;
                    Squares[square2].Refresh();

                    Squares[square1] = cell2;
                    Squares[square2] = cell1;
                }
                // flip the swoops
                lock (Swoops)
                {
                    List <int> swoopList = new List <int>();
                    foreach (int key in Swoops.Keys)
                    {
                        swoopList.Add(key);
                    }
                    foreach (int key in swoopList)
                    {
                        var swoop = Swoops[key];
                        swoop.From.Row = BoardRowCount - swoop.From.Row - 1;
                        swoop.From.Col = BoardColumnCount - swoop.From.Col - 1;
                        swoop.To.Row   = BoardRowCount - swoop.To.Row - 1;
                        swoop.To.Col   = BoardColumnCount - swoop.To.Col - 1;
                        Swoops[key]    = swoop;
                    }
                }
                IsDirty = true;
                Refresh();
            }

            return(change);
        }
 private void ShowTipMask()
 {
     mHightLight = new HighLight(this)
             .Anchor(FindViewById<Android.Support.V4.Widget.DrawerLayout>(Resource.Id.drawer_layout))
             .AddHighLight(Resource.Id.tab_layout, Resource.Layout.info_up, this);
     //.AddHighLight(Resource.Id.id_btn_amazing, Resource.Layout.info_down, B);
     mHightLight.Show();
 }
示例#27
0
 public void AddHighLight(HighLight hl)
 {
     highLights.Add(hl);
     Invalidate();
 }
 public void GetPos(float p0, float p1, Android.Graphics.RectF p2, HighLight.MarginInfo p3)
 {
     p3.LeftMargin = p2.Right - p2.Width() / 2;
     p3.TopMargin = p2.Bottom;
 }