void btnDelete_Click(object sender, DeleteStringListItemRoutedEventArgs e)
        {
            var itm = sender as QueueListItemControl;

            var e2 = new QueueListItemRoutedEventArgs(RemovedItemEvent);

            e2.Item = _items[(int)e.Id];

            RemoveListItem(itm, e.Id);

            RaiseEvent(e2);
        }
Esempio n. 2
0
        private void AddItem_Click(object sender, RoutedEventArgs e)
        {
            var e2 = new QueueListItemRoutedEventArgs(AddItemEvent);

            RaiseEvent(e2);

            if (e2.Handled)
            {
                e2.Items.ForEach(AddListItem);

                var e3 = new QueueListItemRoutedEventArgs(AddedItemEvent);
                e3.Items = e2.Items;
                RaiseEvent(e3);
            }
        }
 private void queue_RemovedItem(object sender, QueueListItemRoutedEventArgs e)
 {
     UpdateQueueuInfo();
 }
        private void Queue_AddItem_1(object sender, QueueListItemRoutedEventArgs e)
        {
            QueueListControl s = sender as QueueListControl;

              SelectQueueDialog dlg = new SelectQueueDialog(GetDiscoveryService(), cbServers.SelectedValue as string, GetAllQueueNames().Except(s.GetItems().Select(i => i.Name).ToList()).OrderBy( name => name ).ToArray());
              dlg.Title = "Select " + s.Title.Remove(s.Title.Length - 1);
              dlg.Owner = this;

              if( dlg.ShowDialog() == true ) {
            e.Handled = true;

            var color = !s.Name.EndsWith("Errors") ? QueueColorManager.GetRandomAvailableColor() : System.Drawing.Color.FromArgb(QueueColorManager.RED);
            e.Item = new QueueListControl.QueueListItem(dlg.SelectedQueueName, color);
              }
        }
    private void AddItem_Click(object sender, RoutedEventArgs e) {

      var e2 = new QueueListItemRoutedEventArgs(AddItemEvent);

      RaiseEvent(e2);

      if( e2.Handled ) {
        e2.Items.ForEach(AddListItem);

        var e3 = new QueueListItemRoutedEventArgs(AddedItemEvent);
        e3.Items = e2.Items;
        RaiseEvent(e3);

      }

    }
    void btnDelete_Click(object sender, DeleteStringListItemRoutedEventArgs e) {
      var itm = sender as QueueListItemControl;

      var e2 = new QueueListItemRoutedEventArgs(RemovedItemEvent);

      e2.Items = new List<QueueListItem> {_items[e.Id]};

      RemoveListItem(itm, e.Id);

      RaiseEvent(e2);
    }
    private void Queue_AddItem(object sender, QueueListItemRoutedEventArgs e) {
      QueueListControl s = sender as QueueListControl;
      var srv = CurrentServer;

      SelectQueueDialog dlg = new SelectQueueDialog(GetDiscoveryService(srv), srv, GetAllQueueNames().Except(s.GetItems().Select(i => i.Name).ToList()).OrderBy(name => name).ToArray());
      dlg.Title = "Select " + s.Title.Remove(s.Title.Length - 1);
      dlg.Owner = this;

      if( dlg.ShowDialog() == true ) {
        e.Handled = true;

        dlg.SelectedQueueNames.ForEach(queueName => {
          var color = !s.Name.EndsWith("Errors") ? QueueColorManager.GetRandomAvailableColor() : Color.FromArgb(QueueColorManager.RED);
          e.Items.Add(new QueueListControl.QueueListItem(queueName, color));
        });
      }
    }