From a25cc382a891627866a586371b7c93c6a39010c1 Mon Sep 17 00:00:00 2001 From: skavan Date: Sat, 28 Jun 2014 15:09:27 -0400 Subject: [PATCH] Basic Functionality including subscription is working --- vbDeviceSpy.sln | 22 + vbDeviceSpy/Form1.Designer.vb | 511 ++++++++++++++++ vbDeviceSpy/Form1.resx | 242 ++++++++ vbDeviceSpy/Form1.vb | 574 ++++++++++++++++++ .../My Project/Application.Designer.vb | 38 ++ vbDeviceSpy/My Project/Application.myapp | 11 + vbDeviceSpy/My Project/AssemblyInfo.vb | 35 ++ vbDeviceSpy/My Project/Resources.Designer.vb | 63 ++ vbDeviceSpy/My Project/Resources.resx | 117 ++++ vbDeviceSpy/My Project/Settings.Designer.vb | 73 +++ vbDeviceSpy/My Project/Settings.settings | 7 + vbDeviceSpy/app.config | 23 + vbDeviceSpy/formForceAdd.Designer.vb | 29 + vbDeviceSpy/formForceAdd.vb | 25 + vbDeviceSpy/vbDeviceSpy.vbproj | 133 ++++ 15 files changed, 1903 insertions(+) create mode 100644 vbDeviceSpy.sln create mode 100644 vbDeviceSpy/Form1.Designer.vb create mode 100644 vbDeviceSpy/Form1.resx create mode 100644 vbDeviceSpy/Form1.vb create mode 100644 vbDeviceSpy/My Project/Application.Designer.vb create mode 100644 vbDeviceSpy/My Project/Application.myapp create mode 100644 vbDeviceSpy/My Project/AssemblyInfo.vb create mode 100644 vbDeviceSpy/My Project/Resources.Designer.vb create mode 100644 vbDeviceSpy/My Project/Resources.resx create mode 100644 vbDeviceSpy/My Project/Settings.Designer.vb create mode 100644 vbDeviceSpy/My Project/Settings.settings create mode 100644 vbDeviceSpy/app.config create mode 100644 vbDeviceSpy/formForceAdd.Designer.vb create mode 100644 vbDeviceSpy/formForceAdd.vb create mode 100644 vbDeviceSpy/vbDeviceSpy.vbproj diff --git a/vbDeviceSpy.sln b/vbDeviceSpy.sln new file mode 100644 index 0000000..7462146 --- /dev/null +++ b/vbDeviceSpy.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30501.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "vbDeviceSpy", "vbDeviceSpy\vbDeviceSpy.vbproj", "{90C8A4EC-D9F2-4107-BD85-DDFE97BD87A9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {90C8A4EC-D9F2-4107-BD85-DDFE97BD87A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90C8A4EC-D9F2-4107-BD85-DDFE97BD87A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90C8A4EC-D9F2-4107-BD85-DDFE97BD87A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90C8A4EC-D9F2-4107-BD85-DDFE97BD87A9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/vbDeviceSpy/Form1.Designer.vb b/vbDeviceSpy/Form1.Designer.vb new file mode 100644 index 0000000..959a19f --- /dev/null +++ b/vbDeviceSpy/Form1.Designer.vb @@ -0,0 +1,511 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1)) + Dim ListViewItem1 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {""}, -1, System.Drawing.SystemColors.WindowText, System.Drawing.SystemColors.Window, New System.Drawing.Font("Microsoft Sans Serif", 8.25!)) + Me.menuItem9 = New System.Windows.Forms.MenuItem() + Me.menuItem13 = New System.Windows.Forms.MenuItem() + Me.menuItem14 = New System.Windows.Forms.MenuItem() + Me.menuItem2 = New System.Windows.Forms.MenuItem() + Me.menuItem7 = New System.Windows.Forms.MenuItem() + Me.rescanMenuItem = New System.Windows.Forms.MenuItem() + Me.menuItem19 = New System.Windows.Forms.MenuItem() + Me.expandAllMenuItem = New System.Windows.Forms.MenuItem() + Me.collapseAllMenuItem = New System.Windows.Forms.MenuItem() + Me.menuItem16 = New System.Windows.Forms.MenuItem() + Me.menuItem3 = New System.Windows.Forms.MenuItem() + Me.viewStatusbarMenuItem = New System.Windows.Forms.MenuItem() + Me.menuItem5 = New System.Windows.Forms.MenuItem() + Me.helpMenuItem = New System.Windows.Forms.MenuItem() + Me.menuItem6 = New System.Windows.Forms.MenuItem() + Me.menuItem10 = New System.Windows.Forms.MenuItem() + Me.showDebugInfoMenuItem = New System.Windows.Forms.MenuItem() + Me.eventListView = New System.Windows.Forms.ListView() + Me.columnHeader6 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) + Me.columnHeader3 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) + Me.columnHeader4 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) + Me.columnHeader5 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) + Me.eventListViewContextMenu = New System.Windows.Forms.ContextMenu() + Me.copyEventCpMenuItem = New System.Windows.Forms.MenuItem() + Me.copyEventLogCpMenuItem = New System.Windows.Forms.MenuItem() + Me.menuItem11 = New System.Windows.Forms.MenuItem() + Me.ClearEventLogMenuItem = New System.Windows.Forms.MenuItem() + Me.menuItem4 = New System.Windows.Forms.MenuItem() + Me.splitter2 = New System.Windows.Forms.Splitter() + Me.menuItem12 = New System.Windows.Forms.MenuItem() + Me.deviceTree = New System.Windows.Forms.TreeView() + Me.deviceContextMenu = New System.Windows.Forms.ContextMenu() + Me.presPageMenuItem = New System.Windows.Forms.MenuItem() + Me.eventSubscribeMenuItem = New System.Windows.Forms.MenuItem() + Me.invokeActionMenuItem = New System.Windows.Forms.MenuItem() + Me.ValidateActionMenuItem = New System.Windows.Forms.MenuItem() + Me.DeviceXMLmenuItem = New System.Windows.Forms.MenuItem() + Me.ServiceXMLmenuItem = New System.Windows.Forms.MenuItem() + Me.removeDeviceMenuItem = New System.Windows.Forms.MenuItem() + Me.menuItem18 = New System.Windows.Forms.MenuItem() + Me.expandAllMenuItem2 = New System.Windows.Forms.MenuItem() + Me.collapseAllMenuItem2 = New System.Windows.Forms.MenuItem() + Me.menuItem21 = New System.Windows.Forms.MenuItem() + Me.rescanNetworkMenuItem = New System.Windows.Forms.MenuItem() + Me.treeImageList = New System.Windows.Forms.ImageList(Me.components) + Me.listInfo = New System.Windows.Forms.ListView() + Me.columnHeader1 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) + Me.columnHeader2 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) + Me.listInfoContextMenu = New System.Windows.Forms.ContextMenu() + Me.openWebPageMenuItem = New System.Windows.Forms.MenuItem() + Me.copyValueCpMenuItem = New System.Windows.Forms.MenuItem() + Me.copyTableCpMenuItem = New System.Windows.Forms.MenuItem() + Me.splitter1 = New System.Windows.Forms.Splitter() + Me.statusBar = New System.Windows.Forms.StatusBar() + Me.mainMenu = New System.Windows.Forms.MainMenu(Me.components) + Me.menuItem1 = New System.Windows.Forms.MenuItem() + Me.manuallyAddDeviceMenuItem = New System.Windows.Forms.MenuItem() + Me.menuItem15 = New System.Windows.Forms.MenuItem() + Me.SuspendLayout() + ' + 'menuItem9 + ' + Me.menuItem9.Index = 3 + Me.menuItem9.Text = "Copy &event log to clipboard" + ' + 'menuItem13 + ' + Me.menuItem13.Index = 5 + Me.menuItem13.Text = "&Clear Event Log" + ' + 'menuItem14 + ' + Me.menuItem14.Index = 6 + Me.menuItem14.Text = "-" + ' + 'menuItem2 + ' + Me.menuItem2.Index = 7 + Me.menuItem2.Text = "E&xit" + ' + 'menuItem7 + ' + Me.menuItem7.Index = 1 + Me.menuItem7.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.rescanMenuItem, Me.menuItem19, Me.expandAllMenuItem, Me.collapseAllMenuItem, Me.menuItem16, Me.menuItem3, Me.viewStatusbarMenuItem}) + Me.menuItem7.Text = "&View" + ' + 'rescanMenuItem + ' + Me.rescanMenuItem.Index = 0 + Me.rescanMenuItem.Shortcut = System.Windows.Forms.Shortcut.F5 + Me.rescanMenuItem.Text = "Rescan network" + ' + 'menuItem19 + ' + Me.menuItem19.Index = 1 + Me.menuItem19.Text = "-" + ' + 'expandAllMenuItem + ' + Me.expandAllMenuItem.Index = 2 + Me.expandAllMenuItem.Text = "&Expand all devices" + ' + 'collapseAllMenuItem + ' + Me.collapseAllMenuItem.Index = 3 + Me.collapseAllMenuItem.Text = "&Collapse all devices" + ' + 'menuItem16 + ' + Me.menuItem16.Index = 4 + Me.menuItem16.Text = "-" + ' + 'menuItem3 + ' + Me.menuItem3.Index = 5 + Me.menuItem3.Text = "Event &log" + ' + 'viewStatusbarMenuItem + ' + Me.viewStatusbarMenuItem.Checked = True + Me.viewStatusbarMenuItem.Index = 6 + Me.viewStatusbarMenuItem.Text = "Status &bar" + ' + 'menuItem5 + ' + Me.menuItem5.Index = 2 + Me.menuItem5.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.helpMenuItem, Me.menuItem6, Me.menuItem10, Me.showDebugInfoMenuItem}) + Me.menuItem5.Text = "&Help" + ' + 'helpMenuItem + ' + Me.helpMenuItem.Index = 0 + Me.helpMenuItem.Shortcut = System.Windows.Forms.Shortcut.F1 + Me.helpMenuItem.Text = "&Help Topics" + ' + 'menuItem6 + ' + Me.menuItem6.Index = 1 + Me.menuItem6.Text = "&Check for updates" + ' + 'menuItem10 + ' + Me.menuItem10.Index = 2 + Me.menuItem10.Text = "-" + ' + 'showDebugInfoMenuItem + ' + Me.showDebugInfoMenuItem.Index = 3 + Me.showDebugInfoMenuItem.Text = "&Show Debug Information" + ' + 'eventListView + ' + Me.eventListView.BorderStyle = System.Windows.Forms.BorderStyle.None + Me.eventListView.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.columnHeader6, Me.columnHeader3, Me.columnHeader4, Me.columnHeader5}) + Me.eventListView.ContextMenu = Me.eventListViewContextMenu + Me.eventListView.Dock = System.Windows.Forms.DockStyle.Bottom + Me.eventListView.FullRowSelect = True + Me.eventListView.Location = New System.Drawing.Point(480, 431) + Me.eventListView.Name = "eventListView" + Me.eventListView.Size = New System.Drawing.Size(1549, 234) + Me.eventListView.TabIndex = 17 + Me.eventListView.UseCompatibleStateImageBehavior = False + Me.eventListView.View = System.Windows.Forms.View.Details + Me.eventListView.Visible = False + ' + 'columnHeader6 + ' + Me.columnHeader6.Text = "Time" + Me.columnHeader6.Width = 54 + ' + 'columnHeader3 + ' + Me.columnHeader3.Text = "Event Source" + Me.columnHeader3.Width = 148 + ' + 'columnHeader4 + ' + Me.columnHeader4.Text = "State Variable" + Me.columnHeader4.Width = 126 + ' + 'columnHeader5 + ' + Me.columnHeader5.Text = "Value" + Me.columnHeader5.Width = 128 + ' + 'eventListViewContextMenu + ' + Me.eventListViewContextMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.copyEventCpMenuItem, Me.copyEventLogCpMenuItem, Me.menuItem11, Me.ClearEventLogMenuItem}) + ' + 'copyEventCpMenuItem + ' + Me.copyEventCpMenuItem.DefaultItem = True + Me.copyEventCpMenuItem.Index = 0 + Me.copyEventCpMenuItem.Text = "Copy &Event to Clipboard" + ' + 'copyEventLogCpMenuItem + ' + Me.copyEventLogCpMenuItem.Index = 1 + Me.copyEventLogCpMenuItem.Text = "Copy Event &Log to Clipboard" + ' + 'menuItem11 + ' + Me.menuItem11.Index = 2 + Me.menuItem11.Text = "-" + ' + 'ClearEventLogMenuItem + ' + Me.ClearEventLogMenuItem.Index = 3 + Me.ClearEventLogMenuItem.Text = "&Clear Event Log" + ' + 'menuItem4 + ' + Me.menuItem4.Index = 4 + Me.menuItem4.Text = "-" + ' + 'splitter2 + ' + Me.splitter2.Dock = System.Windows.Forms.DockStyle.Bottom + Me.splitter2.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.splitter2.Location = New System.Drawing.Point(480, 665) + Me.splitter2.Name = "splitter2" + Me.splitter2.Size = New System.Drawing.Size(1549, 6) + Me.splitter2.TabIndex = 18 + Me.splitter2.TabStop = False + Me.splitter2.Visible = False + ' + 'menuItem12 + ' + Me.menuItem12.Index = 2 + Me.menuItem12.Text = "Copy &information table to clipboard" + ' + 'deviceTree + ' + Me.deviceTree.BackColor = System.Drawing.Color.White + Me.deviceTree.ContextMenu = Me.deviceContextMenu + Me.deviceTree.Dock = System.Windows.Forms.DockStyle.Left + Me.deviceTree.ImageIndex = 0 + Me.deviceTree.ImageList = Me.treeImageList + Me.deviceTree.Indent = 19 + Me.deviceTree.ItemHeight = 16 + Me.deviceTree.Location = New System.Drawing.Point(6, 0) + Me.deviceTree.Name = "deviceTree" + Me.deviceTree.SelectedImageIndex = 0 + Me.deviceTree.Size = New System.Drawing.Size(474, 671) + Me.deviceTree.TabIndex = 13 + ' + 'deviceContextMenu + ' + Me.deviceContextMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.presPageMenuItem, Me.eventSubscribeMenuItem, Me.invokeActionMenuItem, Me.ValidateActionMenuItem, Me.DeviceXMLmenuItem, Me.ServiceXMLmenuItem, Me.removeDeviceMenuItem, Me.menuItem18, Me.expandAllMenuItem2, Me.collapseAllMenuItem2, Me.menuItem21, Me.rescanNetworkMenuItem}) + ' + 'presPageMenuItem + ' + Me.presPageMenuItem.DefaultItem = True + Me.presPageMenuItem.Index = 0 + Me.presPageMenuItem.Text = "Display Presentation Page" + ' + 'eventSubscribeMenuItem + ' + Me.eventSubscribeMenuItem.DefaultItem = True + Me.eventSubscribeMenuItem.Index = 1 + Me.eventSubscribeMenuItem.Text = "Subscribe to Events" + ' + 'invokeActionMenuItem + ' + Me.invokeActionMenuItem.DefaultItem = True + Me.invokeActionMenuItem.Index = 2 + Me.invokeActionMenuItem.Text = "Invoke Action" + ' + 'ValidateActionMenuItem + ' + Me.ValidateActionMenuItem.Index = 3 + Me.ValidateActionMenuItem.Text = "Validate Actions" + ' + 'DeviceXMLmenuItem + ' + Me.DeviceXMLmenuItem.Index = 4 + Me.DeviceXMLmenuItem.Text = "Get Device XML" + ' + 'ServiceXMLmenuItem + ' + Me.ServiceXMLmenuItem.Index = 5 + Me.ServiceXMLmenuItem.Text = "Get Service XML" + ' + 'removeDeviceMenuItem + ' + Me.removeDeviceMenuItem.Index = 6 + Me.removeDeviceMenuItem.Text = "Remove Device" + ' + 'menuItem18 + ' + Me.menuItem18.Index = 7 + Me.menuItem18.Text = "-" + ' + 'expandAllMenuItem2 + ' + Me.expandAllMenuItem2.Index = 8 + Me.expandAllMenuItem2.Text = "&Expand all devices" + ' + 'collapseAllMenuItem2 + ' + Me.collapseAllMenuItem2.Index = 9 + Me.collapseAllMenuItem2.Text = "&Collapse all devices" + ' + 'menuItem21 + ' + Me.menuItem21.Index = 10 + Me.menuItem21.Text = "-" + ' + 'rescanNetworkMenuItem + ' + Me.rescanNetworkMenuItem.Index = 11 + Me.rescanNetworkMenuItem.Text = "Rescan network" + ' + 'treeImageList + ' + Me.treeImageList.ImageStream = CType(resources.GetObject("treeImageList.ImageStream"), System.Windows.Forms.ImageListStreamer) + Me.treeImageList.TransparentColor = System.Drawing.Color.Transparent + Me.treeImageList.Images.SetKeyName(0, "") + Me.treeImageList.Images.SetKeyName(1, "") + Me.treeImageList.Images.SetKeyName(2, "") + Me.treeImageList.Images.SetKeyName(3, "") + Me.treeImageList.Images.SetKeyName(4, "") + Me.treeImageList.Images.SetKeyName(5, "") + Me.treeImageList.Images.SetKeyName(6, "") + Me.treeImageList.Images.SetKeyName(7, "") + ' + 'listInfo + ' + Me.listInfo.BorderStyle = System.Windows.Forms.BorderStyle.None + Me.listInfo.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.columnHeader1, Me.columnHeader2}) + Me.listInfo.ContextMenu = Me.listInfoContextMenu + Me.listInfo.FullRowSelect = True + Me.listInfo.Items.AddRange(New System.Windows.Forms.ListViewItem() {ListViewItem1}) + Me.listInfo.Location = New System.Drawing.Point(480, 0) + Me.listInfo.Name = "listInfo" + Me.listInfo.Size = New System.Drawing.Size(1549, 425) + Me.listInfo.TabIndex = 16 + Me.listInfo.UseCompatibleStateImageBehavior = False + Me.listInfo.View = System.Windows.Forms.View.Details + ' + 'columnHeader1 + ' + Me.columnHeader1.Text = "Name" + Me.columnHeader1.Width = 111 + ' + 'columnHeader2 + ' + Me.columnHeader2.Text = "Value" + Me.columnHeader2.Width = 350 + ' + 'listInfoContextMenu + ' + Me.listInfoContextMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.openWebPageMenuItem, Me.copyValueCpMenuItem, Me.copyTableCpMenuItem}) + ' + 'openWebPageMenuItem + ' + Me.openWebPageMenuItem.DefaultItem = True + Me.openWebPageMenuItem.Index = 0 + Me.openWebPageMenuItem.Text = "&Open Web Page" + ' + 'copyValueCpMenuItem + ' + Me.copyValueCpMenuItem.Index = 1 + Me.copyValueCpMenuItem.Text = "Copy &Value to Clipboard" + ' + 'copyTableCpMenuItem + ' + Me.copyTableCpMenuItem.Index = 2 + Me.copyTableCpMenuItem.Text = "Copy &Table to Clipboard" + ' + 'splitter1 + ' + Me.splitter1.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.splitter1.Location = New System.Drawing.Point(0, 0) + Me.splitter1.Name = "splitter1" + Me.splitter1.Size = New System.Drawing.Size(6, 671) + Me.splitter1.TabIndex = 15 + Me.splitter1.TabStop = False + ' + 'statusBar + ' + Me.statusBar.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.statusBar.Location = New System.Drawing.Point(0, 671) + Me.statusBar.Name = "statusBar" + Me.statusBar.Size = New System.Drawing.Size(2029, 26) + Me.statusBar.TabIndex = 14 + ' + 'mainMenu + ' + Me.mainMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.menuItem1, Me.menuItem7, Me.menuItem5}) + ' + 'menuItem1 + ' + Me.menuItem1.Index = 0 + Me.menuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.manuallyAddDeviceMenuItem, Me.menuItem15, Me.menuItem12, Me.menuItem9, Me.menuItem4, Me.menuItem13, Me.menuItem14, Me.menuItem2}) + Me.menuItem1.Text = "&File" + ' + 'manuallyAddDeviceMenuItem + ' + Me.manuallyAddDeviceMenuItem.Index = 0 + Me.manuallyAddDeviceMenuItem.Text = "Manually Add Device" + ' + 'menuItem15 + ' + Me.menuItem15.Index = 1 + Me.menuItem15.Text = "-" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(2029, 697) + Me.Controls.Add(Me.eventListView) + Me.Controls.Add(Me.splitter2) + Me.Controls.Add(Me.deviceTree) + Me.Controls.Add(Me.listInfo) + Me.Controls.Add(Me.splitter1) + Me.Controls.Add(Me.statusBar) + Me.Menu = Me.mainMenu + Me.Name = "Form1" + Me.Text = "Form1" + Me.ResumeLayout(False) + + End Sub + Private WithEvents menuItem9 As System.Windows.Forms.MenuItem + Private WithEvents menuItem13 As System.Windows.Forms.MenuItem + Private WithEvents menuItem14 As System.Windows.Forms.MenuItem + Private WithEvents menuItem2 As System.Windows.Forms.MenuItem + Private WithEvents menuItem7 As System.Windows.Forms.MenuItem + Private WithEvents rescanMenuItem As System.Windows.Forms.MenuItem + Private WithEvents menuItem19 As System.Windows.Forms.MenuItem + Private WithEvents expandAllMenuItem As System.Windows.Forms.MenuItem + Private WithEvents collapseAllMenuItem As System.Windows.Forms.MenuItem + Private WithEvents menuItem16 As System.Windows.Forms.MenuItem + Private WithEvents menuItem3 As System.Windows.Forms.MenuItem + Private WithEvents viewStatusbarMenuItem As System.Windows.Forms.MenuItem + Private WithEvents menuItem5 As System.Windows.Forms.MenuItem + Private WithEvents helpMenuItem As System.Windows.Forms.MenuItem + Private WithEvents menuItem6 As System.Windows.Forms.MenuItem + Private WithEvents menuItem10 As System.Windows.Forms.MenuItem + Private WithEvents showDebugInfoMenuItem As System.Windows.Forms.MenuItem + Private WithEvents eventListView As System.Windows.Forms.ListView + Private WithEvents columnHeader6 As System.Windows.Forms.ColumnHeader + Private WithEvents columnHeader3 As System.Windows.Forms.ColumnHeader + Private WithEvents columnHeader4 As System.Windows.Forms.ColumnHeader + Private WithEvents columnHeader5 As System.Windows.Forms.ColumnHeader + Private WithEvents eventListViewContextMenu As System.Windows.Forms.ContextMenu + Private WithEvents copyEventCpMenuItem As System.Windows.Forms.MenuItem + Private WithEvents copyEventLogCpMenuItem As System.Windows.Forms.MenuItem + Private WithEvents menuItem11 As System.Windows.Forms.MenuItem + Private WithEvents ClearEventLogMenuItem As System.Windows.Forms.MenuItem + Private WithEvents menuItem4 As System.Windows.Forms.MenuItem + Private WithEvents splitter2 As System.Windows.Forms.Splitter + Private WithEvents menuItem12 As System.Windows.Forms.MenuItem + Private WithEvents deviceTree As System.Windows.Forms.TreeView + Private WithEvents deviceContextMenu As System.Windows.Forms.ContextMenu + Private WithEvents presPageMenuItem As System.Windows.Forms.MenuItem + Private WithEvents eventSubscribeMenuItem As System.Windows.Forms.MenuItem + Private WithEvents invokeActionMenuItem As System.Windows.Forms.MenuItem + Private WithEvents ValidateActionMenuItem As System.Windows.Forms.MenuItem + Private WithEvents DeviceXMLmenuItem As System.Windows.Forms.MenuItem + Private WithEvents ServiceXMLmenuItem As System.Windows.Forms.MenuItem + Private WithEvents removeDeviceMenuItem As System.Windows.Forms.MenuItem + Private WithEvents menuItem18 As System.Windows.Forms.MenuItem + Private WithEvents expandAllMenuItem2 As System.Windows.Forms.MenuItem + Private WithEvents collapseAllMenuItem2 As System.Windows.Forms.MenuItem + Private WithEvents menuItem21 As System.Windows.Forms.MenuItem + Private WithEvents rescanNetworkMenuItem As System.Windows.Forms.MenuItem + Private WithEvents treeImageList As System.Windows.Forms.ImageList + Private WithEvents listInfo As System.Windows.Forms.ListView + Private WithEvents columnHeader1 As System.Windows.Forms.ColumnHeader + Private WithEvents columnHeader2 As System.Windows.Forms.ColumnHeader + Private WithEvents listInfoContextMenu As System.Windows.Forms.ContextMenu + Private WithEvents openWebPageMenuItem As System.Windows.Forms.MenuItem + Private WithEvents copyValueCpMenuItem As System.Windows.Forms.MenuItem + Private WithEvents copyTableCpMenuItem As System.Windows.Forms.MenuItem + Private WithEvents splitter1 As System.Windows.Forms.Splitter + Private WithEvents statusBar As System.Windows.Forms.StatusBar + Private WithEvents mainMenu As System.Windows.Forms.MainMenu + Private WithEvents menuItem1 As System.Windows.Forms.MenuItem + Private WithEvents manuallyAddDeviceMenuItem As System.Windows.Forms.MenuItem + Private WithEvents menuItem15 As System.Windows.Forms.MenuItem + +End Class diff --git a/vbDeviceSpy/Form1.resx b/vbDeviceSpy/Form1.resx new file mode 100644 index 0000000..9fc4ddb --- /dev/null +++ b/vbDeviceSpy/Form1.resx @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 793, 17 + + + 1069, 17 + + + 1286, 17 + + + + AAEAAAD/////AQAAA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.vb b/vbDeviceSpy/Form1.vb new file mode 100644 index 0000000..04df9b5 --- /dev/null +++ b/vbDeviceSpy/Form1.vb @@ -0,0 +1,574 @@ +Imports OpenSource.UPnP +Imports OpenSource.Utilities +Imports System +Imports System.Collections +Imports System.ComponentModel +Imports System.Diagnostics +Imports System.Drawing +Imports System.Globalization +Imports System.IO +Imports System.Reflection +Imports System.Threading +Imports System.Windows.Forms + +Public Class Form1 + Public Delegate Sub UpdateTreeDelegate(node As TreeNode) + Private SubscribeTime As Integer = 300 + Protected scp As UPnPSmartControlPoint + Protected UPnpRoot As TreeNode = New TreeNode("Devices", 0, 0) + Private ForceDeviceList As Hashtable = New Hashtable() + Private df As UPnPDeviceFactory + Private cp As UPnPControlPoint + + Private Sub Form1_HandleDestroyed(sender As Object, e As EventArgs) Handles Me.HandleDestroyed + 'Me.deviceTree.Nodes.Add(Me.UPnpRoot) + + Me.scp = New UPnPSmartControlPoint(New UPnPSmartControlPoint.DeviceHandler(AddressOf Me.HandleAddedDevice)) + AddHandler scp.OnRemovedDevice, AddressOf Me.HandleRemovedDevice + + End Sub + + Protected Sub HandleAddedDevice(sender As UPnPSmartControlPoint, device As UPnPDevice) + Me.HandleCreate(device, device.BaseURL) + End Sub + + Protected Sub HandleRemovedDevice(sender As UPnPSmartControlPoint, device As UPnPDevice) + MyBase.Invoke(New UPnPSmartControlPoint.DeviceHandler(AddressOf Me.HandleRemovedDeviceEx), New Object() {sender, device}) + End Sub + + '// This is a callback that is called when a Forced Add succeeds and a device is found + Private Sub HandleForceAddDevice(sender As OpenSource.UPnP.UPnPDeviceFactory, device As OpenSource.UPnP.UPnPDevice, URL As System.Uri) + + Me.HandleCreate(device, device.BaseURL) + End Sub + + Private Sub HandleControlPointAddDevice(device As OpenSource.UPnP.UPnPDevice, URL As System.Uri) + Me.HandleCreate(device, device.BaseURL) + End Sub + + + '// This is a callback that is called when a Forced Add FAILS + Private Sub HandleForceAddFailed(sender As UPnPDeviceFactory, LocationUri As Uri, e As Exception, urn As String) + Debug.Print("Force Add Failed") + End Sub + + + Protected Sub HandleRemovedDeviceEx(sender As UPnPSmartControlPoint, device As UPnPDevice) + Dim TempList As ArrayList = New ArrayList() + Dim en As IEnumerator = Me.UPnpRoot.Nodes.GetEnumerator() + While en.MoveNext() + Dim tn As TreeNode = CType(en.Current, TreeNode) + If (CType(tn.Tag, UPnPDevice)).UniqueDeviceName = device.UniqueDeviceName Then + TempList.Add(tn) + End If + End While + For x As Integer = 0 To TempList.Count - 1 + Dim i As TreeNode = CType(TempList(x), TreeNode) + Me.CleanTags(i) + Me.UPnpRoot.Nodes.Remove(i) + Next + End Sub + + Protected Sub HandleCreate(device As UPnPDevice, URL As Uri) + Dim TempList As SortedList = New SortedList() + Dim Parent As TreeNode = New TreeNode(device.FriendlyName, 1, 1) + Parent.Tag = device + For cid As Integer = 0 To device.Services.Length - 1 + Dim Child As TreeNode = New TreeNode(device.Services(cid).ServiceURN, 2, 2) + Child.Tag = device.Services(cid) + Dim stateVarNode As TreeNode = New TreeNode("State variables", 6, 6) + Child.Nodes.Add(stateVarNode) + Dim varList As UPnPStateVariable() = device.Services(cid).GetStateVariables() + TempList.Clear() + Dim array As UPnPStateVariable() = varList + For i As Integer = 0 To array.Length - 1 + Dim var As UPnPStateVariable = array(i) + Dim varNode As TreeNode = New TreeNode(var.Name, 5, 5) + varNode.Tag = var + TempList.Add(var.Name, varNode) + Next + Dim sve As IDictionaryEnumerator = TempList.GetEnumerator() + While sve.MoveNext() + stateVarNode.Nodes.Add(CType(sve.Value, TreeNode)) + End While + TempList.Clear() + Dim actions As UPnPAction() = device.Services(cid).GetActions() + For i As Integer = 0 To actions.Length - 1 + Dim action As UPnPAction = actions(i) + Dim argsstr As String = "" + Dim argumentList As UPnPArgument() = action.ArgumentList + For j As Integer = 0 To argumentList.Length - 1 + Dim arg As UPnPArgument = argumentList(j) + If Not arg.IsReturnValue Then + If argsstr <> "" Then + argsstr += ", " + End If + argsstr = argsstr + arg.RelatedStateVar.ValueType + " " + arg.Name + End If + Next + Dim methodNode As TreeNode = New TreeNode(action.Name + "(" + argsstr + ")", 4, 4) + methodNode.Tag = action + TempList.Add(action.Name, methodNode) + Next + Dim ide As IDictionaryEnumerator = TempList.GetEnumerator() + While ide.MoveNext() + Child.Nodes.Add(CType(ide.Value, TreeNode)) + End While + Parent.Nodes.Add(Child) + Next + For cid As Integer = 0 To device.EmbeddedDevices.Length - 1 + Dim Child As TreeNode = Me.ProcessEmbeddedDevice(device.EmbeddedDevices(cid)) + Child.Tag = device.EmbeddedDevices(cid) + Parent.Nodes.Add(Child) + Next + Dim args As Object() = New Object() {Parent} + MyBase.Invoke(New UpdateTreeDelegate(AddressOf Me.HandleTreeUpdate), args) + End Sub + + Protected Function ProcessEmbeddedDevice(device As UPnPDevice) As TreeNode + Dim TempList As SortedList = New SortedList() + Dim Parent As TreeNode = New TreeNode(device.FriendlyName, 1, 1) + Parent.Tag = device + For cid As Integer = 0 To device.Services.Length - 1 + Dim Child As TreeNode = New TreeNode(device.Services(cid).ServiceURN, 2, 2) + Child.Tag = device.Services(cid) + Dim stateVarNode As TreeNode = New TreeNode("State variables", 6, 6) + Child.Nodes.Add(stateVarNode) + Dim varList As UPnPStateVariable() = device.Services(cid).GetStateVariables() + TempList.Clear() + Dim array As UPnPStateVariable() = varList + For i As Integer = 0 To array.Length - 1 + Dim var As UPnPStateVariable = array(i) + Dim varNode As TreeNode = New TreeNode(var.Name, 5, 5) + varNode.Tag = var + TempList.Add(var.Name, varNode) + Next + Dim sve As IDictionaryEnumerator = TempList.GetEnumerator() + While sve.MoveNext() + stateVarNode.Nodes.Add(CType(sve.Value, TreeNode)) + End While + TempList.Clear() + Dim actions As UPnPAction() = device.Services(cid).GetActions() + For i As Integer = 0 To actions.Length - 1 + Dim action As UPnPAction = actions(i) + Dim argsstr As String = "" + Dim argumentList As UPnPArgument() = action.ArgumentList + For j As Integer = 0 To argumentList.Length - 1 + Dim arg As UPnPArgument = argumentList(j) + If Not arg.IsReturnValue Then + If argsstr <> "" Then + argsstr += ", " + End If + argsstr = argsstr + arg.RelatedStateVar.ValueType + " " + arg.Name + End If + Next + Dim methodNode As TreeNode = New TreeNode(action.Name + "(" + argsstr + ")", 4, 4) + methodNode.Tag = action + TempList.Add(action.Name, methodNode) + Next + Dim ide As IDictionaryEnumerator = TempList.GetEnumerator() + While ide.MoveNext() + Child.Nodes.Add(CType(ide.Value, TreeNode)) + End While + Parent.Nodes.Add(Child) + Next + For cid As Integer = 0 To device.EmbeddedDevices.Length - 1 + Dim Child As TreeNode = Me.ProcessEmbeddedDevice(device.EmbeddedDevices(cid)) + Child.Tag = device.EmbeddedDevices(cid) + Parent.Nodes.Add(Child) + Next + Return Parent + End Function + + Private Sub CleanTags(n As TreeNode) + n.Tag = Nothing + For Each sn As TreeNode In n.Nodes + Me.CleanTags(sn) + Next + End Sub + + Protected Sub HandleTreeUpdate(node As TreeNode) + If Me.UPnpRoot.Nodes.Count = 0 Then + Me.UPnpRoot.Nodes.Add(node) + Else + For i As Integer = 0 To Me.UPnpRoot.Nodes.Count - 1 + If Me.UPnpRoot.Nodes(i).Text.CompareTo(node.Text) > 0 Then + Me.UPnpRoot.Nodes.Insert(i, node) + Exit For + End If + If i = Me.UPnpRoot.Nodes.Count - 1 Then + Me.UPnpRoot.Nodes.Add(node) + Exit For + End If + Next + End If + Me.UPnpRoot.Expand() + End Sub + + Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load + Me.SubscribeTime = 300 + Me.UPnpRoot = New TreeNode("Devices", 0, 0) + Me.ForceDeviceList = New Hashtable() + + Me.deviceTree.Nodes.Add(Me.UPnpRoot) + + Dim NetworkUri = New Uri("http://192.168.1.199:1400/xml/device_description.xml") + + df = New UPnPDeviceFactory(NetworkUri, 1800, New UPnPDeviceFactory.UPnPDeviceHandler(AddressOf HandleForceAddDevice), New UPnPDeviceFactory.UPnPDeviceFailedHandler(AddressOf HandleForceAddFailed), System.Net.IPAddress.Parse("192.168.1.103"), "RINCON_000E58A72F9601400") + + 'cp = New UPnPControlPoint() + 'AddHandler cp.OnCreateDevice, AddressOf HandleControlPointAddDevice + 'cp.CreateDeviceAsync(NetworkUri, 600) + + + + + 'Me.scp = New UPnPSmartControlPoint(New UPnPSmartControlPoint.DeviceHandler(AddressOf Me.HandleAddedDevice), Nothing, {"urn:schemas-upnp-org:service:AVTransport:1", "urn:schemas-upnp-org:service:ConnectionManager:1", "urn:schemas-upnp-org:service:RenderingControl:1"}) + 'df = New UPnPDeviceFactory(NetworkUri, 1800, New UPnPDeviceFactory.UPnPDeviceHandler(AddressOf HandleForceAddDevice), New UPnPDeviceFactory.UPnPDeviceFailedHandler(AddressOf HandleForceAddFailed), Nothing, Nothing) + + 'Me.scp = New UPnPSmartControlPoint() + 'AddHandler Me.scp.OnAddedDevice, New UPnPSmartControlPoint.DeviceHandler(AddressOf Me.HandleAddedDevice) + 'AddHandler Me.scp.OnRemovedDevice, New UPnPSmartControlPoint.DeviceHandler(AddressOf Me.HandleRemovedDevice) + + End Sub + + Private Sub OnSubscribeService(sender As Object, e As EventArgs) Handles presPageMenuItem.Click, eventSubscribeMenuItem.Click + If Me.deviceTree.SelectedNode IsNot Nothing Then + If Me.deviceTree.SelectedNode.Tag IsNot Nothing Then + Dim obj As Object = Me.deviceTree.SelectedNode.Tag + If obj.[GetType]() Is GetType(UPnPService) Then + Dim service As UPnPService = DirectCast(obj, UPnPService) + If Not Me.deviceTree.SelectedNode.Checked Then + Me.splitter2.Visible = True + Me.eventListView.Visible = True + Me.menuItem3.Checked = True + Me.deviceTree.SelectedNode.ImageIndex = 3 + Me.deviceTree.SelectedNode.SelectedImageIndex = 3 + Me.deviceTree.SelectedNode.Checked = True + AddHandler service.OnSubscribe, New UPnPService.UPnPEventSubscribeHandler(AddressOf Me.HandleSubscribe) + + Dim stateVariables As UPnPStateVariable() = (CType(service, UPnPService)).GetStateVariables() + For i As Integer = 0 To stateVariables.Length - 1 + Dim V As UPnPStateVariable = stateVariables(i) + AddHandler V.OnModified, New UPnPStateVariable.ModifiedHandler(AddressOf Me.HandleEvents) + Next + service.Subscribe(Me.SubscribeTime, Nothing) + Else + Me.deviceTree.SelectedNode.ImageIndex = 2 + Me.deviceTree.SelectedNode.SelectedImageIndex = 2 + Me.deviceTree.SelectedNode.Checked = False + AddHandler service.OnSubscribe, New UPnPService.UPnPEventSubscribeHandler(AddressOf Me.HandleSubscribe) + + Dim stateVariables As UPnPStateVariable() = (CType(service, UPnPService)).GetStateVariables() + For i As Integer = 0 To stateVariables.Length - 1 + Dim V As UPnPStateVariable = stateVariables(i) + If V.SendEvent Then + AddHandler V.OnModified, New UPnPStateVariable.ModifiedHandler(AddressOf Me.HandleEvents) + End If + Next + service.UnSubscribe(Nothing) + End If + End If + End If + End If + End Sub + + Protected Sub HandleEvents(sender As UPnPStateVariable, EventValue As Object) + If MyBase.InvokeRequired Then + MyBase.Invoke(New UPnPStateVariable.ModifiedHandler(AddressOf Me.HandleEvents), New Object() {sender, EventValue}) + Else + Dim eventSource As String = sender.OwningService.ParentDevice.FriendlyName + "/" + sender.OwningService.ServiceID + Dim eventValue1 As String = UPnPService.SerializeObjectInstance(EventValue) + If eventValue1 = "" Then + eventValue1 = "(Empty)" + End If + Debug.Print(eventSource & "|" & EventValue) + Dim now As DateTime = DateTime.Now + Dim i As ListViewItem = New ListViewItem(New String() {now.ToShortTimeString(), eventSource, sender.Name, EventValue}) + i.Tag = now + Me.eventListView.Items.Insert(0, i) + If Me.deviceTree.SelectedNode IsNot Nothing Then + If Me.deviceTree.SelectedNode.Tag.[GetType]() Is GetType(UPnPStateVariable) Then + If (CType(Me.deviceTree.SelectedNode.Tag, UPnPStateVariable)).SendEvent Then + If Me.deviceTree.SelectedNode.Tag.GetHashCode() = sender.GetHashCode() Then + Me.SetListInfo(Me.deviceTree.SelectedNode.Tag) + End If + End If + End If + End If + Dim fNode As TreeNode = Me.deviceTree.Nodes(0).FirstNode + While fNode IsNot Nothing + Me.ScanDeviceNode(fNode, sender.OwningService) + fNode = fNode.NextNode + End While + End If + End Sub + + Protected Sub SetListInfo(infoObject As Object) + Dim Items As ArrayList = New ArrayList() + If infoObject Is Nothing Then + Items.Add(New ListViewItem(New String() {"Product name", "Device Spy"})) + Items.Add(New ListViewItem(New String() {"Version", AutoUpdate.VersionString})) + Else + If infoObject.[GetType]() Is GetType(UPnPDevice) Then + Dim d As UPnPDevice = CType(infoObject, UPnPDevice) + Items.Add(New ListViewItem(New String() {"Friendly name", d.FriendlyName})) + Items.Add(New ListViewItem(New String() {"Unique device name", d.UniqueDeviceName})) + Items.Add(New ListViewItem(New String() {"Has presentation", d.HasPresentation.ToString()})) + If d.LocationURL IsNot Nothing Then + Items.Add(New ListViewItem(New String() {"Location URL", d.LocationURL.ToString()})) + End If + + Items.Add(New ListViewItem(New String() {"Manufacturer", d.Manufacturer})) + Items.Add(New ListViewItem(New String() {"Manufacturer URL", d.ManufacturerURL})) + Items.Add(New ListViewItem(New String() {"Model description", d.ModelDescription})) + Items.Add(New ListViewItem(New String() {"Model name", d.ModelName})) + Items.Add(New ListViewItem(New String() {"Model number", d.ModelNumber})) + If d.ModelURL IsNot Nothing Then + Items.Add(New ListViewItem(New String() {"Model URL", d.ModelURL.ToString()})) + End If + Items.Add(New ListViewItem(New String() {"Product code", d.ProductCode})) + Items.Add(New ListViewItem(New String() {"Proprietary type", d.ProprietaryDeviceType})) + Items.Add(New ListViewItem(New String() {"Serial number", d.SerialNumber})) + Items.Add(New ListViewItem(New String() {"Services", d.Services.Length.ToString()})) + Items.Add(New ListViewItem(New String() {"Embedded devices", d.EmbeddedDevices.Length.ToString()})) + Items.Add(New ListViewItem(New String() {"Base URL", d.BaseURL.ToString()})) + Items.Add(New ListViewItem(New String() {"Device URN", d.DeviceURN})) + Items.Add(New ListViewItem(New String() {"Expiration timeout", d.ExpirationTimeout.ToString()})) + Items.Add(New ListViewItem(New String() {"Version", d.Major.ToString() + "." + d.Minor.ToString()})) + Items.Add(New ListViewItem(New String() {"Remote endpoint", d.RemoteEndPoint.ToString()})) + Items.Add(New ListViewItem(New String() {"Standard type", d.StandardDeviceType})) + If d.Icon IsNot Nothing Then + Items.Add(New ListViewItem(New String() {"Device icon", String.Concat(New Object() {"Present, ", d.Icon.Width, "x", d.Icon.Height})})) + Else + Items.Add(New ListViewItem(New String() {"Device icon", "None"})) + End If + If d.InterfaceToHost IsNot Nothing Then + Items.Add(New ListViewItem(New String() {"Interface to host", d.InterfaceToHost.ToString()})) + Else + Items.Add(New ListViewItem(New String() {"Interface to host", "(Embedded device)"})) + End If + Dim deviceURL As String = "" + Try + If d.PresentationURL <> Nothing Then + If d.PresentationURL.StartsWith("/") Then + deviceURL = String.Concat(New String() {"http://", d.RemoteEndPoint.Address.ToString(), ":", d.RemoteEndPoint.Port.ToString(), d.PresentationURL}) + Else + If Not d.PresentationURL.ToUpper().StartsWith("HTTP://") Then + deviceURL = String.Concat(New String() {"http://", d.RemoteEndPoint.Address.ToString(), ":", d.RemoteEndPoint.Port.ToString(), "/", d.PresentationURL}) + Else + deviceURL = d.PresentationURL + End If + End If + End If + Catch 'ex_65A As Object + End Try + Items.Add(New ListViewItem(New String() {"Presentation URL", deviceURL})) + Else + If infoObject.[GetType]() Is GetType(UPnPService) Then + Dim s As UPnPService = CType(infoObject, UPnPService) + Items.Add(New ListViewItem(New String() {"Parent UDN", s.ParentDevice.DeviceURN})) + Items.Add(New ListViewItem(New String() {"Version", s.Major.ToString() + "." + s.Minor.ToString()})) + Items.Add(New ListViewItem(New String() {"Methods", s.Actions.Count.ToString()})) + Items.Add(New ListViewItem(New String() {"State variables", s.GetStateVariables().Length.ToString()})) + Items.Add(New ListViewItem(New String() {"Service ID", s.ServiceID})) + Items.Add(New ListViewItem(New String() {"Service URL", CStr(New UPnPDebugObject(s).GetField("SCPDURL"))})) + Dim deviceURL As String = Nothing + Try + If s.ParentDevice.PresentationURL <> Nothing Then + If s.ParentDevice.PresentationURL.ToLower().StartsWith("http://") OrElse s.ParentDevice.PresentationURL.ToLower().StartsWith("https://") Then + deviceURL = s.ParentDevice.PresentationURL + Else + If s.ParentDevice.PresentationURL.StartsWith("/") Then + deviceURL = String.Concat(New String() {"http://", s.ParentDevice.RemoteEndPoint.Address.ToString(), ":", s.ParentDevice.RemoteEndPoint.Port.ToString(), s.ParentDevice.PresentationURL}) + Else + deviceURL = String.Concat(New String() {"http://", s.ParentDevice.RemoteEndPoint.Address.ToString(), ":", s.ParentDevice.RemoteEndPoint.Port.ToString(), "/", s.ParentDevice.PresentationURL}) + End If + End If + End If + Catch 'ex_95F As Object + End Try + If deviceURL <> Nothing Then + Items.Add(New ListViewItem(New String() {"Parent presentation URL", deviceURL})) + End If + Else + If infoObject.[GetType]() Is GetType(UPnPAction) Then + Me.listInfo.Sorting = SortOrder.None + Dim a As UPnPAction = CType(infoObject, UPnPAction) + Items.Add(New ListViewItem(New String() {"Action name", a.Name})) + If Not a.HasReturnValue Then + Items.Add(New ListViewItem(New String() {"Return argument", ""})) + Else + Items.Add(New ListViewItem(New String() {"Return argument ASV", a.GetRetArg().RelatedStateVar.Name})) + Items.Add(New ListViewItem(New String() {"Return Type", a.GetRetArg().RelatedStateVar.ValueType})) + End If + Dim argnum As Integer = 1 + Dim argumentList As UPnPArgument() = a.ArgumentList + For i As Integer = 0 To argumentList.Length - 1 + Dim arg As UPnPArgument = argumentList(i) + If Not arg.IsReturnValue Then + Dim dataType As String = arg.DataType + If dataType Is Nothing OrElse dataType = "" Then + End If + Items.Add(New ListViewItem(New String() {"Argument " + argnum, "(" + arg.RelatedStateVar.ValueType + ") " + arg.Name})) + Items.Add(New ListViewItem(New String() {"Argument " + argnum + " ASV", arg.RelatedStateVar.Name})) + argnum += 1 + End If + Next + Else + If infoObject.[GetType]() Is GetType(UPnPStateVariable) Then + Dim var As UPnPStateVariable = CType(infoObject, UPnPStateVariable) + Items.Add(New ListViewItem(New String() {"Variable name", var.Name})) + Items.Add(New ListViewItem(New String() {"Evented", var.SendEvent.ToString()})) + Items.Add(New ListViewItem(New String() {"Data type", var.ValueType})) + Try + Items.Add(New ListViewItem(New String() {"Last known value", var.Value.ToString()})) + Catch ex_C88 As Exception + Items.Add(New ListViewItem(New String() {"Last known value", ""})) + End Try + If var.Minimum IsNot Nothing AndAlso var.Maximum Is Nothing Then + If var.[Step] IsNot Nothing Then + Items.Add(New ListViewItem(New String() {"Value range", "Not below " + var.Minimum.ToString() + ", Step " + var.[Step].ToString()})) + Else + Items.Add(New ListViewItem(New String() {"Value range", "Not below " + var.Minimum.ToString()})) + End If + Else + If var.Minimum Is Nothing AndAlso var.Maximum IsNot Nothing Then + If var.[Step] IsNot Nothing Then + Items.Add(New ListViewItem(New String() {"Value range", "Not above " + var.Maximum.ToString() + ", Step " + var.[Step].ToString()})) + Else + Items.Add(New ListViewItem(New String() {"Value range", "Not above " + var.Maximum.ToString()})) + End If + Else + If var.Minimum IsNot Nothing OrElse var.Maximum IsNot Nothing Then + If var.[Step] IsNot Nothing Then + Items.Add(New ListViewItem(New String() {"Value range", String.Concat(New String() {"From ", var.Minimum.ToString(), " to ", var.Maximum.ToString(), ", Step ", var.[Step].ToString()})})) + Else + Items.Add(New ListViewItem(New String() {"Value range", "From " + var.Minimum.ToString() + " to " + var.Maximum.ToString()})) + End If + End If + End If + End If + If var.AllowedStringValues IsNot Nothing AndAlso var.AllowedStringValues.Length > 0 Then + Dim AllowedValues As String = "" + Dim allowedStringValues As String() = var.AllowedStringValues + For i As Integer = 0 To allowedStringValues.Length - 1 + Dim x As String = allowedStringValues(i) + If AllowedValues <> "" Then + AllowedValues += ", " + End If + AllowedValues += x + Next + Items.Add(New ListViewItem(New String() {"Allowed values", AllowedValues})) + End If + If var.DefaultValue IsNot Nothing Then + Items.Add(New ListViewItem(New String() {"Default value", UPnPService.SerializeObjectInstance(var.DefaultValue)})) + End If + End If + End If + End If + End If + End If + Me.listInfo.Sorting = SortOrder.Ascending + Me.listInfo.Items.Clear() + Me.listInfo.Items.AddRange(CType(Items.ToArray(GetType(ListViewItem)), ListViewItem())) + End Sub + + Protected Sub HandleSubscribe(sender As UPnPService, succes As Boolean) + If MyBase.InvokeRequired Then + MyBase.Invoke(New UPnPService.UPnPEventSubscribeHandler(AddressOf Me.HandleSubscribe), New Object() {sender, succes}) + Else + If Not succes Then + Me.statusBar.Text = "FAILED Subscription - " + sender.ParentDevice.FriendlyName + ", " + sender.ServiceID + Else + Me.statusBar.Text = "Subscribed to " + sender.ParentDevice.FriendlyName + ", " + sender.ServiceID + End If + End If + End Sub + + Private Sub ScanDeviceNode(dNode As TreeNode, s As UPnPService) + Dim pNode As TreeNode = dNode.FirstNode + While pNode IsNot Nothing + If pNode.Tag.[GetType]() Is GetType(UPnPDevice) Then + Me.ScanDeviceNode(pNode, s) + Else + If pNode.Tag.GetHashCode() = s.GetHashCode() Then + Dim vNode As TreeNode = pNode.FirstNode.FirstNode + While vNode IsNot Nothing + If (CType(vNode.Tag, UPnPStateVariable)).SendEvent Then + Dim stringValue As String = UPnPService.SerializeObjectInstance((CType(vNode.Tag, UPnPStateVariable)).Value) + If stringValue.Length > 10 Then + stringValue = stringValue.Substring(0, 10) + "..." + End If + If stringValue.Length > 0 Then + stringValue = " [" + stringValue + "]" + End If + vNode.Text = (CType(vNode.Tag, UPnPStateVariable)).Name + stringValue + End If + vNode = vNode.NextNode + End While + Exit Sub + End If + End If + pNode = pNode.NextNode + End While + End Sub + + Private Sub presPageMenuItem_Click(sender As Object, e As EventArgs) + + End Sub + + Private Sub ValidateActionMenuItem_Click(sender As Object, e As EventArgs) Handles ValidateActionMenuItem.Click + + End Sub + + Private Sub deviceTree_MouseDown(sender As Object, e As MouseEventArgs) Handles deviceTree.MouseDown + Me.eventSubscribeMenuItem.Visible = False + Me.invokeActionMenuItem.Visible = False + Me.presPageMenuItem.Visible = False + Me.menuItem18.Visible = False + Me.DeviceXMLmenuItem.Visible = False + Me.ServiceXMLmenuItem.Visible = False + Me.ValidateActionMenuItem.Visible = False + Me.removeDeviceMenuItem.Visible = False + Dim node As TreeNode = Me.deviceTree.GetNodeAt(e.X, e.Y) + If node IsNot Nothing Then + Me.deviceTree.SelectedNode = node + Dim infoObject As Object = node.Tag + If infoObject IsNot Nothing Then + If infoObject.[GetType]() Is GetType(UPnPDevice) Then + If (CType(infoObject, UPnPDevice)).ParentDevice Is Nothing Then + Me.removeDeviceMenuItem.Visible = True + End If + If (CType(infoObject, UPnPDevice)).HasPresentation Then + Me.presPageMenuItem.Visible = True + Me.menuItem18.Visible = True + End If + If (CType(infoObject, UPnPDevice)).LocationURL <> Nothing Then + Me.DeviceXMLmenuItem.Visible = True + Me.menuItem18.Visible = True + End If + End If + If infoObject.[GetType]() Is GetType(UPnPService) Then + Me.ValidateActionMenuItem.Visible = True + Me.eventSubscribeMenuItem.Visible = True + Me.ServiceXMLmenuItem.Visible = True + Me.menuItem18.Visible = True + Me.eventSubscribeMenuItem.Checked = node.Checked + End If + If infoObject.[GetType]() Is GetType(UPnPAction) Then + Me.invokeActionMenuItem.Visible = True + Me.menuItem18.Visible = True + End If + End If + End If + End Sub + Private Sub OnSelectedItem(sender As Object, e As TreeViewEventArgs) Handles deviceTree.AfterSelect + Dim node As TreeNode = Me.deviceTree.SelectedNode + Me.SetListInfo(node.Tag) + End Sub + + Private Sub eventSubscribeMenuItem_Click(sender As Object, e As EventArgs) + + End Sub +End Class diff --git a/vbDeviceSpy/My Project/Application.Designer.vb b/vbDeviceSpy/My Project/Application.Designer.vb new file mode 100644 index 0000000..5a5420a --- /dev/null +++ b/vbDeviceSpy/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.34014 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.vbDeviceSpy.Form1 + End Sub + End Class +End Namespace diff --git a/vbDeviceSpy/My Project/Application.myapp b/vbDeviceSpy/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/vbDeviceSpy/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/vbDeviceSpy/My Project/AssemblyInfo.vb b/vbDeviceSpy/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..925ff9f --- /dev/null +++ b/vbDeviceSpy/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/vbDeviceSpy/My Project/Resources.Designer.vb b/vbDeviceSpy/My Project/Resources.Designer.vb new file mode 100644 index 0000000..a9537d4 --- /dev/null +++ b/vbDeviceSpy/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.34014 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("vbDeviceSpy.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/vbDeviceSpy/My Project/Resources.resx b/vbDeviceSpy/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/vbDeviceSpy/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/vbDeviceSpy/My Project/Settings.Designer.vb b/vbDeviceSpy/My Project/Settings.Designer.vb new file mode 100644 index 0000000..c502c0d --- /dev/null +++ b/vbDeviceSpy/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.34014 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.vbDeviceSpy.My.MySettings + Get + Return Global.vbDeviceSpy.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/vbDeviceSpy/My Project/Settings.settings b/vbDeviceSpy/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/vbDeviceSpy/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/vbDeviceSpy/app.config b/vbDeviceSpy/app.config new file mode 100644 index 0000000..22ec4d3 --- /dev/null +++ b/vbDeviceSpy/app.config @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vbDeviceSpy/formForceAdd.Designer.vb b/vbDeviceSpy/formForceAdd.Designer.vb new file mode 100644 index 0000000..341b507 --- /dev/null +++ b/vbDeviceSpy/formForceAdd.Designer.vb @@ -0,0 +1,29 @@ + _ +Partial Class formForceAdd + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + components = New System.ComponentModel.Container + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Text = "formForceAdd" + End Sub +End Class diff --git a/vbDeviceSpy/formForceAdd.vb b/vbDeviceSpy/formForceAdd.vb new file mode 100644 index 0000000..0eafcd0 --- /dev/null +++ b/vbDeviceSpy/formForceAdd.vb @@ -0,0 +1,25 @@ + +Imports OpenSource.UPnP + +Public Class formForceAdd + Public Delegate Sub UpdateTreeDelegate(node As TreeNode) + Private SubscribeTime As Integer = 300 + Protected scp As UPnPSmartControlPoint + + Private ForceDeviceList As Hashtable = New Hashtable() + Private Sub formForceAdd_HandleDestroyed(sender As Object, e As EventArgs) Handles Me.HandleDestroyed + + End Sub + + Private Sub formForceAdd_Load(sender As Object, e As EventArgs) Handles Me.Load + Me.SubscribeTime = 300 + Me.ForceDeviceList = New Hashtable() + + 'Me.scp = New UPnPSmartControlPoint(AddressOf Me.HandleAddedDevice) + 'Me.scp.ForceDeviceAddition("http://192.168.1.199:1400/xml/device_description.xml") + ''Me.scp = New UPnPSmartControlPoint(New UPnPSmartControlPoint.DeviceHandler(AddressOf Me.HandleAddedDevice)) + 'Me.scp = New UPnPSmartControlPoint(New UPnPSmartControlPoint.DeviceHandler(AddressOf Me.HandleAddedDevice), "http://192.168.1.199:1400/xml/device_description.xml") + 'AddHandler Me.scp.OnRemovedDevice, New UPnPSmartControlPoint.DeviceHandler(AddressOf Me.HandleRemovedDevice) + + End Sub +End Class \ No newline at end of file diff --git a/vbDeviceSpy/vbDeviceSpy.vbproj b/vbDeviceSpy/vbDeviceSpy.vbproj new file mode 100644 index 0000000..32ba986 --- /dev/null +++ b/vbDeviceSpy/vbDeviceSpy.vbproj @@ -0,0 +1,133 @@ + + + + + Debug + AnyCPU + {90C8A4EC-D9F2-4107-BD85-DDFE97BD87A9} + WinExe + vbDeviceSpy.My.MyApplication + vbDeviceSpy + vbDeviceSpy + 512 + WindowsForms + v2.0 + + + + AnyCPU + true + full + true + true + bin\Debug\ + vbDeviceSpy.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + vbDeviceSpy.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + ..\..\DeviceSpy\lib\UPnP.dll + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + formForceAdd.vb + + + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file