コード例 #1
0
        public void Method2()
        {
            int a = 1;
            int b = 2;

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

            //CollapseSlideInPane();
        }
コード例 #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();
        }
コード例 #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);
        }
コード例 #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();
             }
         }
     }
 }
コード例 #6
0
ファイル: BinaryTree.cs プロジェクト: denied5/EpamLab2
        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;
            }
        }
コード例 #7
0
ファイル: Queue.cs プロジェクト: Nemo-Illusionist/GZipTest
        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);
            }
        }
コード例 #8
0
ファイル: AddNewCircle.cs プロジェクト: EAVologzhanin/TreeApp
 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("Введите корректные данные");
     }
 }
コード例 #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();
            }
        }
コード例 #10
0
        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++;
        }
コード例 #11
0
ファイル: AddForm.cs プロジェクト: IskraKate/.net-db
 private void addButton_Click(object sender, EventArgs e)
 {
     AddEvent?.Invoke();
     this.Close();
 }
コード例 #12
0
ファイル: MainWindow.xaml.cs プロジェクト: BaredJJ/UseEntity
 private void AddButton_OnClick(object sender, RoutedEventArgs e)
 {
     AddEvent?.Invoke(sender, e);
 }
コード例 #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);
        }
コード例 #14
0
    //----------------------------------
    //  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++;
            }
        }
    }
コード例 #15
0
 public void Method1(int a, int b)
 {
     AddEvent?.Invoke(a, b);
 }
コード例 #16
0
 private void AddButton_OnClick(object Sender, RoutedEventArgs E)
 {
     AddEvent?.Invoke(Sender, E);
 }
コード例 #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();
 }
コード例 #18
0
 public void Add(ITransaction transaction)
 {
     transactions.Add(transaction);
     AddEvent?.Invoke(this, new TransactionEventArgs(transaction));
 }
コード例 #19
0
 private void AddElementButton_Click(object sender, EventArgs e)
 {
     AddEvent?.Invoke(true);
 }
コード例 #20
0
 public void AddNotification(object o, EventArgs args)
 {
     Console.WriteLine("Add event");
     AddEvent?.Invoke(o, args);
 }
コード例 #21
0
 private void AddAssetButton_Click(object sender, RoutedEventArgs e)
 {
     AddEvent?.Invoke(this, new EventArgs());
 }
コード例 #22
0
 private void OnAddEvent(EventArgs e)
 {
     AddEvent?.Invoke(this, e);
 }
コード例 #23
0
ファイル: CanvasGR3.cs プロジェクト: PaulLora/UMLGraph
 public void CargarFigura(UMLGraph.Grupos.Grupo3.Figuras.Figura tmp)
 {
     ControlCanvas.Figuras.Figuras.Add(tmp);
     AddEvent?.Invoke();
 }
コード例 #24
0
 public void Invoke() => OnEvent?.Invoke();
コード例 #25
0
 public void RaiseAddEvent(AddEventArgs e)
 => AddEvent?.Invoke(this, e);
コード例 #26
0
 protected void OnAddEvent(WindowInfoWithHandle windowInfo)
 {
     AddEvent?.Invoke(this, new OriginalWinEventArg(windowInfo));
 }
コード例 #27
0
 public void Load()
 {
     AddEvent?.Invoke(fridgeComboBox, buyerComboBox, sellerComboBox);
 }
コード例 #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);
        }