コード例 #1
0
 public void OnTFButtonClick(object sender, RoutedEventArgs e)
 {
     try
     {
         string     isin = "", tf = "", dt = "";
         DataButton dbut = (DataButton)sender;
         dbut.IsEnabled = false;
         m_mainWindow.DummyButton.Focus();
         if (RetrieveInstTF(dbut.ID, ref isin, ref tf, ref dt))
         {
             Thread thread = new Thread(() =>
             {
                 WindowCandleChart wcch = new WindowCandleChart(isin + " " + tf);
                 wcch.CandleChartFrame.Bind(Plaza2Connector, isin, tf, dt, dbut, _dispatcher);
                 wcch.Show();
                 wcch.Closed += new EventHandler(wcch.CandleChartFrame.OnClosed);
                 wcch.CandleChartFrame.IsDispatcherRun = true;
                 System.Windows.Threading.Dispatcher.Run();
             }
                                        );
             thread.SetApartmentState(ApartmentState.STA);
             thread.Start();
         }
         else
         {
             MessageBox.Show("Unable to get TF data");
         }
     }
     catch (Exception exc)
     {
         Plaza2Connector.Alarmer.Error("OnTFButtonClick", exc);
     }
 }
コード例 #2
0
ファイル: GamePlay.cs プロジェクト: FAngelo94/redBitBlocks
    /// <summary>
    /// Function called when user click on a button
    /// </summary>
    public void ClickButton()
    {
        if (!GM.InGame || isBlocksDestroyed)
        {
            return;
        }
        int        blocks       = 0;
        DataButton dataButton   = EventSystem.current.currentSelectedGameObject.GetComponent <DataButton>();
        int        r            = dataButton.R;
        int        c            = dataButton.C;
        int        currentValue = buttonsValue[r, c];

        blocks = CountBlocks(r, c, buttonsValue[r, c]);

        if (blocks > 1)
        {
            isBlocksDestroyed = true;
            pointsManager.UpdatePoints(blocks);
            timeManager.UpdateTimer(blocks);
            StartCoroutine(UpdateBlocksDelay());
        }
        else
        {
            buttonsValue[r, c] = currentValue;
        }
    }
コード例 #3
0
 public void Finnish()
 {
     LanguageScript.Lang = 1;
     LanguageGameobject.GetComponent <LanguageScript>().SetLanguage();
     DataButton.SetActive(true);
     LanguageScreen.SetActive(false);
     EasyConnectPanel.SetActive(true);
 }
コード例 #4
0
        public void onClickANote(object sender, EventArgs e)
        {
            DataButton b   = (DataButton)sender;
            string     sql = "UPDATE punchclock SET AdminNote='" + AdminNote.Text + "' WHERE IDKey='" + b.GetInt() + "'";

            DatabaseFunctions.SendToPhp(sql);
            b.BackgroundColor = Color.FromRgb(213, 213, 213);
        }
コード例 #5
0
        public void onClickOverrideTime(object sender, RoutedEventArgs e)
        {
            DataButton b   = (DataButton)sender;
            string     sql = "UPDATE punchclock SET TimeStamp='" + FormatFunctions.CleanDateNew(Timepick.Text) + "' WHERE IDKey='" + b.GetInt() + "'";

            DatabaseFunctions.SendToPhp(sql);
            b.Background = new SolidColorBrush(Color.FromRgb(213, 213, 213));
        }
コード例 #6
0
        public void populatePend(string result)
        {
            GridFiller.PurgeHeader(DetailBody);
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    DataButton b = new DataButton();
                    b.Content  = "Approve";
                    b.Integer  = int.Parse(dictionary["IDKey"][i]);
                    b.Integer2 = int.Parse(dictionary["Approved"][i]);
                    if (dictionary["Approved"][i] == "1")
                    {
                        b.Background = new SolidColorBrush(ClientData.rotatingConfirmationColors[0]);
                        b.Content    = "Disapprove";
                    }
                    else
                    {
                        b.Background = new SolidColorBrush(ClientData.rotatingNegativeColors[0]);
                    }
                    b.Click += onClickApprove;
                    DataButton b2 = new DataButton();
                    b2.Content = "Add Note";
                    b2.Integer = int.Parse(dictionary["IDKey"][i]);
                    b2.Click  += onClickANote;
                    DataButton b3 = new DataButton();
                    b3.Content = "Alter";
                    b3.Integer = int.Parse(dictionary["IDKey"][i]);
                    b3.Click  += onClickOverrideTime;
                    Label T = new Label();
                    T.Content = FormatFunctions.PrettyDate(dictionary["TimeStamp"][i]);
                    Label L = new Label();
                    L.Content = FormatFunctions.PrettyDate(dictionary["Coordinates"][i]);
                    Label I = new Label();
                    I.Content = convertState(dictionary["State"][i]);
                    Label N = new Label();
                    N.Content = FormatFunctions.PrettyDate(dictionary["Note"][i]);
                    List <UIElement> list = new List <UIElement>()
                    {
                        b, b2, b3, T, L, I, N
                    };
                    GridFiller.rapidFillPremadeObjects(list, DetailBody, new bool[] { false, false, false, true, true, true, true });
                }
            }
        }
コード例 #7
0
        private void ReflectToObject(object sender, String text)
        {
            Control ctl = sender as Control;

            if (ctl.InvokeRequired)
            {
                object[] ob = new object[2] {
                    sender, text
                };
                ctl.Invoke(new ReflectToObjectDelegate(ReflectToObject), ob);
                return;
            }
            if (sender is DataButton)
            {
                DataButton dataButton = sender as DataButton;
                dataButton.Text = text;
            }
        }
