Пример #1
0
        public Form1()
        {
            InitializeComponent();
            DoubleBuffered = true;
            currentShape   = eLineType.None;
            radius         = 10;
            myColorLine    = Color.Bisque;
            myPen          = new Pen(myColorLine);

            myBrush       = Brushes.Red;
            bDragFlag     = false;
            formWidth     = this.Width;
            formHeight    = this.Height;
            arPoints      = new List <Point>();
            deltaMovement = new List <myPointDelta>();
            Paint        += new PaintEventHandler(Form1_Paint);
            MouseDown    += button1_MouseDown;


            moveTimer          = new System.Windows.Forms.Timer();
            moveTimer.Interval = 30;
            moveTimer.Tick    += new EventHandler(TimerTickHandler);
            move           = 1;
            deltaMovementX = deltaMovementY = move;

            KeyPreview = true;
            KeyDown   += new KeyEventHandler(Form1_KeyDown);
            MouseUp   += MouseUpper;

            MouseMove += new MouseEventHandler(MouseMoving);
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            AllFalse();
            this.movementButton.Text = "Start movement";

            currentShape = eLineType.None;
        }
Пример #3
0
 public BoardLineState(eLineType i_LineType, uint i_AmountOfPlayers, uint i_TotalLineLength)
 {
     r_LineType = i_LineType;
     r_AmountOfCellsByPlayer  = new uint[i_AmountOfPlayers];
     m_TotalAmountOfCellsUsed = 0;
     r_TotalNumberOfCells     = i_TotalLineLength;
 }
Пример #4
0
 private void button5_Click(object sender, EventArgs e) //Безье
 {
     if (listPoints.Count == 4)                         //рисуем безье если есть 4 точки
     {
         LineType = eLineType.Beizers;
         Refresh();
     }
     else
     {
         bButtonOn = false; //отключаем точки
     }
 }
Пример #5
0
        public void Stop(eLineType elt)
        {
            if (((int)elt & (int)eLineType.PreMatches) > 0)
            {
                PreMatchClient.Stop();
            }

            if (((int)elt & (int)eLineType.LiveMatches) > 0)
            {
                LiveBetClient.Stop();
                VirtualLiveBetClient.Stop();
            }
        }
Пример #6
0
        public void Run(eLineType elt)
        {
            Log.Debug("run line clients");

            if (((int)elt & (int)eLineType.PreMatches) > 0)
            {
                PreMatchClient.Run();
                StatisticsClient.Run();
                MetainfoClient.Run();
                //TournamentFlagsClient.Run();
            }

            if (((int)elt & (int)eLineType.LiveMatches) > 0)
            {
                LiveBetClient.Run();
                VirtualLiveBetClient.Run();
            }

            LineCleaner.Run();
        }
Пример #7
0
        private void BesierButton_Click_1(object sender, EventArgs e)
        {
            if ((arPoints.Count - 1) % 3 == 0 && arPoints.Count > 2)
            {
                currentShape = eLineType.Beiser;
                Refresh();
            }
            else
            {
                int temp = 0;
                while ((arPoints.Count - 1 + temp) % 3 != 0 || (arPoints.Count - 1 + temp) < 3)
                {
                    temp++;
                }
                string            message = $"Add {temp} more points";
                string            caption = "Action can not be done";
                MessageBoxButtons buttons = MessageBoxButtons.OK;
                DialogResult      result;

                // Displays the MessageBox.
                result = MessageBox.Show(message, caption, buttons);
            }
        }
Пример #8
0
        public Form1()
        {
            InitializeComponent();
            this.DoubleBuffered = true;

            arPoints  = new List <Point>();
            speedList = new List <Point>();

            this.buttonDots.Click     += (sender, e) => bAddPoints = !bAddPoints;
            this.buttonParams.Click   += (sender, e) => formParams.ShowDialog(this);
            this.buttonClear.Click    += ClearDots;
            this.buttonCurved.Click   += (sender, e) => { lineType = eLineType.Curved; Refresh(); };
            this.buttonPolygone.Click += (sender, e) => { lineType = eLineType.Polygone; Refresh(); };
            this.buttonFilled.Click   += (sender, e) => { lineType = eLineType.Filled; Refresh(); };
            this.buttonBezier.Click   += (sender, e) => { lineType = eLineType.Bezier; Refresh(); };
            this.buttonMove.Click     += buttonMove_Click;
            Paint             += Form1_Paint;
            MouseClick        += Form1_MouseClick;
            MouseDown         += Form1_MouseDown;
            MouseMove         += Form1_MouseMove;
            MouseUp           += Form1_MouseUp;
            moveTimer.Interval = 30;
            moveTimer.Tick    += TimerTickHandler;
        }
Пример #9
0
 private void button6_Click(object sender, EventArgs e)
 {
     currentShape = eLineType.Broken;
     Refresh();
 }
Пример #10
0
        public seriesData createSeries(string seriesLabel, Primitive data, string colour, eLineType type)
        {
            Type PrimitiveType = typeof(Primitive);
            Dictionary<Primitive, Primitive> _arrayMap;
            seriesData _series = new seriesData();
            double x, y;

            try
            {
                data = Utilities.CreateArrayMap(data);
                _arrayMap = (Dictionary<Primitive, Primitive>)PrimitiveType.GetField("_arrayMap", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreCase | BindingFlags.Instance).GetValue(data);

                foreach (KeyValuePair<Primitive, Primitive> kvp in _arrayMap)
                {
                    x = (double)kvp.Key;
                    y = (double)kvp.Value;
                    _series.dataX.Add(x);
                    _series.dataY.Add(y);
                    _series.minX = System.Math.Min(_series.minX, x);
                    _series.minY = System.Math.Min(_series.minY, y);
                    _series.maxX = System.Math.Max(_series.maxX, x);
                    _series.maxY = System.Math.Max(_series.maxY, y);
                    _series.type = type;
                }
            }
            catch (Exception ex)
            {
                Utilities.OnError(Utilities.GetCurrentMethod(), ex);
            }

            _series.colour = colour;
            _series.name = seriesLabel;

            return _series;
        }
