Skip to content

Commit 9c5c177

Browse files
committed
fix build warning and one snippets 5000 error
1 parent a6a2d4e commit 9c5c177

File tree

6 files changed

+82
-78
lines changed

6 files changed

+82
-78
lines changed
Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,48 @@
11
' <Snippet1>
22

3-
Imports System.Collections.Generic
4-
Imports System.Text
53
Imports System.AddIn
64
Imports System.AddIn.Pipeline
7-
Imports Calc2AddInView.CalcAddInViews
85

96
Namespace CalculatorAddIns
10-
' <Snippet2>
11-
' This pipeline segment has
12-
' two attributes:
13-
' 1 - An AddInAttribute to identify
14-
' this segment as an add-in.
15-
'
16-
' 2 - A QualificationDataAttribute to
17-
' indicate that the add-in should
18-
' be loaded into a new application domain.
7+
' <Snippet2>
8+
' This pipeline segment has
9+
' two attributes:
10+
' 1 - An AddInAttribute to identify
11+
' this segment as an add-in.
12+
'
13+
' 2 - A QualificationDataAttribute to
14+
' indicate that the add-in should
15+
' be loaded into a new application domain.
1916

20-
<AddIn("Calculator Add-in", Version:="2.0.0.0")> _
21-
<QualificationData("Isolation", "NewAppDomain")> _
17+
<AddIn("Calculator Add-in", Version:="2.0.0.0")>
18+
<QualificationData("Isolation", "NewAppDomain")>
2219
Public Class SampleV2AddIn
23-
' </Snippet2>
24-
Inherits Calculator2
25-
Public Overrides ReadOnly Property Operations() As String
26-
Get
27-
Return "+, -, *, /, **"
28-
End Get
29-
End Property
20+
' </Snippet2>
21+
Inherits Calculator2
22+
Public Overrides ReadOnly Property Operations() As String
23+
Get
24+
Return "+, -, *, /, **"
25+
End Get
26+
End Property
3027

31-
Public Overrides Function Operate(ByVal operation As String, _
32-
ByVal a As Double, ByVal b As Double) As Double
33-
Select Case operation
34-
Case "+"
35-
Return a + b
36-
Case "-"
37-
Return a - b
38-
Case "*"
39-
Return a * b
40-
Case "/"
41-
Return a / b
42-
Case "**"
43-
Return Math.Pow(a, b)
44-
Case Else
45-
Throw New InvalidOperationException("This add-in does not support: " & operation)
46-
End Select
47-
End Function
28+
Public Overrides Function Operate(ByVal operation As String,
29+
ByVal a As Double, ByVal b As Double) As Double
30+
Select Case operation
31+
Case "+"
32+
Return a + b
33+
Case "-"
34+
Return a - b
35+
Case "*"
36+
Return a * b
37+
Case "/"
38+
Return a / b
39+
Case "**"
40+
Return Math.Pow(a, b)
41+
Case Else
42+
Throw New InvalidOperationException("This add-in does not support: " & operation)
43+
End Select
44+
End Function
4845

49-
End Class
46+
End Class
5047
End Namespace
51-
' </Snippet1>
48+
' </Snippet1>

snippets/visualbasic/System.AddIn/AddInAttribute/Overview/AddInCalcV2.vbproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -11,11 +11,16 @@
1111
<AssemblyName>AddInCalcV2</AssemblyName>
1212
<FileAlignment>512</FileAlignment>
1313
<MyType>Windows</MyType>
14-
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<TargetFrameworkVersion>v4.81</TargetFrameworkVersion>
1515
<OptionExplicit>On</OptionExplicit>
1616
<OptionCompare>Binary</OptionCompare>
1717
<OptionStrict>Off</OptionStrict>
1818
<OptionInfer>On</OptionInfer>
19+
<FileUpgradeFlags>
20+
</FileUpgradeFlags>
21+
<UpgradeBackupLocation>
22+
</UpgradeBackupLocation>
23+
<OldToolsVersion>3.5</OldToolsVersion>
1924
</PropertyGroup>
2025
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2126
<DebugSymbols>true</DebugSymbols>
@@ -75,6 +80,7 @@
7580
<Compile Include="My Project\Application.Designer.vb">
7681
<AutoGen>True</AutoGen>
7782
<DependentUpon>Application.myapp</DependentUpon>
83+
<DesignTime>True</DesignTime>
7884
</Compile>
7985
<Compile Include="My Project\Resources.Designer.vb">
8086
<AutoGen>True</AutoGen>
@@ -121,4 +127,4 @@
121127
<Target Name="AfterBuild">
122128
</Target>
123129
-->
124-
</Project>
130+
</Project>

snippets/visualbasic/System.AddIn/AddInAttribute/Overview/My Project/Application.Designer.vb

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

snippets/visualbasic/System.AddIn/AddInAttribute/Overview/My Project/Resources.Designer.vb

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

snippets/visualbasic/System.AddIn/AddInAttribute/Overview/My Project/Settings.Designer.vb

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

xml/System/Enum.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
309309
:::code language="csharp" source="~/snippets/csharp/System/Enum/Equals/enumequals1.cs" interactive="try-dotnet" id="Snippet1":::
310310
:::code language="fsharp" source="~/snippets/fsharp/System/Enum/Equals/enumequals1.fs" id="Snippet1":::
311-
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.enum.equals/vb/enumequals1.vb" id="Snippet1":::
311+
:::code language="vb" source="~/snippets/visualbasic/System/Enum/Equals/enumequals1.vb" id="Snippet1":::
312312
313313
]]></format>
314314
</remarks>

0 commit comments

Comments
 (0)