Beispiel #1
0
        public void Method2()
        {
            int a = 1;
            int b = 2;

            AddEvent?.Invoke(a, b);
        }
Beispiel #2
0
        public void AddNewTask(object sender, RoutedEventArgs e)
        {
            MyFrame.BackStack.Clear();
            MyFrame.Navigate(typeof(CreateOrModifyTaskPage), this, new SuppressNavigationTransitionInfo());
            ShowSlideInPane();
            AddEvent?.Invoke();

            //CollapseSlideInPane();
        }
Beispiel #3
0
        private void FixButton_Click(object sender, RoutedEventArgs e)
        {
            image.Source = videoPlayer.MakeScreenShot();
            AddEvent.Invoke(image.Source);

            int n = Convert.ToInt32(TextBox1.Text);

            n++;
            TextBox1.Text = n.ToString();
        }
Beispiel #4
0
        public static async Task <bool> Add(IHubUserModel user)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            var addNewUser = false;

            while (_lock)
            {
                Thread.Sleep(100);
            }

            _lock = true;

            try
            {
                var connectedId = user.ConnectionId.First();

                var findUser = _store.FirstOrDefault(i => i.Id == user.Id);
                if (findUser != null)
                {
                    findUser.ConnectionId.Add(connectedId);
                }
                else
                {
                    addNewUser = true;
                    _store.Add(user);
                }

                var findId = _store_connectedIds.FirstOrDefault(i => i.ConnectionId == connectedId);
                if (findId == null)
                {
                    _store_connectedIds.Add(new HubConnectedIdModel
                    {
                        UserId       = user.Id,
                        ConnectionId = connectedId
                    });
                }

                AddEvent?.Invoke(user);
                _lock = false;
            }
            catch (Exception)
            {
                Thread.Sleep(100);
                return(await Add(user).ConfigureAwait(false));
            }

            return(addNewUser);
        }
Beispiel #5
0
 private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     if (AddEvent != null)
     {
         bool?result = AddEvent.Invoke();
         if (result != null && result.Value)
         {
             if (RefreshEvent != null)
             {
                 RefreshEvent.Invoke();
             }
         }
     }
 }
Beispiel #6
0
        private void Insert(Node <T> node)
        {
            if (node is null)
            {
                throw new TreeException("Node can't be null", new ArgumentNullException());
            }
            Count++;
            AddEvent?.Invoke(node.Value);
            var currentNode = Root;

            while (!currentNode.AddChild(node))
            {
                currentNode = currentNode > node ? currentNode.Left : currentNode.Right;
            }
        }
Beispiel #7
0
        public void Add(long position, byte[] bytes)
        {
            if (bytes == null)
            {
                throw new ArgumentNullException(nameof(bytes));
            }
            if (position < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(position));
            }

            lock (_parts)
            {
                _parts.Add(position, bytes);
                AddEvent?.Invoke(this, EventArgs.Empty);
            }
        }
Beispiel #8
0
 private void Add_Click(object sender, EventArgs e)
 {
     try
     {
         price  = double.Parse(richTextBox3.Text);
         info   = richTextBox2.Text;
         chance = double.Parse(richTextBox1.Text);
         AddEvent?.Invoke(this, null);
         ChangeEvent?.Invoke(this, null);
         AddSquare?.Invoke(this, null);
         AddTriangle?.Invoke(this, null);
         Close();
     }
     catch
     {
         MessageBox.Show("Введите корректные данные");
     }
 }
Beispiel #9
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            try
            {
                _path = personName.Text + personSurname.Text + personPatronymic.Text + ".jpeg";

                if (personPhoto.Image != null)
                {
                    personPhoto.Image.Save(_path, System.Drawing.Imaging.ImageFormat.Jpeg);
                }

                AddEvent?.Invoke();

                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.Close();
            }
        }
        public void AddFirst(T data)
        {
            if (data == null)
            {
                throw new ArgumentNullException();
            }
            Node <T> node = new Node <T>(data);

            if (head == null)
            {
                head      = node;
                tail      = node;
                tail.Next = head;
            }
            else
            {
                node.Next = head;
                tail.Next = node;
                head      = node;
            }
            AddEvent?.Invoke(this, node.Data);
            count++;
        }
Beispiel #11
0
 private void addButton_Click(object sender, EventArgs e)
 {
     AddEvent?.Invoke();
     this.Close();
 }
Beispiel #12
0
 private void AddButton_OnClick(object sender, RoutedEventArgs e)
 {
     AddEvent?.Invoke(sender, e);
 }
