Exemple #1
0
        private void SubscriptionIndicationReceived(IndicationEventArgs e)
        {
            if (this.IsDisposed)
            {
                return;
            }

            BeginInvoke(new Action <IndicationEventArgs>(AddIndication), e);
        }
Exemple #2
0
        internal void AddIndication(IndicationEventArgs e)
        {
            var lastNodeVisible = NotificationsTreeView.Nodes.Count > 0 && NotificationsTreeView.Nodes[NotificationsTreeView.Nodes.Count - 1].IsVisible;
            var oldTopNode      = NotificationsTreeView.TopNode;

            NotificationsTreeView.BeginUpdate();

            //Create the root notification node.
            string rootDisplayName = GetNotificationDisplayName(e.IndicationType, e.IndicationProperties, e.SourceInstanceProperties);

            int imageIndex           = DetermineImageIndex(e.IndicationType);
            var notificationRootNode = new TreeNode(rootDisplayName, imageIndex, imageIndex);

            if (e.IndicationProperties != null && e.IndicationProperties.Count > 0)
            {
                //Create the IndicationProperties and add it to the root.
                var indicationPropertiesNode = new TreeNode("Indication Properties", -1, -1);
                notificationRootNode.Nodes.Add(indicationPropertiesNode);

                //Add all the properties.
                AddProperties(indicationPropertiesNode, e.IndicationProperties);
                indicationPropertiesNode.Expand();
            }

            if (e.SourceInstanceProperties != null && e.SourceInstanceProperties.Count > 0)
            {
                //Create the IndicationProperties and add it to the root.
                var instancePropertiesNode = new TreeNode("Source Instance Properties");
                notificationRootNode.Nodes.Add(instancePropertiesNode);

                //Add all the properties.
                AddProperties(instancePropertiesNode, e.SourceInstanceProperties);
                instancePropertiesNode.Expand();
            }


            //_notifications.Add(indicationId, notificationRootNode);

            //Finally, add all these nodes to the tree.
            NotificationsTreeView.Nodes.Add(notificationRootNode);

            NotificationsTreeView.EndUpdate();

            // If the last node was visible when we started, make the *new* last node visible
            if (lastNodeVisible)
            {
                notificationRootNode.EnsureVisible();
            }
            else // Otherwise, keep the scroll position where it was
            {
                NotificationsTreeView.TopNode = oldTopNode;
            }
        }
 private void AddIndication(IndicationEventArgs obj)
 {
     var item = new ListViewItem(new[]
                                     {
                                         ((DateTime)obj.IndicationProperties["IndicationTime"]).ToLongTimeString(),
                                         (string)obj.IndicationProperties["QueryText"],
                                         (string)obj.IndicationProperties["Parameters"],
                                         string.Format("{0} ms", obj.IndicationProperties["ExecutionTimeMS"])
                                     });
     listView1.Items.Add(item);
     item.EnsureVisible();
 }
Exemple #4
0
        private void AddIndication(IndicationEventArgs obj)
        {
            var item = new ListViewItem(new[]
            {
                ((DateTime)obj.IndicationProperties["IndicationTime"]).ToLongTimeString(),
                (string)obj.IndicationProperties["QueryText"],
                (string)obj.IndicationProperties["Parameters"],
                string.Format("{0} ms", obj.IndicationProperties["ExecutionTimeMS"])
            });

            listView1.Items.Add(item);
            item.EnsureVisible();
        }
Exemple #5
0
        internal void AddIndication(IndicationEventArgs e)
        {
            //Create the root notification node.
            string rootDisplayName = GetNotificationDisplayName(e.IndicationType);

            int imageIndex           = DetermineImageIndex(e.IndicationType);
            var notificationRootNode = new TreeNode(rootDisplayName, imageIndex, imageIndex);

            if (e.IndicationProperties != null && e.IndicationProperties.Count > 0)
            {
                //Create the IndicationProperties and add it to the root.
                var indicationPropertiesNode = new TreeNode("Indication Properties", -1, -1);
                notificationRootNode.Nodes.Add(indicationPropertiesNode);

                //Add all the properties.
                AddProperties(indicationPropertiesNode, e.IndicationProperties);
                indicationPropertiesNode.Expand();
            }

            if (e.SourceInstanceProperties != null && e.SourceInstanceProperties.Count > 0)
            {
                //Create the IndicationProperties and add it to the root.
                var instancePropertiesNode = new TreeNode("Source Instance Properties");
                notificationRootNode.Nodes.Add(instancePropertiesNode);

                //Add all the properties.
                AddProperties(instancePropertiesNode, e.SourceInstanceProperties);
                instancePropertiesNode.Expand();
            }


            //_notifications.Add(indicationId, notificationRootNode);

            //Finally, add all these nodes to the tree.
            NotificationsTreeView.Nodes.Add(notificationRootNode);
        }
        internal void AddIndication(IndicationEventArgs e)
        {
            //Create the root notification node.
            string rootDisplayName = GetNotificationDisplayName(e.IndicationType);

            int imageIndex = DetermineImageIndex(e.IndicationType);
            var notificationRootNode = new TreeNode(rootDisplayName, imageIndex, imageIndex);

            if (e.IndicationProperties != null && e.IndicationProperties.Count > 0)
            {
                //Create the IndicationProperties and add it to the root.
                var indicationPropertiesNode = new TreeNode("Indication Properties", -1, -1);
                notificationRootNode.Nodes.Add(indicationPropertiesNode);

                //Add all the properties.
                AddProperties(indicationPropertiesNode, e.IndicationProperties);
                indicationPropertiesNode.Expand();
            }

            if (e.SourceInstanceProperties != null && e.SourceInstanceProperties.Count > 0)
            {
                //Create the IndicationProperties and add it to the root.
                var instancePropertiesNode = new TreeNode("Source Instance Properties");
                notificationRootNode.Nodes.Add(instancePropertiesNode);

                //Add all the properties.
                AddProperties(instancePropertiesNode, e.SourceInstanceProperties);
                instancePropertiesNode.Expand();
            }


            //_notifications.Add(indicationId, notificationRootNode);

            //Finally, add all these nodes to the tree.
            NotificationsTreeView.Nodes.Add(notificationRootNode);
        }
Exemple #7
0
 void SubscriptionIndicationReceived(object sender, IndicationEventArgs e)
 {
     // hack. it would be better to get the actual subscription id and compare properly
     if (subscription != null && subscription.SubscriptionUri.Contains(e.SubscriptionID)) 
         subscriptionTab1.BeginInvoke(new Action<IndicationEventArgs>(subscriptionTab1.AddIndication), e);
 }
 private void SubscriptionIndicationReceived(IndicationEventArgs e)
 {
     BeginInvoke(new Action <IndicationEventArgs>(AddIndication), e);
 }
Exemple #9
0
 void SubscriptionIndicationReceived(IndicationEventArgs e)
 {
     subscriptionTab1.BeginInvoke(new Action <IndicationEventArgs>(subscriptionTab1.AddIndication), e);
 }
Exemple #10
0
 void SubscriptionIndicationReceived(IndicationEventArgs e)
 {
     subscriptionTab1.BeginInvoke(new Action<IndicationEventArgs>(subscriptionTab1.AddIndication), e);
 }
 private void SubscriptionIndicationReceived(IndicationEventArgs e)
 {
      BeginInvoke(new Action<IndicationEventArgs>(AddIndication), e);
 }