Пример #11
0
        public void addSeries(string graphName, string seriesLabel, Primitive data, string colour, eLineType type)
        {
            Type GraphicsWindowType = typeof(GraphicsWindow);
            Dictionary<string, UIElement> _objectsMap;
            UIElement obj;

            try
            {
                _objectsMap = (Dictionary<string, UIElement>)GraphicsWindowType.GetField("_objectsMap", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreCase).GetValue(null);
                if (!_objectsMap.TryGetValue(graphName, out obj))
                {
                    Utilities.OnShapeError(Utilities.GetCurrentMethod(), graphName);
                    return;
                }

                try
                {
                    Canvas _graph = (Canvas)obj;

                    plotData _plotData = getPlotData(graphName);
                    // Create new series if needed (otherwise its just the graph background)
                    if (null != data)
                    {
                        bool bFound = false;
                        seriesData newSeries = createSeries(seriesLabel, data, colour, type);
                        foreach (seriesData series in _plotData.series)
                        {
                            if (series.name == seriesLabel)
                            {
                                series.CopyFrom(newSeries);
                                bFound = true;
                                break;
                            }
                        }
                        if (!bFound) _plotData.series.Add(newSeries);
                    }
                    delegate_Data = new object[] { _graph, _plotData, eZoom.FALSE, eRescale.TRUE };
                    FastThread.Invoke(plotSeries_Delegate);
                }
                catch (Exception ex)
                {
                    Utilities.OnError(Utilities.GetCurrentMethod(), ex);
                }
            }
            catch (Exception ex)
            {
                Utilities.OnError(Utilities.GetCurrentMethod(), ex);
            }
        }
Пример #12
0
 public seriesData()
 {
     name = "";
     minX = 1.0e20;
     maxX = -1.0e20;
     minY = 1.0e20;
     maxY = -1.0e20;
     dataX.Clear();
     dataY.Clear();
     colour = "";
     type = eLineType.LINE;
 }
Пример #13
0
 public void CopyFrom(seriesData from)
 {
     name = from.name;
     minX = from.minX;
     maxX = from.maxX;
     minY = from.minY;
     maxY = from.maxY;
     dataX.Clear();
     dataY.Clear();
     foreach (double value in from.dataX) dataX.Add(value);
     foreach (double value in from.dataY) dataY.Add(value);
     //dataX = from.dataX;
     //dataY = from.dataY;
     colour = from.colour;
     type = from.type;
 }
Пример #14
0
 private void PaintedButton_Click_1(object sender, EventArgs e)
 {
     currentShape = eLineType.Painted;
     Refresh();
 }
Пример #15
0
 private void button6_Click(object sender, EventArgs e)//заполненная
 {
     LineType = eLineType.Filled;
     Refresh();
 }
Пример #16
0
 private void button4_Click(object sender, EventArgs e)//ломаная
 {
     LineType = eLineType.Polygone;
     Refresh();
 }
Пример #17
0
 private void button3_Click(object sender, EventArgs e) //кривая
 {
     LineType = eLineType.Curved;
     Refresh();
 }
Пример #18
0
 private void button5_Click(object sender, EventArgs e)
 {
     currentShape = eLineType.Curved;
     Refresh();
 }
Пример #19
0
        public static SportRadarId Create(eVersionedObjectType vot, long lObjectId, UInt16 uiExtendedId, eLineType lt, UInt16 uiClientId)
        {
            try
            {
                ExcpHelper.ThrowIf <ArgumentException>(Math.Abs(lObjectId) > MAX_OBJECT_ID, "SportRadarId.Create(ObjectType={0}, ObjectId={1}, ExtendedId={2}, LineType={3}, Client={4}, ) ERROR. ObjectId is too big. MaxValue={5}",
                                                       vot, lObjectId, uiExtendedId, lt, uiClientId, MAX_OBJECT_ID);
                ExcpHelper.ThrowIf <ArgumentException>(uiExtendedId > MAX_EXTENDED_ID, "SportRadarId.Create(ObjectType={0}, ObjectId={1}, ExtendedId={2}, LineType={3}, Client={4}, ) ERROR. ExtendedId is too big. MaxValue={5}",
                                                       vot, lObjectId, uiExtendedId, lt, uiClientId, MAX_EXTENDED_ID);
                ExcpHelper.ThrowIf <ArgumentException>(uiClientId > MAX_CLIENT_ID, "SportRadarId.Create(ObjectType={0}, ObjectId={1}, ExtendedId={2}, LineType={3}, Client={4}, ) ERROR. ClientId is too big. MaxValue={5}",
                                                       vot, lObjectId, uiExtendedId, lt, uiClientId, MAX_CLIENT_ID);

                SportRadarId srid = new SportRadarId();

                srid.ObjectId   = lObjectId;
                srid.ExtendedId = uiExtendedId;
                srid.LineType   = lt;
                srid.ClientId   = uiClientId;
                srid.ObjectType = vot;

                return(srid);
            }
            catch (Exception excp)
            {
                throw;
            }

            return(null);
        }
Пример #20
0
 public void Clear(eLineType elt)
 {
     throw new NotImplementedException();
 }