コード例 #8
0
        private void DataButton_Click(object sender, EventArgs e)
        {
            DataButton dataButton = sender as DataButton;
            DataInfo   dataInfo   = dataButton.ButtonDataInfo;
            Calculator calculator = new Calculator();

            calculator.InitStrNum        = dataButton.Text;
            calculator.PointButtonEnable = dataInfo.PointEnable;
            calculator.MinusButtonEnable = dataInfo.MinusEnable;
            calculator.MaxValue          = dataInfo.MaxValue;
            calculator.MinValue          = dataInfo.MinValue;
            calculator.ShowDialog();
            dataButton.HasClick = true;
            if (calculator.LastNumber.ToString() != dataButton.Text)
            {
                dataButton.Text = calculator.LastNumber.ToString();
            }
            calculator.Dispose();
        }
コード例 #9
0
        public void populatePend(string result)
        {
            GridFiller.PurgeHeader(ApproveBody);
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    DataButton b = new DataButton();
                    b.Text     = "Approve";
                    b.Integer  = int.Parse(dictionary["IDKey"][i]);
                    b.Integer2 = int.Parse(dictionary["Approved"][i]);
                    if (dictionary["Approved"][i] == "1")
                    {
                        b.BackgroundColor = ClientData.rotatingConfirmationColors[0];
                        b.Text            = "Disapprove";
                    }
                    else
                    {
                        b.BackgroundColor = ClientData.rotatingNegativeColors[0];
                    }
                    b.Clicked += onClickApprove;
                    DataButton b2 = new DataButton();
                    b2.Text     = "Add Note";
                    b2.Integer  = int.Parse(dictionary["IDKey"][i]);
                    b2.Clicked += onClickANote;
                    Label T = new Label();
                    T.Text = FormatFunctions.PrettyDate(dictionary["TimeStamp"][i]);
                    Label L = new Label();
                    L.Text = FormatFunctions.PrettyDate(dictionary["Coordinates"][i]);
                    Label I = new Label();
                    I.Text = convertState(dictionary["State"][i]);
                    Label N = new Label();
                    N.Text = FormatFunctions.PrettyDate(dictionary["Note"][i]);
                    List <View> list = new List <View>()
                    {
                        b, b2, T, L, I, N
                    };
                    GridFiller.rapidFillPremadeObjectsStandardHeight(list, ApproveBody, new bool[] { false, false, true, true, true, true }, 50);
                }
            }
        }
コード例 #10
0
        public static void CreateButtonNoClickEvent(string text = "")
        {
            var button = new DataButton()
            {
                Name     = $"{BaseName}{Index}",
                Text     = text,
                Width    = Width,
                Location = new Point(Left, Top),
                Parent   = ParentControl,
                Visible  = true
            };

            button.Click += EventHandler;
            ButtonsList.Add(button);

            ParentControl.Controls.Add(button);
            Top   += HeightPadding;
            Index += 1;
        }
コード例 #11
0
ファイル: GameManager.cs プロジェクト: FAngelo94/redBitBlocks
    // Start is called before the first frame update
    void Start()
    {
        int index = 0;

        buttons      = new GameObject[4, 4];
        buttonsValue = new int[4, 4];
        for (int r = 0; r < 4; r++)
        {
            for (int c = 0; c < 4; c++)
            {
                buttons[r, c] = buttonsContainer.transform.GetChild(index).gameObject;
                DataButton dataButton = buttons[r, c].GetComponent <DataButton>();
                dataButton.R = r;
                dataButton.C = c;
                index++;
            }
        }
        gamePlay      = gameObject.AddComponent(typeof(GamePlay)) as GamePlay;
        timeManager   = gameObject.AddComponent(typeof(TimeManager)) as TimeManager;
        pointsManager = gameObject.AddComponent(typeof(PointsManager)) as PointsManager;
        SetVariables();
    }
コード例 #12
0
        public static void CreateCategoryButton(string text, int categoryIdentifier)
        {
            var button = new DataButton()
            {
                Name       = $"{BaseName}{Index}",
                Text       = text,
                Width      = Width,
                Location   = new Point(Left, Top),
                Parent     = ParentControl,
                Identifier = categoryIdentifier,
                Visible    = true,
                ImageAlign = ContentAlignment.MiddleLeft,
                TextAlign  = ContentAlignment.MiddleRight
            };

            button.Click += EventHandler;
            ButtonsList.Add(button);

            ParentControl.Controls.Add(button);
            Top   += HeightPadding;
            Index += 1;
        }
コード例 #13
0
        public void onClickApprove(object sender, EventArgs e)
        {
            DataButton b = (DataButton)sender;

            b.BackgroundColor = ClientData.getGridColorCC(true);
            string sql;

            if (b.GetInt2() == 1)
            {
                b.BackgroundColor = ClientData.rotatingConfirmationColors[0];
                b.Text            = "Approve";
                b.Integer2        = 0;
                sql = "UPDATE punchclock SET Approved='0' WHERE IDKey='" + b.GetInt() + "'";
            }
            else
            {
                b.Text            = "Disapprove";
                b.BackgroundColor = ClientData.rotatingNegativeColors[0];
                b.Integer2        = 1;
                sql = "UPDATE punchclock SET Approved='1' WHERE IDKey='" + b.GetInt() + "'";
            }
            DatabaseFunctions.SendToPhp(sql);
        }
コード例 #14
0
 public void English()
 {
     DataButton.SetActive(true);
     LanguageScreen.SetActive(false);
     EasyConnectPanel.SetActive(true);
 }