Beispiel #13
0
        /// <summary>
        /// Adds an item to the end of the ObservableList.
        /// </summary>
        /// <param name="item">The item to be added to the end of the ObservableList.</param>
        /// <returns>void</returns>
        public void Add(T item)
        {
            _items.Add(item);

            AddEvent?.Invoke(item);
        }
    //----------------------------------
    //  id管理(dlib)
    //----------------------------------
    #region id管理
    private void AddId()
    {
        //print("a: " + blobPosList.Count + " " + userNumPre);

        if (blobPosList.Count <= blobNumPre)
        {
            return;
        }

        int addIdNum = blobPosList.Count - blobNumPre;

        for (int k = 0; k < addIdNum; k++)
        {
            // id, x, y追加
            List <float> thisIdList = new List <float>();
            thisIdList.Add(idCounter);  // ID
            string debugStr = "Add Id: " + idCounter;
            bool   added    = false;

            for (int i = 0; i < blobPosList.Count; i++)
            {
                bool exist = false;
                for (int j = 0; j < idList.Count; j++)
                {
                    if (idList[j].Count > 1)
                    {
                        float distance = Vector2.Distance(new Vector2(blobPosList[i].x, blobPosList[i].y), new Vector2(idList[j][1], idList[j][2]));
                        if (distance < sameLimitDistance)
                        {
                            exist = true;
                            break;
                        }
                    }
                }

                if (!exist)
                {
                    thisIdList.Add(blobPosList[i].x);         // X
                    thisIdList.Add(blobPosList[i].y);         // Y
                    thisIdList.Add(blobPosList[i].width);     // width
                    thisIdList.Add(blobPosList[i].height);    // height

                    List <Rect> smooth = new List <Rect>();
                    smooth.Add(new Rect(blobPosList[i].x, blobPosList[i].y, blobPosList[i].width, blobPosList[i].height));
                    blobSmoothList.Add(smooth);

                    debugStr += "  (" + blobPosList[i].x + ", " + blobPosList[i].y + ")";
                    added     = true;
                    break;
                }
            }

            if (added)
            {
                idList.Add(thisIdList);
                print(debugStr);
                addEvent.Invoke(idCounter);
                idCounter++;
            }
        }
    }
Beispiel #15
0
 public void Method1(int a, int b)
 {
     AddEvent?.Invoke(a, b);
 }
Beispiel #16
0
 private void AddButton_OnClick(object Sender, RoutedEventArgs E)
 {
     AddEvent?.Invoke(Sender, E);
 }
Beispiel #17
0
 //Method gebruikt om een portefeuille toe te voegen en de textbox leeg te maken
 private void AddPortefeuille()
 {
     repo.AddPortefeuille(idGebruiker, NaamPortfeuille);
     NaamPortfeuille = "";
     AddEvent?.Invoke();
 }
Beispiel #18
0
 public void Add(ITransaction transaction)
 {
     transactions.Add(transaction);
     AddEvent?.Invoke(this, new TransactionEventArgs(transaction));
 }
Beispiel #19
0
 private void AddElementButton_Click(object sender, EventArgs e)
 {
     AddEvent?.Invoke(true);
 }
 public void AddNotification(object o, EventArgs args)
 {
     Console.WriteLine("Add event");
     AddEvent?.Invoke(o, args);
 }
Beispiel #21
0
 private void AddAssetButton_Click(object sender, RoutedEventArgs e)
 {
     AddEvent?.Invoke(this, new EventArgs());
 }
Beispiel #22
0
 private void OnAddEvent(EventArgs e)
 {
     AddEvent?.Invoke(this, e);
 }
Beispiel #23
0
 public void CargarFigura(UMLGraph.Grupos.Grupo3.Figuras.Figura tmp)
 {
     ControlCanvas.Figuras.Figuras.Add(tmp);
     AddEvent?.Invoke();
 }
 public void Invoke() => OnEvent?.Invoke();
Beispiel #25
0
 public void RaiseAddEvent(AddEventArgs e)
 => AddEvent?.Invoke(this, e);
Beispiel #26
0
 protected void OnAddEvent(WindowInfoWithHandle windowInfo)
 {
     AddEvent?.Invoke(this, new OriginalWinEventArg(windowInfo));
 }
Beispiel #27
0
 public void Load()
 {
     AddEvent?.Invoke(fridgeComboBox, buyerComboBox, sellerComboBox);
 }
Beispiel #28
0
        /// <summary>
        /// Inserts an item into the ObservableList at the specified index.
        /// </summary>
        /// <param name="index">The zero-based index at which item should be inserted.</param>
        /// <param name="item">The item to insert.</param>
        /// <returns>void</returns>
        public void Insert(int index, T item)
        {
            _items.Insert(index, item);

            AddEvent?.Invoke(item);
        }