The event argurments passed when an item event occurs.
Inheritance: System.EventArgs
Exemple #1
0
 private void CertificatesCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
 {
     try {
         OkBTN.Enabled = e.Items.Count == 1;
     } catch (Exception exception) {
         GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
     }
 }
Exemple #2
0
        private void ServersCTRL_ItemsSelected(object sender, ListItemActionEventArgs e) {
            try {
                m_endpoint = null;

                foreach (ConfiguredEndpoint server in e.Items) {
                    m_endpoint = server;
                    break;
                }

                OkBTN.Enabled = m_endpoint != null;
            } catch (Exception exception) {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
Exemple #3
0
        private void HostsCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
        {
            try {
                m_hostname = null;

                foreach (string hostname in e.Items)
                {
                    m_hostname = hostname;
                    break;
                }

                OkBTN.Enabled = !String.IsNullOrEmpty(m_hostname);
            } catch (Exception exception) {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
Exemple #4
0
        private void ServersCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
        {
            try {
                m_server = null;

                foreach (ApplicationDescription server in e.Items)
                {
                    m_server = server;
                    break;
                }

                OkBTN.Enabled = m_server != null;
            } catch (Exception exception) {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
        private void HostsCTRL_ItemsPicked(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_hostname = null;

                foreach (string hostname in e.Items)
                {
                    m_hostname = hostname;
                    break;
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(String.Empty, GuiUtils.CallerName(), exception);
            }
        }
        private void ServersCTRL_ItemsPicked(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_server = null;

                foreach (ApplicationDescription server in e.Items)
                {
                    m_server = server;
                    break;
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(String.Empty, GuiUtils.CallerName(), exception);
            }
        }
Exemple #7
0
        private void ServersCTRL_ItemsPicked(object sender, ListItemActionEventArgs e)
        {
            try {
                m_server = null;

                foreach (ServerOnNetwork server in e.Items)
                {
                    m_server = server;
                    break;
                }

                if (m_server != null)
                {
                    DialogResult = DialogResult.OK;
                }
            } catch (Exception exception) {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
Exemple #8
0
        private void HostsCTRL_ItemsPicked(object sender, ListItemActionEventArgs e)
        {
            try {
                m_hostname = null;

                foreach (string hostname in e.Items)
                {
                    m_hostname = hostname;
                    break;
                }

                if (!String.IsNullOrEmpty(m_hostname))
                {
                    DialogResult = DialogResult.OK;
                }
            } catch (Exception exception) {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
        private void HostsCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_hostname = null;

                foreach (string hostname in e.Items)
                {
                    m_hostname = hostname;
                    break;
                }

                OkBTN.IsEnabled = !String.IsNullOrEmpty(m_hostname);
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(String.Empty, GuiUtils.CallerName(), exception);
            }
        }
Exemple #10
0
        private void ServersCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_endpoint = null;

                foreach (ConfiguredEndpoint server in e.Items)
                {
                    m_endpoint = server;
                    break;
                }

                OkBTN.IsEnabled = m_endpoint != null;
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(String.Empty, GuiUtils.CallerName(), exception);
            }
        }
Exemple #11
0
        private void HostsCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_hostname = null;

                foreach (string hostname in e.Items)
                {
                    m_hostname = hostname;
                    break;
                }

                OkBTN.Enabled = !String.IsNullOrEmpty(m_hostname);
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
Exemple #12
0
        private void NotificationsCTRL_ItemsAdded(object sender, ListItemActionEventArgs e)
        {
            try
            {
                foreach (NotificationMessageListCtrl.ItemData item in e.Items)
                {
                    if (item.NotificationMessage == null || item.Subscription.Session == null)
                    {
                        return;
                    }

                    JsonEncoder encoder = new JsonEncoder(
                        item.Subscription.Session.MessageContext, false);

                    foreach (MonitoredItem monitoredItem in item.Subscription.MonitoredItems)
                    {
                        encoder.WriteNodeId("MonitoredItem", monitoredItem.ResolvedNodeId);
                        item.NotificationMessage.Encode(encoder);

                        var json = encoder.Close();
                        try
                        {
                            m_massTransitPublisher.Publish(json);
                            Utils.Trace(null, "Publishing: " + json);
                        }
                        catch (Exception ex)
                        {
                            Utils.Trace(ex, "Failed to publish message, dropping....");
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Utils.Trace(exception, "Error processing monitored item notification.");
            }
        }
        private void ServersCTRL_ItemsPicked(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_server = null;

                foreach (ServerOnNetwork server in e.Items)
                {
                    m_server = server;
                    break;
                }

                if (m_server != null)
                {
                    DialogResult = DialogResult.OK;
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
        private void ServersCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_endpoint = null;

                foreach (ConfiguredEndpoint server in e.Items)
                {
                    m_endpoint = server;
                    break;
                }

                OkBTN.IsEnabled = m_endpoint != null;
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(String.Empty, GuiUtils.CallerName(), exception);
            }
        }
Exemple #15
0
        private void ContentFilterCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
        {
            try
            {
                if (e.Items.Count > 0)
                {
                    foreach (object item in e.Items)
                    {
                        List<ContentFilterElement> elements = ContentFilterCTRL.GetElements();

                        for (int ii = 0; ii < elements.Count; ii++)
                        {
                            if (Object.ReferenceEquals(elements[ii], item))
                            {
                                FilterOperandsCTRL.Initialize(m_session, elements, ii);
                            }
                        }

                        break;
                    }
                }
                else
                {
                    FilterOperandsCTRL.Initialize(m_session, null, -1);       
                }
            }
            catch (Exception exception)
            {
				GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
Exemple #16
0
        private void HostsCTRL_ItemsPicked(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_hostname = null;

                foreach (string hostname in e.Items)
                {
                    m_hostname = hostname;
                    break;
                }

                if (!String.IsNullOrEmpty(m_hostname))
                {
                    DialogResult = DialogResult.OK;
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
        private void ServersCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_server = null;

                foreach (ServerOnNetwork server in e.Items)
                {
                    m_server = server;
                    break;
                }

                OkBTN.Enabled = m_server != null;
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
        private void HostsCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_hostname = null;

                foreach (string hostname in e.Items)
                {
                    m_hostname = hostname;
                    break;
                }

                OkBTN.IsEnabled = !String.IsNullOrEmpty(m_hostname);
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(String.Empty, GuiUtils.CallerName(), exception);
            }
        }
        private void ServersCTRL_ItemsPicked(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_server = null;

                foreach (ApplicationDescription server in e.Items)
                {
                    m_server = server;
                    break;
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(String.Empty, GuiUtils.CallerName(), exception);
            }
        }
        private void HostsCTRL_ItemsPicked(object sender, ListItemActionEventArgs e)
        {
            try
            {
                m_hostname = null;

                foreach (string hostname in e.Items)
                {
                    m_hostname = hostname;
                    break;
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(String.Empty, GuiUtils.CallerName(), exception);
            }
        }
 private void CertificatesCTRL_ItemsSelected(object sender, ListItemActionEventArgs e)
 {
     try
     {
         OkBTN.Enabled = e.Items.Count == 1;
     }
     catch (Exception exception)
     {
         GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
     }
 }
        private void NotificationsCTRL_ItemsAdded(object sender, ListItemActionEventArgs e)
        {
            try
            {
                foreach (NotificationMessageListCtrl.ItemData item in e.Items)
                {
                    if (item.NotificationMessage == null || item.Subscription.Session == null)
                    {
                        return;
                    }

                    JsonEncoder encoder = new JsonEncoder(
                        item.Subscription.Session.MessageContext, false);

                    foreach (MonitoredItem monitoredItem in item.Subscription.MonitoredItems)
                    {
                        encoder.WriteNodeId("MonitoredItem", monitoredItem.ResolvedNodeId);
                        ((DataChangeNotification)((NotificationData)item.NotificationMessage.NotificationData[0].Body)).MonitoredItems[0].Encode(encoder);

                        string json = encoder.Close();
                        json = json.Replace("\\", "");
                        byte[] bytes = new UTF8Encoding(false).GetBytes(json);

                        foreach (var publisher in m_publishers)
                        {
                            try
                            {
                                publisher.Publish(new ArraySegment<byte>(bytes));
                                Utils.Trace(null, "Publishing: " + json);
                            }
                            catch (Exception ex)
                            {
                                Utils.Trace(ex, "Failed to publish message, dropping....");
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Utils.Trace(exception, "Error processing monitored item notification.");
            }
        }