コード例 #1
0
        private void SubscriptionIndicationReceived(IndicationEventArgs e)
        {
            if (this.IsDisposed)
            {
                return;
            }

            BeginInvoke(new Action <IndicationEventArgs>(AddIndication), e);
        }
コード例 #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;
            }
        }
コード例 #3
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();
 }
コード例 #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();
        }
コード例 #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);
        }
コード例 #6
0
ファイル: SubscriptionTab.cs プロジェクト: rbramwell/OrionSDK
        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);
        }
コード例 #7
0
ファイル: QueryTab.cs プロジェクト: rbramwell/OrionSDK
 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);
 }
コード例 #8
0
 private void SubscriptionIndicationReceived(IndicationEventArgs e)
 {
     BeginInvoke(new Action <IndicationEventArgs>(AddIndication), e);
 }
コード例 #9
0
ファイル: QueryTab.cs プロジェクト: cooperdustin12/psproj
 void SubscriptionIndicationReceived(IndicationEventArgs e)
 {
     subscriptionTab1.BeginInvoke(new Action <IndicationEventArgs>(subscriptionTab1.AddIndication), e);
 }
コード例 #10
0
ファイル: QueryTab.cs プロジェクト: nothrow/OrionSDK
 void SubscriptionIndicationReceived(IndicationEventArgs e)
 {
     subscriptionTab1.BeginInvoke(new Action<IndicationEventArgs>(subscriptionTab1.AddIndication), e);
 }
コード例 #11
0
 private void SubscriptionIndicationReceived(IndicationEventArgs e)
 {
      BeginInvoke(new Action<IndicationEventArgs>(AddIndication), e);
 }