diff --git a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/application.xaml.vb b/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/application.xaml.vb
deleted file mode 100644
index 170cf232b25..00000000000
--- a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/application.xaml.vb
+++ /dev/null
@@ -1,10 +0,0 @@
-Imports System.Configuration
-
-Namespace EditingCollectionsSnippets
- '''
- ''' Interaction logic for App.xaml
- '''
- Partial Public Class App
- Inherits Application
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/changeitem.xaml.vb b/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/changeitem.xaml.vb
deleted file mode 100644
index 87d14a32526..00000000000
--- a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/changeitem.xaml.vb
+++ /dev/null
@@ -1,18 +0,0 @@
-Imports System.Text
-
-Namespace EditingCollectionsSnippets
- '''
- ''' Interaction logic for ChangeItem.xaml
- '''
- Partial Public Class ChangeItemWindow
- Inherits Window
- Public Sub New()
- InitializeComponent()
- End Sub
-
- Private Sub Submit_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- DialogResult = True
- Close()
- End Sub
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/editingcollectionssnippets.vbproj b/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/editingcollectionssnippets.vbproj
deleted file mode 100644
index 78b3d2fc88b..00000000000
--- a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/editingcollectionssnippets.vbproj
+++ /dev/null
@@ -1,179 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 10.0.20821
- 2.0
- {3AB84863-E854-4CFC-8E46-5CFADC62C582}
- WinExe
-
-
- EditingCollectionsSample
- v4.8
- On
- Binary
- Off
- On
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
-
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- bin\Debug\
- true
- true
- prompt
- AllRules.ruleset
-
-
- pdbonly
- true
- bin\Release\
- false
- true
- prompt
- AllRules.ruleset
-
-
-
-
- 3.5
-
-
- 3.5
-
-
- 3.5
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- Application.xaml
- Code
-
-
- Window1.xaml
- Code
-
-
-
-
- ChangeItem.xaml
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.vb
- Designer
-
-
- SettingsSingleFileGenerator
- Settings.Designer.vb
-
-
-
-
-
- False
- Microsoft .NET Framework 4 Client Profile %28x86 and x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
- False
- Microsoft Visual Basic PowerPacks 10.0
- true
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/my project/assemblyinfo.vb b/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/my project/assemblyinfo.vb
deleted file mode 100644
index 6cc5acd942f..00000000000
--- a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/my project/assemblyinfo.vb
+++ /dev/null
@@ -1,51 +0,0 @@
-Imports System.Reflection
-Imports System.Resources
-Imports System.Runtime.CompilerServices
-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.
-
-
-
-
-
-
-
-
-
-' Setting ComVisible to false makes the types in this assembly not visible
-' to COM components. If you need to access a type in this assembly from
-' COM, set the ComVisible attribute to true on that type.
-
-
-'In order to begin building localizable applications, set
-'CultureYouAreCodingWith in your .vbproj file
-'inside a . For example, if you are using US english
-'in your source files, set the to en-US. Then uncomment
-'the NeutralResourceLanguage attribute below. Update the "en-US" in
-'the line below to match the UICulture setting in the project file.
-
-'[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
- '(used if a resource is not found in the page,
- ' or application resource dictionaries)
- '(used if a resource is not found in the page,
- ' app, or any theme specific resource dictionaries)
- 'where the generic resource dictionary is located - where theme specific resource dictionaries are located
-
-
-' 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:
-' [assembly: AssemblyVersion("1.0.*")]
-
-
diff --git a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/my project/resources.designer.vb b/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/my project/resources.designer.vb
deleted file mode 100644
index e0b2aaa9ed1..00000000000
--- a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/my project/resources.designer.vb
+++ /dev/null
@@ -1,61 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3026
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Namespace My.Resources
-
-
- '''
- ''' A strongly-typed resource class, for looking up localized strings, etc.
- '''
- ' 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.
-
- Friend Module Resources
-
- Private resourceMan As Global.System.Resources.ResourceManager
-
- Private resourceCulture As Global.System.Globalization.CultureInfo
-
-' internal Resources()
-' {
-' }
-
- '''
- ''' 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 New Global.System.Resources.ResourceManager("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(ByVal value As System.Globalization.CultureInfo)
- resourceCulture = value
- End Set
- End Property
- End Module
-End Namespace
diff --git a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/my project/settings.designer.vb b/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/my project/settings.designer.vb
deleted file mode 100644
index 0f55dfb2c8f..00000000000
--- a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/my project/settings.designer.vb
+++ /dev/null
@@ -1,26 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3026
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Namespace My
-
-
-
- Friend NotInheritable Partial Class Settings
- Inherits System.Configuration.ApplicationSettingsBase
-
- Private Shared defaultInstance As Settings = (CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New Settings()), Settings))
-
- Public Shared ReadOnly Property [Default]() As Settings
- Get
- Return defaultInstance
- End Get
- End Property
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb b/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb
deleted file mode 100644
index db2b0dcfaf2..00000000000
--- a/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb
+++ /dev/null
@@ -1,207 +0,0 @@
-Imports System.Text
-Imports System.Collections.ObjectModel
-Imports System.ComponentModel
-
-Namespace EditingCollectionsSnippets
- '''
- ''' Interaction logic for Window1.xaml
- '''
- Partial Public Class Window1
- Inherits Window
- Public Sub New()
- InitializeComponent()
- End Sub
-
-
- Private Sub edit_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- If itemsControl.SelectedItem Is Nothing Then
- MessageBox.Show("No item is selected")
- Return
- End If
-
- '
- Dim editableCollectionView As IEditableCollectionView = TryCast(itemsControl.Items, IEditableCollectionView)
-
- ' Create a window that prompts the user to edit an item.
- Dim win As New ChangeItemWindow()
- editableCollectionView.EditItem(itemsControl.SelectedItem)
- win.DataContext = itemsControl.SelectedItem
-
- ' If the user submits the new item, commit the changes.
- ' If the user cancels the edits, discard the changes.
- If CBool(win.ShowDialog()) Then
- editableCollectionView.CommitEdit()
- Else
- '
- ' If the objects in the collection can discard pending
- ' changes, calling IEditableCollectionView.CancelEdit
- ' will revert the changes. Otherwise, you must provide
- ' your own logic to revert the changes in the object.
-
- If Not editableCollectionView.CanCancelEdit Then
- ' Provide logic to revert changes.
- End If
-
- editableCollectionView.CancelEdit()
- '
- End If
- '
- End Sub
-
- Private Sub add_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- '
- Dim editableCollectionView As IEditableCollectionView = TryCast(itemsControl.Items, IEditableCollectionView)
-
- If Not editableCollectionView.CanAddNew Then
- MessageBox.Show("You cannot add items to the list.")
- Return
- End If
-
- ' Create a window that prompts the user to enter a new
- ' item to sell.
- Dim win As New ChangeItemWindow()
-
- 'Create a new item to be added to the collection.
- win.DataContext = editableCollectionView.AddNew()
-
- ' If the user submits the new item, commit the new
- ' object to the collection. If the user cancels
- ' adding the new item, discard the new item.
- If CBool(win.ShowDialog()) Then
- editableCollectionView.CommitNew()
- Else
- editableCollectionView.CancelNew()
- End If
-
- '
- End Sub
-
- Private Sub remove_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- Dim item As PurchaseItem = TryCast(itemsControl.SelectedItem, PurchaseItem)
-
- If item Is Nothing Then
- MessageBox.Show("No Item is selected")
- Return
- End If
-
- '
- Dim editableCollectionView As IEditableCollectionView = TryCast(itemsControl.Items, IEditableCollectionView)
-
- If Not editableCollectionView.CanRemove Then
- MessageBox.Show("You cannot remove items from the list.")
- Return
- End If
-
- If MessageBox.Show("Are you sure you want to remove " & item.Description, "Remove Item", MessageBoxButton.YesNo) = MessageBoxResult.Yes Then
- editableCollectionView.Remove(itemsControl.SelectedItem)
- End If
- '
- End Sub
- End Class
-
- Public Class PurchaseItem
- Implements IEditableObject, INotifyPropertyChanged
- Private Structure ItemData
- Friend Description As String
- Friend Price As Double
- Friend OfferExpires As Date
- End Structure
- Private copyData As ItemData
- Private currentData As ItemData
-
- Public Sub New()
- Me.New("New item", 0, Date.Now)
- End Sub
-
- Public Sub New(ByVal desc As String, ByVal price As Double, ByVal endDate As Date)
- Description = desc
- Me.Price = price
- OfferExpires = endDate
- End Sub
-
- Public Overrides Function ToString() As String
- Return String.Format("{0}, {1:c}, {2:D}", Description, Price, OfferExpires)
- End Function
-
- Public Property Description() As String
- Get
- Return currentData.Description
- End Get
- Set(ByVal value As String)
- If currentData.Description <> value Then
- currentData.Description = value
- NotifyPropertyChanged("Description")
- End If
- End Set
- End Property
-
- Public Property Price() As Double
- Get
- Return currentData.Price
- End Get
- Set(ByVal value As Double)
- If currentData.Price <> value Then
- currentData.Price = value
- NotifyPropertyChanged("Price")
- End If
- End Set
- End Property
-
- Public Property OfferExpires() As Date
- Get
- Return currentData.OfferExpires
- End Get
- Set(ByVal value As Date)
- If value <> currentData.OfferExpires Then
- currentData.OfferExpires = value
- NotifyPropertyChanged("OfferExpires")
- End If
- End Set
- End Property
-
- #Region "INotifyPropertyChanged Members"
-
- Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
-
- Private Sub NotifyPropertyChanged(ByVal info As String)
- RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(info))
- End Sub
-
- #End Region
-
- #Region "IEditableObject Members"
-
- Public Sub BeginEdit() Implements IEditableObject.BeginEdit
- copyData = currentData
- End Sub
-
- Public Sub CancelEdit() Implements IEditableObject.CancelEdit
- currentData = copyData
- NotifyPropertyChanged("")
-
- End Sub
-
- Public Sub EndEdit() Implements IEditableObject.EndEdit
- copyData = New ItemData()
-
- End Sub
-
- #End Region
-
- End Class
-
- Public Class ItemsForSale
- Inherits ObservableCollection(Of PurchaseItem)
- Public Sub New()
- Add((New PurchaseItem("Snowboard and bindings", 120, New Date(2009, 1, 1))))
- Add((New PurchaseItem("Inside VB, second edition", 10, New Date(2009, 2, 2))))
- Add((New PurchaseItem("Laptop - only 1 year old", 499.99, New Date(2009, 2, 28))))
- Add((New PurchaseItem("Set of 6 chairs", 120, New Date(2009, 2, 28))))
- Add((New PurchaseItem("My DVD Collection", 15, New Date(2009, 1, 1))))
- Add((New PurchaseItem("TV Drama Series", 39.985, New Date(2009, 1, 1))))
- Add((New PurchaseItem("Squash racket", 60, New Date(2009, 2, 28))))
- End Sub
-
- End Class
-
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/application.xaml.vb b/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/application.xaml.vb
deleted file mode 100644
index 39c79f3e75c..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/application.xaml.vb
+++ /dev/null
@@ -1,14 +0,0 @@
-Imports System.Collections.Generic
-Imports System.Configuration
-Imports System.Data
-Imports System.Linq
-Imports System.Windows
-
-Namespace ContentStringSnippets
- '''
- ''' Interaction logic for App.xaml
- '''
- Partial Public Class App
- Inherits Application
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/contentstringsnippets.vbproj b/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/contentstringsnippets.vbproj
deleted file mode 100644
index 114ccada69f..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/contentstringsnippets.vbproj
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 10.0.20821
- 2.0
- {ABEE88DC-8923-443A-9580-B34499F30CCD}
- WinExe
-
- ContentStringSnippets
- v4.0
- On
- Binary
- Off
- On
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
- Client
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- bin\Debug\
- true
- true
- prompt
- AllRules.ruleset
-
-
- pdbonly
- true
- bin\Release\
- false
- true
- prompt
- AllRules.ruleset
-
-
-
-
- 3.5
-
-
- 3.5
-
-
- 3.5
-
-
-
-
-
-
-
- 4.0
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- Application.xaml
- Code
-
-
- Window1.xaml
- Code
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.vb
-
-
- SettingsSingleFileGenerator
- Settings.Designer.vb
-
-
-
-
-
- False
- Microsoft .NET Framework 4 Client Profile %28x86 and x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
- False
- Microsoft Visual Basic PowerPacks 10.0
- true
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/my project/assemblyinfo.vb b/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/my project/assemblyinfo.vb
deleted file mode 100644
index 9b49d81314f..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/my project/assemblyinfo.vb
+++ /dev/null
@@ -1,52 +0,0 @@
-Imports System.Reflection
-Imports System.Resources
-Imports System.Runtime.CompilerServices
-Imports System.Runtime.InteropServices
-Imports System.Windows
-
-' 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.
-
-
-
-
-
-
-
-
-
-' Setting ComVisible to false makes the types in this assembly not visible
-' to COM components. If you need to access a type in this assembly from
-' COM, set the ComVisible attribute to true on that type.
-
-
-'In order to begin building localizable applications, set
-'CultureYouAreCodingWith in your .vbproj file
-'inside a . For example, if you are using US english
-'in your source files, set the to en-US. Then uncomment
-'the NeutralResourceLanguage attribute below. Update the "en-US" in
-'the line below to match the UICulture setting in the project file.
-
-'[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
- '(used if a resource is not found in the page,
- ' or application resource dictionaries)
- '(used if a resource is not found in the page,
- ' app, or any theme specific resource dictionaries)
- 'where the generic resource dictionary is located - where theme specific resource dictionaries are located
-
-
-' 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:
-' [assembly: AssemblyVersion("1.0.*")]
-
-
diff --git a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/my project/resources.designer.vb b/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/my project/resources.designer.vb
deleted file mode 100644
index 72b6a506118..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/my project/resources.designer.vb
+++ /dev/null
@@ -1,62 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3026
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-
-Namespace My.Resources
-
-
- '''
- ''' A strongly-typed resource class, for looking up localized strings, etc.
- '''
- ' 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.
-
- Friend Module Resources
-
- Private resourceMan As Global.System.Resources.ResourceManager
-
- Private resourceCulture As Global.System.Globalization.CultureInfo
-
-' internal Resources()
-' {
-' }
-
- '''
- ''' Returns the cached ResourceManager instance used by this class.
- '''
-
- Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
- Get
- If (resourceMan Is Nothing) Then
- Dim temp As New Global.System.Resources.ResourceManager("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(ByVal value As System.Globalization.CultureInfo)
- resourceCulture = value
- End Set
- End Property
- End Module
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/my project/settings.designer.vb b/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/my project/settings.designer.vb
deleted file mode 100644
index 4a409ba907f..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/my project/settings.designer.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3026
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-
-Namespace My
-
-
-
- Friend NotInheritable Partial Class Settings
- Inherits System.Configuration.ApplicationSettingsBase
-
- Private Shared defaultInstance As Settings = (CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New Settings()), Settings))
-
- Public Shared ReadOnly Property [Default]() As Settings
- Get
- Return defaultInstance
- End Get
- End Property
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/window1.xaml.vb b/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/window1.xaml.vb
deleted file mode 100644
index 77992ed5868..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/GroupStyle/HeaderStringFormat/window1.xaml.vb
+++ /dev/null
@@ -1,194 +0,0 @@
-Imports System.Collections.Generic
-Imports System.Linq
-Imports System.Text
-Imports System.Windows
-Imports System.Windows.Controls
-Imports System.Windows.Data
-Imports System.Windows.Documents
-Imports System.Windows.Input
-Imports System.Windows.Media
-Imports System.Windows.Media.Imaging
-Imports System.Windows.Navigation
-Imports System.Windows.Shapes
-Imports System.Collections.ObjectModel
-
-Namespace ContentStringSnippets
- '''
- ''' Interaction logic for Window1.xaml
- '''
- Partial Public Class Window1
- Inherits Window
- Public Sub New()
- InitializeComponent()
- End Sub
- End Class
-
- '
- ' The converter to group the items.
- Public Class GroupByPrice
- Implements IValueConverter
- Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
-
- If Not(TypeOf value Is Double) Then
- Return Nothing
- End If
-
- Dim itemPrice As Double = CDbl(value)
-
- If itemPrice < 100 Then
- Return 100
- End If
-
- If itemPrice < 250 Then
- Return 250
- End If
-
- If itemPrice < 500 Then
- Return 500
- End If
-
- Return 1000
-
-
-
- End Function
-
- Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
- Throw New NotImplementedException()
- End Function
- End Class
-
- ' The type of objects that are added to the ItemsControl.
- Public Class PurchaseItem
- Public Property Description() As String
- Public Property Price() As Double
- Public Property OfferExpires() As Date
-
- Public Sub New()
- End Sub
-
- Public Sub New(ByVal desc As String, ByVal price As Double, ByVal endDate As Date)
- Description = desc
- Me.Price = price
- OfferExpires = endDate
- End Sub
-
- Public Overrides Function ToString() As String
- Return String.Format("{0}, {1:c}, {2:D}", Description, Price, OfferExpires)
- End Function
- End Class
-
- ' The source of the ItemsControl.
- Public Class ItemsForSale
- Inherits ObservableCollection(Of PurchaseItem)
-
- Public Sub New()
- Add((New PurchaseItem("Snowboard and bindings", 120, New Date(2009, 1, 1))))
- Add((New PurchaseItem("Inside VB, second edition", 10, New Date(2009, 2, 2))))
- Add((New PurchaseItem("Laptop - only 1 year old", 499.99, New Date(2009, 2, 28))))
- Add((New PurchaseItem("Set of 6 chairs", 120, New Date(2009, 2, 28))))
- Add((New PurchaseItem("My DVD Collection", 15, New Date(2009, 1, 1))))
- Add((New PurchaseItem("TV Drama Series", 39.985, New Date(2009, 1, 1))))
- Add((New PurchaseItem("Squash racket", 60, New Date(2009, 2, 28))))
-
- End Sub
-
- End Class
- '
-
- 'TabControl.ContentStringFormat
- #Region "TabControlData"
- Public Class Student
- Implements IFormattable
-
- Public Property Name() As String
- Private Property Courses() As ObservableCollection(Of Course)
-
- Public Sub New()
- Me.New("")
-
- End Sub
-
- Public Sub New(ByVal name As String)
- Me.Name = name
- Courses = New ObservableCollection(Of Course)()
- End Sub
-
- ' Add a course to the student's schedule.
- Public Sub AddCourse(ByVal name As String, ByVal id As Integer, ByVal desc As String)
- Courses.Add(New Course(name, id, desc))
- End Sub
-
- '
- Public Overloads Function ToString(ByVal format As String, ByVal formatProvider As IFormatProvider) As String Implements IFormattable.ToString
- ' 'n': print the name only.
- If format = "n" Then
- Return Name
- End If
-
- ' 'cl': print the course list.
- If format = "cl" Then
- Dim stringFormat As String = "{0,-25}{1,-30}{2,-10}" & vbCrLf
-
- Dim str As New StringBuilder()
-
- str.AppendLine()
- str.AppendFormat(stringFormat, "Title", "Description", "ID")
- str.AppendLine()
-
- For Each c As Course In Courses
- str.AppendFormat(stringFormat, c.Title, c.Description, c.SectionID)
- Next c
-
- Return str.ToString()
- End If
-
- Return Me.ToString()
- End Function
- '
- End Class
-
- Public Class Course
- Public Property Title() As String
- Public Property SectionID() As Integer
- Public Property Description() As String
-
- Public Sub New()
- End Sub
-
- Public Sub New(ByVal title As String, ByVal section As Integer, ByVal desc As String)
- Me.Title = title
- SectionID = section
- Description = desc
- End Sub
- End Class
-
- Public Class Students
- Inherits ObservableCollection(Of Student)
- Public Sub New()
- Dim s1 As New Student("Sunil Uppal")
- s1.AddCourse("Calculus 303", 19, "Advanced Calculus")
- s1.AddCourse("History 110", 35, "Introduction to World History")
- s1.AddCourse("Psychology 110", 40, "Behavioral Psychology")
- s1.AddCourse("Physical Education 204", 80, "Racquetball")
- Me.Add(s1)
-
- Dim s2 As New Student("Alice Ciccu")
- s2.AddCourse("English 200", 50, "Advanced Composition")
- s2.AddCourse("English 315", 100, "Shakespear's Sonnets")
- s2.AddCourse("History 230", 38, "European History 1000-1500")
- Me.Add(s2)
-
-
- Dim s3 As New Student("Jeff Price")
- s3.AddCourse("History 230", 38, "European History 1000-1500")
- s3.AddCourse("History 110", 35, "Introduction to World History")
- s3.AddCourse("Physical Education 204", 80, "Racquetball")
- Me.Add(s3)
-
-
- End Sub
- End Class
-
- #End Region
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/DrawingAttributesSample.vbproj b/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/DrawingAttributesSample.vbproj
deleted file mode 100644
index 8b6862026f6..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/DrawingAttributesSample.vbproj
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
- Debug
- AnyCPU
- {1CAEAC80-B18F-4C82-816A-D17BED2AAC78}
- WinExe
- DrawingAttributesSample
- DrawingAttributesSample
-
- v4.8
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
- 10.0.20821
-
-
- true
- full
- true
- true
- true
- bin\
- DrawingAttributesSample.xml
- 42016,42017,42018,42019,42032,42314
-
-
- false
- false
- true
- false
- true
- bin\
- DrawingAttributesSample.xml
- 42016,42017,42018,42019,42032,42314
-
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- Code
-
-
-
- VbMyResourcesResXFileCodeGenerator
- Resources.Designer.vb
- My.Resources
- Designer
-
-
- SettingsSingleFileGenerator
- Settings.Designer.vb
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.5
- false
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/AssemblyInfo.vb b/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/AssemblyInfo.vb
deleted file mode 100644
index 681912667fd..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/AssemblyInfo.vb
+++ /dev/null
@@ -1,58 +0,0 @@
-Imports System.Reflection
-Imports System.Runtime.InteropServices
-Imports System.Globalization
-Imports System.Resources
-Imports System.Windows
-
-' 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
-
-
-
-
-
-
-
-
-
-'In order to begin building localizable applications, set
-'CultureYouAreCodingWith in your .vbproj file
-'inside a . For example, if you are using US english
-'in your source files, set the to "en-US". Then uncomment the
-'NeutralResourceLanguage attribute below. Update the "en-US" in the line
-'below to match the UICulture setting in the project file.
-
-'
-
-
-'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
-'1st parameter: where theme specific resource dictionaries are located
-'(used if a resource is not found in the page,
-' or application resource dictionaries)
-
-'2nd parameter: where the generic resource dictionary is located
-'(used if a resource is not found in the page,
-'app, and any theme specific resource dictionaries)
-
-
-
-
-'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/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/MyEvents.vb b/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/MyEvents.vb
deleted file mode 100644
index 0fd4598d1c9..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/MyEvents.vb
+++ /dev/null
@@ -1,13 +0,0 @@
-Namespace My
- Partial Friend Class MyApplication
-
- 'Use the editor window dropdowns in the Application pane of the Project Designer to handle MyApplication Events
- '
- 'Startup: Raised when the application starts, before the startup form is created.
- 'Shutdown: Raised after all application forms are closed. This event is not raised if the application is terminating abnormally.
- 'UnhandledException: Raised if the application encounters an unhandled exception.
- 'StartupNextInstance: Raised when launching a single-instance application and the application is already active.
- 'NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
-
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/Resources.Designer.vb b/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/Resources.Designer.vb
deleted file mode 100644
index eddcf2c1068..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/Resources.Designer.vb
+++ /dev/null
@@ -1,61 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3031
-'
-' 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.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("DrawingAttributesSample.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/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/Settings.Designer.vb b/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/Settings.Designer.vb
deleted file mode 100644
index 28cfeb597d7..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/My Project/Settings.Designer.vb
+++ /dev/null
@@ -1,71 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3031
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict On
-Option Explicit On
-
-
-
- _
-Partial Friend NotInheritable Class Settings
- Inherits Global.System.Configuration.ApplicationSettingsBase
-
- Private Shared defaultInstance As Settings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New Settings),Settings)
-
-#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 Settings
- 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
-
-Namespace My
-
- _
- Friend Module MySettingsProperty
-
- _
- Friend ReadOnly Property Settings() As Global.DrawingAttributesSample.Settings
- Get
- Return Global.DrawingAttributesSample.Settings.Default
- End Get
- End Property
- End Module
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/MyApp.xaml.vb b/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/MyApp.xaml.vb
deleted file mode 100644
index 26a48994221..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/MyApp.xaml.vb
+++ /dev/null
@@ -1,11 +0,0 @@
-' Interaction logic for MyApp.xaml
-Partial Public Class MyApp
- Inherits Application
-
- Private Sub AppStartup(ByVal sender As Object, ByVal e As StartupEventArgs) Handles Me.Startup
- Dim mainWindow As Window1 = New Window1
- mainWindow.Show()
- End Sub
-
-End Class
-
diff --git a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/Window1.xaml.vb b/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/Window1.xaml.vb
deleted file mode 100644
index 4c7f5f2c0d5..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/InkCanvas/Overview/Window1.xaml.vb
+++ /dev/null
@@ -1,371 +0,0 @@
-
-Imports System.IO
-Imports System.Windows
-Imports System.Windows.Controls
-Imports System.Windows.Data
-Imports System.Windows.Documents
-Imports System.Windows.Media
-Imports System.Windows.Shapes
-Imports System.Windows.Ink
-
-'/
-'/ Interaction logic for Window1.xaml
-'/
-
-Partial Public Class Window1
- Inherits Window
-
- '
- Private WithEvents inkCanvas1 As New InkCanvas()
- Private inkDA As DrawingAttributes
- Private highlighterDA As DrawingAttributes
- Private useHighlighter As Boolean = False
-
- ' Add an InkCanvas to the window, and allow the user to
- ' switch between using a green pen and a purple highlighter
- ' on the InkCanvas.
- Private Sub WindowLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
-
- inkCanvas1.Background = Brushes.DarkSlateBlue
- inkCanvas1.DefaultDrawingAttributes.Color = Colors.SpringGreen
-
- ' Add the InkCanvas to the DockPanel, named root.
- root.Children.Add(inkCanvas1)
-
- ' Set up the DrawingAttributes for the pen.
- inkDA = New DrawingAttributes()
- With inkDA
- .Color = Colors.SpringGreen
- .Height = 5
- .Width = 5
- .FitToCurve = True
- End With
-
- ' Set up the DrawingAttributes for the highlighter.
- highlighterDA = New DrawingAttributes()
- With highlighterDA
- .Color = Colors.Orchid
- .IsHighlighter = True
- .IgnorePressure = True
- .StylusTip = StylusTip.Rectangle
- .Height = 30
- .Width = 10
- End With
-
- inkCanvas1.DefaultDrawingAttributes = inkDA
-
- End Sub
-
-
- ' Create a button called switchHighlighter and use
- ' SwitchHighlighter_Click to handle the Click event.
- ' The useHighlighter variable is a boolean that indicates
- ' whether the InkCanvas renders ink as a highlighter.
-
- '
- ' Switch between using the 'pen' DrawingAttributes and the
- ' 'highlighter' DrawingAttributes when the user clicks on .
- Private Sub SwitchHighlighter_Click(ByVal sender As [Object], ByVal e As RoutedEventArgs)
-
- useHighlighter = Not useHighlighter
-
- If useHighlighter Then
- switchHighlighter.Content = "Use Pen"
- inkCanvas1.DefaultDrawingAttributes = highlighterDA
- Else
-
- switchHighlighter.Content = "Use Highlighter"
- inkCanvas1.DefaultDrawingAttributes = inkDA
- End If
-
- End Sub
- '
-
- '
-
- '
- Private Sub inkDA_AttributeChanged(ByVal sender As Object, _
- ByVal e As PropertyDataChangedEventArgs)
-
- If (e.PropertyGuid = DrawingAttributeIds.Color) Then
- Me.Title = "The pen color is: " + e.NewValue.ToString()
- End If
-
- End Sub
- '
-
- Private Sub InitializeAllProperties()
- '
- ' Set up the DrawingAttributes for the pen.
- inkDA = New Ink.DrawingAttributes()
- With inkDA
- .Color = Colors.SpringGreen
- .Height = 5
- .Width = 5
- .FitToCurve = True
- .StylusTipTransform = New Matrix(1, 0, 0, 1, 20, 0)
- End With
-
- ' Set up the DrawingAttributes for the highlighter.
- highlighterDA = New Ink.DrawingAttributes()
- With highlighterDA
- .Color = Colors.Orchid
- .IsHighlighter = True
- .IgnorePressure = True
- .StylusTip = StylusTip.Rectangle
- .Height = 30
- .Width = 10
- End With
-
- inkCanvas1.DefaultDrawingAttributes = inkDA
- '
- End Sub
-
- Public Sub New()
- InitializeComponent()
- 'AddHandler inkCanvas1.StrokeCollected, AddressOf inkCanvas1_StrokeCollected
- AddHandler inkCanvas1.Strokes.StrokesChanged, AddressOf Strokes_StrokesChanged
- AddHandler inkCanvas1.StrokeErasing, AddressOf inkCanvas1_StrokeErasing
- AddHandler inkCanvas1.DefaultDrawingAttributesReplaced, AddressOf inkCanvas1_DefaultDrawingAttributesReplaced
- ' TODO: Remove from when the PropertyData is fixed.
- 'AddHandler inkDA.AttributeChanged, AddressOf inkDA_AttributeChanged
-
- 'Uncomment the following line to assign custom properties.
- 'AssignDrawingAttributesInstrument()
-
- End Sub
-
- '
- Private Sub inkCanvas1_DefaultDrawingAttributesReplaced(ByVal sender As Object, _
- ByVal e As DrawingAttributesReplacedEventArgs)
-
- If (e.NewDrawingAttributes.IsHighlighter) Then
-
- Me.Title = "Now using a highlighter."
-
- Else
-
- Me.Title = "Now using a pen."
-
- End If
-
- End Sub
- '
-
- '
- Private Sub inkCanvas1_StrokeErasing(ByVal sender As Object, _
- ByVal e As InkCanvasStrokeErasingEventArgs)
-
- If (e.Stroke.DrawingAttributes.IsHighlighter) Then
- e.Cancel = True
-
- End If
- End Sub
- '
-
- '
- Dim currentTimeGuid As Guid = New Guid("12345678-1234-1234-1234-123456789012")
-
- Private Sub Strokes_StrokesChanged(ByVal sender As Object, _
- ByVal args As StrokeCollectionChangedEventArgs)
-
- Dim s As Stroke
-
- For Each s In args.Added
- s.AddPropertyData(currentTimeGuid, DateTime.Now)
- Next
-
- End Sub
- '
-
- Private Sub inkCanvas1_StrokeCollected(ByVal sender As Object, ByVal e As InkCanvasStrokeCollectedEventArgs)
-
- End Sub
-
- Private Sub SaveStrokes_Click(ByVal sender As [Object], ByVal e As RoutedEventArgs)
-
- 'Dim isf As [Byte]() = inkCanvas1.Strokes.Save(PersistenceFormat.InkSerializedFormat, CompressionMode.Maximum)
-
- 'Dim fs As New FileStream("strokes.isf", FileMode.Create)
- 'fs.Write(isf, 0, isf.Length)
- 'fs.Close()
-
- End Sub
-
- Private Sub LoadStrokes_Click(ByVal sender As [Object], ByVal e As RoutedEventArgs)
-
- 'If Not File.Exists("strokes.isf") Then
- ' MessageBox.Show("""strokes.isf"" does not exist." + _
- ' " Save the StrokeCollection before loading it.")
- ' Return
- 'End If
-
- 'Dim buffer(9999) As [Byte]
- 'Dim fs As New FileStream("strokes.isf", FileMode.Open, _
- ' FileAccess.Read)
- 'fs.Read(buffer, 0, buffer.Length)
- 'fs.Close()
-
- 'Dim strokes As New StrokeCollection(buffer)
- 'inkCanvas1.Strokes = strokes
-
- End Sub
- 'ChangeAuthorsInk(aGuid, anAuthor, Colors.Red);
-
- '
- Private purposeGuid As New Guid("12345678-9012-3456-7890-123456789012")
- Private penValue As String = "pen"
- Private highlighterValue As String = "highlighter"
-
- ' Add a property to each DrawingAttributes object to
- ' specify its use.
- Private Sub AssignDrawingAttributesInstrument()
-
- inkDA.AddPropertyData(purposeGuid, penValue)
- highlighterDA.AddPropertyData(purposeGuid, highlighterValue)
-
- End Sub
-
- ' Change the color of the ink that on the InkCanvas that used the pen.
- Private Sub ChangeColors_Click(ByVal sender As [Object], _
- ByVal e As RoutedEventArgs)
-
- Dim s As Stroke
-
- For Each s In inkCanvas1.Strokes
- If s.DrawingAttributes.ContainsPropertyData(purposeGuid) Then
-
- Dim data As Object = s.DrawingAttributes.GetPropertyData(purposeGuid)
-
- If TypeOf data Is String AndAlso CStr(data) = penValue Then
- s.DrawingAttributes.Color = Colors.Black
- End If
-
- End If
- Next s
-
- End Sub
-
- '
-
- Private Sub ChangePenColors_Click(ByVal sender As [Object], _
- ByVal e As RoutedEventArgs)
-
- If inkCanvas1.DefaultDrawingAttributes.Color = Colors.Black Then
- inkDA.Color = Colors.AntiqueWhite
- Else
- inkDA.Color = Colors.Black
- End If
-
- End Sub
-
- Private Sub ClearStrokes_Click(ByVal sender As [Object], ByVal e As RoutedEventArgs)
- inkCanvas1.Strokes.Clear()
- GetPropertyIds()
-
- End Sub
-
- Sub GetPropertyIds()
-
- '
- Dim propertyIds() As Guid
- propertyIds = inkDA.GetPropertyDataIds()
- '
- End Sub
-
- '
- Sub CopyAttributes(ByVal someStroke As Stroke)
- Dim attributes As New DrawingAttributes()
- attributes.Color = Colors.Red
- someStroke.DrawingAttributes = attributes.Clone()
- End Sub
- '
-
- '
- Private customProperty As New Guid("12345678-9012-3456-7890-123456789012")
-
- Sub RemovePropertyDataId(ByVal attributes As Ink.DrawingAttributes)
-
- If attributes.ContainsPropertyData(customProperty) Then
- attributes.RemovePropertyData(customProperty)
- End If
-
- End Sub
- '
-
- Private Sub AttributesEqual()
-
- '
- Dim attributes1 As New DrawingAttributes()
- attributes1.Color = Colors.Blue
- attributes1.StylusTip = StylusTip.Rectangle
- attributes1.Height = 5
- attributes1.Width = 5
-
- Dim attributes2 As New DrawingAttributes()
- attributes2.Color = Colors.Blue
- attributes2.StylusTip = StylusTip.Rectangle
- attributes2.Height = 5
- attributes2.Width = 5
- '
-
- '
- If attributes1 = attributes2 Then
- MessageBox.Show("The DrawingAttributes are equal")
- Else
- MessageBox.Show("The DrawingAttributes are not equal")
- End If
- '
-
- '
- If attributes1.Equals(attributes2) Then
- MessageBox.Show("The DrawingAttributes are equal")
- Else
- MessageBox.Show("The DrawingAttributes are not equal")
- End If
- '
-
- '
- If attributes1 <> attributes2 Then
- MessageBox.Show("The DrawingAttributes are not equal")
- Else
- MessageBox.Show("The DrawingAttributes are equal")
- End If
- '
- End Sub
-
- Private Sub ValidateHeightAndWidth()
- Dim DAHeight As Double = 100
- Dim DAWidth As Double = 100
-
- '
- If DAHeight < DrawingAttributes.MinHeight Then
-
- DAHeight = DrawingAttributes.MinHeight
-
- ElseIf DAHeight > DrawingAttributes.MaxHeight Then
-
- DAHeight = DrawingAttributes.MaxHeight
-
- End If
-
- inkCanvas1.DefaultDrawingAttributes.Height = DAHeight
- '
-
- '
- If DAWidth < DrawingAttributes.MinWidth Then
-
- DAWidth = DrawingAttributes.MinWidth
-
- ElseIf DAWidth > DrawingAttributes.MaxWidth Then
-
- DAWidth = DrawingAttributes.MaxWidth
-
- End If
-
- inkCanvas1.DefaultDrawingAttributes.Width = DAWidth
- '
- End Sub
-
-
-End Class
diff --git a/snippets/visualbasic/System.Windows.Controls/Page/Overview/codepage.vb b/snippets/visualbasic/System.Windows.Controls/Page/Overview/codepage.vb
deleted file mode 100644
index f29fa8a6cc5..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/Page/Overview/codepage.vb
+++ /dev/null
@@ -1,10 +0,0 @@
-'
-
-Imports System.Windows.Controls
-
-Public Class CodePage
- Inherits Page
- Public Sub New()
- End Sub
-End Class
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Controls/Page/Overview/homepage.xaml.vb b/snippets/visualbasic/System.Windows.Controls/Page/Overview/homepage.xaml.vb
deleted file mode 100644
index 7c5b71f951d..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/Page/Overview/homepage.xaml.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-'
-
-Imports System.Windows
-Imports System.Windows.Controls
-
-Namespace VisualBasic
- Partial Public Class HomePage
- Inherits Page
- Public Sub New()
- InitializeComponent()
-
- Me.WindowTitle = "Hello, Page!"
- Me.WindowWidth = 500
- Me.WindowHeight = 300
- End Sub
-
- End Class
-End Namespace
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Controls/Page/Overview/markupandcodebehindpage.xaml.vb b/snippets/visualbasic/System.Windows.Controls/Page/Overview/markupandcodebehindpage.xaml.vb
deleted file mode 100644
index 79f27626ec4..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/Page/Overview/markupandcodebehindpage.xaml.vb
+++ /dev/null
@@ -1,11 +0,0 @@
-'
-
-Imports System.Windows.Controls
-
-Partial Public Class MarkupAndCodeBehindPage
- Inherits Page
- Public Sub New()
- InitializeComponent()
- End Sub
-End Class
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Controls/Page/Overview/my project/assemblyinfo.vb b/snippets/visualbasic/System.Windows.Controls/Page/Overview/my project/assemblyinfo.vb
deleted file mode 100644
index 731a8669d01..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/Page/Overview/my project/assemblyinfo.vb
+++ /dev/null
@@ -1,51 +0,0 @@
-#Region "Using directives"
-
-Imports System.Reflection
-Imports System.Runtime.CompilerServices
-Imports System.Resources
-Imports System.Globalization
-Imports System.Windows
-Imports System.Runtime.InteropServices
-
-#End Region
-
-' 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.
-
-
-
-
-
-
-
-
-
-
-'In order to begin building localizable applications, set
-'CultureYouAreCodingWith in your .vbproj file
-'inside a . For example, if you are using US english
-'in your source files, set the to en-US. Then uncomment
-'the NeutralResourceLanguage attribute below. Update the "en-US" in
-'the line below to match the UICulture setting in the project file.
-
-'[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
- '(used if a resource is not found in the page,
- ' or application resource dictionaries)
- '(used if a resource is not found in the page,
- ' app, or any theme specific resource dictionaries)
- 'where the generic resource dictionary is located - where theme specific resource dictionaries are located
-
-
-' 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 Revision and Build Numbers
-' by using the '*' as shown below:
-
diff --git a/snippets/visualbasic/System.Windows.Controls/Page/Overview/my project/resources.designer.vb b/snippets/visualbasic/System.Windows.Controls/Page/Overview/my project/resources.designer.vb
deleted file mode 100644
index 107e11a1731..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/Page/Overview/my project/resources.designer.vb
+++ /dev/null
@@ -1,62 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.1416
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-
-Namespace My.Resources
-
-
- '''
- ''' A strongly-typed resource class, for looking up localized strings, etc.
- '''
- ' 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.
-
- Friend Module Resources
-
- Private resourceMan As Global.System.Resources.ResourceManager
-
- Private resourceCulture As Global.System.Globalization.CultureInfo
-
-' internal Resources()
-' {
-' }
-
- '''
- ''' 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 New Global.System.Resources.ResourceManager("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(ByVal value As System.Globalization.CultureInfo)
- resourceCulture = value
- End Set
- End Property
- End Module
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Controls/Page/Overview/my project/settings.designer.vb b/snippets/visualbasic/System.Windows.Controls/Page/Overview/my project/settings.designer.vb
deleted file mode 100644
index 2778274b6ca..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/Page/Overview/my project/settings.designer.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.1416
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-
-Namespace My
-
-
-
- Friend NotInheritable Partial Class Settings
- Inherits System.Configuration.ApplicationSettingsBase
-
- Private Shared defaultInstance As Settings = (CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New Settings()), Settings))
-
- Public Shared ReadOnly Property [Default]() As Settings
- Get
- Return defaultInstance
- End Get
- End Property
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Controls/Page/Overview/pagesnippets.vbproj b/snippets/visualbasic/System.Windows.Controls/Page/Overview/pagesnippets.vbproj
deleted file mode 100644
index dbe07fb5fab..00000000000
--- a/snippets/visualbasic/System.Windows.Controls/Page/Overview/pagesnippets.vbproj
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
- Debug
- AnyCPU
- {CAFA2E63-4246-49BC-8299-072856BD3400}
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
-
- VisualBasic
- winexe
-
- v4.8
- On
- Binary
- Off
- On
- http://localhost/CSharp/
- true
- Web
- true
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- true
- false
- false
-
- 10.0.20821
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
-
-
- false
- true
- .\bin\Release\
- false
- true
-
-
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
-
-
-
-
-
- Code
- HomePage.xaml
-
-
- Code
- MarkupAndCodeBehindPage.xaml
-
-
-
- ResXFileCodeGenerator
- Designer
- Resources.Designer.vb
-
-
- SettingsSingleFileGenerator
- Settings.Designer.vb
-
-
- True
- True
- Resources.resx
-
-
- True
- True
- Settings.settings
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.5
- false
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Documents/Hyperlink/Overview/hyperlinksnippets.vbproj b/snippets/visualbasic/System.Windows.Documents/Hyperlink/Overview/hyperlinksnippets.vbproj
deleted file mode 100644
index bbab5bb0d6e..00000000000
--- a/snippets/visualbasic/System.Windows.Documents/Hyperlink/Overview/hyperlinksnippets.vbproj
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
- Debug
- AnyCPU
-
-
- HyperlinkSnippets
- winexe
- v4.8
- On
- Binary
- Off
- On
-
- 10.0.20821
- {2431D3E3-6695-42BB-946F-236ED5A3D7E4}
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- AllRules.ruleset
-
-
- false
- true
- .\bin\Release\
- false
- true
- AllRules.ruleset
-
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MyApp.xaml
- Code
-
-
- Window1.xaml
- Code
-
-
-
-
- False
- Microsoft .NET Framework 4 Client Profile %28x86 and x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
- False
- Microsoft Visual Basic PowerPacks 10.0
- true
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Documents/Hyperlink/Overview/myapp.xaml.vb b/snippets/visualbasic/System.Windows.Documents/Hyperlink/Overview/myapp.xaml.vb
deleted file mode 100644
index baebf4ed0ed..00000000000
--- a/snippets/visualbasic/System.Windows.Documents/Hyperlink/Overview/myapp.xaml.vb
+++ /dev/null
@@ -1,13 +0,0 @@
-Imports System.Xml
-Imports System.Configuration
-
-Namespace HyperlinkSnippets
- '''
- ''' Interaction logic for MyApp.xaml
- '''
-
- Partial Public Class MyApp
- Inherits Application
-
- End Class
-End Namespace
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Documents/Hyperlink/Overview/window1.xaml.vb b/snippets/visualbasic/System.Windows.Documents/Hyperlink/Overview/window1.xaml.vb
deleted file mode 100644
index 640ba8c7b59..00000000000
--- a/snippets/visualbasic/System.Windows.Documents/Hyperlink/Overview/window1.xaml.vb
+++ /dev/null
@@ -1,90 +0,0 @@
-Namespace HyperlinkSnippets
- '''
- ''' Interaction logic for Window1.xaml
- '''
-
- Partial Public Class Window1
- Inherits Window
-
- Public Sub New()
- InitializeComponent()
- End Sub
-
- Private Sub WindowLoaded(ByVal sender As Object, ByVal args As RoutedEventArgs)
- Constructors()
- End Sub
-
- Private Sub Constructors()
- With True
- '
- ' A child Inline element for the new Hyperlink element.
- Dim runx As New Run("Link text for the Hyperlink element.")
-
- ' After this line executes, the new element "hyper1"
- ' contains the specified Inline element, "runx".
- Dim hyperl As New Hyperlink(runx)
- '
- End With
-
- With True
- '
- ' A child Inline element for the new Hyperlink element.
- Dim runx As New Run("Link text for the Hyperlink element.")
-
- ' An empty paragraph will serve as the container for the new Hyperlink element.
- Dim parx As New Paragraph()
-
- ' After this line executes, the new element "hyperl"
- ' contains the specified Inline element, "runx". Also, "hyperl" is
- ' inserted at the point indicated by the insertionPosition parameter,
- ' which in this case indicates the content start position in the Paragraph
- ' element "parx".
- Dim hyperl As New Hyperlink(runx, parx.ContentStart)
- '
- End With
- With True
- '
- ' Create a paragraph and three text runs to serve as example content.
- Dim parx As New Paragraph()
- Dim run1 As New Run("Text run 1.")
- Dim run2 As New Run("Text to link.")
- Dim run3 As New Run("Text run 3.")
-
- ' Add the three text runs to the paragraph, separated by linebreaks.
- parx.Inlines.Add(run1)
- parx.Inlines.Add(New LineBreak())
- parx.Inlines.Add(run2)
- parx.Inlines.Add(New LineBreak())
- parx.Inlines.Add(run3)
-
- ' After this line executes, the selection of content
- ' indicated by the "start" and "end" parameters will be
- ' enclosed by the new Hyperlink. In this case, the new Hyperlink
- ' will enclose the entire contents of the text run "run2".
- Dim hyperl As New Hyperlink(run2.ContentStart, run2.ContentEnd)
- '
-
- flowDoc.Blocks.Add(parx)
- End With
-
-
-
- End Sub
-
- Private Sub Props()
- '
- Dim parx As New Paragraph()
- Dim run1 As New Run("Text preceeding the hyperlink.")
- Dim run2 As New Run("Text following the hyperlink.")
- Dim run3 As New Run("Link Text.")
-
- Dim hyperl As New Hyperlink(run3)
- hyperl.NavigateUri = New Uri("http://search.msn.com")
-
- parx.Inlines.Add(run1)
- parx.Inlines.Add(hyperl)
- parx.Inlines.Add(run2)
- '
- End Sub
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/CustomRenderedStroke.vb b/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/CustomRenderedStroke.vb
deleted file mode 100644
index 5a2846cd872..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/CustomRenderedStroke.vb
+++ /dev/null
@@ -1,73 +0,0 @@
-
-Imports System.Collections.Generic
-Imports System.Text
-Imports System.Windows
-Imports System.Windows.Ink
-Imports System.Windows.Input
-Imports System.Windows.Media
-
-'
-
-Class ShadowedStroke
- Inherits Stroke
-
- Private shadow As New Guid("12345678-9012-3456-7890-123456789012")
-
- Public Sub New(ByVal stylusPoints As StylusPointCollection, ByVal drawingAttributes As DrawingAttributes)
- MyBase.New(stylusPoints, drawingAttributes)
-
- AddHandler Me.DrawingAttributes.PropertyDataChanged, AddressOf DrawingAttributes_PropertyDataChanged
-
- End Sub
-
- Public Property Shadowed() As Boolean
-
- ' Return the value of the custom property, shadow.
- ' If there is no custom property, return false.
- Get
- If Not Me.DrawingAttributes.ContainsPropertyData(shadow) Then
- Return False
- End If
-
- Dim propertyData As Object = Me.DrawingAttributes.GetPropertyData(shadow)
-
- If TypeOf propertyData Is Boolean Then
- Return CType(propertyData, Boolean)
- Else
- Return False
- End If
- End Get
-
- ' Set the value of the custom property.
- Set
- Me.DrawingAttributes.AddPropertyData(shadow, value)
- End Set
-
- End Property
-
-
- Private Sub DrawingAttributes_PropertyDataChanged(ByVal sender As Object, ByVal e As PropertyDataChangedEventArgs)
-
- Me.OnInvalidated(New EventArgs())
-
- End Sub
-
- Protected Overrides Sub DrawCore(ByVal context As System.Windows.Media.DrawingContext, _
- ByVal overriddenAttributes As DrawingAttributes)
- ' create a drop shadow
- '
- If Me.Shadowed Then
- Dim pathGeometry As Geometry = Me.GetGeometry(overriddenAttributes).Clone()
- pathGeometry.Transform = New TranslateTransform(5, 0)
- Try
- context.PushOpacity(0.5)
- context.DrawGeometry(Brushes.DarkGray, Nothing, pathGeometry)
- Finally
- context.Pop()
- End Try
- End If
- MyBase.DrawCore(context, overriddenAttributes)
-
- End Sub
-End Class
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/Ink3d.vb b/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/Ink3d.vb
deleted file mode 100644
index c3d48f0d8f5..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/Ink3d.vb
+++ /dev/null
@@ -1,188 +0,0 @@
-
-Imports System.Windows
-Imports System.Windows.Controls
-Imports System.Windows.Media
-Imports System.Windows.Ink
-Imports System.Windows.Input
-Imports System.Collections
-Imports System.Windows.Input.StylusPlugIns
-
-
-' This control allows the user to input ink and display it
-' with 3d visual effects.
-
-Public Class Ink3d
- Inherits Border
-
- Private inkDA As DrawingAttributes
- Private presenter As InkPresenter
- Private stylusPoints As StylusPointCollection
- Private renderer As New DynamicRenderer()
-
- Public Sub New()
-
- ' Use an InkPresenter to display the strokes on the control.
- presenter = New InkPresenter()
- Me.Child = presenter
-
- inkDA = New DrawingAttributes()
- inkDA.Width = 5
- inkDA.Height = 5
- 'inkDA.AddPropertyData(shadow, false);
- 'inkDA.PropertyDataChanged += new PropertyDataChangedEventHandler(inkDA_PropertyDataChanged);
- renderer.DrawingAttributes = inkDA
- Me.StylusPlugIns.Add(renderer)
- presenter.AttachVisuals(renderer.RootVisual, renderer.DrawingAttributes)
-
- End Sub
-
-
- Shared Sub New()
- ' Allow ink to be drawn only within the bounds of the control.
- Dim owner As Type = GetType(Ink3d)
- ClipToBoundsProperty.OverrideMetadata(owner, New FrameworkPropertyMetadata(True))
-
- End Sub
-
-
-
-
- ' Remove all the strokes from the control.
- Public Sub ClearStrokes()
- presenter.Strokes.Clear()
-
- End Sub
-
-
-
-
- Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs)
-
- MyBase.OnStylusDown(e)
-
- stylusPoints = New StylusPointCollection()
-
- stylusPoints.Add(e.GetStylusPoints(Me, stylusPoints.Description))
-
- End Sub
-
-
-
-
- Protected Overrides Sub OnStylusMove(ByVal e As StylusEventArgs)
-
- MyBase.OnStylusMove(e)
-
- If stylusPoints Is Nothing Then
- stylusPoints = New StylusPointCollection()
- End If
- stylusPoints.Add(e.GetStylusPoints(Me, stylusPoints.Description))
-
- End Sub
-
-
-
-
- Protected Overrides Sub OnStylusUp(ByVal e As StylusEventArgs)
-
- MyBase.OnStylusUp(e)
-
- If stylusPoints Is Nothing Then
- stylusPoints = New StylusPointCollection()
- End If
- stylusPoints.Add(e.GetStylusPoints(Me, stylusPoints.Description))
-
- AddStroke()
-
- End Sub
-
-
-
- Protected Overrides Sub OnMouseLeftButtonUp(ByVal e As MouseButtonEventArgs)
-
- MyBase.OnMouseLeftButtonUp(e)
-
- If Not (e.StylusDevice Is Nothing) Then
- Return
- End If
- If stylusPoints Is Nothing Then
- stylusPoints = New StylusPointCollection()
- End If
- Dim pt As Point = e.GetPosition(Me)
-
- stylusPoints.Add(New StylusPoint(pt.X, pt.Y))
-
- AddStroke()
-
- End Sub
-
-
-
- Protected Overrides Sub OnMouseLeftButtonDown(ByVal e As MouseButtonEventArgs)
-
- MyBase.OnMouseLeftButtonDown(e)
-
- If Not (e.StylusDevice Is Nothing) Then
- Return
- End If
- stylusPoints = New StylusPointCollection()
-
- Dim pt As Point = e.GetPosition(Me)
-
- stylusPoints.Add(New StylusPoint(pt.X, pt.Y))
-
- End Sub
-
-
-
-
- Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
-
- MyBase.OnMouseMove(e)
-
- If Not (e.StylusDevice Is Nothing) Then
- Return
- End If
- If e.LeftButton = MouseButtonState.Released Then
- Return
- End If
- If stylusPoints Is Nothing Then
- stylusPoints = New StylusPointCollection()
- End If
- Dim pt As Point = e.GetPosition(Me)
-
- stylusPoints.Add(New StylusPoint(pt.X, pt.Y))
-
- End Sub
-
-
-
- Private Sub AddStroke()
- Dim newStroke As New ShadowedStroke(stylusPoints, inkDA)
- newStroke.Shadowed = strokesAreShadowed
-
- presenter.Strokes.Add(newStroke)
-
- stylusPoints = Nothing
-
- End Sub
-
- Private strokesAreShadowed As Boolean
-
-
- Public Property Shadowed() As Boolean
- Get
- Return strokesAreShadowed
- End Get
-
- ' Set the value of the custom property.
- Set
- strokesAreShadowed = value
-
- Dim s As ShadowedStroke
- For Each s In presenter.Strokes
- s.Shadowed = strokesAreShadowed
- Next s
- End Set
- End Property
-End Class
diff --git a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/AssemblyInfo.vb b/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/AssemblyInfo.vb
deleted file mode 100644
index 0262a6e12f9..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/AssemblyInfo.vb
+++ /dev/null
@@ -1,34 +0,0 @@
-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/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/MyEvents.vb b/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/MyEvents.vb
deleted file mode 100644
index 0fd4598d1c9..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/MyEvents.vb
+++ /dev/null
@@ -1,13 +0,0 @@
-Namespace My
- Partial Friend Class MyApplication
-
- 'Use the editor window dropdowns in the Application pane of the Project Designer to handle MyApplication Events
- '
- 'Startup: Raised when the application starts, before the startup form is created.
- 'Shutdown: Raised after all application forms are closed. This event is not raised if the application is terminating abnormally.
- 'UnhandledException: Raised if the application encounters an unhandled exception.
- 'StartupNextInstance: Raised when launching a single-instance application and the application is already active.
- 'NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
-
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/MyResources.Designer.vb b/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/MyResources.Designer.vb
deleted file mode 100644
index 706736c64db..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/MyResources.Designer.vb
+++ /dev/null
@@ -1,61 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3031
-'
-' 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.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 MyResources
-
- 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("StrokeCollectionShadow.MyResources", GetType(MyResources).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/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/MySettings.Designer.vb b/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/MySettings.Designer.vb
deleted file mode 100644
index 270200cddc0..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/My Project/MySettings.Designer.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3031
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict On
-Option Explicit On
-
-
-
- _
-Partial Friend NotInheritable Class MySettings
- Inherits Global.System.Configuration.ApplicationSettingsBase
-
- Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings),MySettings)
-
- Public Shared ReadOnly Property [Default]() As MySettings
- Get
- Return defaultInstance
- End Get
- End Property
-End Class
diff --git a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/MyApp.xaml.vb b/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/MyApp.xaml.vb
deleted file mode 100644
index 71627158a9d..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/MyApp.xaml.vb
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Imports System.Windows
-Imports System.Data
-Imports System.Xml
-Imports System.Configuration
-
-
-'/
-'/ Interaction logic for MyApp.xaml
-'/
-
-Namespace StrokeCollectionShadow
- Class MyApp
- Inherits Application
-
- Private Sub AppStartingUp(ByVal sender As Object, ByVal e As StartupEventArgs)
- Dim mainWindow As New Window1()
- mainWindow.Show()
-
- End Sub
- End Class
-End Namespace
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/StrokeCollectionShadow.vbproj b/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/StrokeCollectionShadow.vbproj
deleted file mode 100644
index 2aa2c4411e1..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/StrokeCollectionShadow.vbproj
+++ /dev/null
@@ -1,158 +0,0 @@
-
-
- Debug
- AnyCPU
- {8E1B4E01-08F4-49EA-95FA-586EA9CC3AE7}
- WinExe
- $(OutputType)
- StrokeCollectionShadow
- StrokeCollectionShadow
- 10.0.20821
- 2.0
- en-US
- v4.8
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
-
- true
- full
- true
- true
- true
- bin\
- StrokeCollectionShadow.xml
- 42016,42017,42018,42019,42032,42314
-
-
- false
- false
- true
- false
- true
- bin\
- StrokeCollectionShadow.xml
- 42016,42017,42018,42019,42032,42314
-
-
-
-
-
-
-
-
- False
- ..\..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Windows\v6.0.5070\UIAutomationProvider.dll
-
-
- False
- ..\..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Windows\v6.0.5070\UIAutomationTypes.dll
-
-
-
-
-
- 4.0
-
-
- ..\..\..\..\WindowsFormsIntegration.dll
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code
-
-
- True
- True
- MyResources.resx
-
-
- Code
-
-
- True
- True
- MySettings.settings
-
-
- VbMyResourcesResXFileCodeGenerator
- My.Resources
- MyResources.Designer.vb
-
-
-
- SettingsSingleFileGenerator
- MySettings.Designer.vb
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.5
- false
-
-
- False
- Windows Installer 3.1
- true
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/Window1.xaml.vb b/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/Window1.xaml.vb
deleted file mode 100644
index 3f1b9ac303c..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/DrawingAttributes/PropertyDataChanged/Window1.xaml.vb
+++ /dev/null
@@ -1,38 +0,0 @@
-
-Imports System.Windows
-Imports System.Windows.Controls
-Imports System.Windows.Data
-Imports System.Windows.Documents
-Imports System.Windows.Media
-Imports System.Windows.Shapes
-
-
-
-'/
-'/ Interaction logic for Window1.xaml
-'/
-Namespace StrokeCollectionShadow
-
- Class Window1
- Inherits Window
-
- Dim myInkSelector As New Ink3d()
- Public Sub New()
- InitializeComponent()
-
-
- myInkSelector.Background = Brushes.Green
- root.Children.Add(myInkSelector)
-
- End Sub
-
-
- ' To use Loaded event put Loaded="WindowLoaded" attribute in root element of .xaml file.
- ' private void WindowLoaded(object sender, EventArgs e) {}
- ' Sample event handler:
- Private Sub Toggle3d_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- myInkSelector.Shadowed = Not myInkSelector.Shadowed
-
- End Sub
- End Class
-End Namespace
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/CustomRenderedStroke.vb b/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/CustomRenderedStroke.vb
deleted file mode 100644
index e71608485a3..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/CustomRenderedStroke.vb
+++ /dev/null
@@ -1,88 +0,0 @@
-
-Imports System.Collections.Generic
-Imports System.Text
-Imports System.Windows
-Imports System.Windows.Ink
-Imports System.Windows.Input
-Imports System.Windows.Media
-
-Namespace StrokeSnippets_VB
-
- '
- ' Enumerator that specifies the drawing mode of the stroke.
-
- Public Enum DrawingMode
- Solid
- StyulusPoints
- End Enum 'DrawingMode
- '
-
- Class CustomRenderedStroke
- Inherits MyStroke
-
- Public Sub New(ByVal points As StylusPointCollection)
- MyBase.New(points)
-
- End Sub
-
-
-
- Public Sub New(ByVal stylusPoints As StylusPointCollection, ByVal drawingAttributes As DrawingAttributes)
- MyBase.New(stylusPoints, drawingAttributes)
-
- End Sub
-
-
- '
- Private strokeMode As DrawingMode = DrawingMode.Solid
-
- ' Property that specifies whether to draw a solid stroke or the stylus points
- Public Property Mode() As DrawingMode
-
- Get
- Return strokeMode
- End Get
-
- Set(ByVal value As DrawingMode)
- If strokeMode <> value Then
- strokeMode = value
- Me.OnInvalidated(New EventArgs())
- End If
- End Set
-
- End Property
-
-
- Protected Overrides Sub DrawCore(ByVal context As System.Windows.Media.DrawingContext, _
- ByVal overridedAttributes As DrawingAttributes)
- Dim strokeBrush As New SolidColorBrush(overridedAttributes.Color)
-
- ' If strokeMode it set to Solid, draw the strokes regularly.
- ' Otherwise, draw the stylus points.
- If strokeMode = DrawingMode.Solid Then
- Dim geometry As Geometry = GetGeometry(overridedAttributes)
- context.DrawGeometry(strokeBrush, Nothing, geometry)
- ' strokeMode == DrawingMode.StylusPoints
- Else
- Dim points As StylusPointCollection
-
- ' Get the stylus points used to draw the stroke. The points used depends on
- ' the value of FitToCurve.
- If Me.DrawingAttributes.FitToCurve Then
- points = Me.GetBezierStylusPoints()
- Else
- points = Me.StylusPoints
- End If
-
- ' Draw a circle at each stylus point.
- Dim p As StylusPoint
- For Each p In points
- context.DrawEllipse(Nothing, New Pen(strokeBrush, 1), CType(p, Point), 5, 5)
- Next p
- End If
-
- End Sub
- '
-
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/AssemblyInfo.vb b/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/AssemblyInfo.vb
deleted file mode 100644
index 6a4df1c36f5..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/AssemblyInfo.vb
+++ /dev/null
@@ -1,34 +0,0 @@
-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/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/MyEvents.vb b/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/MyEvents.vb
deleted file mode 100644
index 0fd4598d1c9..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/MyEvents.vb
+++ /dev/null
@@ -1,13 +0,0 @@
-Namespace My
- Partial Friend Class MyApplication
-
- 'Use the editor window dropdowns in the Application pane of the Project Designer to handle MyApplication Events
- '
- 'Startup: Raised when the application starts, before the startup form is created.
- 'Shutdown: Raised after all application forms are closed. This event is not raised if the application is terminating abnormally.
- 'UnhandledException: Raised if the application encounters an unhandled exception.
- 'StartupNextInstance: Raised when launching a single-instance application and the application is already active.
- 'NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
-
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/MyResources.Designer.vb b/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/MyResources.Designer.vb
deleted file mode 100644
index 24e5ec69b59..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/MyResources.Designer.vb
+++ /dev/null
@@ -1,61 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3031
-'
-' 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.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 MyResources
-
- 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("StrokeSnippets_VB.MyResources", GetType(MyResources).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/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/MySettings.Designer.vb b/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/MySettings.Designer.vb
deleted file mode 100644
index 270200cddc0..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/My Project/MySettings.Designer.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3031
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict On
-Option Explicit On
-
-
-
- _
-Partial Friend NotInheritable Class MySettings
- Inherits Global.System.Configuration.ApplicationSettingsBase
-
- Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings),MySettings)
-
- Public Shared ReadOnly Property [Default]() As MySettings
- Get
- Return defaultInstance
- End Get
- End Property
-End Class
diff --git a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/MyApp.xaml.vb b/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/MyApp.xaml.vb
deleted file mode 100644
index 6083a7b199b..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/MyApp.xaml.vb
+++ /dev/null
@@ -1,36 +0,0 @@
-
-Imports System.Windows
-Imports System.Data
-Imports System.Xml
-Imports System.Configuration
-
-
-'/
-'/ Interaction logic for MyApp.xaml
-'/
-Namespace StrokeSnippets_VB
-
- Class MyApp
- Inherits Application
- '
- 'ToDo: Error processing original source shown below
- '
- ' public partial class MyApp : Application
- '------------^--- 'class', 'struct', 'interface' or 'delegate' expected
- '
- 'ToDo: Error processing original source shown below
- '
- ' public partial class MyApp : Application
- '--------------------^--- Syntax error: ';' expected
- Private Sub AppStartingUp(ByVal sender As Object, ByVal e As StartupEventArgs)
- Dim mainWindow As New Window1()
- mainWindow.Show()
-
- End Sub
- End Class
- '
- 'ToDo: Error processing original source shown below
- ' }
- '}
- '-^--- expression expected
-End Namespace
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/MyBorder.vb b/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/MyBorder.vb
deleted file mode 100644
index 5f666c8aff0..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/MyBorder.vb
+++ /dev/null
@@ -1,528 +0,0 @@
-
-Imports System.Collections
-Imports System.IO
-Imports System.Runtime.InteropServices
-Imports System.Windows
-Imports System.Windows.Controls
-Imports System.Windows.Ink
-Imports System.Windows.Input
-Imports System.Windows.Media
-Imports System.Windows.Input.StylusPlugIns
-
-
-Namespace StrokeSnippets_VB
-
- ' This control initializes with strokes already on it and allows the
- ' user to erase the strokes with the stylus.
- ' Need this in MyStroke
- _
- Public Class MyBorder
- Inherits Border
-
- Public Enum sMode
- add
- clip
- remove
- surround
- End Enum 'sMode
-
- Private _state As sMode
-
-
- Public Property state() As sMode
- Get
- Return _state
- End Get
- Set(ByVal value As sMode)
- _state = Value
- End Set
- End Property
-
- Private _shadow As Boolean
-
-
- Public Property shadow() As Boolean
- Get
- Return _shadow
- End Get
- Set(ByVal value As Boolean)
- _shadow = Value
- End Set
- End Property
-
- Private _fitToCurve As Boolean = False
-
-
- Public Property FitToCurve() As Boolean
- Get
- Return _fitToCurve
- End Get
-
- Set(ByVal value As Boolean)
- _fitToCurve = Value
- End Set
- End Property
-
-
- Private gotFirstStroke As Boolean
-
- ' To save strokes in a file
- Private myFile As StreamWriter
- Private Shared STROKE_FILE As String = "c:\temp\stroke"
-
- Private myStroke, shadowStroke As Stroke
- Private myNewStroke As MyStroke
- Private myStrokeCollection As StrokeCollection
- 'StylusPackets[] myStylusPacketsArray;
- Private stylusPoints As StylusPointCollection
- Private myIncrementalHitTester As IncrementalHitTester
- Private myInkPresenter As InkPresenter
- Private renderer As DynamicRenderer
-
- Private inkAttributes As DrawingAttributes
-
- ' The base-64 encoded string that contains ink data
- ' in ink serialized format (ISF).
- Private strokesString As String = "base64:AOoFAxBIEEVqGwIAWf9GahsCAFn/GRQyCACAEAIAAABCMwgAgA" + "wCAAAAQhWrqtNBq6rTQaVh0MSr+ivFHyEVVFVVVVV1OkBUVVVVVXU6QJ7" + "0SZ80DJrAVFVVVVV/pcAKU3yC/gEb+AX/k5Z8PwWBO5KktgJSUAAKjzyC" + "wBZYLEoCJLd+Cbti873JlTUvn158doCC/gKb+ApwAJslSywE2ALAAWPPI" + "FhKWBKWAKAmwJVglAKACiMjgv3d+8Xi+fHWM2WC0zcm89+NSoL+A5P4Dl" + "uNlhFIqpLKAAoaF4L+AhP4CFAWAWCggv4Dc/gNty2yy5SrlKAKIhyC/gI" + "b+Ai+JZc2XZOyb46vLQCC/gOL+A5YDNlWFjN3CwAKQFeC/gOr+A7VhUFZ" + "KCsS2WTc2SyhKuWVLR3ly2LAXx574ssUgv4Dm/gOcCwEEpUTYSixUsuWy" + "gVZ79AQsWGyWUAKLCiC/gQT+BA9SWbllDfGqy3Lcu+OmfH8EIL+BDv4EP" + "XLKSpY3lVFhZuVZvKACkFggv4F2/gXlKLFuCVKTcsqUlkoRKBmk8zfFll" + "S2ySlACwAgv4Ds/gO+WWWWLBLFllllSksAoSkWG1kSbFu5AoAAAo/YoL+" + "Biv4GJJU+P4qSalUBKWdkBYCbm+Nliyk1CVKgCxYNYqC/gQb+BBwO8ABY" + "olDz4gAEzaw2AVCUKAsWCooCiAegv4Hw/gfEJe8zUoSgLCC/gNT+A0xM7" + "Gdmdliay2VaAo0PoL+B7v4Hx5Yq3lc2xZsseeC3N8aDXjUpWW4UIL+A5P" + "4DnhYqAIWFkqpcrLZuJuWqSyxVAovNoL+CJP4IjnlkDvHeSbSVd9FqFlI" + "oWAAgv4Dk/gOVc7gbmdyZ1LajFFJmlRKsoAKVXmC/go7+CjdRvredypaK" + "myLC7ytZQqFiyWbikAEvfg2pSVKS7liSwWJNsrbi4CC/gQD+A/9M2ACxU" + "qKjcVuXKiosCWWKQSyhvKRUUWULCwEmyyu4gA="
-
-
- Public Sub New()
- gotFirstStroke = False
-
- ' Set the default state if no button is clicked
- state = sMode.add
- myInkPresenter = New InkPresenter()
-
- Child = myInkPresenter
-
- inkAttributes = New DrawingAttributes()
- inkAttributes.Color = Colors.Green
- inkAttributes.Width = 5
- inkAttributes.Height = 5
-
- renderer = New DynamicRenderer()
- renderer.DrawingAttributes = inkAttributes
- Me.StylusPlugIns.Add(renderer)
- myInkPresenter.AttachVisuals(renderer.RootVisual, renderer.DrawingAttributes)
-
- StrokeConstructorSample()
-
- End Sub
-
-
- Shared Sub New()
- ' Allow ink to be drawn only within the bounds of the control.
- Dim owner As Type = GetType(MyBorder)
- ClipToBoundsProperty.OverrideMetadata(owner, New FrameworkPropertyMetadata(True))
-
- End Sub
-
-
-
-
- ' Prepare to collect stylus packets. Get the
- ' IncrementalHitTester from the InkPresenter's
- ' StrokeCollection and subscribe to its StrokeHitChanged event.
- Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs)
- MyBase.OnStylusDown(e)
-
- Select Case state
- Case sMode.add
- Dim eventPoints As StylusPointCollection = e.GetStylusPoints(Me)
- stylusPoints = New StylusPointCollection(eventPoints.Description)
- Case sMode.surround
- ' Use StrokeChanged event handler to detect stroke encirclement when using percentage
- myIncrementalHitTester = myInkPresenter.Strokes.GetIncrementalLassoHitTester(50)
-
- AddHandler CType(myIncrementalHitTester, IncrementalLassoHitTester).SelectionChanged, AddressOf myIHT_StrokeHitChanged
-
- myIncrementalHitTester.AddPoints(e.GetStylusPoints(Me))
- Case Else
- ' Otherwise we detect when the IHT hits the existing strokes
- ' Use StrokeIntersectionChanged event handler to detect stroke hit when using stylus
- Dim eraserTip As New EllipseStylusShape(3, 3, 0)
-
- myIncrementalHitTester = myInkPresenter.Strokes.GetIncrementalStrokeHitTester(eraserTip)
-
- AddHandler CType(myIncrementalHitTester, IncrementalStrokeHitTester).StrokeHit, AddressOf myIHT_StrokeIntersectionChanged
-
- myIncrementalHitTester.AddPoints(e.GetStylusPoints(Me))
- End Select
-
- e.Handled = True
-
- End Sub
-
-
- ' Collect the StylusPackets as the stylus moves.
- Protected Overrides Sub OnStylusMove(ByVal e As StylusEventArgs)
- Select Case state
- Case sMode.add
- stylusPoints.Add(e.GetStylusPoints(Me))
- Case Else
- myIncrementalHitTester.AddPoints(e.GetStylusPoints(Me))
- End Select
-
- e.Handled = True
-
- End Sub
-
-
- ' Unsubscribe from the StrokeHitChanged event when the
- ' user lifts the stylus.
- Protected Overrides Sub OnStylusUp(ByVal e As StylusEventArgs)
- Select Case state
- Case sMode.add
- ' Add the stylus points to a StylusPointCollection
- ' in the StylusUp event. e is a StylusEventArgs object.
- stylusPoints.Add(e.GetStylusPoints(Me))
-
- ' Create new stroke from the collected stylus points.
- 'myNewStroke = new MyStroke(stylusPoints, inkAttributes.Clone());
- myNewStroke = New CustomRenderedStroke(stylusPoints, inkAttributes.Clone())
-
- '
- ' Handle DrawingAtributesChanged event on stroke
- AddHandler myNewStroke.DrawingAttributesChanged, AddressOf myNewStroke_DrawingAttributesChanged
- '
-
- '
- ' Handle DrawingAttributesReplaced event on stroke
- AddHandler myNewStroke.DrawingAttributesReplaced, AddressOf myNewStroke_DrawingAttributesReplaced
- '
-
- AddHandler myNewStroke.StylusPointsChanged, AddressOf myNewStroke_StylusPointsChanged
- AddHandler myNewStroke.StylusPointsReplaced, AddressOf myNewStroke_StylusPointsReplaced
- AddHandler myNewStroke.StylusPoints.Changed, AddressOf StylusPoints_Changed
-
- 'myNewStroke.MoveStylusPoints();
-
- '
- ' Handle PropertyDataChanged event on stroke
- AddHandler myNewStroke.PropertyDataChanged, AddressOf myNewStroke_PropertyDataChanged
- '
-
- '
- ' Get packets from stroke
- 'StylusPackets myStylusPackets = myNewStroke.StylusPackets;
- '
-
- ' This should fire a DrawingAttributesChanged event
-
- '
- ' Make the new stroke green.
- myNewStroke.DrawingAttributes.Color = Colors.Green
- '
-
- ' Add stroke to InkPresenter
- 'myNewStroke.DrawingAttributes = inkAttributes.Clone();
- myNewStroke.DrawingAttributes.FitToCurve = FitToCurve
-
- myInkPresenter.Strokes.Add(myNewStroke)
-
- CompareStrokePoints(myNewStroke)
-
- ' Add pink shadow if requested
- If shadow Then
- shadowStroke = myNewStroke.Clone()
- shadowStroke.Transform(New Matrix(1, 0, 0, 1, 2, 0), False)
- shadowStroke.DrawingAttributes.Color = Colors.Pink
- myInkPresenter.Strokes.Add(shadowStroke)
- End If
-
- Case sMode.surround
-
- myIncrementalHitTester.AddPoints(e.GetStylusPoints(Me))
-
- ' Disable SelectionChanged event handler when using encirclement
- RemoveHandler CType(myIncrementalHitTester, IncrementalLassoHitTester).SelectionChanged, _
- AddressOf myIHT_StrokeHitChanged
-
- 'removehandler myincrementalhittester.se
- Case Else
- myIncrementalHitTester.AddPoints(e.GetStylusPoints(Me))
-
- ' Disable StrokeHit event handler when using stylus hits
- AddHandler CType(myIncrementalHitTester, IncrementalStrokeHitTester).StrokeHit, _
- AddressOf myIHT_StrokeIntersectionChanged
- End Select
-
- e.Handled = True
-
- End Sub
-
-
- '
- Private Sub StylusPoints_Changed(ByVal sender As Object, ByVal e As EventArgs)
-
- MessageBox.Show("stylus points changed")
-
- End Sub
-
- '
- '
- Private Sub myNewStroke_StylusPointsChanged(ByVal sender As Object, ByVal e As EventArgs)
-
- MessageBox.Show("stylus points changed")
-
- End Sub
-
- '
- '
- Private Sub myNewStroke_StylusPointsReplaced(ByVal sender As Object, ByVal e As StylusPointsReplacedEventArgs)
-
- MessageBox.Show("stylus points replaced")
-
- End Sub
-
- '
- Sub CompareStrokePoints(ByVal aStroke As Stroke)
-
- End Sub
-
-
-
- Private Sub myNewStroke_PropertyDataChanged(ByVal sender As Object, ByVal e As PropertyDataChangedEventArgs)
-
- End Sub
-
-
- Private Sub myNewStroke_DrawingAttributesReplaced(ByVal sender As Object, ByVal e As DrawingAttributesReplacedEventArgs)
-
- End Sub
-
-
- Private Sub myNewStroke_DrawingAttributesChanged(ByVal sender As Object, ByVal e As PropertyDataChangedEventArgs)
-
- End Sub
-
-
- ' When the stylus clips a stroke,
- ' delete that stroke.
- ' When the stylus erases a stoke,
- ' replace the stroke with the strokes returned by
- ' the Stroke.Erase method.
- Private Sub myIHT_StrokeIntersectionChanged(ByVal sender As Object, ByVal e As StrokeHitEventArgs)
- Dim thisStroke As Stroke = e.HitStroke
-
- '
- Dim myRect As Rect = thisStroke.GetBounds()
- '
-
- If state = sMode.clip Then
-
- ' ***Stroke.Clip***
- '
- ' Get the intersections when the stroke is clipped.
- ' e is a StrokeIntersectionChangedEventArgs object in the
- ' StrokeIntersectionChanged event handler.
- Dim clipResult As StrokeCollection = e.GetPointEraseResults()
-
- Dim strokesToReplace As New StrokeCollection()
-
- strokesToReplace.Add(thisStroke)
-
- ' Replace the old stroke with the new one.
- If clipResult.Count > 0 Then
- myInkPresenter.Strokes.Replace(strokesToReplace, clipResult)
- Else
- myInkPresenter.Strokes.Remove(strokesToReplace)
- End If
- '
-
- If Not gotFirstStroke Then
-
- '
- ' Create a guid for the date/timestamp.
- Dim dtGuid As New Guid("03457307-3475-3450-3035-640435034540")
-
- Dim now As DateTime = DateTime.Now
-
- ' Check whether the property is already saved
- If thisStroke.ContainsPropertyData(dtGuid) Then
- ' Check whether the existing property matches the current date/timestamp
- Dim oldDT As DateTime = CType(thisStroke.GetPropertyData(dtGuid), DateTime)
-
- If oldDT <> now Then
- ' Update the current date and time
- thisStroke.AddPropertyData(dtGuid, now)
- End If
- End If
- '
-
- '
- ' Create a guid for the date/timestamp.
- Dim dateTimeGuid As New Guid("03457307-3475-3450-3035-045430534046")
-
- Dim current As DateTime = DateTime.Now
-
- ' Check whether the property is already saved
- If thisStroke.ContainsPropertyData(dateTimeGuid) Then
- Dim oldDateTime As DateTime = CType(thisStroke.GetPropertyData(dateTimeGuid), DateTime)
-
- ' Check whether the existing property matches the current date/timestamp
- If Not oldDateTime = current Then
- ' Delete the custom property
- thisStroke.RemovePropertyData(dateTimeGuid)
- End If
- End If
- '
-
- End If
-
- '
- ' Save the stroke as an array of Point objects
- 'Point[] myPoints = thisStroke.GetRenderingPoints();
- '
- ' Port to VB if I ever get this working!
- ' See if we can figure out which stroke point(s) got hit
- 'StrokeIntersection[] myStrokeIntersections = e.GetHitStrokeIntersections();
- 'Point[] myStrokeIntersectionPoints = new Point[myStrokeIntersections.Length];
- 'int p = 0;
- 'for (int k = 0; k < myStrokeIntersections.Length; k++)
- '{
- ' StrokeIntersection s = myStrokeIntersections[k];
- ' if (s.HitBegin != StrokeIntersection.BeforeFirst && s.HitEnd != StrokeIntersection. AfterLast)
- ' {
- ' // Get stroke point that is closest to average between HitBegin and HitEnd:
- ' double x = s.HitBegin;
- ' double y = s.HitEnd;
- ' double midPoint = (x + y) / 2;
- ' int middlePoint = (int)midPoint;
- ' // Now add that Point from the existing stroke points
- ' myStrokeIntersectionPoints[p] = myPoints[middlePoint];
- ' p++;
- ' }
- '}
- ' Get DrawingContext for InkPresenter
- 'VisualCollection myVisuals = VisualOperations.GetChildren(myInkPresenter);
- 'DrawingVisual myVisual = new DrawingVisual();
- 'DrawingContext myContext = myVisual.RenderOpen();
- '// Draw midpoints of stroke intersections a little green circles
- 'for (int j = 0; j < myStrokeIntersectionPoints.Length; j++)
- '{
- ' // Draw green circles around each point
- ' myContext.DrawGeometry(Brushes.Green,
- ' new Pen(Brushes.Green, 1.0),
- ' new EllipseGeometry(myStrokeIntersectionPoints[j], 4.0, 4.0));
- '}
- 'myContext.Close();
- 'myVisuals.Add(myVisual);
-
- ' Do I have to do something here to display the revised InkPresenter?
-
- ' Open the file to hold strokes
- ' if the file already exists, overwrite it
- 'myFile = new StreamWriter(File.Open(STROKE_FILE, FileMode.Create));
- 'Point myPoint;
- 'int xVal, yVal;
- 'for (int i = 0; i < myPoints.Length; i++)
- '{
- ' myPoint = myPoints[i];
- ' xVal = (int)myPoint.X;
- ' yVal = (int)myPoint.Y;
- ' // Save the point to a file
- ' myFile.WriteLine(xVal.ToString() + " " + yVal.ToString());
- '}
- 'myFile.Flush();
- 'myFile.Close();
- 'gotFirstStroke = true;
- Else
- ' ***erase**
- '
- ' Remove the stokee that is hit.
- myInkPresenter.Strokes.Remove(e.HitStroke)
- End If
- '
- End Sub
-
-
- ' When the stylus encircles a stroke,
- ' erase that stroke.
- Private Sub myIHT_StrokeHitChanged(ByVal sender As Object, ByVal e As LassoSelectionChangedEventArgs)
-
- 'Dim selectedStroke As MyStroke
- For Each selectedStroke As MyStroke In e.SelectedStrokes
- selectedStroke.Selected = True
- Next selectedStroke 'stroke.DrawingAttributes.Color = Colors.Red;
-
- For Each stroke As MyStroke In e.DeselectedStrokes
- stroke.Selected = False
- Next stroke
- 'stroke.DrawingAttributes.Color = Colors.Green;
- End Sub
-
-
- ' Remove the encircled stroke.
- 'if (eraseResult.Count > 0)
- '{
- ' myInkPresenter.Strokes.Remove(eraseResult);
- '}
-
- Public Sub ChangeDrawingMode(ByVal mode As DrawingMode)
- If myInkPresenter.Strokes.Count = 0 Then
- Return
- End If
-
- If Not TypeOf myInkPresenter.Strokes(0) Is CustomRenderedStroke Then
- Return
- End If
-
- Dim s As CustomRenderedStroke
- For Each s In myInkPresenter.Strokes
- s.Mode = mode
- Next s
-
- End Sub
-
-
- Private Sub StrokeConstructorSample()
- '
- Dim drawingAttributes1 As New DrawingAttributes()
- drawingAttributes1.Color = Colors.Green
-
- Dim stylusPoint1 As StylusPoint = New StylusPoint(100, 100)
- Dim stylusPoint2 As StylusPoint = New StylusPoint(100, 200)
- Dim stylusPoint3 As StylusPoint = New StylusPoint(200, 200)
- Dim stylusPoint4 As StylusPoint = New StylusPoint(200, 100)
- Dim stylusPoint5 As StylusPoint = New StylusPoint(100, 100)
-
- Dim points() As StylusPoint = {stylusPoint1, stylusPoint2, _
- stylusPoint3, stylusPoint4, stylusPoint1}
-
- Dim pointCollection As New StylusPointCollection(points)
-
- Dim NewStroke As Stroke = New Stroke(pointCollection, drawingAttributes1)
-
- myInkPresenter.Strokes.Add(NewStroke)
- '
-
- End Sub
-
- '
-
- '
- Function GetLittleRedStroke(ByVal theStroke As Stroke) As Stroke
- ' Copy the incoming stroke
- Dim sCopy As Stroke = theStroke.Clone()
-
- ' Scale it by 50%
- Dim xform As New Matrix()
- xform.Scale(0.5, 0.5)
-
- sCopy.Transform(xform, False)
-
- ' Color it red
- sCopy.DrawingAttributes.Color = Colors.Red
-
- ' Return the new stroke
- Return sCopy
-
- End Function 'getLittleRedStroke
-
- '
-
- '
- End Class
-
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/MyStroke.vb b/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/MyStroke.vb
deleted file mode 100644
index ef1641d4272..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/MyStroke.vb
+++ /dev/null
@@ -1,184 +0,0 @@
-
-Imports System.Runtime.InteropServices
-Imports System.Windows
-Imports System.Windows.Ink
-Imports System.Windows.Input
-Imports System.Windows.Media
-
-Imports System.Collections.Generic
-Imports System.Text
-
-
-Namespace StrokeSnippets_VB
-
- Class MyStroke
- Inherits Stroke
- ' Let user reset color for all new strokes
- ' by setting the color for any stroke.
- ' We'll start off by setting the color to black.
- Private myColor As Color = Colors.Black
-
- Private dtGuid As Guid
-
-
- Public Sub New(ByVal points As StylusPointCollection)
- MyBase.New(points)
- initialize()
-
- End Sub
- 'MoveStylusPoints();
-
- Public Sub New(ByVal stylusPoints As StylusPointCollection, ByVal drawingAttributes As DrawingAttributes)
- MyBase.New(stylusPoints, drawingAttributes)
-
- End Sub
-
- 'MoveStylusPoints();
-
- Private Sub initialize()
- setTimeStamp()
-
- End Sub
-
-
- Public Sub MoveStylusPoints()
- Dim points As StylusPointCollection = Me.StylusPoints
-
- Dim i As Integer
-
- While i < points.Count
- Dim p As StylusPoint = points(i)
- p.Y = p.Y + 20
- points(i) = p
- i += 1
- End While
-
- End Sub
-
-
-
- Private Sub setTimeStamp()
- ' See if we have the same timestamp as the border
- Dim sAttr As Attribute = Attribute.GetCustomAttribute(GetType(MyBorder), GetType(GuidAttribute))
- dtGuid = New Guid("03457307-3475-3450-3035-640435034540")
-
- End Sub
-
-
- '
- Protected Overrides Sub OnDrawingAttributesChanged(ByVal e As PropertyDataChangedEventArgs)
- ' Notify base class of event
- MyBase.OnDrawingAttributesChanged(e)
-
- ' See if the change was a new DrawingAttribute.Color property
- Dim eT As Type = e.NewValue.GetType()
-
- End Sub
-
-
-
- 'if (eT == typeof(Color))
- '{
- ' Color c = (Color)e.NewValue;
- ' if (c == Colors.Red)
- ' {
- ' MessageBox.Show("The stroke is now red!");
- ' }
- '}
- '
-
-
- '
- Protected Overrides Sub DrawCore(ByVal context As DrawingContext, _
- ByVal overridedAttributes As DrawingAttributes)
-
- ' Draw the stroke. Calling base.DrawCore accomplishes the same thing.
- Dim geometry As Geometry = GetGeometry(overridedAttributes)
- context.DrawGeometry(New SolidColorBrush(overridedAttributes.Color), Nothing, geometry)
-
- Dim points As StylusPointCollection
-
- ' Get the stylus points used to draw the stroke. The points used depends on
- ' the value of FitToCurve.
- If Me.DrawingAttributes.FitToCurve Then
- points = Me.GetBezierStylusPoints()
- Else
- points = Me.StylusPoints
- End If
-
- ' Draw a circle at each stylus point.
- Dim p As StylusPoint
- For Each p In points
- context.DrawEllipse(Nothing, New Pen(Brushes.Black, 1), CType(p, Point), 5, 5)
- Next p
-
- End Sub
-
- '
- Private Sub DrawSelectedStrokeAndPoints(ByVal context As DrawingContext, ByVal overridedAttributes As DrawingAttributes)
-
- End Sub
-
-
- '
- Protected Overrides Sub OnDrawingAttributesReplaced(ByVal e As DrawingAttributesReplacedEventArgs)
-
- '// Notify base class of event
- 'base.OnDrawingAttributesReplaced(e);
- 'if (e.NewDrawingAttributes.Color == Colors.Red)
- '{
- ' MessageBox.Show("The stroke is now red!");
- '}
- End Sub
-
- '
- Private Sub MyStroke_PacketsChanged(ByVal sender As Object, ByVal e As EventArgs)
-
- End Sub
-
-
- '
- Protected Overrides Sub OnStylusPointsChanged(ByVal e As EventArgs)
- ' Notify base class of event
- MyBase.OnStylusPointsChanged(e)
-
- End Sub
-
- '
- Private Sub MyStroke_PropertyDataChanged(ByVal sender As Object, ByVal e As PropertyDataChangedEventArgs)
-
- End Sub
-
-
- '
- Protected Overrides Sub OnPropertyDataChanged(ByVal e As PropertyDataChangedEventArgs)
-
- ' Notify base class of event
- MyBase.OnPropertyDataChanged(e)
-
- ' If the current stroke color changes,
- ' reset the default color for the class.
- If e.PropertyGuid.Equals(DrawingAttributeIds.Color) Then
- myColor = Me.DrawingAttributes.Color
- End If
-
- End Sub
- '
- Private IsSelected As Boolean
-
-
- Public Property Selected() As Boolean
- Get
- Return IsSelected
- End Get
-
- Set(ByVal value As Boolean)
- If IsSelected <> Value Then
- IsSelected = Value
- Me.OnInvalidated(New EventArgs())
- End If
- End Set
- End Property
- End Class
-
-End Namespace
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/StrokeSnippets_VB.vbproj b/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/StrokeSnippets_VB.vbproj
deleted file mode 100644
index ba57e445994..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/StrokeSnippets_VB.vbproj
+++ /dev/null
@@ -1,150 +0,0 @@
-
-
- Debug
- AnyCPU
- {EE49F5FB-15F5-4A91-9BF9-2E77961F5CCA}
- StrokeSnippets_VB
- StrokeSnippets_VB
- 4
- winexe
- $(OutputType)
- 10.0.20821
- 2.0
- en-US
- v4.8
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
-
- true
- full
- true
- true
- true
- bin\
- StrokeSnippets_VB.xml
- 42016,42017,42018,42019,42032,42314
-
-
- false
- false
- true
- false
- true
- bin\
- StrokeSnippets_VB.xml
- 42016,42017,42018,42019,42032,42314
-
-
-
-
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code
-
-
- True
- True
- MyResources.resx
-
-
- Code
-
-
- True
- True
- MySettings.settings
-
-
-
-
- VbMyResourcesResXFileCodeGenerator
- My.Resources
- MyResources.Designer.vb
-
-
-
- SettingsSingleFileGenerator
- MySettings.Designer.vb
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.5
- false
-
-
- False
- Windows Installer 3.1
- true
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/Window1.xaml.vb b/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/Window1.xaml.vb
deleted file mode 100644
index d572bea54b3..00000000000
--- a/snippets/visualbasic/System.Windows.Ink/Stroke/.ctor/Window1.xaml.vb
+++ /dev/null
@@ -1,99 +0,0 @@
-
-Imports System.IO
-Imports System.Reflection
-Imports System.Windows
-Imports System.Windows.Controls
-Imports System.Windows.Data
-Imports System.Windows.Documents
-Imports System.Windows.Media
-Imports System.Windows.Shapes
-
-
-'/
-'/ Interaction logic for Window1.xaml
-'/
-Namespace StrokeSnippets_VB
-
- Class Window1
- Inherits Window
-
- Dim border1 As MyBorder
-
- Public Sub New()
- InitializeComponent()
-
- border1 = New MyBorder()
- 'border1.Background = Brushes.Green
- root.Children.Add(border1)
-
- End Sub
-
-
- ' Remove touched stroke points
- Private Sub button1Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- border1.state = MyBorder.sMode.clip
-
- End Sub
-
-
- ' Remove touched strokes
- Private Sub button2Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- border1.state = MyBorder.sMode.remove
-
- End Sub
-
-
- ' Remove encircled strokes
- Private Sub button3Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- border1.state = MyBorder.sMode.surround
-
- End Sub
-
-
- ' Add strokes to collection
- Private Sub button4Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- border1.state = MyBorder.sMode.add
- border1.shadow = False
-
- End Sub
-
-
- ' Add shadowed strokes to collection
- Private Sub button5Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- border1.state = MyBorder.sMode.add
- border1.shadow = True
-
- End Sub
-
-
- Private Sub button6Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- border1.FitToCurve = Not border1.FitToCurve
-
- If border1.FitToCurve Then
- button6.Content = "FtC: on"
- Else
- button6.Content = "FtC: off"
- End If
-
- End Sub
-
- Private mode As DrawingMode = DrawingMode.Solid
-
-
- Private Sub ToggleDrawingMode_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
- If mode = DrawingMode.Solid Then
- border1.ChangeDrawingMode(DrawingMode.StyulusPoints)
- mode = DrawingMode.StyulusPoints
- Else
- border1.ChangeDrawingMode(DrawingMode.Solid)
- mode = DrawingMode.Solid
- End If
-
- End Sub
- End Class
- '
- 'ToDo: Error processing original source shown below
- '}
- '}
- '-^--- expression expected
-End Namespace
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/AssemblyInfo.vb b/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/AssemblyInfo.vb
deleted file mode 100644
index 0b050475a9b..00000000000
--- a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/AssemblyInfo.vb
+++ /dev/null
@@ -1,58 +0,0 @@
-Imports System.Reflection
-Imports System.Runtime.InteropServices
-Imports System.Globalization
-Imports System.Resources
-Imports System.Windows
-
-' 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
-
-
-
-
-
-
-
-
-
-'In order to begin building localizable applications, set
-'CultureYouAreCodingWith in your .vbproj file
-'inside a . For example, if you are using US english
-'in your source files, set the to "en-US". Then uncomment the
-'NeutralResourceLanguage attribute below. Update the "en-US" in the line
-'below to match the UICulture setting in the project file.
-
-'
-
-
-'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
-'1st parameter: where theme specific resource dictionaries are located
-'(used if a resource is not found in the page,
-' or application resource dictionaries)
-
-'2nd parameter: where the generic resource dictionary is located
-'(used if a resource is not found in the page,
-'app, and any theme specific resource dictionaries)
-
-
-
-
-'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/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/MyEvents.vb b/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/MyEvents.vb
deleted file mode 100644
index 0fd4598d1c9..00000000000
--- a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/MyEvents.vb
+++ /dev/null
@@ -1,13 +0,0 @@
-Namespace My
- Partial Friend Class MyApplication
-
- 'Use the editor window dropdowns in the Application pane of the Project Designer to handle MyApplication Events
- '
- 'Startup: Raised when the application starts, before the startup form is created.
- 'Shutdown: Raised after all application forms are closed. This event is not raised if the application is terminating abnormally.
- 'UnhandledException: Raised if the application encounters an unhandled exception.
- 'StartupNextInstance: Raised when launching a single-instance application and the application is already active.
- 'NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
-
- End Class
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/Resources.Designer.vb b/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/Resources.Designer.vb
deleted file mode 100644
index 7811451446f..00000000000
--- a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/Resources.Designer.vb
+++ /dev/null
@@ -1,61 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3031
-'
-' 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.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("PacketSpy.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/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/Settings.Designer.vb b/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/Settings.Designer.vb
deleted file mode 100644
index 12838d051e0..00000000000
--- a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/My Project/Settings.Designer.vb
+++ /dev/null
@@ -1,71 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.3031
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict On
-Option Explicit On
-
-
-
- _
-Partial Friend NotInheritable Class Settings
- Inherits Global.System.Configuration.ApplicationSettingsBase
-
- Private Shared defaultInstance As Settings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New Settings),Settings)
-
-#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 Settings
- 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
-
-Namespace My
-
- _
- Friend Module MySettingsProperty
-
- _
- Friend ReadOnly Property Settings() As Global.PacketSpy.Settings
- Get
- Return Global.PacketSpy.Settings.Default
- End Get
- End Property
- End Module
-End Namespace
diff --git a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/MyApp.xaml.vb b/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/MyApp.xaml.vb
deleted file mode 100644
index 667b44c2780..00000000000
--- a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/MyApp.xaml.vb
+++ /dev/null
@@ -1,10 +0,0 @@
-' Interaction logic for MyApp.xaml
-Partial Public Class MyApp
- Inherits Application
-
- Private Sub AppStartup(ByVal sender As Object, ByVal e As StartupEventArgs) Handles Me.Startup
- Dim mainWindow As Window1 = New Window1
- mainWindow.Show()
- End Sub
-
-End Class
diff --git a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/PacketSpy.vbproj b/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/PacketSpy.vbproj
deleted file mode 100644
index 9a54abfad99..00000000000
--- a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/PacketSpy.vbproj
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
- Debug
- AnyCPU
- {9767FC20-91FD-49F2-83E5-D89AE69B1509}
- WinExe
- PacketSpy
- PacketSpy
-
- v4.8
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
- 10.0.20821
-
-
- true
- full
- true
- true
- true
- bin\
- PacketSpy.xml
- 42016,42017,42018,42019,42032,42314
-
-
- false
- false
- true
- false
- true
- bin\
- PacketSpy.xml
- 42016,42017,42018,42019,42032,42314
-
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- Code
-
-
-
- VbMyResourcesResXFileCodeGenerator
- Resources.Designer.vb
- My.Resources
- Designer
-
-
- SettingsSingleFileGenerator
- Settings.Designer.vb
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.5
- false
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/Window1.xaml.vb b/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/Window1.xaml.vb
deleted file mode 100644
index b7b1c7ef995..00000000000
--- a/snippets/visualbasic/System.Windows.Input/StylusDevice/GetStylusPoints/Window1.xaml.vb
+++ /dev/null
@@ -1,576 +0,0 @@
-
-Imports System.Windows
-Imports System.Windows.Controls
-Imports System.Windows.Data
-Imports System.Windows.Documents
-Imports System.Windows.Media
-Imports System.Windows.Shapes
-Imports System.Windows.Ink
-Imports System.Windows.Input
-Imports System.Threading
-Imports System.Collections.ObjectModel
-Imports System.Collections.Generic
-Imports System.Reflection
-Imports System.IO
-
-
-'/
-'/ Interaction logic for Window1.xaml
-'/
-
-Class Window1
- Inherits Window '
- 'ToDo: Error processing original source shown below
- '
- ' public partial class Window1 : Window
- '------------^--- 'class', 'struct', 'interface' or 'delegate' expected
- '
- 'ToDo: Error processing original source shown below
- '
- ' public partial class Window1 : Window
- '--------------------^--- Syntax error: ';' expected
- Private constrainingRect As Rect
-
-
-
- Public Sub New()
- InitializeComponent()
- Me.WindowState = WindowState.Maximized
- inkCanvas1.EditingMode = InkCanvasEditingMode.Ink
- inkCanvas1.DefaultDrawingAttributes.IgnorePressure = False
- inkCanvas1.DefaultDrawingAttributes.Height = 5
- inkCanvas1.DefaultDrawingAttributes.Width = 5
- AddHandler inkCanvas1.StylusDown, AddressOf inkCanvas1_StylusDown
- AddHandler inkCanvas1.StylusMove, AddressOf inkCanvas1_StylusMove
-
-
-
- inkCanvas1.DefaultStylusPointDescription = New StylusPointDescription(New StylusPointPropertyInfo() {New StylusPointPropertyInfo(StylusPointProperties.X), New StylusPointPropertyInfo(StylusPointProperties.Y), New StylusPointPropertyInfo(StylusPointProperties.NormalPressure)})
-
- constrainingRect = New Rect(100, 100, 200, 200)
-
- AddHandler Me.KeyDown, AddressOf Window1_KeyDown
-
- 'DrawRect();
- StylusPointConstructor()
-
- StylusPointCollectionSnippets()
- DescriptionSnippets()
- ClonePoints()
- StylusPropertySnippets()
-
- End Sub
-
- 'CompareDescriptions();
- 'MessageBox.Show(StylusPoint.MinXYValue.ToString() & ", " +
- ' StylusPoint.MaxXYValue.ToString());
-
- Private Sub Window1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
- If e.Key = Key.T Then
- GetTabletStylusPointProperties()
- End If
-
- End Sub
-
-
- '
- Private Sub inkCanvas1_StylusMove(ByVal sender As Object, ByVal e As StylusEventArgs)
- Dim points As StylusPointCollection = e.GetStylusPoints(inkCanvas1)
- Dim description As StylusPointDescription = points.Description
- Dim normalPressureInfo As New StringWriter()
-
- If description.HasProperty(StylusPointProperties.NormalPressure) Then
-
- Dim propertyInfo As StylusPointPropertyInfo = _
- description.GetPropertyInfo(StylusPointProperties.NormalPressure)
-
- normalPressureInfo.WriteLine(" Guid = {0}", propertyInfo.Id.ToString())
- normalPressureInfo.Write(" Min = {0}", propertyInfo.Minimum.ToString())
- normalPressureInfo.Write(" Max = {0}", propertyInfo.Maximum.ToString())
- normalPressureInfo.Write(" Unit = {0}", propertyInfo.Unit.ToString())
- normalPressureInfo.WriteLine(" Res = {0}", propertyInfo.Resolution.ToString())
- End If
-
- End Sub
-
- '
-
- '
- Private Sub inkCanvas1_StylusDown(ByVal sender As Object, ByVal e As StylusDownEventArgs)
- Dim points As StylusPointCollection = e.GetStylusPoints(inkCanvas1)
- Dim firstPoint As Point = CType(points(0), Point)
-
- Dim circle As Ellipse = New Ellipse()
- circle.Width = 5
- circle.Height = 5
- circle.Fill = Brushes.Red
- InkCanvas.SetTop(circle, firstPoint.Y)
- InkCanvas.SetLeft(circle, firstPoint.X)
- inkCanvas1.Children.Add(circle)
-
- End Sub
- '
-
- Sub ValidateMinMaxX(ByVal point As StylusPoint)
- Dim x As Double = 1000
-
- '
- If x < StylusPoint.MinXY Then
- x = StylusPoint.MinXY
- ElseIf x > StylusPoint.MaxXY Then
- x = StylusPoint.MaxXY
- End If
-
- point.X = x
- '
-
- End Sub
-
- '
- Private Sub inkCanvas1_StylusSystemGesture(ByVal sender As Object, ByVal e As StylusSystemGestureEventArgs)
-
- Me.Title = e.SystemGesture.ToString()
-
- Select Case e.SystemGesture
- Case SystemGesture.RightTap
- ' Do something.
-
- Case SystemGesture.Tap
- ' Do something else.
- End Select
-
- End Sub
-
- '
-
- Sub GetTabletStylusPointProperties()
- '
- Dim currentTablet As TabletDevice = Tablet.CurrentTabletDevice
-
- Dim supportedProperties As ReadOnlyCollection(Of StylusPointProperty) _
- = currentTablet.SupportedStylusPointProperties
-
- Dim properties As New StringWriter()
-
- For Each supportedProperty As StylusPointProperty In supportedProperties
- properties.WriteLine(supportedProperty.ToString())
- Next supportedProperty
-
- MessageBox.Show(properties.ToString())
- '
-
- End Sub
-
-
- ' To use Loaded event put Loaded="WindowLoaded" attribute in root element of .xaml file.
- ' private void WindowLoaded(object sender, EventArgs e) {}
- ' Sample event handler:
- 'private void SaveStrokes_Click(object sender, RoutedEventArgs e)
- '{
- '}
- Private Sub DrawRect()
- Dim myRectVisual As DrawingVisual
-
- myRectVisual = New DrawingVisual()
- Dim myDrawingContext As DrawingContext = myRectVisual.RenderOpen()
-
- Dim mySolidColorBrush As New SolidColorBrush()
- Dim myPen As New Pen(Brushes.Red, 1)
-
- myDrawingContext.DrawRectangle(Nothing, myPen, constrainingRect)
-
- ' Important: Close the DrawingContext.
- myDrawingContext.Close()
-
- 'Dim collection As VisualCollection = VisualOperations.GetChildren(inkCanvas1)
-
- 'collection.Add(myRectVisual)
-
- End Sub
-
-
- Private Sub StylusMoveEventHandler(ByVal sender As Object, ByVal e As StylusEventArgs)
-
- Dim points As StylusPointCollection = e.GetStylusPoints(inkCanvas1)
- WriteStylusPointValues(points)
- WriteDescriptionInfo(points)
-
- End Sub
-
-
- Private Sub StylusEventHandler(ByVal sender As Object, ByVal e As StylusEventArgs)
-
- End Sub
-
-
-
- Sub GetDescriptionFromStylusDevice()
- '
- Dim currentStylus As StylusDevice = Stylus.CurrentStylusDevice
-
- Dim description1 As New StylusPointDescription(New StylusPointPropertyInfo() _
- {New StylusPointPropertyInfo(StylusPointProperties.X), _
- New StylusPointPropertyInfo(StylusPointProperties.Y), _
- New StylusPointPropertyInfo(StylusPointProperties.NormalPressure), _
- New StylusPointPropertyInfo(StylusPointProperties.XTiltOrientation), _
- New StylusPointPropertyInfo(StylusPointProperties.YTiltOrientation), _
- New StylusPointPropertyInfo(StylusPointProperties.BarrelButton)})
-
- Dim description2 As StylusPointDescription = currentStylus.GetStylusPoints(inkCanvas1).Description
-
- Dim description3 As StylusPointDescription = _
- StylusPointDescription.GetCommonDescription(description1, description2)
-
- Dim points As StylusPointCollection = currentStylus.GetStylusPoints(inkCanvas1, description3)
- '
- End Sub
-
-
- '
- Private Sub WriteDescriptionInfo(ByVal points As StylusPointCollection)
-
- Dim pointsDescription As StylusPointDescription = points.Description
-
- Dim properties As ReadOnlyCollection(Of StylusPointPropertyInfo) = _
- pointsDescription.GetStylusPointProperties()
-
- Dim descriptionStringWriter As New StringWriter
- descriptionStringWriter.Write("Property Count:{0}", pointsDescription.PropertyCount.ToString())
-
- Dim pointProperty As StylusPointPropertyInfo
- For Each pointProperty In properties
-
- ' GetStylusPointPropertyName is defined below and returns the
- ' name of the property.
- descriptionStringWriter.Write("name = {0}", GetStylusPointPropertyName(pointProperty).ToString())
- descriptionStringWriter.WriteLine(" Guid = {0}", pointProperty.Id.ToString())
- descriptionStringWriter.Write(" IsButton = {0}", pointProperty.IsButton.ToString())
- descriptionStringWriter.Write(" Min = {0}", pointProperty.Minimum.ToString())
- descriptionStringWriter.Write(" Max = {0}", pointProperty.Maximum.ToString())
- descriptionStringWriter.Write(" Unit = {0}", pointProperty.Unit.ToString())
- descriptionStringWriter.WriteLine(" Res {0}", pointProperty.Resolution.ToString())
-
- Next pointProperty
-
- descriptionOutput.Text = descriptionStringWriter.ToString()
-
- End Sub
-
- '
- '
- Private Sub WriteStylusPointValues(ByVal points As StylusPointCollection)
- Dim pointsDescription As StylusPointDescription = points.Description
-
- Dim properties As ReadOnlyCollection(Of StylusPointPropertyInfo) = _
- pointsDescription.GetStylusPointProperties()
-
- ' Write the name and value of each property in
- ' every stylus point.
- Dim packetWriter As New StringWriter()
-
- packetWriter.WriteLine("{0} stylus points", points.Count.ToString())
-
- For Each stylusPoint As StylusPoint In points
-
- packetWriter.WriteLine("Stylus Point info")
- packetWriter.WriteLine("X: {0}", stylusPoint.X.ToString())
- packetWriter.WriteLine("Y: {0}", stylusPoint.Y.ToString())
- packetWriter.WriteLine("Pressure: {0}", stylusPoint.PressureFactor.ToString())
-
- ' Get the property name and value for each StylusPoint.
- ' Note that this loop reports the X, Y, and pressure values differantly than
- ' getting their values above.
- For i As Integer = 0 To pointsDescription.PropertyCount - 1
-
- Dim currentProperty As StylusPointProperty = properties(i)
-
- ' GetStylusPointPropertyName is defined below and returns the
- ' name of the property.
- packetWriter.Write("{0}: ", GetStylusPointPropertyName(currentProperty))
- packetWriter.WriteLine(stylusPoint.GetPropertyValue(currentProperty).ToString())
- Next i
-
- packetWriter.WriteLine()
-
- Next stylusPoint
-
- packetOutput.Text = packetWriter.ToString()
-
- End Sub
-
- '
- '
- ' Use reflection to get the name of currentProperty.
- Private Function GetStylusPointPropertyName(ByVal currentProperty As StylusPointProperty) As String
- Dim guid As Guid = currentProperty.Id
-
- ' Iterate through the StylusPointProperties to find the StylusPointProperty
- ' that matches currentProperty, then return the name.
- Dim theFieldInfo As FieldInfo
-
- For Each theFieldInfo In GetType(StylusPointProperties).GetFields()
-
- Dim pointProperty As StylusPointProperty = _
- CType(theFieldInfo.GetValue(currentProperty), StylusPointProperty)
-
- If pointProperty.Id = guid Then
- Return theFieldInfo.Name
- End If
-
- Next theFieldInfo
-
- Return "Not found"
-
- End Function 'GetStylusPointPropertyName
-
- '
- Sub StylusPointConstructor()
-
- '
- Dim newDescription As New StylusPointDescription( _
- New StylusPointPropertyInfo() {New StylusPointPropertyInfo(StylusPointProperties.X), _
- New StylusPointPropertyInfo(StylusPointProperties.Y), _
- New StylusPointPropertyInfo(StylusPointProperties.NormalPressure), _
- New StylusPointPropertyInfo(StylusPointProperties.XTiltOrientation), _
- New StylusPointPropertyInfo(StylusPointProperties.YTiltOrientation), _
- New StylusPointPropertyInfo(StylusPointProperties.BarrelButton)})
-
- Dim propertyValues As Integer() = {1800, 1000, 1}
-
- Dim newStylusPoint As New StylusPoint(100, 100, 0.5F, newDescription, propertyValues)
- '
-
- '
- Dim XTiltPropertyInfo As New StylusPointPropertyInfo( _
- StylusPointProperties.XTiltOrientation, 0, 3600, _
- StylusPointPropertyUnit.Degrees, 10.0F)
- '
- Dim point As New StylusPoint()
-
- '
- If point.HasProperty(StylusPointProperties.PitchRotation) Then
- Dim pitchRotation As Integer = _
- point.GetPropertyValue(StylusPointProperties.PitchRotation)
- End If
- '
-
- '
- If point.HasProperty(StylusPointProperties.PitchRotation) Then
- point.SetPropertyValue(StylusPointProperties.PitchRotation, 1000)
- End If
- '
- End Sub
-
-
- ' All equality tests pass
- Sub TestStylusPointsEquality()
-
- '
- Dim point1 As New StylusPoint()
- Dim point2 As New StylusPoint()
-
- point1.X = 150
- point1.Y = 400
- point1.PressureFactor = 0.45F
-
- point2.X = 150
- point2.Y = 400
- point2.PressureFactor = 0.45F
- '
-
- '
- If point2.Equals(point1) Then
- MessageBox.Show("The two StylusPoint objects are equal.")
- Else
- MessageBox.Show("The two StylusPoint objects are not equal.")
- End If
- '
-
- '
- If StylusPoint.Equals(point1, point2) Then
- MessageBox.Show("The two StylusPoint objects are equal.")
- Else
- MessageBox.Show("The two StylusPoint objects are not equal.")
- End If
- '
-
- '
- If point1 = point2 Then
- MessageBox.Show("The two StylusPoint objects are equal.")
- Else
- MessageBox.Show("The two StylusPoint objects are not equal.")
- End If
- '
-
- '
- If point1 <> point2 Then
- MessageBox.Show("The two StylusPoint objects are not equal.")
- Else
- MessageBox.Show("The two StylusPoint objects are equal.")
- End If
- '
- End Sub
-
-
- Sub StylusPointCollectionSnippets()
- 'MessageBox.Show("hi");
- '
- Dim points As New StylusPointCollection(New Point() _
- {New Point(100, 100), _
- New Point(100, 200), _
- New Point(200, 250), _
- New Point(300, 300)})
- '
- 'points.RemoveAt(0);
- 'points.RemoveAt(0);
- Dim point As New StylusPoint(400, 300)
-
- End Sub
- 'points.Insert(3, point);
- 'points.Insert(2, point);
-
-
- Sub StylusPointCollectionConstructor()
- '
- Dim stylusPoint1 As New StylusPoint(100, 100, 0.5F)
- Dim stylusPoint2 As New StylusPoint(200, 200, 0.35F)
-
- Dim points As New StylusPointCollection(New StylusPoint() {stylusPoint1, stylusPoint2})
- '
- End Sub
-
-
-
- Sub DescriptionSnippets()
- '
- Dim description1 As New StylusPointDescription( _
- New StylusPointPropertyInfo() {New StylusPointPropertyInfo(StylusPointProperties.X), _
- New StylusPointPropertyInfo(StylusPointProperties.Y), _
- New StylusPointPropertyInfo(StylusPointProperties.NormalPressure), _
- New StylusPointPropertyInfo(StylusPointProperties.XTiltOrientation), _
- New StylusPointPropertyInfo(StylusPointProperties.YTiltOrientation), _
- New StylusPointPropertyInfo(StylusPointProperties.BarrelButton)})
-
- ' Create a StylusPointCollection that uses description1 as its
- ' StylusPointDescription.
- Dim points As New StylusPointCollection(description1)
-
- Dim description2 As New StylusPointDescription( _
- New StylusPointPropertyInfo() {New StylusPointPropertyInfo(StylusPointProperties.X), _
- New StylusPointPropertyInfo(StylusPointProperties.Y), _
- New StylusPointPropertyInfo(StylusPointProperties.NormalPressure), _
- New StylusPointPropertyInfo(StylusPointProperties.ButtonPressure), _
- New StylusPointPropertyInfo(StylusPointProperties.BarrelButton)})
-
- ' Find the common StylusPointDescription between description1
- ' and description2. Get a StylusPointCollection that uses the
- ' common StylusPointDescription.
- Dim common As StylusPointDescription = _
- StylusPointDescription.GetCommonDescription(description1, description2)
-
- Dim points2 As StylusPointCollection = points.Reformat(common)
- '
- End Sub
-
-
- Sub ClonePoints()
- '
- Dim rawPoints() As Point = {New Point(100, 100), _
- New Point(100, 200), _
- New Point(200, 250), _
- New Point(300, 300)}
-
- Dim points1 As New StylusPointCollection(rawPoints)
-
- ' Create a copy of points1 and change the second StylusPoint.
- Dim points2 As StylusPointCollection = points1.Clone()
- points2(1) = New StylusPoint(200, 100)
-
- ' Create a stroke from each StylusPointCollection and add them to
- ' inkCanvas1. Note that changing a StylusPoint in point2 did not
- ' affect points1.
- Dim stroke1 As New Stroke(points1)
- inkCanvas1.Strokes.Add(stroke1)
-
- Dim stroke2 As New Stroke(points2)
- stroke2.DrawingAttributes.Color = Colors.Red
- inkCanvas1.Strokes.Add(stroke2)
- '
- End Sub
-
-
-
- Sub CompareDescriptions()
- '
- Dim description1 As New StylusPointDescription( _
- New StylusPointPropertyInfo() {New StylusPointPropertyInfo(StylusPointProperties.X), _
- New StylusPointPropertyInfo(StylusPointProperties.Y), _
- New StylusPointPropertyInfo(StylusPointProperties.NormalPressure), _
- New StylusPointPropertyInfo(StylusPointProperties.XTiltOrientation), _
- New StylusPointPropertyInfo(StylusPointProperties.YTiltOrientation), _
- New StylusPointPropertyInfo(StylusPointProperties.BarrelButton)})
-
- Dim description2 As New StylusPointDescription( _
- New StylusPointPropertyInfo() {New StylusPointPropertyInfo(StylusPointProperties.X), _
- New StylusPointPropertyInfo(StylusPointProperties.Y), _
- New StylusPointPropertyInfo(StylusPointProperties.NormalPressure), _
- New StylusPointPropertyInfo(StylusPointProperties.BarrelButton)})
- '
-
- '
- If StylusPointDescription.AreCompatible(description1, description2) Then
- MessageBox.Show("The two descriptions are compatible.")
- Else
- MessageBox.Show("The two descriptions are not compatible.")
- End If
- '
-
- '
- If description2.IsSubsetOf(description1) Then
- MessageBox.Show("description2 is a subset of description1.")
- Else
- MessageBox.Show("description2 is not a subset of description1.")
- End If
- '
- End Sub
-
-
- Private Sub points_Changed(ByVal sender As Object, ByVal e As EventArgs)
- MessageBox.Show("The SylusPointCollection changed")
-
- End Sub
-
- ' The OnStylusDown method is to demonstrate how to create
- ' a StylusPointCollection to collect stylus points in a custom control.
- ' Nothing happens with stylusPoints, it's dead end code.
- '
- Private stylusPoints As StylusPointCollection
-
-
- Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs)
- MyBase.OnStylusDown(e)
-
- Dim eventPoints As StylusPointCollection = e.GetStylusPoints(Me)
-
- ' Create a new StylusPointCollection using the StylusPointDescription
- ' from the stylus points in the StylusDownEventArgs.
- stylusPoints = New StylusPointCollection(eventPoints.Description, eventPoints.Count)
- stylusPoints.Add(eventPoints)
-
- End Sub
- '
-
- Sub StylusPropertySnippets()
- Dim newProperty As New StylusPointPropertyInfo(StylusPointProperties.TwistOrientation)
-
- '
- Dim guid As New Guid("12345678-1234-1234-1234-123456789012")
- Dim newlyDefinedProperty As New StylusPointProperty(guid, False)
- '
- End Sub
-
-
- Sub StylusPropertyInfoSnippets()
-
- End Sub
-End Class
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows/Application/Overview/appcode.vb b/snippets/visualbasic/System.Windows/Application/Overview/appcode.vb
deleted file mode 100644
index be8bf0a58cd..00000000000
--- a/snippets/visualbasic/System.Windows/Application/Overview/appcode.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-'
-
-Imports System.Windows
-
-Namespace SDKSample
- Public Class AppCode
- Inherits Application
- ' Entry point method
-
- Public Shared Sub Main()
- Dim app As New AppCode()
- app.Run()
- End Sub
- End Class
-End Namespace
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows/Application/Overview/application.xaml.vb b/snippets/visualbasic/System.Windows/Application/Overview/application.xaml.vb
deleted file mode 100644
index 7834d3ec3b9..00000000000
--- a/snippets/visualbasic/System.Windows/Application/Overview/application.xaml.vb
+++ /dev/null
@@ -1,10 +0,0 @@
-'
-
-Imports System.Windows
-
-Namespace SDKSample
- Partial Public Class App
- Inherits Application
- End Class
-End Namespace
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows/Application/Overview/applicationsnippets.vbproj b/snippets/visualbasic/System.Windows/Application/Overview/applicationsnippets.vbproj
deleted file mode 100644
index 59d1ed1ea99..00000000000
--- a/snippets/visualbasic/System.Windows/Application/Overview/applicationsnippets.vbproj
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
- Debug
- AnyCPU
- {D4982CD9-4444-4BB5-B4AC-2D9AB41B87DA}
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
-
-
- VisualBasic
- winexe
-
- v4.0
- On
- Binary
- Off
- On
- http://localhost/CSharp/
- true
- Web
- true
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- true
- false
- false
- Client
- 10.0.20821
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
-
-
- false
- true
- .\bin\Release\
- false
- true
-
-
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- Application.xaml
- Code
-
-
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.5
- false
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Windows/Application/Overview/my project/assemblyinfo.vb b/snippets/visualbasic/System.Windows/Application/Overview/my project/assemblyinfo.vb
deleted file mode 100644
index 731a8669d01..00000000000
--- a/snippets/visualbasic/System.Windows/Application/Overview/my project/assemblyinfo.vb
+++ /dev/null
@@ -1,51 +0,0 @@
-#Region "Using directives"
-
-Imports System.Reflection
-Imports System.Runtime.CompilerServices
-Imports System.Resources
-Imports System.Globalization
-Imports System.Windows
-Imports System.Runtime.InteropServices
-
-#End Region
-
-' 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.
-
-
-
-
-
-
-
-
-
-
-'In order to begin building localizable applications, set
-'CultureYouAreCodingWith in your .vbproj file
-'inside a . For example, if you are using US english
-'in your source files, set the to en-US. Then uncomment
-'the NeutralResourceLanguage attribute below. Update the "en-US" in
-'the line below to match the UICulture setting in the project file.
-
-'[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
- '(used if a resource is not found in the page,
- ' or application resource dictionaries)
- '(used if a resource is not found in the page,
- ' app, or any theme specific resource dictionaries)
- 'where the generic resource dictionary is located - where theme specific resource dictionaries are located
-
-
-' 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 Revision and Build Numbers
-' by using the '*' as shown below:
-
diff --git a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/client.exe.config b/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/client.exe.config
deleted file mode 100644
index fa5ce3583b2..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/client.exe.config
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/client.vb b/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/client.vb
deleted file mode 100644
index f4b21ba4c8a..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/client.vb
+++ /dev/null
@@ -1,44 +0,0 @@
-
-Imports System.ServiceModel
-Imports System.ServiceModel.Channels
-
-Imports microsoft.wcf.documentation
-
-
-
-'
-Public Class Client
- Public Shared Sub Main()
- Try
- ' Picks up configuration from the config file.
- Dim factory As New ChannelFactory(Of ISampleServiceChannel)("WSHttpBinding_ISampleService")
-
- ' Add the client side behavior programmatically to all created channels.
- factory.Endpoint.Behaviors.Add(New EndpointBehaviorMessageInspector())
-
- Dim wcfClientChannel As ISampleServiceChannel = factory.CreateChannel()
-
- ' Making calls.
- Console.WriteLine("Enter the greeting to send: ")
- Dim greeting As String = Console.ReadLine()
- Console.WriteLine("The service responded: " & wcfClientChannel.SampleMethod(greeting))
-
- Console.WriteLine("Press ENTER to exit:")
- Console.ReadLine()
-
- ' Done with service.
- wcfClientChannel.Close()
- Console.WriteLine("Done!")
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.Message)
- Console.Read()
- Catch fault As FaultException(Of SampleFault)
- Console.WriteLine("SampleFault fault occurred: {0}", fault.Detail.FaultMessage)
- Console.Read()
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.Message)
- Console.Read()
- End Try
- End Sub
- '
-End Class
diff --git a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/client.vbproj b/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/client.vbproj
deleted file mode 100644
index f8b100e2181..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/client.vbproj
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
- Debug
- AnyCPU
- {66190530-B4E3-4BF0-94B4-DFE52D15E50F}
- Exe
- false
- Client
-
-
-
-
-
-
- 3.5
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
- On
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/host.vbproj b/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/host.vbproj
deleted file mode 100644
index beb9bf6a9f2..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/host.vbproj
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
- Debug
- AnyCPU
- {907F0C93-0FC2-4419-B0CE-2B775830A3C2}
- Exe
- false
- HostApplication
-
-
-
-
-
-
- 3.5
- On
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/hostapplication.exe.config b/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/hostapplication.exe.config
deleted file mode 100644
index 6e49f0b25df..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/hostapplication.exe.config
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/hostapplication.vb b/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/hostapplication.vb
deleted file mode 100644
index a8bfa15a1e2..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/hostapplication.vb
+++ /dev/null
@@ -1,40 +0,0 @@
-
-Imports System.Configuration
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.Text
-
-Namespace Microsoft.WCF.Documentation
- Friend Class HostApplication
-
- Shared Sub Main()
- Dim app As New HostApplication()
- app.Run()
- End Sub
-
- Private Sub Run()
- ' Create a ServiceHost for the service type and use the base address from configuration.
- Using serviceHost As New ServiceHost(GetType(SampleService))
- Try
- ' Open the ServiceHostBase to create listeners and start listening for messages.
- serviceHost.Open()
-
- ' The service can now be accessed.
- Console.WriteLine("The service is ready.")
- Console.WriteLine("Press to terminate service.")
- Console.WriteLine()
- Console.ReadLine()
-
- ' Close the ServiceHostBase to shutdown the service.
- serviceHost.Close()
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.Message)
- Console.Read()
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.Message)
- Console.Read()
- End Try
- End Using
- End Sub
- End Class
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/iendpointbehaviormessageinspector.vb b/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/iendpointbehaviormessageinspector.vb
deleted file mode 100644
index fe3442210c2..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/iendpointbehaviormessageinspector.vb
+++ /dev/null
@@ -1,75 +0,0 @@
-'
-
-
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.ServiceModel.Configuration
-Imports System.ServiceModel.Description
-Imports System.ServiceModel.Dispatcher
-Imports System.Text
-
-Namespace Microsoft.WCF.Documentation
- Friend Class EndpointBehaviorMessageInspector
- Inherits BehaviorExtensionElement
- Implements IEndpointBehavior, IDispatchMessageInspector, IClientMessageInspector
- '
- ' IEndpointBehavior Members
- Public Sub AddBindingParameters(ByVal serviceEndpoint As ServiceEndpoint, ByVal bindingParameters As System.ServiceModel.Channels.BindingParameterCollection) Implements IEndpointBehavior.AddBindingParameters
- Return
- End Sub
-
- Public Sub ApplyClientBehavior(ByVal serviceEndpoint As ServiceEndpoint, ByVal behavior As ClientRuntime) Implements IEndpointBehavior.ApplyClientBehavior
- behavior.MessageInspectors.Add(New EndpointBehaviorMessageInspector())
- End Sub
-
- Public Sub ApplyDispatchBehavior(ByVal serviceEndpoint As ServiceEndpoint, ByVal endpointDispatcher As EndpointDispatcher) Implements IEndpointBehavior.ApplyDispatchBehavior
- endpointDispatcher.DispatchRuntime.MessageInspectors.Add(New EndpointBehaviorMessageInspector())
- End Sub
-
- Public Sub Validate(ByVal serviceEndpoint As ServiceEndpoint) Implements IEndpointBehavior.Validate
- Return
- End Sub
- '
-
- '
- ' BehaviorExtensionElement members
- Public Overrides ReadOnly Property BehaviorType() As Type
- Get
- Return GetType(EndpointBehaviorMessageInspector)
- End Get
- End Property
-
- Protected Overrides Function CreateBehavior() As Object
- Return New EndpointBehaviorMessageInspector()
- End Function
- '
-
- '
- ' IDispatchMessageInspector Members
-
- Public Function AfterReceiveRequest(ByRef request As System.ServiceModel.Channels.Message, ByVal channel As IClientChannel, ByVal instanceContext As InstanceContext) As Object Implements IDispatchMessageInspector.AfterReceiveRequest
- Console.WriteLine("AfterReceiveRequest called.")
- Return Nothing
- End Function
-
- Public Sub BeforeSendReply(ByRef reply As System.ServiceModel.Channels.Message, ByVal correlationState As Object) Implements IDispatchMessageInspector.BeforeSendReply
- Console.WriteLine("BeforeSendReply called.")
- End Sub
- '
-
-
- #Region "IClientMessageInspector Members"
-
- Public Sub AfterReceiveReply(ByRef reply As System.ServiceModel.Channels.Message, ByVal correlationState As Object) Implements IClientMessageInspector.AfterReceiveReply
- Console.WriteLine("AfterReceiveReply called.")
- End Sub
-
- Public Function BeforeSendRequest(ByRef request As System.ServiceModel.Channels.Message, ByVal channel As IClientChannel) As Object Implements IClientMessageInspector.BeforeSendRequest
- Console.WriteLine("BeforeSendRequest called.")
- Return Nothing
- End Function
-
- #End Region
- End Class
-End Namespace
-'
diff --git a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/proxycode.vb b/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/proxycode.vb
deleted file mode 100644
index d389f96be79..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/proxycode.vb
+++ /dev/null
@@ -1,90 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.42
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-
-
-Imports System.Runtime.Serialization
-
-
-
-Namespace Microsoft.WCF.Documentation
-
-
- _
- Partial Public Class SampleFault
- Inherits Object
- Implements System.Runtime.Serialization.IExtensibleDataObject
-
- Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
-
- Private FaultMessageField As String
-
- Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData
- Get
- Return Me.extensionDataField
- End Get
- Set(ByVal value As System.Runtime.Serialization.ExtensionDataObject)
- Me.extensionDataField = value
- End Set
- End Property
-
- _
- Public Property FaultMessage() As String
- Get
- Return Me.FaultMessageField
- End Get
- Set(ByVal value As String)
- Me.FaultMessageField = value
- End Set
- End Property
- End Class
-End Namespace
-
-
- _
-Public Interface ISampleService
-
- _
- Function SampleMethod(ByVal msg As String) As String
-End Interface
-
- _
-Public Interface ISampleServiceChannel
- Inherits ISampleService, System.ServiceModel.IClientChannel
-End Interface
-
- _
-Partial Public Class SampleServiceClient
- Inherits System.ServiceModel.ClientBase(Of ISampleService)
- Implements ISampleService
-
- Public Sub New()
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String)
- MyBase.New(endpointConfigurationName)
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As String)
- MyBase.New(endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal binding As System.ServiceModel.Channels.Binding, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(binding, remoteAddress)
- End Sub
-
- Public Function SampleMethod(ByVal msg As String) As String Implements ISampleService.SampleMethod
- Return MyBase.Channel.SampleMethod(msg)
- End Function
-End Class
diff --git a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/services.vb b/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/services.vb
deleted file mode 100644
index ac0f98f502a..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/services.vb
+++ /dev/null
@@ -1,38 +0,0 @@
-
-Imports System.Collections.Generic
-Imports System.Runtime.Serialization
-Imports System.ServiceModel
-Imports System.Text
-
-Namespace Microsoft.WCF.Documentation
- _
- Public Interface ISampleService
-
- _
- Function SampleMethod(ByVal msg As String) As String
- End Interface
-
- Friend Class SampleService
- Implements ISampleService
- Public Function SampleMethod(ByVal msg As String) As String Implements ISampleService.SampleMethod
- Console.WriteLine("The caller said: ""{0}""", msg)
- Return "The service greets you: " & msg
- End Function
- End Class
-
- ' The detail type of the specified SOAP fault.
- _
- Public Class SampleFault
- _
- Private msg As String
-
- Public Property FaultMessage() As String
- Get
- Return Me.msg
- End Get
- Set(ByVal value As String)
- Me.msg = value
- End Set
- End Property
- End Class
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/client.vb b/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/client.vb
deleted file mode 100644
index 016216c9151..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/client.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-Imports System.ServiceModel
-Imports System.ServiceModel.Channels
-
-Public Class Client
- Public Shared Sub Main()
- ' Picks up configuration from the config file.
- Dim wcfClient As New SampleServiceClient()
- Try
- ' Making calls.
- Console.WriteLine("Enter the greeting to send: ")
- Dim greeting As String = Console.ReadLine()
- Console.WriteLine("The service responded: " & wcfClient.SampleMethod(greeting))
-
- ' Done with service.
- wcfClient.Close()
- Console.WriteLine("Done!")
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.StackTrace)
- wcfClient.Abort()
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.StackTrace)
- wcfClient.Abort()
- Finally
- Console.WriteLine("Press ENTER to exit:")
- Console.ReadLine()
- End Try
- End Sub
-End Class
diff --git a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/client.vbproj b/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/client.vbproj
deleted file mode 100644
index 3c221f3b9b8..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/client.vbproj
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
- Debug
- AnyCPU
- {66190530-B4E3-4BF0-94B4-DFE52D15E50F}
- Exe
- false
- Client
-
-
-
-
-
-
- 2.0
- On
- On
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/host.vbproj b/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/host.vbproj
deleted file mode 100644
index 54159b905c4..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/host.vbproj
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
- Debug
- AnyCPU
- {907F0C93-0FC2-4419-B0CE-2B775830A3C2}
- Exe
- false
- HostApplication
-
-
-
-
-
-
- 2.0
- On
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
- On
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/hostapplication.vb b/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/hostapplication.vb
deleted file mode 100644
index cdca5809271..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/hostapplication.vb
+++ /dev/null
@@ -1,40 +0,0 @@
-Imports System.Configuration
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.Text
-
-Namespace Microsoft.WCF.Documentation
- Friend Class HostApplication
-
- Shared Sub Main()
- Dim app As New HostApplication()
- app.Run()
- End Sub
-
- Private Sub Run()
- ' Create a ServiceHost for the service type and use the base address from configuration.
- Using serviceHost As New ServiceHost(GetType(SampleService))
- Try
-
- ' Open the ServiceHostBase to create listeners and start listening for messages.
- serviceHost.Open()
-
- ' The service can now be accessed.
- Console.WriteLine("The service is ready.")
- Console.WriteLine("Press to terminate service.")
- Console.WriteLine()
- Console.ReadLine()
-
- ' Close the ServiceHostBase to shutdown the service.
- serviceHost.Close()
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.Message)
- Console.Read()
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.Message)
- Console.Read()
- End Try
- End Using
- End Sub
- End Class
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/objectproviderbehavior.vb b/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/objectproviderbehavior.vb
deleted file mode 100644
index c6ee178c2d1..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/objectproviderbehavior.vb
+++ /dev/null
@@ -1,82 +0,0 @@
-'
-
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.ServiceModel.Configuration
-Imports System.ServiceModel.Description
-Imports System.ServiceModel.Dispatcher
-Imports System.Text
-Imports System.Xml
-
-Namespace Microsoft.WCF.Documentation
- '
- Public Class ObjectProviderBehavior
- Implements IInstanceProvider
-
- Private message As String
- Private service As SampleService = Nothing
-
- Public Sub New(ByVal msg As String)
- Console.WriteLine("The non-default constructor has been called.")
- Me.message = msg
- Me.service = New SampleService("Singleton sample service.")
- End Sub
-
- #Region "IInstanceProvider Members"
-
- Public Function GetInstance(ByVal instanceContext As InstanceContext, ByVal message As System.ServiceModel.Channels.Message) As Object Implements IInstanceProvider.GetInstance
- Console.WriteLine("GetInstance is called:")
- Return Me.service
- End Function
-
- Public Function GetInstance(ByVal instanceContext As InstanceContext) As Object Implements IInstanceProvider.GetInstance
- Console.WriteLine("GetInstance is called:")
- Return Me.service
- End Function
-
- Public Sub ReleaseInstance(ByVal instanceContext As InstanceContext, ByVal instance As Object) Implements IInstanceProvider.ReleaseInstance
- Console.WriteLine("ReleaseInstance is called. The SingletonBehaviorAttribute never releases.")
- End Sub
-
- #End Region
- End Class
- '
-
- '
- Public Class SingletonBehaviorAttribute
- Inherits Attribute
- Implements IContractBehaviorAttribute, IContractBehavior
-
- #Region "IContractBehaviorAttribute Members"
-
- Public ReadOnly Property TargetContract() As Type Implements IContractBehaviorAttribute.TargetContract
- Get
- Return GetType(ISampleService)
- End Get
- End Property
-
- #End Region
-
- #Region "IContractBehavior Members"
-
- Public Sub AddBindingParameters(ByVal description As ContractDescription, ByVal endpoint As ServiceEndpoint, ByVal parameters As System.ServiceModel.Channels.BindingParameterCollection) Implements IContractBehavior.AddBindingParameters
- Return
- End Sub
-
- Public Sub ApplyClientBehavior(ByVal description As ContractDescription, ByVal endpoint As ServiceEndpoint, ByVal clientRuntime As ClientRuntime) Implements IContractBehavior.ApplyClientBehavior
- Return
- End Sub
-
- Public Sub ApplyDispatchBehavior(ByVal description As ContractDescription, ByVal endpoint As ServiceEndpoint, ByVal dispatch As DispatchRuntime) Implements IContractBehavior.ApplyDispatchBehavior
- dispatch.InstanceProvider = New ObjectProviderBehavior("Custom ObjectProviderBehavior constructor.")
- End Sub
-
- Public Sub Validate(ByVal description As ContractDescription, ByVal endpoint As ServiceEndpoint) Implements IContractBehavior.Validate
- Return
- End Sub
-
- #End Region
- End Class
- '
-End Namespace
-'
diff --git a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/proxycode.vb b/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/proxycode.vb
deleted file mode 100644
index 705dc0a05a1..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/proxycode.vb
+++ /dev/null
@@ -1,51 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.42
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-
- _
-Public Interface ISampleService
-
- _
- Function SampleMethod(ByVal msg As String) As String
-End Interface
-
- _
-Public Interface ISampleServiceChannel
- Inherits ISampleService, System.ServiceModel.IClientChannel
-End Interface
-
- _
-Partial Public Class SampleServiceClient
- Inherits System.ServiceModel.ClientBase(Of ISampleService)
- Implements ISampleService
-
- Public Sub New()
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String)
- MyBase.New(endpointConfigurationName)
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As String)
- MyBase.New(endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal binding As System.ServiceModel.Channels.Binding, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(binding, remoteAddress)
- End Sub
-
- Public Function SampleMethod(ByVal msg As String) As String Implements ISampleService.SampleMethod
- Return MyBase.Channel.SampleMethod(msg)
- End Function
-End Class
diff --git a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/services.vb b/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/services.vb
deleted file mode 100644
index 54b4443ac75..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/services.vb
+++ /dev/null
@@ -1,32 +0,0 @@
-'
-
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.Text
-
-Namespace Microsoft.WCF.Documentation
- _
- Public Interface ISampleService
- _
- Function SampleMethod(ByVal msg As String) As String
- End Interface
-
- _
- Public Class SampleService
- Implements ISampleService
- #Region "ISampleService Members"
- Private message As String
-
- Public Sub New(ByVal msg As String)
- Me.message = msg
- End Sub
-
- Public Function SampleMethod(ByVal msg As String) As String Implements ISampleService.SampleMethod
- Console.WriteLine("The caller said: " & msg)
- Return Me.message
- End Function
-
- #End Region
- End Class
-End Namespace
-'
diff --git a/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/cs.vbproj b/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/cs.vbproj
deleted file mode 100644
index e86e018e829..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/cs.vbproj
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
- Debug
- AnyCPU
- 9.0.30729
- 2.0
- {7BF5F387-4FA7-43FF-AB48-01D8A630FE19}
- Exe
-
-
- CS
-
-
-
-
- 2.0
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
- On
-
-
- true
- full
- false
- bin\Debug\
- true
- true
- prompt
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- bin\Release\
- false
- true
- prompt
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
- False
- ..\..\..\..\..\Whidbey\Assemblies\System.ServiceModel.dll
-
-
-
-
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/module1.vb b/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/module1.vb
deleted file mode 100644
index cd98cf18df9..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/module1.vb
+++ /dev/null
@@ -1,67 +0,0 @@
-' Snippet for S_UENamedPipeTransportBindingElement.
-
-Imports System.Collections.Generic
-Imports System.Configuration
-Imports System.Globalization
-Imports System.Net
-Imports System.Net.Security
-Imports System.ServiceModel
-Imports System.ServiceModel.Channels
-Imports System.ServiceModel.Configuration
-Imports System.ServiceModel.Security
-Imports System.Text
-Imports System.Xml
-
-Namespace Snippets
- Module Module1
-
- Sub Main()
- '
- '
- '
- '
- Dim bElement As New NamedPipeTransportBindingElement()
- '
-
- Dim connectionPoolSettings As NamedPipeConnectionPoolSettings = bElement.ConnectionPoolSettings
- '
- '
- '
-
- '
- Dim scheme As String = bElement.Scheme
- '
-
- '
- Dim bElementCopy As BindingElement = bElement.Clone()
- '
-
- '
- Dim binding As New BasicHttpBinding()
- Dim b As ISecurityCapabilities = binding.GetProperty(Of ISecurityCapabilities)(New BindingParameterCollection())
-
- Dim SupportsServerAuthentication As Boolean = b.SupportsServerAuthentication
- '
-
- End Sub
-
- Private Sub RunClient()
- Dim binding As New CustomBinding()
- binding.Elements.Add(New NamedPipeTransportBindingElement())
- Dim customBinding As New CustomBinding()
- Dim bpCollection As New BindingParameterCollection()
-
- '
- Dim bContext As New BindingContext(customBinding, bpCollection)
- Dim factory As IChannelFactory(Of IOutputChannel) = binding.BuildChannelFactory(Of IOutputChannel)(bContext)
- '
-
- '
- Dim listener As IChannelListener(Of IOutputChannel) = binding.BuildChannelListener(Of IOutputChannel)(bContext)
- '
-
- End Sub
-
- End Module
-
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/my project/assemblyinfo.vb b/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/my project/assemblyinfo.vb
deleted file mode 100644
index a0b25ee834d..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/my project/assemblyinfo.vb
+++ /dev/null
@@ -1,33 +0,0 @@
-Imports System.Reflection
-Imports System.Runtime.CompilerServices
-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.
-
-
-
-
-
-
-
-
-
-' Setting ComVisible to false makes the types in this assembly not visible
-' to COM components. If you need to access a type in this assembly from
-' COM, set the ComVisible attribute to true on that type.
-
-
-' 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
-'
-
-
diff --git a/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/cs.vbproj b/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/cs.vbproj
deleted file mode 100644
index f97a4aa12b5..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/cs.vbproj
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
- Debug
- AnyCPU
- 9.0.21022
- 2.0
- {6D2BC98D-8A4A-4A15-8EEC-98E221C380D9}
- Exe
-
-
- CS
-
-
-
-
- 2.0
- On
- On
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- bin\Debug\
- true
- true
- prompt
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- bin\Release\
- false
- true
- prompt
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/module1.vb b/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/module1.vb
deleted file mode 100644
index 7664e82187f..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/module1.vb
+++ /dev/null
@@ -1,9 +0,0 @@
-Imports System.Collections.Generic
-Imports System.Text
-
-Namespace CS
- Module Module1
- Sub Main(ByVal args() As String)
- End Sub
- End Module
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/my project/assemblyinfo.vb b/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/my project/assemblyinfo.vb
deleted file mode 100644
index 991ffcb7cb8..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/my project/assemblyinfo.vb
+++ /dev/null
@@ -1,33 +0,0 @@
-Imports System.Reflection
-Imports System.Runtime.CompilerServices
-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.
-
-
-
-
-
-
-
-
-
-' Setting ComVisible to false makes the types in this assembly not visible
-' to COM components. If you need to access a type in this assembly from
-' COM, set the ComVisible attribute to true on that type.
-
-
-' 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
-'
-
-
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/client.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/client.vb
deleted file mode 100644
index deb65ebf363..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/client.vb
+++ /dev/null
@@ -1,62 +0,0 @@
-'
-
-Imports System.ServiceModel
-Imports System.ServiceModel.Channels
-Imports System.Threading
-
-Namespace Microsoft.WCF.Documentation
- Public Class Client
- Implements SampleDuplexHelloCallback
- Private waitHandle As AutoResetEvent
-
- Public Sub New()
- waitHandle = New AutoResetEvent(False)
- End Sub
-
- Public Sub Run()
- ' Picks up configuration from the config file.
- Dim wcfClient As New SampleDuplexHelloClient(New InstanceContext(Me))
- Try
- Console.ForegroundColor = ConsoleColor.White
- Console.WriteLine("Enter a greeting to send and press ENTER: ")
- Console.Write(">>> ")
- Console.ForegroundColor = ConsoleColor.Green
- Dim greeting = Console.ReadLine()
- Console.ForegroundColor = ConsoleColor.White
- Console.WriteLine("Called service with: " & Constants.vbCrLf & Constants.vbTab & greeting)
- wcfClient.Hello(greeting)
- Console.WriteLine("Execution passes service call and moves to the WaitHandle.")
- Me.waitHandle.WaitOne()
- Console.ForegroundColor = ConsoleColor.Blue
- Console.WriteLine("Set was called.")
- Console.Write("Press ")
- Console.ForegroundColor = ConsoleColor.Red
- Console.Write("ENTER")
- Console.ForegroundColor = ConsoleColor.Blue
- Console.Write(" to exit...")
- Console.ReadLine()
- wcfClient.Close()
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.Message)
- Console.ReadLine()
- wcfClient.Abort()
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.Message)
- Console.ReadLine()
- wcfClient.Abort()
- End Try
- End Sub
-
- Public Shared Sub Main()
- Dim client As New Client()
- client.Run()
- End Sub
-
- Public Sub Reply(ByVal response As String) Implements SampleDuplexHelloCallback.Reply
- Console.WriteLine("Received output.")
- Console.WriteLine(Constants.vbCrLf & Constants.vbTab & response)
- Me.waitHandle.Set()
- End Sub
- End Class
-End Namespace
-'
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/client.vbproj b/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/client.vbproj
deleted file mode 100644
index dd66f7a9738..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/client.vbproj
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
- Debug
- AnyCPU
- {66190530-B4E3-4BF0-94B4-DFE52D15E50F}
- Exe
- false
- Client
-
-
-
-
- 2.0
-
-
- On
- On
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/host.vbproj b/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/host.vbproj
deleted file mode 100644
index f98e2f679a7..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/host.vbproj
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
- Debug
- AnyCPU
- {907F0C93-0FC2-4419-B0CE-2B775830A3C2}
- Exe
- false
- HostApplication
-
-
-
-
- 2.0
-
-
- On
- On
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/hostapplication.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/hostapplication.vb
deleted file mode 100644
index 985162ab083..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/hostapplication.vb
+++ /dev/null
@@ -1,38 +0,0 @@
-
-Imports System.Configuration
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.Text
-
-Namespace Microsoft.WCF.Documentation
- Friend Class HostApplication
-
- Shared Sub Main()
- Dim app As New HostApplication()
- app.Run()
- End Sub
-
- Private Sub Run()
- ' Create a ServiceHost for the service type and use the base address from configuration.
- Using serviceHost As New ServiceHost(GetType(DuplexHello))
- Try
- ' Open the ServiceHostBase to create listeners and start listening for messages.
- serviceHost.Open()
-
- ' The service can now be accessed.
- Console.WriteLine("The service is ready.")
- Console.WriteLine("Press to terminate service.")
- Console.WriteLine()
- Console.ReadLine()
-
- ' Close the ServiceHostBase to shutdown the service.
- serviceHost.Close()
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.Message)
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.Message)
- End Try
- End Using
- End Sub
- End Class
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/proxycode.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/proxycode.vb
deleted file mode 100644
index c25de1fcdc5..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/proxycode.vb
+++ /dev/null
@@ -1,68 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.42
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-
-
-
-
- _
-Public Interface SampleDuplexHello
-
- _
- Sub Hello(ByVal greeting As String)
-End Interface
-
- _
-Public Interface SampleDuplexHelloCallback
-
- _
- Sub Reply(ByVal responseToGreeting As String)
-End Interface
-
- _
-Public Interface SampleDuplexHelloChannel
- Inherits SampleDuplexHello, System.ServiceModel.IClientChannel
-End Interface
-
- _
-Partial Public Class SampleDuplexHelloClient
- Inherits System.ServiceModel.DuplexClientBase(Of SampleDuplexHello)
- Implements SampleDuplexHello
-
- Public Sub New(ByVal callbackInstance As System.ServiceModel.InstanceContext)
- MyBase.New(callbackInstance)
- End Sub
-
- Public Sub New(ByVal callbackInstance As System.ServiceModel.InstanceContext, ByVal endpointConfigurationName As String)
- MyBase.New(callbackInstance, endpointConfigurationName)
- End Sub
-
- Public Sub New(ByVal callbackInstance As System.ServiceModel.InstanceContext, ByVal endpointConfigurationName _
- As String, ByVal remoteAddress As String)
- MyBase.New(callbackInstance, endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal callbackInstance As System.ServiceModel.InstanceContext, ByVal endpointConfigurationName _
- As String, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(callbackInstance, endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal callbackInstance As System.ServiceModel.InstanceContext, ByVal binding As System.ServiceModel.Channels.Binding, _
- ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(callbackInstance, binding, remoteAddress)
- End Sub
-
- Public Sub Hello(ByVal greeting As String) Implements SampleDuplexHello.Hello
- MyBase.Channel.Hello(greeting)
- End Sub
-End Class
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/services.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/services.vb
deleted file mode 100644
index 13e3f3e7a5d..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/services.vb
+++ /dev/null
@@ -1,44 +0,0 @@
-'
-
-
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.Threading
-
-Namespace Microsoft.WCF.Documentation
- _
- Public Interface IDuplexHello
- _
- Sub Hello(ByVal greeting As String)
- End Interface
-
- Public Interface IHelloCallbackContract
- _
- Sub Reply(ByVal responseToGreeting As String)
- End Interface
-
- Public Class DuplexHello
- Implements IDuplexHello
- Public Sub New()
- Console.WriteLine("Service object created: " & Me.GetHashCode().ToString())
- End Sub
-
- Protected Overrides Sub Finalize()
- Console.WriteLine("Service object destroyed: " & Me.GetHashCode().ToString())
- End Sub
-
- Public Sub Hello(ByVal greeting As String) Implements IDuplexHello.Hello
- Console.WriteLine("Caller sent: " & greeting)
- Console.WriteLine("Session ID: " & OperationContext.Current.SessionId)
- Console.WriteLine("Waiting two seconds before returning call.")
- ' Put a slight delay to demonstrate asynchronous behavior on client.
- Thread.Sleep(2000)
- Dim callerProxy = OperationContext.Current.GetCallbackChannel(Of IHelloCallbackContract)()
- Dim response = "Service object " & Me.GetHashCode().ToString() & " received: " & greeting
- Console.WriteLine("Sending back: " & response)
- callerProxy.Reply(response)
- End Sub
- End Class
-End Namespace
-'
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/client.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/client.vb
deleted file mode 100644
index 2cebab81c44..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/client.vb
+++ /dev/null
@@ -1,32 +0,0 @@
-'
-
-
-Imports System.ServiceModel
-Imports System.ServiceModel.Channels
-
-Public Class Client
- Public Shared Sub Main()
- ' Picks up configuration from the config file.
- Dim wcfClient As New HelloWorldClient()
- Try
- ' Making calls.
- Console.WriteLine("Enter the greeting to send: ")
- Dim greeting = Console.ReadLine()
- Console.WriteLine("The service responded: " & wcfClient.SampleMethod(greeting))
-
- ' Done with service.
- wcfClient.Close()
- Console.WriteLine("Done!")
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.Message)
- wcfClient.Abort()
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.Message)
- wcfClient.Abort()
- Finally
- Console.WriteLine("Press ENTER to exit:")
- Console.ReadLine()
- End Try
- End Sub
-End Class
-'
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/client.vbproj b/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/client.vbproj
deleted file mode 100644
index dd66f7a9738..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/client.vbproj
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
- Debug
- AnyCPU
- {66190530-B4E3-4BF0-94B4-DFE52D15E50F}
- Exe
- false
- Client
-
-
-
-
- 2.0
-
-
- On
- On
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/host.vbproj b/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/host.vbproj
deleted file mode 100644
index f98e2f679a7..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/host.vbproj
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
- Debug
- AnyCPU
- {907F0C93-0FC2-4419-B0CE-2B775830A3C2}
- Exe
- false
- HostApplication
-
-
-
-
- 2.0
-
-
- On
- On
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/hostapplication.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/hostapplication.vb
deleted file mode 100644
index 50eca0d12ba..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/hostapplication.vb
+++ /dev/null
@@ -1,38 +0,0 @@
-
-Imports System.Configuration
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.Text
-
-Namespace Microsoft.WCF.Documentation
- Friend Class HostApplication
-
- Shared Sub Main()
- Dim app As New HostApplication()
- app.Run()
- End Sub
-
- Private Sub Run()
- ' Create a ServiceHost for the service type and use the base address from config.
- Using serviceHost As New ServiceHost(GetType(SampleService))
- Try
- ' Open the ServiceHostBase to create listeners and start listening for messages.
- serviceHost.Open()
-
- ' The service can now be accessed.
- Console.WriteLine("The service is ready.")
- Console.WriteLine("Press to terminate service.")
- Console.WriteLine()
- Console.ReadLine()
-
- ' Close the ServiceHostBase to shutdown the service.
- serviceHost.Close()
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.Message)
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.Message)
- End Try
- End Using
- End Sub
- End Class
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/proxycode.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/proxycode.vb
deleted file mode 100644
index 22d0ffd31bb..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/proxycode.vb
+++ /dev/null
@@ -1,57 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.42
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-
-
-
-
- _
-Public Interface HelloWorld
-
- _
- Function SampleMethod(ByVal msg As String) As String
-End Interface
-
- _
-Public Interface HelloWorldChannel
- Inherits HelloWorld, System.ServiceModel.IClientChannel
-End Interface
-
- _
-Partial Public Class HelloWorldClient
- Inherits System.ServiceModel.ClientBase(Of HelloWorld)
- Implements HelloWorld
-
- Public Sub New()
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String)
- MyBase.New(endpointConfigurationName)
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As String)
- MyBase.New(endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal binding As System.ServiceModel.Channels.Binding, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(binding, remoteAddress)
- End Sub
-
- Public Function SampleMethod(ByVal msg As String) As String Implements HelloWorld.SampleMethod
- Return MyBase.Channel.SampleMethod(msg)
- End Function
-End Class
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/services.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/services.vb
deleted file mode 100644
index 04cfc8ecd54..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.names/vb/services.vb
+++ /dev/null
@@ -1,26 +0,0 @@
-'
-
-
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.Text
-
-Namespace Microsoft.WCF.Documentation
- _
- Public Interface ISampleService
- _
- Function SampleMethod(ByVal msg As String) As String
- End Interface
-
- Friend Class SampleService
- Implements ISampleService
- #Region "ISampleService Members"
-
- Public Function SampleMethod(ByVal msg As String) As String Implements ISampleService.SampleMethod
- Return "The service greets you: " & msg
- End Function
-
- #End Region
- End Class
-End Namespace
-'
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/client.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/client.vb
deleted file mode 100644
index ccc3ffccf0b..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/client.vb
+++ /dev/null
@@ -1,64 +0,0 @@
-'
-
-Imports System.ServiceModel
-Imports System.ServiceModel.Channels
-Imports System.Threading
-
-Namespace Microsoft.WCF.Documentation
- Public Class Client
- Implements SampleDuplexHelloCallback
- Private waitHandle As AutoResetEvent
-
- Public Sub New()
- waitHandle = New AutoResetEvent(False)
- End Sub
-
- Public Sub Run()
- ' Picks up configuration from the config file.
- Dim wcfClient As New SampleDuplexHelloClient(New InstanceContext(Me))
- Try
- Console.ForegroundColor = ConsoleColor.White
- Console.WriteLine("Enter a greeting to send and press ENTER: ")
- Console.Write(">>> ")
- Console.ForegroundColor = ConsoleColor.Green
- Dim greeting = Console.ReadLine()
- Console.ForegroundColor = ConsoleColor.White
- Console.WriteLine("Called service with: " & Constants.vbCrLf & Constants.vbTab & greeting)
- wcfClient.Hello(greeting)
- wcfClient.Hello("Second greeting.")
- Console.WriteLine("Execution passes service call and moves to the WaitHandle.")
- Me.waitHandle.WaitOne()
- Console.ForegroundColor = ConsoleColor.Blue
- Console.WriteLine("Set was called.")
- Console.Write("Press ")
- Console.ForegroundColor = ConsoleColor.Red
- Console.Write("ENTER")
- Console.ForegroundColor = ConsoleColor.Blue
- Console.Write(" to exit...")
- Console.ReadLine()
- wcfClient.Close()
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.Message)
- Console.ReadLine()
- wcfClient.Abort()
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.Message)
- Console.ReadLine()
- wcfClient.Abort()
- End Try
- End Sub
- Public Shared Sub Main()
- Dim client As New Client()
- client.Run()
- End Sub
-
- Public Sub Reply(ByVal response As String) Implements SampleDuplexHelloCallback.Reply
- Console.WriteLine("Received output.")
- Console.WriteLine(Constants.vbCrLf & Constants.vbTab & response)
- If response.Contains("Second greeting.") Then
- Me.waitHandle.Set()
- End If
- End Sub
- End Class
-End Namespace
-'
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/client.vbproj b/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/client.vbproj
deleted file mode 100644
index dd66f7a9738..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/client.vbproj
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
- Debug
- AnyCPU
- {66190530-B4E3-4BF0-94B4-DFE52D15E50F}
- Exe
- false
- Client
-
-
-
-
- 2.0
-
-
- On
- On
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/host.vbproj b/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/host.vbproj
deleted file mode 100644
index f98e2f679a7..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/host.vbproj
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
- Debug
- AnyCPU
- {907F0C93-0FC2-4419-B0CE-2B775830A3C2}
- Exe
- false
- HostApplication
-
-
-
-
- 2.0
-
-
- On
- On
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/hostapplication.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/hostapplication.vb
deleted file mode 100644
index 9d434f0b695..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/hostapplication.vb
+++ /dev/null
@@ -1,41 +0,0 @@
-
-Imports System.Configuration
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.Text
-
-Namespace Microsoft.WCF.Documentation
- Friend Class HostApplication
-
- Shared Sub Main()
- Dim app As New HostApplication()
- app.Run()
- End Sub
-
- Private Sub Run()
- ' Get base address from app settings in configuration if you want.
- Dim baseAddress As New Uri(ConfigurationManager.AppSettings("baseAddress"))
-
- ' Create a ServiceHost for the service type and provide the base address.
- Using serviceHost As New ServiceHost(GetType(DuplexHello), baseAddress)
- Try
- ' Open the ServiceHostBase to create listeners and start listening for messages.
- serviceHost.Open()
-
- ' The service can now be accessed.
- Console.WriteLine("The service is ready.")
- Console.WriteLine("Press to terminate service.")
- Console.WriteLine()
- Console.ReadLine()
-
- ' Close the ServiceHostBase to shutdown the service.
- serviceHost.Close()
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.Message)
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.Message)
- End Try
- End Using
- End Sub
- End Class
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/proxycode.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/proxycode.vb
deleted file mode 100644
index 329b79a7e58..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/proxycode.vb
+++ /dev/null
@@ -1,67 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.42
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-
-
-
-
- _
-Public Interface SampleDuplexHello
-
- _
- Sub Hello(ByVal greeting As String)
-End Interface
-
- _
-Public Interface SampleDuplexHelloCallback
-
- _
- Sub Reply(ByVal responseToGreeting As String)
-End Interface
-
- _
-Public Interface SampleDuplexHelloChannel
- Inherits SampleDuplexHello, System.ServiceModel.IClientChannel
-End Interface
-
- _
-Partial Public Class SampleDuplexHelloClient
- Inherits System.ServiceModel.DuplexClientBase(Of SampleDuplexHello)
- Implements SampleDuplexHello
-
- Public Sub New(ByVal callbackInstance As System.ServiceModel.InstanceContext)
- MyBase.New(callbackInstance)
- End Sub
-
- Public Sub New(ByVal callbackInstance As System.ServiceModel.InstanceContext, ByVal endpointConfigurationName As String)
- MyBase.New(callbackInstance, endpointConfigurationName)
- End Sub
-
- Public Sub New(ByVal callbackInstance As System.ServiceModel.InstanceContext, ByVal endpointConfigurationName As String, _
- ByVal remoteAddress As String)
- MyBase.New(callbackInstance, endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal callbackInstance As System.ServiceModel.InstanceContext, ByVal endpointConfigurationName As String, _
- ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(callbackInstance, endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal callbackInstance As System.ServiceModel.InstanceContext, ByVal binding As _
- System.ServiceModel.Channels.Binding, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(callbackInstance, binding, remoteAddress)
- End Sub
-
- Public Sub Hello(ByVal greeting As String) Implements SampleDuplexHello.Hello
- MyBase.Channel.Hello(greeting)
- End Sub
-End Class
diff --git a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/services.vb b/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/services.vb
deleted file mode 100644
index 03d37fc1912..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/sca.session/vb/services.vb
+++ /dev/null
@@ -1,46 +0,0 @@
-'
-
-
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.Threading
-
-Namespace Microsoft.WCF.Documentation
- _
- Public Interface IDuplexHello
- _
- Sub Hello(ByVal greeting As String)
- End Interface
-
- Public Interface IHelloCallbackContract
- _
- Sub Reply(ByVal responseToGreeting As String)
- End Interface
-
- _
- Public Class DuplexHello
- Implements IDuplexHello
-
- Public Sub New()
- Console.WriteLine("Service object created: " & Me.GetHashCode().ToString())
- End Sub
-
- Protected Overrides Sub Finalize()
- Console.WriteLine("Service object destroyed: " & Me.GetHashCode().ToString())
- End Sub
-
- Public Sub Hello(ByVal greeting As String) Implements IDuplexHello.Hello
- Console.WriteLine("Caller sent: " & greeting)
- Console.WriteLine("Session ID: " & OperationContext.Current.SessionId)
- Console.WriteLine("Waiting two seconds before returning call.")
- ' Put a slight delay to demonstrate asynchronous behavior on client.
- Thread.Sleep(2000)
- Dim callerProxy As IHelloCallbackContract = OperationContext.Current.GetCallbackChannel(Of IHelloCallbackContract)()
- Dim response = "Service object " & Me.GetHashCode().ToString() & " received: " & greeting
- Console.WriteLine("Sending back: " & response)
- callerProxy.Reply(response)
- End Sub
- End Class
-End Namespace
-'
diff --git a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/client.vb b/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/client.vb
deleted file mode 100644
index c0a20c86bef..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/client.vb
+++ /dev/null
@@ -1,34 +0,0 @@
-'
-
-
-Imports System.ServiceModel
-Imports System.ServiceModel.Channels
-
-Public Class Client
- Public Shared Sub Main()
- ' Picks up configuration from the config file.
- Dim wcfClient As New SampleServiceClient()
- Try
- ' Making calls.
- Console.WriteLine("Enter the greeting to send: ")
- Dim greeting = Console.ReadLine()
- Console.WriteLine("The service responded: " & wcfClient.SampleMethod(greeting))
-
- Console.WriteLine("Press ENTER to exit:")
- Console.ReadLine()
-
- ' Done with service.
- wcfClient.Close()
- Console.WriteLine("Done!")
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.Message)
- wcfClient.Abort()
- Console.Read()
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.Message)
- wcfClient.Abort()
- Console.Read()
- End Try
- End Sub
-End Class
-'
diff --git a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/client.vbproj b/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/client.vbproj
deleted file mode 100644
index dd66f7a9738..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/client.vbproj
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
- Debug
- AnyCPU
- {66190530-B4E3-4BF0-94B4-DFE52D15E50F}
- Exe
- false
- Client
-
-
-
-
- 2.0
-
-
- On
- On
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/host.vbproj b/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/host.vbproj
deleted file mode 100644
index f98e2f679a7..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/host.vbproj
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
- Debug
- AnyCPU
- {907F0C93-0FC2-4419-B0CE-2B775830A3C2}
- Exe
- false
- HostApplication
-
-
-
-
- 2.0
-
-
- On
- On
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- .\bin\Debug\
- true
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
- pdbonly
- true
- .\bin\Release\
- false
- true
- 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
-
-
-
- False
- .NET Framework 2.0 %28x86%29
- true
-
-
- False
- .NET Framework 3.0 %28x86%29
- false
-
-
- False
- .NET Framework 3.5
- false
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/hostapplication.vb b/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/hostapplication.vb
deleted file mode 100644
index e5945e52647..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/hostapplication.vb
+++ /dev/null
@@ -1,38 +0,0 @@
-
-Imports System.Configuration
-Imports System.Collections.Generic
-Imports System.ServiceModel
-Imports System.Text
-
-Namespace Microsoft.WCF.Documentation
- Friend Class HostApplication
-
- Shared Sub Main()
- Dim app As New HostApplication()
- app.Run()
- End Sub
-
- Private Sub Run()
- ' Create a ServiceHost for the service type and use base address from configuration.
- Using serviceHost As New ServiceHost(GetType(SampleService))
- Try
- ' Open the ServiceHostBase to create listeners and start listening for messages.
- serviceHost.Open()
-
- ' The service can now be accessed.
- Console.WriteLine("The service is ready.")
- Console.WriteLine("Press to terminate service.")
- Console.WriteLine()
- Console.ReadLine()
-
- ' Close the ServiceHostBase to shutdown the service.
- serviceHost.Close()
- Catch timeProblem As TimeoutException
- Console.WriteLine("The service operation timed out. " & timeProblem.Message)
- Catch commProblem As CommunicationException
- Console.WriteLine("There was a communication problem. " & commProblem.Message)
- End Try
- End Using
- End Sub
- End Class
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/proxycode.vb b/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/proxycode.vb
deleted file mode 100644
index 0e518bc2750..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/proxycode.vb
+++ /dev/null
@@ -1,56 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:2.0.50727.42
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-
-
-
-
- _
-Public Interface SampleService
-
- _
- Function SampleMethod(ByVal msg As String) As String
-End Interface
-
- _
-Public Interface SampleServiceChannel
- Inherits SampleService, System.ServiceModel.IClientChannel
-End Interface
-
- _
-Partial Public Class SampleServiceClient
- Inherits System.ServiceModel.ClientBase(Of SampleService)
- Implements SampleService
-
- Public Sub New()
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String)
- MyBase.New(endpointConfigurationName)
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As String)
- MyBase.New(endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(endpointConfigurationName, remoteAddress)
- End Sub
-
- Public Sub New(ByVal binding As System.ServiceModel.Channels.Binding, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
- MyBase.New(binding, remoteAddress)
- End Sub
-
- Public Function SampleMethod(ByVal msg As String) As String Implements SampleService.SampleMethod
- Return MyBase.Channel.SampleMethod(msg)
- End Function
-End Class
diff --git a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/services.vb b/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/services.vb
deleted file mode 100644
index 2e97b5e998b..00000000000
--- a/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/services.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-'
-
-
-Imports System.Collections.Generic
-Imports System.Net.Security
-Imports System.ServiceModel
-Imports System.Text
-
-Namespace Microsoft.WCF.Documentation
- _
- Public Interface ISampleService
- _
- Function SampleMethod(ByVal msg As String) As String
- End Interface
-
- Friend Class SampleService
- Implements ISampleService
- #Region "ISampleService Members"
-
- Public Function SampleMethod(ByVal msg As String) As String Implements ISampleService.SampleMethod
- Return "The service greets you: " & msg
- End Function
-
- #End Region
- End Class
-End Namespace
-'
diff --git a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/customcontrol.vb b/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/customcontrol.vb
deleted file mode 100644
index 915809e2606..00000000000
--- a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/customcontrol.vb
+++ /dev/null
@@ -1,564 +0,0 @@
-'************************************************************************************************
-' *
-' * File: CustomControl.vb
-' *
-' * Description:
-' *
-' * A custom list control that supports UI Automation.
-' *
-' * See ProviderForm.vb for a full description of this sample.
-' *
-' *
-' * This file is part of the Microsoft Windows SDK Code Samples.
-' *
-' * Copyright (C) Microsoft Corporation. All rights reserved.
-' *
-' * This source code is intended only as a supplement to Microsoft
-' * Development Tools and/or on-line documentation. See these other
-' * materials for detailed information regarding Microsoft code samples.
-' *
-' * THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
-' * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-' * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-' * PARTICULAR PURPOSE.
-' *
-' ************************************************************************************************
-
-
-Imports System.Collections.Generic
-Imports System.Text
-Imports System.Drawing
-Imports System.Windows.Forms
-Imports System.Diagnostics
-Imports System.Collections
-Imports System.Windows.Automation.Provider
-Imports System.Windows.Automation
-Imports System.Security.Permissions
-
-Namespace CustomControls
- Public Enum Availability
- Online
- Offline
- End Enum
-
- Public Class CustomListControl
- Inherits Control
- #Region "Private Members"
-
- ' Collection of strings that are items in the list.
- Private itemsArray As ArrayList
- ' Index of selected item, or -1 if no item is selected.
- Private currentSelection As Integer = -1
- ' Constraints on list size.
- Private maxNumberOfItems As Integer = 10
- Private minNumberOfItems As Integer = 1
- ' Dimensions of list item.
- Private Const itemHeight As Integer = 15
- Private Const listWidth As Integer = 70
- ' Dimensions of image that signifies item status.
- Private Const imageWidth As Integer = 10
- Private Const imageHeight As Integer = 10
- ' Text indentation to allow room for image.
- Private Const textIndent As Integer = 15
-
- ' Unique identifier for each list item; never reused during the life of the control.
- Private uniqueIdentifier As Integer = 0
-
- ' The UI Automation provider for this instance of the control.
- Private myListProvider As ListProvider
-
- #End Region ' Private Members
-
- #Region "Public Methods"
-
- '''
- ''' Constructor.
- '''
- Public Sub New()
- Me.Size = New Size(listWidth, itemHeight * MaximumNumberOfItems)
-
- ' Initialize list item collection.
- itemsArray = New ArrayList()
- End Sub
-
-
- '''
- ''' Gets the maximum number of items the list can accommodate. For this example, this is constrained
- ''' by the size of the window so that we do not have to handle scrolling.
- '''
- Public ReadOnly Property MaximumNumberOfItems() As Integer
- Get
- Return maxNumberOfItems
- End Get
- End Property
-
- '''
- ''' Gets the minimum number of items the list can accommodate.
- '''
- Public ReadOnly Property MinimumNumberOfItems() As Integer
- Get
- Return minNumberOfItems
- End Get
- End Property
-
- '''
- ''' Gets the unique identifier of a list item. This number is never reused within an instance
- ''' of the control.
- '''
- Public ReadOnly Property UniqueId() As Integer
- Get
- uniqueIdentifier += 1
- Return uniqueIdentifier
- End Get
- End Property
-
- '''
- ''' Gets and sets the index of the selected item.
- '''
- Public Property SelectedIndex() As Integer
- Get
- Return Me.currentSelection
- End Get
- Set(ByVal value As Integer)
- InternalSelect(value)
- End Set
- End Property
-
- '''
- ''' Gets the item at the specified index.
- '''
- ''' The zero-based index of the item.
- ''' The control for the item.
- Public Function GetItem(ByVal i As Integer) As CustomListItem
- Return CType(itemsArray(i), CustomListItem)
- End Function
-
- '''
- ''' Gets the number of items in the list.
- '''
- Public ReadOnly Property ItemCount() As Integer
- Get
- Return itemsArray.Count
- End Get
- End Property
-
- '''
- ''' Gets the index of the specified item.
- '''
- ''' The item.
- ''' The zero-based index.
- Public Function ItemIndex(ByVal listItem As CustomListItem) As Integer
- ' Allows CustomListItem to requery its index, as it can change.
- Return itemsArray.IndexOf(listItem)
- End Function
-
- '''
- ''' Removes an item from the list.
- '''
- ''' Index of the item.
- ''' true if successful.
- Public Function Remove(ByVal itemIndex As Integer) As Boolean
- If (Me.ItemCount = minNumberOfItems) OrElse (itemIndex <= -1) OrElse (itemIndex >= Me.ItemCount) Then
- ' If the number of items in the list is already at minimum,
- ' no additional items can be removed.
- Return False
- End If
- Dim itemToBeRemoved As CustomListItem = CType(itemsArray(itemIndex), CustomListItem)
-
- ' Notify the provider that item it going to be destroyed.
- itemToBeRemoved.IsAlive = False
-
- ' Force refresh.
- Me.Invalidate()
-
- ' Raise notification.
- If myListProvider IsNot Nothing Then
- ListProvider.OnStructureChangeRemove(itemToBeRemoved.Container)
- End If
- itemsArray.RemoveAt(itemIndex)
- currentSelection = 0 ' Reset selection to first item.
-
- Return True
- End Function
-
- '''
- ''' Adds an item to the list.
- '''
- ''' Index at which to add the item.
- ''' Item to add.
- ''' true if successful.
- Public Function Add(ByVal item As String, ByVal a As Availability) As Boolean
- If itemsArray.Count < maxNumberOfItems Then
- Dim listItem As CustomListItem
- listItem = New CustomListItem(Me, item, Me.UniqueId, a)
- itemsArray.Add(listItem)
-
- ' Initialize the selection if necessary.
- If currentSelection < 0 Then
- currentSelection = 0
- listItem.IsSelected = True
- End If
- Me.Invalidate() ' update to draw new added item
-
- ' Raise a UI Automation event.
- If myListProvider IsNot Nothing Then
- ListProvider.OnStructureChangeAdd(listItem.Container)
- End If
- Return True
- End If
- Return False
- End Function
-
- #End Region ' Public Methods
-
-
- #Region "Private/Internal methods"
-
- '''
- ''' Responds to GotFocus event by repainting the list.
- '''
- ''' Event arguments
- Protected Overrides Sub OnGotFocus(ByVal e As EventArgs)
- OnPaint(New PaintEventArgs(CreateGraphics(), Me.DisplayRectangle))
- MyBase.OnGotFocus(e)
- End Sub
-
- '''
- ''' Responds to LostFocus event by repainting the list.
- '''
- ''' Event arguments.
- Protected Overrides Sub OnLostFocus(ByVal e As EventArgs)
- OnPaint(New PaintEventArgs(CreateGraphics(), Me.DisplayRectangle))
- MyBase.OnLostFocus(e)
- End Sub
-
- '''
- ''' Responds to Paint event.
- '''
- ''' Event arguments.
- Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
- ' Use SystemBrushes for colors of a control.
- Dim backgroundBrush As System.Drawing.Brush = SystemBrushes.Window
- Dim focusedBrush As System.Drawing.Brush
- If Me.Focused Then
- focusedBrush = SystemBrushes.Highlight
- Else
- focusedBrush = New SolidBrush(Color.DarkGray)
- End If
- e.Graphics.FillRectangle(backgroundBrush, DisplayRectangle)
-
- ' Colors for online/offline image.
- Dim itemOnBrush As System.Drawing.Brush = Brushes.Green
- Dim itemOffBrush As System.Drawing.Brush = Brushes.Red
-
- Dim itemTextFont As System.Drawing.Font = SystemFonts.DefaultFont
-
- Dim itemInk As System.Drawing.Brush = SystemBrushes.ControlText
- Dim selectedItemInk As System.Drawing.Brush = SystemBrushes.HighlightText
-
- ' Loop through items to draw their text onto screen
- For i As Integer = 0 To itemsArray.Count - 1
- Dim pt As New Point(DisplayRectangle.Left+2, DisplayRectangle.Top + (i * itemHeight))
- Dim listItem As CustomListItem = (CType(itemsArray(i), CustomListItem))
- Dim rc As Rectangle = GetRectForItem(i)
- rc = New Rectangle(rc.X, rc.Y+2, imageWidth, imageHeight)
- If listItem.Status = Availability.Online Then
- e.Graphics.FillRectangle(itemOnBrush, rc)
- Else
- e.Graphics.FillRectangle(itemOffBrush, rc)
- End If
- rc = New Rectangle(rc.X + textIndent, rc.Y-2, listWidth - textIndent, itemHeight)
- If i = SelectedIndex Then
- e.Graphics.FillRectangle(focusedBrush, rc)
- e.Graphics.DrawString(listItem.Text, itemTextFont, selectedItemInk, rc)
- Else
- ' Item not selected.
- e.Graphics.DrawString(listItem.Text, itemTextFont, itemInk, rc)
- End If
- Next i
- e.Dispose()
- End Sub
-
- '''
- ''' Handles MouseDown event by selecting the item under the cursor.
- '''
- ''' Event arguments.
- Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
- Me.Focus()
- Dim index As Integer = ItemIndexFromPoint(New Point(e.X, e.Y))
- If index <> -1 Then
- InternalSelect(index)
- End If
- End Sub
-
- '''
- ''' Gets the index at the specified screen coordinates.
- '''
- ''' The screen coordinates.
- ''' The index of the item, or -1 if pt is not within the control.
- ''' This logic is simple because the control does not support scrolling.
- Friend Function ItemIndexFromPoint(ByVal pt As Point) As Integer
- ' Determine whether the point is within the control.
- If Not Me.DisplayRectangle.Contains(pt) Then
- Return -1
- End If
-
- Dim index As Integer = CInt((Me.DisplayRectangle.Y + pt.Y) / itemHeight)
- If index >= itemsArray.Count Then
- index = -1
- End If
- Return index
- End Function
-
- '''
- ''' Gets the screen coordinates of an item.
- '''
- ''' The index of the item.
- ''' The screen coordinates.
- Friend Function GetRectForItem(ByVal index As Integer) As Rectangle
- Dim itemTop As Integer = DisplayRectangle.Top + (itemHeight * index) + 1
- Return New Rectangle(DisplayRectangle.X, itemTop, DisplayRectangle.Width, itemHeight)
- End Function
-
- '''
- ''' Processes up/down arrow keys.
- '''
- ''' The Windows message.
- ''' Information about the key press.
- ''' true if successful.
-
- Protected Overrides Function ProcessCmdKey(ByRef msg As Message, ByVal keyData As Keys) As Boolean
- If keyData = Keys.Down Then
- If currentSelection < itemsArray.Count - 1 Then
- InternalSelect(currentSelection + 1)
- End If
- Return True
-
- ElseIf keyData = Keys.Up Then
- If currentSelection > 0 Then
- InternalSelect(currentSelection - 1)
- End If
- Return True
- Else
- Return MyBase.ProcessCmdKey(msg, keyData)
- End If
- End Function
-
- '''
- ''' Selects an item in the list.
- '''
- ''' Index of the item to select.
- Private Sub InternalSelect(ByVal index As Integer)
- If (index >= itemsArray.Count) OrElse (index < 0) Then
- Throw New ArgumentOutOfRangeException()
- Else
- If currentSelection <> index Then
- CType(itemsArray(currentSelection), CustomListItem).IsSelected = False
- CType(itemsArray(index), CustomListItem).IsSelected = True
- currentSelection = index
- ' Force refresh.
- Invalidate()
- CustomControls.ListProvider.OnSelectionChange(CType(itemsArray(index), CustomListItem))
- End If
-
- ' Raise an event.
- ListProvider.OnFocusChange(CType(itemsArray(index), CustomListItem))
- End If
- End Sub
-
- #End Region ' Private/Internal methods
-
-
- #Region "UI Automation related methods"
-
- '''
- ''' Gets the UI Automation provider for the control.
- '''
- Public ReadOnly Property Provider() As ListProvider
- Get
- Return myListProvider
- End Get
- End Property
-
- '''
- ''' Gets a value that specifies whether the UI Automation provider is attached.
- '''
- Protected ReadOnly Property AutomationIsActive() As Boolean
- Get
- Return (myListProvider IsNot Nothing)
- End Get
- End Property
-
- '''
- ''' Handles WM_GETOBJECT message; others are passed to base handler.
- '''
- ''' Windows message.
- ''' This method enables UI Automation to find the control.
-
- Protected Overrides Sub WndProc(ByRef m As Message)
- Const WM_GETOBJECT As Integer = &H003D
-
- If m.Msg = WM_GETOBJECT Then
- If Not AutomationIsActive Then
- ' If no provider has been created, then create one.
- myListProvider = New ListProvider(Me)
-
- ' Create providers for each existing item in the list.
- For Each listItem As CustomListItem In itemsArray
- listItem.Provider = New ListItemProvider(myListProvider,listItem)
- Next listItem
- End If
-
- m.Result = AutomationInteropProvider.ReturnRawElementProvider(Handle, m.WParam, m.LParam, myListProvider)
- Return
- End If
- MyBase.WndProc(m)
- End Sub
-
- #End Region ' UI Automation related methods
- End Class
-
-
-
- Public Class CustomListItem
- Private ItemIsSelected As Boolean = False
-
- Private ItemText As String
- Private ItemIndex As Integer
- Private ItemOwnerList As CustomListControl
- Private ItemStatus As Availability
- Private ItemId As Integer
- Private ItemProvider As ListItemProvider
- Private ItemRect As Rectangle
- Private ItemIsAlive As Boolean
-
- '''
- ''' Constructor.
- '''
- ''' The owning list.
- ''' The text of the item.
- ''' The unique identifier of the item within the list.
- ''' The status (online or offline) of the item.
- Public Sub New(ByVal parent As CustomListControl, ByVal text As String, ByVal id As Integer, ByVal availability As Availability)
- ItemIsAlive = True
- ItemOwnerList = parent
- ItemText = text
- ItemId = id
- ItemStatus = availability
- End Sub
-
- '''
- ''' Gets and sets the status of the item (alive if it is still displayed).
- '''
- Public Property IsAlive() As Boolean
- Get
- Return ItemIsAlive
- End Get
- Set(ByVal value As Boolean)
- ItemIsAlive = value
- End Set
- End Property
-
- '''
- ''' Gets the CustomListControl that contains this item.
- '''
- Public ReadOnly Property Container() As CustomListControl
- Get
- Return ItemOwnerList
- End Get
- End Property
-
- '''
- ''' Gets and sets the selection status of the item.
- '''
- Public Property IsSelected() As Boolean
- Get
- Return ItemIsSelected
- End Get
- Set(ByVal value As Boolean)
- ItemIsSelected = value
- End Set
- End Property
-
- '''
- ''' Gets the unique identifier of the item within the list.
- '''
- Public ReadOnly Property Id() As Integer
- Get
- Return ItemId
- End Get
- End Property
-
- '''
- ''' Gets the location of the item on the screen.
- '''
- '''
- ''' Uses delegation to avoid interacting with the UI on a different thread.
- '''
- Public ReadOnly Property Location() As Rectangle
- Get
- ItemRect = Me.ItemOwnerList.GetRectForItem(Me.Index)
- ' Invoke control method on separate thread to avoid clashing with UI.
- ' Use anonymous method for simplicity.
- Me.ItemOwnerList.Invoke(New MethodInvoker(Sub() ItemRect = Me.ItemOwnerList.RectangleToScreen(ItemRect)))
- Return ItemRect
- End Get
- End Property
-
- '''
- ''' Gets and sets the text of the item.
- '''
- Public Property Text() As String
- Get
- Return ItemText
- End Get
- Set(ByVal value As String)
- ItemText = value
- End Set
- End Property
-
- '''
- ''' Gets and sets the index of the item.
- '''
- Public Property Index() As Integer
- Get
- ItemIndex = ItemOwnerList.ItemIndex(Me)
- Return ItemIndex
- End Get
- Set(ByVal value As Integer)
- ItemIndex = value
- End Set
- End Property
-
- '''
- ''' Gets and sets the status (online or offline) of the item.
- '''
- Public Property Status() As Availability
- Get
- Return ItemStatus
- End Get
- Set(ByVal value As Availability)
- ItemStatus = value
- End Set
- End Property
-
-
- '''
- ''' Gets and sets the UI Automation provider for the item.
- '''
- Public Property Provider() As ListItemProvider
- Get
- If ItemProvider Is Nothing Then
- ItemProvider = New ListItemProvider(ItemOwnerList.Provider, Me)
-
- End If
- Return ItemProvider
- End Get
- Set(ByVal value As ListItemProvider)
- ItemProvider = value
- End Set
- End Property
-
-
- End Class
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/elementprovider.vbproj b/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/elementprovider.vbproj
deleted file mode 100644
index 3dfe539b07b..00000000000
--- a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/elementprovider.vbproj
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
- Debug
- AnyCPU
- 10.0.20821
- 2.0
- {60A534E9-F891-4B01-9AD4-5EFDFE6B0B42}
- WinExe
-
- ElementProvider
- true
- http://localhost/ElementProvider/
- true
- Web
- true
- Foreground
- 7
- Days
- false
- false
- true
- 1.0.0.*
- true
- LocalIntranet
- false
- v4.0
- On
- Binary
- Off
- On
- Client
-
-
- true
- full
- false
- .\
- true
- true
- prompt
-
-
-
-
- pdbonly
- true
- bin\Release\
- false
- true
- prompt
-
-
-
-
-
-
-
-
-
- False
-
-
- False
- D:\avalon.binaries.x86chk\UIAutomationTypes.dll
-
-
- False
-
-
-
-
- Component
-
-
-
-
-
-
- ProviderForm.vb
- Designer
-
-
- Form
-
-
- ProviderForm.vb
-
-
-
-
- False
- .NET Framework 2.0 Beta
- true
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/listfragment.vb b/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/listfragment.vb
deleted file mode 100644
index eca9e051399..00000000000
--- a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/listfragment.vb
+++ /dev/null
@@ -1,342 +0,0 @@
-'************************************************************************************************
-' *
-' * File: ListFragment.vb
-' *
-' * Description: Implements a UI Automation provider for a custom list control.
-' *
-' * See ProviderForm.vb for a full description of this sample.
-' *
-' *
-' * This file is part of the Microsoft Windows SDK Code Samples.
-' *
-' * Copyright (C) Microsoft Corporation. All rights reserved.
-' *
-' * This source code is intended only as a supplement to Microsoft
-' * Development Tools and/or on-line documentation. See these other
-' * materials for detailed information regarding Microsoft code samples.
-' *
-' * THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
-' * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-' * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-' * PARTICULAR PURPOSE.
-' *
-' ************************************************************************************************
-
-
-Imports System.Collections.Generic
-Imports System.Text
-Imports System.Drawing
-Imports System.Windows.Forms
-Imports System.Windows.Automation.Provider
-Imports System.Windows.Automation
-Imports System.Collections
-Imports System.Threading
-
-
-Namespace CustomControls
- Public Class ListProvider
- Implements IRawElementProviderFragmentRoot, ISelectionProvider
- ' Control that contains the list.
- Private OwnerListControl As CustomListControl
- ' Window handle of the control.
- Private WindowHandle As IntPtr
-
- '''
- ''' Constructor
- '''
- '''
- ''' The control for which this object is providing UI Automation functionality.
- '''
- Public Sub New(ByVal control As CustomListControl)
- OwnerListControl = control
- WindowHandle = control.Handle
- End Sub
-
- #Region "IRawElementProviderSimple Members"
-
- '''
- ''' Retrieves the object that supports the specified control pattern.
- '''
- ''' The pattern identifier
- '''
- ''' The supporting object, or null if the pattern is not supported.
- '''
- Private Function GetPatternProvider(ByVal patternId As Integer) As Object Implements IRawElementProviderSimple.GetPatternProvider
- If patternId = SelectionPatternIdentifiers.Pattern.Id Then
- Return Me
- End If
- Return Nothing
- End Function
-
-
- '''
- ''' Gets provider property values.
- '''
- ''' The property identifier.
- ''' The value of the property.
- Private Function GetPropertyValue(ByVal propertyId As Integer) As Object Implements IRawElementProviderSimple.GetPropertyValue
- If propertyId = AutomationElementIdentifiers.ControlTypeProperty.Id Then
- Return ControlType.List.Id
- ' It is necessary to supply a value for IsKeyboardFocusable in a Windows Forms control,
- ' because this value cannot be discovered by the HWND host provider. This is not
- ' necessary for a Win32 provider.
- ElseIf propertyId = AutomationElementIdentifiers.IsKeyboardFocusableProperty.Id Then
- Return True
- ElseIf propertyId = AutomationElementIdentifiers.FrameworkIdProperty.Id Then
- Return "Custom"
- End If
- Return Nothing
- End Function
-
- '''
- ''' Gets the host provider.
- '''
- '''
- ''' Fragment roots return their window providers; most others return null.
- '''
- Private ReadOnly Property HostRawElementProvider() As IRawElementProviderSimple Implements IRawElementProviderSimple.HostRawElementProvider
- Get
- Return AutomationInteropProvider.HostProviderFromHandle(WindowHandle)
- End Get
- End Property
-
- '''
- ''' Gets provider options.
- '''
- Private ReadOnly Property IRawElementProviderSimple_ProviderOptions() As ProviderOptions Implements IRawElementProviderSimple.ProviderOptions
- Get
- Return ProviderOptions.ServerSideProvider
- End Get
- End Property
-
- #End Region ' IRawElementProviderSimple Members
-
-
- #Region "IRawElementProviderFragment Members"
-
- '''
- ''' Gets the bounding rectangle.
- '''
- '''
- ''' Fragment roots should return an empty rectangle. UI Automation will get the rectangle
- ''' from the host control (the HWND in this case).
- '''
- Private ReadOnly Property BoundingRectangle() As System.Windows.Rect Implements IRawElementProviderFragment.BoundingRectangle
- Get
- Return System.Windows.Rect.Empty
- End Get
- End Property
-
- '''
- ''' Gets the root of this fragment.
- Private ReadOnly Property FragmentRoot() As IRawElementProviderFragmentRoot Implements IRawElementProviderFragment.FragmentRoot
- Get
- Return Me
- End Get
- End Property
-
- '''
- ''' Gets any fragment roots that are embedded in this fragment.
- '''
- ''' Null in this case.
- Private Function GetEmbeddedFragmentRoots() As IRawElementProviderSimple() Implements IRawElementProviderFragment.GetEmbeddedFragmentRoots
- Return Nothing
- End Function
-
- '''
- ''' Gets the runtime identifier of the UI Automation element.
- '''
- ''' Fragment roots return null.
- Private Function GetRuntimeId() As Integer() Implements IRawElementProviderFragment.GetRuntimeId
- Return Nothing
- End Function
-
- '''
- ''' Navigates to adjacent elements in the UI Automation tree.
- '''
- ''' Direction of navigation.
- ''' The element in that direction, or null.
- ''' The provider only returns directions that it is responsible for.
- ''' UI Automation knows how to navigate between HWNDs, so only the custom item
- ''' navigation needs to be provided.
- '''
- Private Function Navigate(ByVal direction As NavigateDirection) As IRawElementProviderFragment Implements IRawElementProviderFragment.Navigate
- If direction = NavigateDirection.FirstChild Then
- Return GetProviderForIndex(0)
- ElseIf direction = NavigateDirection.LastChild Then
- Return GetProviderForIndex(OwnerListControl.ItemCount-1)
- End If
- Return Nothing
- End Function
-
- '''
- ''' Responds to a client request to set the focus to this control.
- '''
- ''' Setting focus to the control is handled by the parent window.
- Private Sub SetFocus() Implements IRawElementProviderFragment.SetFocus
- Throw New Exception("The method is not implemented.")
- End Sub
-
- #End Region ' IRawElementProviderFragment Members
-
-
- #Region "IRawElementProviderFragmentRoot Members"
-
- '''
- ''' Gets the child element at the specified point.
- '''
- ''' Distance from the left of the application window.
- ''' Distance from the top of the application window.
- ''' The provider for the element at that point.
- Private Function ElementProviderFromPoint(ByVal x As Double, ByVal y As Double) As IRawElementProviderFragment Implements IRawElementProviderFragmentRoot.ElementProviderFromPoint
- Dim index As Integer = -1
- Dim clientPoint As New System.Drawing.Point(CInt(x), CInt(y))
-
- ' Invoke control method on separate thread to avoid clashing with UI.
- ' Use anonymous method for simplicity.
- Me.OwnerListControl.Invoke(New MethodInvoker(Sub() clientPoint = Me.OwnerListControl.PointToClient(clientPoint)))
-
- index = OwnerListControl.ItemIndexFromPoint(clientPoint)
-
- If index = -1 Then
- Return Nothing
- End If
- Return GetProviderForIndex(index)
- End Function
-
-
- '''
- ''' Returns the child element that is selected when the list gets focus.
- '''
- ''' The selected item.
- Private Function GetFocus() As IRawElementProviderFragment Implements IRawElementProviderFragmentRoot.GetFocus
- Dim index As Integer = OwnerListControl.SelectedIndex
- Return GetProviderForIndex(index)
- End Function
-
- #End Region ' IRawElementProviderFragmentRoot
-
-
- #Region "ISelectionProvider Members"
-
- '
- '''
- ''' Specifies whether selection of more than one item at a time is supported.
- '''
- Private ReadOnly Property CanSelectMultiple() As Boolean Implements ISelectionProvider.CanSelectMultiple
- Get
- Return False
- End Get
- End Property
- '
-
- '
- '''
- ''' Returns the UI Automation provider for the selected list items.
- '''
- ''' The selected items.
- '''
- ''' Because this is a single-selection list box, only one item is
- ''' returned.
- '''
- Private Function GetSelection() As IRawElementProviderSimple() Implements ISelectionProvider.GetSelection
- Dim index As Integer = OwnerListControl.SelectedIndex
- Return New IRawElementProviderSimple() { GetProviderForIndex(index) }
- End Function
- '
-
- '
- '''
- ''' Specifies whether the list must have an item selected at all times.
- '''
- Private ReadOnly Property IsSelectionRequired() As Boolean Implements ISelectionProvider.IsSelectionRequired
- Get
- Return True
- End Get
- End Property
- '
-
- #End Region ' ISelectionProvider Members
-
- #Region "Helper methods"
-
- '''
- ''' Gets the UI Automation provider for the item at the specified index.
- '''
- ''' Index of the item.
- ''' The provider object, or null if the index is out of range.
- Public Function GetProviderForIndex(ByVal index As Integer) As IRawElementProviderFragment
- Dim OwnerCustomListItemCount As Integer = OwnerListControl.ItemCount - 1
- If (index < 0) OrElse (index > OwnerCustomListItemCount) Then
- Return Nothing
- End If
- Return CType(Me.OwnerListControl.GetItem(index).Provider, IRawElementProviderFragment)
- End Function
-
-
- '''
- ''' Responds to a focus change by raising an event.
- '''
- ''' The item that has received focus.
- Public Shared Sub OnFocusChange(ByVal listItem As CustomListItem)
- If AutomationInteropProvider.ClientsAreListening Then
- Dim args As New AutomationEventArgs(AutomationElementIdentifiers.AutomationFocusChangedEvent)
- AutomationInteropProvider.RaiseAutomationEvent(AutomationElementIdentifiers.AutomationFocusChangedEvent, listItem.Provider, args)
- End If
- End Sub
-
-
- '''
- ''' Responds to a selection change by raising an event.
- '''
- ''' The item that has been selected.
- Public Shared Sub OnSelectionChange(ByVal listItem As CustomListItem)
- If AutomationInteropProvider.ClientsAreListening Then
- Dim args As New AutomationEventArgs(SelectionItemPatternIdentifiers.ElementSelectedEvent)
- AutomationInteropProvider.RaiseAutomationEvent(SelectionItemPatternIdentifiers.ElementSelectedEvent, listItem.Provider, args)
- End If
- End Sub
-
-'
- '''
- ''' Responds to an addition to the UI Automation tree structure by raising an event.
- '''
- '''
- ''' The list to which the item was added.
- '''
- '''
- ''' For the runtime Id of the item, pass 0 because the provider cannot know
- ''' what its actual runtime Id is.
- '''
- Public Shared Sub OnStructureChangeAdd(ByVal list As CustomListControl)
- If AutomationInteropProvider.ClientsAreListening Then
- Dim fakeRuntimeId() As Integer = { 0 }
- Dim args As New StructureChangedEventArgs(StructureChangeType.ChildrenBulkAdded, fakeRuntimeId)
- AutomationInteropProvider.RaiseStructureChangedEvent(CType(list.Provider, IRawElementProviderSimple), args)
- End If
- End Sub
-
- '''
- ''' Responds to a removal from the UI Automation tree structure
- ''' by raising an event.
- '''
- '''
- ''' The list from which the item was removed.
- '''
- '''
- ''' For the runtime Id of the list, pass 0 because the provider cannot know
- ''' what its actual runtime ID is.
- '''
- Public Shared Sub OnStructureChangeRemove(ByVal list As CustomListControl)
- If AutomationInteropProvider.ClientsAreListening Then
- Dim fakeRuntimeId() As Integer = { 0 }
- Dim args As New StructureChangedEventArgs(StructureChangeType.ChildrenBulkRemoved, fakeRuntimeId)
- AutomationInteropProvider.RaiseStructureChangedEvent(CType(list.Provider, IRawElementProviderSimple), args)
- End If
- End Sub
-'
-
- #End Region ' Helper methods
-
- End Class
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/listitemfragment.vb b/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/listitemfragment.vb
deleted file mode 100644
index ef461378679..00000000000
--- a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/listitemfragment.vb
+++ /dev/null
@@ -1,298 +0,0 @@
-'************************************************************************************************
-' *
-' * File: ListItemFragment.vb
-' *
-' * Description: Implements a list item as a fragment within a custom control
-' * that supports UI Automation.
-' *
-' * See ProviderForm.vb for a full description of this sample.
-' *
-' *
-' * This file is part of the Microsoft Windows SDK Code Samples.
-' *
-' * Copyright (C) Microsoft Corporation. All rights reserved.
-' *
-' * This source code is intended only as a supplement to Microsoft
-' * Development Tools and/or on-line documentation. See these other
-' * materials for detailed information regarding Microsoft code samples.
-' *
-' * THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
-' * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-' * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-' * PARTICULAR PURPOSE.
-' *
-' ************************************************************************************************
-
-Imports System.Collections.Generic
-Imports System.Text
-Imports System.Windows.Automation.Provider
-Imports System.Windows.Automation
-Imports System.Drawing
-Imports System.Windows.Forms
-Imports System.Diagnostics
-Imports System.Collections
-
-Namespace CustomControls
- Public Class ListItemProvider
- Implements IRawElementProviderFragment, ISelectionItemProvider
- ' Provider for the list that contains the item.
- Private containerListProvider As ListProvider
- ' Control that contains the list.
- Private listItemControl As CustomListItem
- ' ArrayList that represents the collection of ListItems.
- Private selectedItems As ArrayList
-
-
- '''
- ''' Constructor.
- '''
- '''
- ''' UI Automation provider for the fragment root (the containing list).
- '''
- ''' The control that owns this provider.
- Public Sub New(ByVal rootProvider As ListProvider, ByVal thisItem As CustomListItem)
- containerListProvider = rootProvider
- listItemControl = thisItem
- selectedItems = New ArrayList()
- End Sub
-
-
- '''
- ''' Gets the index of the item within the list.
- '''
- Public ReadOnly Property Index() As Integer
- Get
- Return listItemControl.Index
- End Get
- End Property
-
-
- #Region "IRawElementProviderSimple Members"
-
- '''
- ''' Retrieves the object that supports the specified control pattern.
- '''
- ''' The pattern identifier
- '''
- ''' The supporting object, or null if the pattern is not supported.
- '''
- Public Function GetPatternProvider(ByVal patternId As Integer) As Object Implements System.Windows.Automation.Provider.IRawElementProviderSimple.GetPatternProvider
- If patternId = SelectionItemPatternIdentifiers.Pattern.Id Then
- Return Me
- End If
- Return Nothing
- End Function
-
- '''
- ''' Returns UI Automation property values.
- '''
- ''' The identifier of the property.
- ''' The value of the property.
- Public Function GetPropertyValue(ByVal propertyId As Integer) As Object Implements System.Windows.Automation.Provider.IRawElementProviderSimple.GetPropertyValue
- If listItemControl.IsAlive = False Then
- Throw New ElementNotAvailableException()
- End If
- If propertyId = AutomationElementIdentifiers.NameProperty.Id Then
- Return listItemControl.Text
- ElseIf propertyId = AutomationElementIdentifiers.ControlTypeProperty.Id Then
- Return ControlType.ListItem.Id
- ElseIf propertyId = AutomationElementIdentifiers.AutomationIdProperty.Id Then
- Return listItemControl.Id.ToString()
- ElseIf propertyId = AutomationElementIdentifiers.HasKeyboardFocusProperty.Id Then
- Return listItemControl.IsSelected
- ElseIf propertyId = AutomationElementIdentifiers.ItemStatusProperty.Id Then
- If listItemControl.Status = CustomControls.Availability.Online Then
- Return "Contact is online"
- Else
- Return "Contact is offline"
- End If
- ElseIf propertyId = AutomationElementIdentifiers.IsEnabledProperty.Id Then
- Return True
- ElseIf propertyId = AutomationElementIdentifiers.IsKeyboardFocusableProperty.Id Then
- Return True
- ElseIf propertyId = AutomationElementIdentifiers.FrameworkIdProperty.Id Then
- Return "Custom"
- End If
- Return Nothing
- End Function
-
- '''
- ''' Returns a host provider.
- '''
- '''
- ''' In this case, because the element is not directly hosted in a
- ''' window, null is returned.
- '''
- Public ReadOnly Property HostRawElementProvider() As IRawElementProviderSimple Implements System.Windows.Automation.Provider.IRawElementProviderSimple.HostRawElementProvider
- Get
- ' Because the element is not directly hosted in a window, null is returned.
- Return Nothing
- End Get
- End Property
-
- '''
- ''' Gets provider options.
- '''
- Public ReadOnly Property ProviderOptions() As ProviderOptions Implements System.Windows.Automation.Provider.IRawElementProviderSimple.ProviderOptions
- Get
- Return ProviderOptions.ServerSideProvider
- End Get
- End Property
-
- #End Region ' IRawElementProviderSimple Members
-
- #Region "IRawElementProviderFragment Members"
-
- '''
- ''' Gets the bounding rectangle, in screen coordinates.
- '''
- Public ReadOnly Property BoundingRectangle() As System.Windows.Rect Implements IRawElementProviderFragment.BoundingRectangle
- Get
- Dim rc As Rectangle = Me.listItemControl.Location
- Return New System.Windows.Rect(rc.X, rc.Y, rc.Width, rc.Height)
- End Get
- End Property
-
- '''
- ''' Gets the root of this fragment.
- '''
- Public ReadOnly Property FragmentRoot() As IRawElementProviderFragmentRoot Implements IRawElementProviderFragment.FragmentRoot
- Get
- Return containerListProvider
- End Get
- End Property
-
- '''
- ''' Gets any fragment roots that are embedded in this fragment.
- '''
- ''' Null in this case.
- Public Function GetEmbeddedFragmentRoots() As IRawElementProviderSimple() Implements IRawElementProviderFragment.GetEmbeddedFragmentRoots
- Return Nothing
- End Function
-
- '''
- ''' Gets the runtime identifier of the UI Automation element.
- '''
- ''' An array of integers.
- Public Function GetRuntimeId() As Integer() Implements IRawElementProviderFragment.GetRuntimeId
- Return New Integer() { AutomationInteropProvider.AppendRuntimeId, listItemControl.Id}
- End Function
-
- '''
- ''' Navigate to adjacent elements in the UI Automation tree.
- '''
- ''' Direction to navigate.
- ''' The element in that direction, or null.
- Public Function Navigate(ByVal direction As NavigateDirection) As IRawElementProviderFragment Implements IRawElementProviderFragment.Navigate
- If direction = NavigateDirection.Parent Then
- Return containerListProvider
- ElseIf direction = NavigateDirection.NextSibling Then
- Return containerListProvider.GetProviderForIndex(listItemControl.Index + 1)
- ElseIf direction = NavigateDirection.PreviousSibling Then
- Return containerListProvider.GetProviderForIndex(listItemControl.Index - 1)
- End If
- Return Nothing
- End Function
-
-
- '''
- ''' Responds to a client request to set the focus to this control.
- '''
- Public Sub SetFocus() Implements IRawElementProviderFragment.SetFocus
- If listItemControl.IsAlive = False Then
- Throw New ElementNotAvailableException()
- End If
- listItemControl.Container.SelectedIndex = Index
- End Sub
-
- #End Region ' IRawElementProviderFragment Members
-
- #Region "ISelectionItemProvider Members"
-
- '
- '''
- ''' Adds an item to the selection for list boxes that
- ''' support multiple selection.
- '''
- '''
- ''' In a single-selection list box, AddToSelection() is
- ''' equivalent to Select().
- ''' selectedItems is the collection of selected ListItems.
- '''
- Public Sub AddToSelection() Implements ISelectionItemProvider.AddToSelection
- ' Return if the item is already selected.
- If (CType(Me, ISelectionItemProvider)).IsSelected Then
- Return
- End If
- selectedItems.Add(Me)
- ' TODO: Update UI.
- End Sub
- '
-
- '
- '''
- ''' Specifies whether the item is selected.
- '''
- '''
- ''' selectedItems is the collection of selected ListItems.
- '''
- Public ReadOnly Property IsSelected() As Boolean Implements ISelectionItemProvider.IsSelected
- Get
- Return selectedItems.Contains(Me)
- End Get
- End Property
- '
-
- '
- '''
- ''' Removes the item from the selection in list boxes that support
- ''' multiple selection or no selection at all.
- '''
- '''
- ''' selectedItems is the collection of selected ListItems.
- '''
- Public Sub RemoveFromSelection() Implements ISelectionItemProvider.RemoveFromSelection
- ' Return if the item is already selected.
- If (CType(Me, ISelectionItemProvider)).IsSelected Then
- Return
- End If
- If (CType(Me, ISelectionProvider)).IsSelectionRequired And selectedItems.Count <= 0 Then
- Throw New InvalidOperationException("Operation cannot be performed.")
- End If
-
- selectedItems.Remove(Me)
- ' TODO: Update UI.
- End Sub
- '
-
- '
- '''
- ''' Selects the item.
- '''
- '''
- ''' selectedItems is the collection of selected ListItems.
- '''
- Public Sub [Select]() Implements ISelectionItemProvider.Select
- selectedItems.Clear()
- selectedItems.Add(Me)
- ' TODO: Update UI.
- End Sub
- '
-
- '
- '''
- ''' Gets the list box that contains the item.
- '''
- '''
- ''' Provider for the list that contains the item.
- '''
- Public ReadOnly Property SelectionContainer() As IRawElementProviderSimple Implements ISelectionItemProvider.SelectionContainer
- Get
- Return containerListProvider
- End Get
- End Property
- '
-
- #End Region ' ISelectionPatternProvider Members
- End Class
-End Namespace
diff --git a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/program.vb b/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/program.vb
deleted file mode 100644
index 382475a5c4f..00000000000
--- a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/program.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-'************************************************************************************************
-' *
-' * File: Program.vb
-' *
-' * Description: Entry point for an application that supports UIAutomation in a custom control.
-' *
-' * See ProviderForm.vb for a full description of this sample.
-' *
-' *
-' * This file is part of the Microsoft Windows SDK Code Samples.
-' *
-' * Copyright (C) Microsoft Corporation. All rights reserved.
-' *
-' * This source code is intended only as a supplement to Microsoft
-' * Development Tools and/or on-line documentation. See these other
-' * materials for detailed information regarding Microsoft code samples.
-' *
-' * THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
-' * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-' * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-' * PARTICULAR PURPOSE.
-' *
-' ************************************************************************************************
-
-
-Imports System.Collections.Generic
-Imports System.Windows.Forms
-
-Namespace CustomControls
- Friend NotInheritable Class Program
- '''
- ''' The main entry point for the application.
- '''
- Private Sub New()
- End Sub
-
- Shared Sub Main()
- Application.EnableVisualStyles()
- Application.Run(New SampleApplicationForm())
- End Sub
- End Class
-End Namespace
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/providerform.designer.vb b/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/providerform.designer.vb
deleted file mode 100644
index 846dcffcd5a..00000000000
--- a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/providerform.designer.vb
+++ /dev/null
@@ -1,153 +0,0 @@
-Namespace CustomControls
- Partial Public Class SampleApplicationForm
- '''
- ''' Required designer variable.
- '''
- Private components As System.ComponentModel.IContainer = Nothing
-
- '''
- ''' Clean up any resources being used.
- '''
- ''' true if managed resources should be disposed; otherwise, false.
- Protected Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing AndAlso (components IsNot Nothing) Then
- components.Dispose()
- End If
- MyBase.Dispose(disposing)
- End Sub
-
- #Region "Windows Form Designer generated code"
-
- '''
- ''' Required method for Designer support - do not modify
- ''' the contents of this method with the code editor.
- '''
- Private Sub InitializeComponent()
- Me.btnExit = New System.Windows.Forms.Button()
- Me.btnRemove = New System.Windows.Forms.Button()
- Me.btnAdd = New System.Windows.Forms.Button()
- Me.label1 = New System.Windows.Forms.Label()
- Me.txtItem = New System.Windows.Forms.TextBox()
- Me.radioOn = New System.Windows.Forms.RadioButton()
- Me.radioOff = New System.Windows.Forms.RadioButton()
- Me.groupBox1 = New System.Windows.Forms.GroupBox()
- Me.groupBox1.SuspendLayout()
- Me.SuspendLayout()
- '
- ' btnExit
- '
- Me.btnExit.DialogResult = System.Windows.Forms.DialogResult.OK
- Me.btnExit.Location = New System.Drawing.Point(179, 208)
- Me.btnExit.Name = "btnExit"
- Me.btnExit.Size = New System.Drawing.Size(68, 23)
- Me.btnExit.TabIndex = 2
- Me.btnExit.Text = "E&xit"
-' Me.btnExit.Click += New System.EventHandler(Me.btnExit_Click)
- '
- ' btnRemove
- '
- Me.btnRemove.DialogResult = System.Windows.Forms.DialogResult.OK
- Me.btnRemove.Location = New System.Drawing.Point(179, 179)
- Me.btnRemove.Name = "btnRemove"
- Me.btnRemove.Size = New System.Drawing.Size(68, 23)
- Me.btnRemove.TabIndex = 1
- Me.btnRemove.Text = "&Remove"
-' Me.btnRemove.Click += New System.EventHandler(Me.btnRemove_Click)
- '
- ' btnAdd
- '
- Me.btnAdd.Location = New System.Drawing.Point(32, 109)
- Me.btnAdd.Name = "btnAdd"
- Me.btnAdd.Size = New System.Drawing.Size(68, 23)
- Me.btnAdd.TabIndex = 4
- Me.btnAdd.Text = "&Add"
-' Me.btnAdd.Click += New System.EventHandler(Me.btnAdd_Click)
- '
- ' label1
- '
- Me.label1.AutoSize = True
- Me.label1.Location = New System.Drawing.Point(13, 16)
- Me.label1.Name = "label1"
- Me.label1.Size = New System.Drawing.Size(106, 13)
- Me.label1.TabIndex = 0
- Me.label1.Text = "&Enter Contact Name:"
- '
- ' txtItem
- '
- Me.txtItem.Location = New System.Drawing.Point(16, 38)
- Me.txtItem.MaxLength = 15
- Me.txtItem.Name = "txtItem"
- Me.txtItem.Size = New System.Drawing.Size(100, 20)
- Me.txtItem.TabIndex = 1
- Me.txtItem.WordWrap = False
- '
- ' radioOn
- '
- Me.radioOn.AutoSize = True
- Me.radioOn.Checked = True
- Me.radioOn.Location = New System.Drawing.Point(32, 64)
- Me.radioOn.Name = "radioOn"
- Me.radioOn.Size = New System.Drawing.Size(55, 17)
- Me.radioOn.TabIndex = 2
- Me.radioOn.TabStop = True
- Me.radioOn.Text = "O&nline"
- Me.radioOn.UseVisualStyleBackColor = True
- '
- ' radioOff
- '
- Me.radioOff.AutoSize = True
- Me.radioOff.Location = New System.Drawing.Point(32, 86)
- Me.radioOff.Name = "radioOff"
- Me.radioOff.Size = New System.Drawing.Size(55, 17)
- Me.radioOff.TabIndex = 3
- Me.radioOff.TabStop = True
- Me.radioOff.Text = "O&ffline"
- Me.radioOff.UseVisualStyleBackColor = True
- '
- ' groupBox1
- '
- Me.groupBox1.Controls.Add(Me.radioOff)
- Me.groupBox1.Controls.Add(Me.radioOn)
- Me.groupBox1.Controls.Add(Me.txtItem)
- Me.groupBox1.Controls.Add(Me.label1)
- Me.groupBox1.Controls.Add(Me.btnAdd)
- Me.groupBox1.Location = New System.Drawing.Point(147, 12)
- Me.groupBox1.Name = "groupBox1"
- Me.groupBox1.Size = New System.Drawing.Size(132, 146)
- Me.groupBox1.TabIndex = 0
- Me.groupBox1.TabStop = False
- '
- ' SampleApplicationForm
- '
- Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
- Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
- Me.ClientSize = New System.Drawing.Size(291, 254)
- Me.Controls.Add(Me.groupBox1)
- Me.Controls.Add(Me.btnRemove)
- Me.Controls.Add(Me.btnExit)
- Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
- Me.Margin = New System.Windows.Forms.Padding(2)
- Me.MaximizeBox = False
- Me.Name = "SampleApplicationForm"
- Me.Text = "UIAutomation Fragment Provider"
- Me.groupBox1.ResumeLayout(False)
- Me.groupBox1.PerformLayout()
- Me.ResumeLayout(False)
-
- End Sub
-
- #End Region
-
- Private WithEvents btnExit As System.Windows.Forms.Button
- Private WithEvents btnRemove As System.Windows.Forms.Button
- Private WithEvents btnAdd As System.Windows.Forms.Button
- Private label1 As System.Windows.Forms.Label
- Private txtItem As System.Windows.Forms.TextBox
- Private radioOff As System.Windows.Forms.RadioButton
- Private radioOn As System.Windows.Forms.RadioButton
- Private groupBox1 As System.Windows.Forms.GroupBox
-
-
- End Class
-End Namespace
-
diff --git a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/providerform.vb b/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/providerform.vb
deleted file mode 100644
index 6cd00da0fc7..00000000000
--- a/snippets/visualbasic/VS_Snippets_Wpf/UIAISelectionProvider_ISelectionItemProvider_snip/visualbasic/providerform.vb
+++ /dev/null
@@ -1,125 +0,0 @@
-'************************************************************************************************
-' *
-' * File: ProviderForm.vb
-' *
-' * Description:
-' *
-' * The sample is shows how to implement UI Automation providers for the elements
-' * of a fragment that is hosted in an HWND. The control itself has been kept
-' * simple. It does not support scrolling and therefore an arbitrary limit has
-' * been set on the number of items it can contain.
-' *
-' * The fragment consists of the root element (a list box) and its children (the
-' * list items.) The UI Automation provider for the list box supports only one
-' * control pattern, the Selection pattern. The provider for the list items
-' * implements the SelectionItem pattern.
-' *
-' * To see the UI Automation provider at work, run the application and then open
-' * UI Spy. You can see the application and its controls in the Control View.
-' * Clicking on the control or on the list items in the UI Spy tree causes the
-' * provider's methods to be called, and the values returned are displayed in the
-' * Properties pane. (Note that some values are retrieved from the default HWND
-' * provider, not this custom implementation.) You can also select an item in the
-' * list by using the SelectionItem control pattern in UI Spy.
-' *
-' *
-' * This file is part of the Microsoft Windows SDK Code Samples.
-' *
-' * Copyright (C) Microsoft Corporation. All rights reserved.
-' *
-' * This source code is intended only as a supplement to Microsoft
-' * Development Tools and/or on-line documentation. See these other
-' * materials for detailed information regarding Microsoft code samples.
-' *
-' * THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
-' * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-' * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-' * PARTICULAR PURPOSE.
-' *
-' ************************************************************************************************
-
-
-Imports System.Collections.Generic
-Imports System.ComponentModel
-Imports System.Data
-Imports System.Drawing
-Imports System.Text
-Imports System.Windows.Forms
-
-
-Namespace CustomControls
- Partial Public Class SampleApplicationForm
- Inherits Form
- Private customList As CustomListControl
-
- '''
- ''' Constructor for the application window.
- '''
- Public Sub New()
- InitializeComponent()
-
- ' Create a label.
- Dim listLabel As New Label()
- listLabel.Location = New Point(20, 10)
- listLabel.AutoSize = True
- listLabel.TabIndex = 0
- listLabel.Text = "&Contacts:"
- Me.Controls.Add(listLabel)
-
- ' Create an instance of the custom control.
- customList = New CustomListControl()
- customList.Name = "customList"
-
- ' Add it to the form's controls. Among other things, this makes it possible for
- ' UIAutomation to discover it, as it will become a child of the application window.
- Me.Controls.Add(customList)
-
- ' Set some properties.
- customList.Location = New Point(20, 30)
- ' Text becomes the Name property for the custom control.
- customList.Text = listLabel.Text
- customList.TabIndex = 0
-
- ' Add list items.
- customList.Add("Prakash",CustomControls.Availability.Online)
- customList.Add("James", CustomControls.Availability.Online)
- customList.Add("Lisa", CustomControls.Availability.Offline)
- customList.Add("Kim", CustomControls.Availability.Online)
- customList.Add("Bailey", CustomControls.Availability.Offline)
- End Sub
-
- '''
- ''' Handles Add button clicks.
- '''
- ''' Object that raised the event.
- ''' Event arguments.
- Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click
- If Me.txtItem.Text.Length <> 0 Then
- If Me.radioOn.Checked Then
- Me.customList.Add(Me.txtItem.Text, Availability.Online)
- Else
- Me.customList.Add(Me.txtItem.Text, Availability.Offline)
- End If
- Me.txtItem.Clear()
- End If
- End Sub
-
- '''
- ''' Handles Remove button clicks.
- '''
- ''' Object that raised the event.
- ''' Event arguments.
- Private Sub btnRemove_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRemove.Click
- Dim success As Boolean = customList.Remove(Me.customList.SelectedIndex)
- End Sub
-
- '''
- ''' Handles Exit button clicks.
- '''
- ''' Object that raised the event.
- ''' Event arguments.
- Private Sub btnExit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnExit.Click
- Application.Exit()
- End Sub
- End Class
-End Namespace
diff --git a/xml/System.ComponentModel/IEditableCollectionView.xml b/xml/System.ComponentModel/IEditableCollectionView.xml
index a727106dd91..7b7c72ba35d 100644
--- a/xml/System.ComponentModel/IEditableCollectionView.xml
+++ b/xml/System.ComponentModel/IEditableCollectionView.xml
@@ -35,7 +35,6 @@
The following example shows how to add an item to a collection by using methods that are defined by . This application displays a list of items for sale and gives the user the option of adding, editing, or removing an item. When the user adds or edits an item, a form prompts the user to enter a new item. If the user submits the form, the item is committed to the collection. If the user cancels the form, the item is discarded. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem":::
- :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem":::
]]>
@@ -79,7 +78,6 @@
The following example creates a that prompts the user to add a new item. Then it calls to create a new object and sets the of the to that object. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem":::
- :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem":::
]]>
@@ -127,7 +125,6 @@
The following example checks whether an item can be added to the collection. If is `false`, the example tells the user that an item cannot be added. Otherwise, it shows a form that prompts the user to add a new item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections) .
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem":::
- :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem":::
]]>
@@ -171,7 +168,6 @@
The following example gets to check whether the original values of the edited item can be restored before it calls . If the values cannot be restored, you must supply additional logic to do so. If they can be, the values are restored when the example calls . For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetcanceledit":::
- :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetcanceledit":::
]]>
@@ -214,7 +210,6 @@
The following example gets to check whether the original values of the edited item can be restored before it calls . If the values cannot be restored, you must supply additional logic to do so. If they can be, the values are restored when the example calls . For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetcanceledit":::
- :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetcanceledit":::
]]>
@@ -252,7 +247,6 @@
The following example displays a form that prompts the user to add a new item. If the user submits the form, the example calls to add the item to the collection. If the user cancels the form, the example calls to discard the item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem":::
- :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem":::
]]>
@@ -296,7 +290,6 @@
The following example calls to check whether an item can be removed from the collection. If an item can be removed, the example prompts the user to confirm the action and calls if the user clicks **Yes**. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetremoveitem":::
- :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetremoveitem":::
]]>
@@ -334,7 +327,6 @@
The following example creates a form that prompts the user to edit an existing item. If the user submits the form, the example calls to save the changes to the collection. If the user cancels the form, the example calls to discard the changes. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetedititem":::
- :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetedititem":::
]]>
@@ -377,7 +369,6 @@
The following example displays a form that prompts the user to add a new item. If the user submits the form, the example calls to add the item to the collection. If the user cancels the form, the example calls to discard the item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem":::
- :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem":::
]]>
@@ -474,7 +465,6 @@
The following example creates a form that prompts the user to edit an existing item. If the user submits the form, the changes are committed to the collection. If the user cancels the form, the changes are discarded. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections) .
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetedititem":::
- :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetedititem":::
]]>
@@ -620,7 +610,6 @@
The following example calls to check whether an item can be removed from the collection. If an item can be removed, the example prompts the user to confirm the action and calls if the user clicks **Yes**. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetremoveitem":::
- :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetremoveitem":::
]]>
diff --git a/xml/System.ServiceModel.Channels/NamedPipeTransportBindingElement.xml b/xml/System.ServiceModel.Channels/NamedPipeTransportBindingElement.xml
index ce6dbffdbb9..4e747a45a31 100644
--- a/xml/System.ServiceModel.Channels/NamedPipeTransportBindingElement.xml
+++ b/xml/System.ServiceModel.Channels/NamedPipeTransportBindingElement.xml
@@ -54,7 +54,6 @@
This example shows how to use this class:
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/cs/program.cs" id="Snippet0":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/module1.vb" id="Snippet0":::
]]>
@@ -91,7 +90,6 @@
This example shows how to use the parameterless constructor:
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/cs/program.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/module1.vb" id="Snippet1":::
]]>
@@ -132,7 +130,6 @@
This example shows how to initialize a new instance of the class:
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/cs/program.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/module1.vb" id="Snippet2":::
]]>
@@ -181,7 +178,6 @@
This example shows how to create a channel factory of the specified type that can be used to create channels:
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/cs/program.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/module1.vb" id="Snippet6":::
]]>
@@ -221,7 +217,6 @@
This example shows how to create a copy of the current binding element:
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/cs/program.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/module1.vb" id="Snippet5":::
]]>
@@ -257,7 +252,6 @@
This example shows how to get a collection of connection pool settings:
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/cs/program.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/module1.vb" id="Snippet3":::
]]>
@@ -310,7 +304,6 @@
This example shows how to get a specified object from the :
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/cs/program.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/module1.vb" id="Snippet8":::
]]>
@@ -351,7 +344,6 @@
This example shows how to get the URI scheme for the transport:
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/cs/program.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uenamedpipetransportbindingelement/vb/module1.vb" id="Snippet4":::
]]>
diff --git a/xml/System.ServiceModel.Description/IContractBehavior.xml b/xml/System.ServiceModel.Description/IContractBehavior.xml
index 3db8e678b8c..137b9afed5f 100644
--- a/xml/System.ServiceModel.Description/IContractBehavior.xml
+++ b/xml/System.ServiceModel.Description/IContractBehavior.xml
@@ -102,7 +102,6 @@
To insert the instance provider customization, the example shows how to implement a custom attribute (`SingletonBehaviorAttribute`) that implements to insert the custom service instance provider. It also implements , which binds its use to the `ISampleService` contract.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/icontractbehavior/cs/objectproviderbehavior.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/objectproviderbehavior.vb" id="Snippet2":::
]]>
@@ -212,7 +211,6 @@
To insert the instance provider customization, the example shows how to implement a custom attribute (`SingletonBehaviorAttribute`) that implements to insert the custom service instance provider. It also implements , which binds its use to the `ISampleService` contract.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/icontractbehavior/cs/objectproviderbehavior.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/objectproviderbehavior.vb" id="Snippet2":::
]]>
@@ -275,7 +273,6 @@
To insert the instance provider customization, the example shows how to implement a custom attribute (`SingletonBehaviorAttribute`) that implements to insert the custom service instance provider. It also implements , which binds its use to the `ISampleService` contract.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/icontractbehavior/cs/objectproviderbehavior.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/icontractbehavior/vb/objectproviderbehavior.vb" id="Snippet2":::
]]>
diff --git a/xml/System.ServiceModel.Security/X509ServiceCertificateAuthentication.xml b/xml/System.ServiceModel.Security/X509ServiceCertificateAuthentication.xml
index e46869bd2ed..df14e46138a 100644
--- a/xml/System.ServiceModel.Security/X509ServiceCertificateAuthentication.xml
+++ b/xml/System.ServiceModel.Security/X509ServiceCertificateAuthentication.xml
@@ -50,7 +50,6 @@
The following example shows how to use this class.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uex509servicecertificateauthentication/cs/client.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/client.vb" id="Snippet4":::
]]>
@@ -122,7 +121,6 @@
The following code shows how to set this property.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uex509servicecertificateauthentication/cs/client.cs" id="Snippet0":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/client.vb" id="Snippet0":::
The property can also be set in a configuration file.
@@ -172,7 +170,6 @@
The following code shows how to set this property.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uex509servicecertificateauthentication/cs/client.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/client.vb" id="Snippet1":::
The property can also be set in a configuration file.
@@ -223,7 +220,6 @@
The following code shows how to set this property.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uex509servicecertificateauthentication/cs/client.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/client.vb" id="Snippet2":::
The property can also be set in a configuration file.
@@ -274,7 +270,6 @@
The following code shows how to set this property.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_uex509servicecertificateauthentication/cs/client.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_uex509servicecertificateauthentication/vb/client.vb" id="Snippet3":::
The property can also be set in a configuration file.
diff --git a/xml/System.ServiceModel/ChannelFactory.xml b/xml/System.ServiceModel/ChannelFactory.xml
index 6c8e8d31998..67b3cc387c1 100644
--- a/xml/System.ServiceModel/ChannelFactory.xml
+++ b/xml/System.ServiceModel/ChannelFactory.xml
@@ -87,7 +87,6 @@
The following code example shows how to insert programmatically a client behavior prior to the creation of the channel object by the factory.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/channelfactorybehaviors/cs/client.cs" id="Snippet10":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/client.vb" id="Snippet10":::
]]>
diff --git a/xml/System.ServiceModel/ChannelFactory`1.xml b/xml/System.ServiceModel/ChannelFactory`1.xml
index 564de930a31..30ab264e3b7 100644
--- a/xml/System.ServiceModel/ChannelFactory`1.xml
+++ b/xml/System.ServiceModel/ChannelFactory`1.xml
@@ -79,7 +79,6 @@
The following code example shows how to insert programmatically a client behavior prior to the creation of the channel object by the factory.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/channelfactorybehaviors/cs/client.cs" id="Snippet10":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/channelfactorybehaviors/vb/client.vb" id="Snippet10":::
]]>
diff --git a/xml/System.ServiceModel/ClientBase`1.xml b/xml/System.ServiceModel/ClientBase`1.xml
index cf719e6f601..19b85fba951 100644
--- a/xml/System.ServiceModel/ClientBase`1.xml
+++ b/xml/System.ServiceModel/ClientBase`1.xml
@@ -144,7 +144,6 @@
The following code example shows how a client uses this constructor in a `SampleServiceClient` class that extends the class.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/servicecontractattribute/cs/client.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/client.vb" id="Snippet3":::
]]>
diff --git a/xml/System.ServiceModel/OperationContext.xml b/xml/System.ServiceModel/OperationContext.xml
index 206376dd6d9..3e7a5e6c56f 100644
--- a/xml/System.ServiceModel/OperationContext.xml
+++ b/xml/System.ServiceModel/OperationContext.xml
@@ -92,7 +92,6 @@
The following code example uses the property and method to obtain the channel back to the caller from within a method. All methods in this example are one-way methods, enabling the service and the client to communicate in both directions independently. In this case, the example client application expects only one return call before it exits, but another client, for example a Windows Forms client, can receive any number of calls from the service.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/sca.callbackcontract/cs/services.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/services.vb" id="Snippet1":::
The following client implements the `SampleDuplexHelloCallback` to receive the callback message. The imported callback contract is not the same name as the one in the service, due to the use of the property in the preceding example. Note that the client makes no assumptions about whether or when it might receive a callback; the server callback is entirely independent of the client's outbound call.
@@ -100,7 +99,6 @@
> For an example that uses the class in a client scenario, see .
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/sca.callbackcontract/cs/client.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/client.vb" id="Snippet3":::
]]>
@@ -253,7 +251,6 @@
The following code example uses the property and method to create a channel back to the caller from within a method. All methods in this example are one-way methods, enabling the service and the client to communicate in both directions independently. In this case, the example client application expects only one return call before it exits, but another client, for example a Windows Forms client, can receive any number of calls from the service.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/sca.callbackcontract/cs/services.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/services.vb" id="Snippet1":::
]]>
@@ -370,7 +367,6 @@ Call the metho
The following code example uses the property and method to create a channel back to the caller from within a operation. All operations in this example are one-way operations, enabling the service and the client to communicate in both directions independently. In this case, the example client application expects only one return call before it exits, but another client, for example a Windows Forms client, can receive any number of calls from the service.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/sca.callbackcontract/cs/services.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/services.vb" id="Snippet1":::
The following client implements the `SampleDuplexHelloCallback` to receive the callback message. The imported callback contract is not the same name as the one in the service, due to the use of the property in the preceding example. Note that the client makes no assumptions about whether or when it might receive a callback; the server callback is entirely independent of the client's outbound call.
@@ -378,7 +374,6 @@ Call the metho
> For an example that uses the class in a client scenario, see .
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/sca.callbackcontract/cs/client.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/client.vb" id="Snippet3":::
]]>
diff --git a/xml/System.ServiceModel/ServiceContractAttribute.xml b/xml/System.ServiceModel/ServiceContractAttribute.xml
index f8ea69cc4c3..3f7528b0446 100644
--- a/xml/System.ServiceModel/ServiceContractAttribute.xml
+++ b/xml/System.ServiceModel/ServiceContractAttribute.xml
@@ -97,7 +97,6 @@
The code example then implements that contract on the `SampleService` class.
[!code-csharp[ServiceContractAttribute#1](~/snippets/csharp/VS_Snippets_CFX/servicecontractattribute/cs/services.cs#1)]
- [!code-vb[ServiceContractAttribute#1](~/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/services.vb#1)]
The following code example shows a simple configuration file for the preceding service that creates one endpoint.
@@ -106,7 +105,6 @@
The following code example shows a simple client that invokes the preceding `SampleService`.
[!code-csharp[ServiceContractAttribute#3](~/snippets/csharp/VS_Snippets_CFX/servicecontractattribute/cs/client.cs#3)]
- [!code-vb[ServiceContractAttribute#3](~/snippets/visualbasic/VS_Snippets_CFX/servicecontractattribute/vb/client.vb#3)]
]]>
@@ -195,7 +193,6 @@
The following code example shows a service that specifies a callback contract, which indicates that a service of type `IDuplexHello` must have a correspondent that implements a service of type `IHelloCallbackContract`. In addition, `IHelloCallbackContract` implements a one-way callback method, enabling the service to call the client without waiting for a reply to support a distributed, event-driven client.
[!code-csharp[SCA.CallbackContract#1](~/snippets/csharp/VS_Snippets_CFX/sca.callbackcontract/cs/services.cs#1)]
- [!code-vb[SCA.CallbackContract#1](~/snippets/visualbasic/VS_Snippets_CFX/sca.callbackcontract/vb/services.vb#1)]
]]>
@@ -318,12 +315,10 @@
The following code example shows how to use the