Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into with-html

  • Loading branch information...
commit b5e468cc28d23d0dbf30ed45a4e3022f05fcd39c 2 parents d9cd7f9 + 68614fe
@LeeWitherington LeeWitherington authored
Showing with 890 additions and 0 deletions.
  1. +37 −0 dotnet/ReportGenerator-CS/Machine.cs
  2. +39 −0 dotnet/ReportGenerator-CS/Properties/AssemblyInfo.cs
  3. +37 −0 dotnet/ReportGenerator-CS/Report.cs
  4. +58 −0 dotnet/ReportGenerator-CS/ReportGenerator-CS.csproj
  5. +34 −0 dotnet/ReportGenerator-CS/Robot.cs
  6. +39 −0 dotnet/ReportGenerator-CS/Tests/ReportTest.cs
  7. +32 −0 dotnet/ReportGenerator-CS/Tests/RobotTest.cs
  8. +30 −0 dotnet/ReportGenerator-VB/Machine.vb
  9. +13 −0 dotnet/ReportGenerator-VB/My Project/Application.Designer.vb
  10. +10 −0 dotnet/ReportGenerator-VB/My Project/Application.myapp
  11. +35 −0 dotnet/ReportGenerator-VB/My Project/AssemblyInfo.vb
  12. +63 −0 dotnet/ReportGenerator-VB/My Project/Resources.Designer.vb
  13. +117 −0 dotnet/ReportGenerator-VB/My Project/Resources.resx
  14. +73 −0 dotnet/ReportGenerator-VB/My Project/Settings.Designer.vb
  15. +7 −0 dotnet/ReportGenerator-VB/My Project/Settings.settings
  16. +36 −0 dotnet/ReportGenerator-VB/Report.vb
  17. +115 −0 dotnet/ReportGenerator-VB/ReportGenerator-VB.vbproj
  18. +27 −0 dotnet/ReportGenerator-VB/Robot.vb
  19. +33 −0 dotnet/ReportGenerator-VB/Tests/ReportTest.vb
  20. +29 −0 dotnet/ReportGenerator-VB/Tests/RobotTest.vb
  21. +26 −0 dotnet/Reporting-VS2008.sln
  22. BIN  dotnet/lib/nunit.framework.dll
View
37 dotnet/ReportGenerator-CS/Machine.cs
@@ -0,0 +1,37 @@
+namespace ReportGeneratorCS
+{
+ public class Machine
+ {
+ private string name;
+ private string bin;
+ private string location;
+
+ public Machine(string name, string location)
+ {
+ this.name = name;
+ this.location = location;
+ }
+
+ public string Take()
+ {
+ string result = bin;
+ bin = null;
+ return result;
+ }
+
+ public string Bin()
+ {
+ return bin;
+ }
+
+ public void Put(string bin)
+ {
+ this.bin = bin;
+ }
+
+ public string Name()
+ {
+ return name;
+ }
+ }
+}
View
39 dotnet/ReportGenerator-CS/Properties/AssemblyInfo.cs
@@ -0,0 +1,39 @@
+using System.Reflection;
+using 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.
+
+[assembly: AssemblyTitle("Factory")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("Factory")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+
+[assembly: Guid("2cc2454a-91ba-46ef-b6e5-df8778a52ab8")]
+
+// 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")]
View
37 dotnet/ReportGenerator-CS/Report.cs
@@ -0,0 +1,37 @@
+using System.Collections.Generic;
+using System.IO;
+
+namespace ReportGeneratorCS
+{
+ public class Report
+ {
+ public static void report(StringWriter output, IList<Machine> machines, Robot robot)
+ {
+ output.Write("FACTORY REPORT\n");
+
+ IEnumerator<Machine> line = machines.GetEnumerator();
+ while (line.MoveNext())
+ {
+ Machine machine = line.Current;
+ output.Write("Machine " + machine.Name());
+
+ if (machine.Bin() != null)
+ output.Write(" bin=" + machine.Bin());
+
+ output.Write("\n");
+ }
+ output.Write("\n");
+
+ output.Write("Robot");
+ if (robot.Location() != null)
+ output.Write(" location=" + robot.Location().Name());
+
+ if (robot.Bin() != null)
+ output.Write(" bin=" + robot.Bin());
+
+ output.Write("\n");
+
+ output.Write("========\n");
+ }
+ }
+}
View
58 dotnet/ReportGenerator-CS/ReportGenerator-CS.csproj
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{A544A661-A053-404A-BE68-190687ACDEF7}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ReportGeneratorCS</RootNamespace>
+ <AssemblyName>ReportGeneratorCS</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.framework, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\lib\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Machine.cs" />
+ <Compile Include="Report.cs" />
+ <Compile Include="Tests\ReportTest.cs" />
+ <Compile Include="Robot.cs" />
+ <Compile Include="Tests\RobotTest.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
View
34 dotnet/ReportGenerator-CS/Robot.cs
@@ -0,0 +1,34 @@
+namespace ReportGeneratorCS
+{
+ public class Robot
+ {
+ private string bin;
+ private Machine location;
+
+ public Machine Location()
+ {
+ return location;
+ }
+
+ public void MoveTo(Machine location)
+ {
+ this.location = location;
+ }
+
+ public void Pick()
+ {
+ bin = location.Take();
+ }
+
+ public string Bin()
+ {
+ return bin;
+ }
+
+ public void Release()
+ {
+ location.Put(bin);
+ bin = null;
+ }
+ }
+}
View
39 dotnet/ReportGenerator-CS/Tests/ReportTest.cs
@@ -0,0 +1,39 @@
+using System.Collections.Generic;
+using System.IO;
+using NUnit.Framework;
+
+namespace ReportGeneratorCS.Tests
+{
+ [TestFixture]
+ public class ReportTest
+ {
+ [Test]
+ public void TestReport()
+ {
+ IList<Machine> line = new List<Machine>();
+ line.Add(new Machine("mixer", "left"));
+
+ Machine extruder = new Machine("extruder", "center");
+ extruder.Put("paste");
+ line.Add(extruder);
+
+ Machine oven = new Machine("oven", "right");
+ oven.Put("chips");
+ line.Add(oven);
+
+ Robot robot = new Robot();
+ robot.MoveTo(extruder);
+ robot.Pick();
+
+ StringWriter output = new StringWriter();
+ Report.report(output, line, robot);
+
+ string expected = "FACTORY REPORT\n"
+ + "Machine mixer\nMachine extruder\n"
+ + "Machine oven bin=chips\n\n"
+ + "Robot location=extruder bin=paste\n" + "========\n";
+
+ Assert.That(expected, Is.EqualTo(output.ToString()));
+ }
+ }
+}
View
32 dotnet/ReportGenerator-CS/Tests/RobotTest.cs
@@ -0,0 +1,32 @@
+using NUnit.Framework;
+
+namespace ReportGeneratorCS.Tests
+{
+ [TestFixture]
+ public class RobotTest
+ {
+ [Test]
+ public void TestRobot()
+ {
+ Machine sorter = new Machine("Sorter", "left");
+ sorter.Put("chips");
+ Machine oven = new Machine("Oven", "middle");
+ Robot robot = new Robot();
+
+ Assert.That("chips", Is.EqualTo(sorter.Bin()));
+ Assert.That(oven.Bin(), Is.Null);
+ Assert.That(robot.Location(), Is.Null);
+ Assert.That(robot.Bin(), Is.Null);
+
+ robot.MoveTo(sorter);
+ robot.Pick();
+ robot.MoveTo(oven);
+ robot.Release();
+
+ Assert.That(robot.Bin(), Is.Null);
+ Assert.That(oven, Is.EqualTo(robot.Location()));
+ Assert.That(sorter.Bin(), Is.Null);
+ Assert.That("chips", Is.EqualTo(oven.Bin()));
+ }
+ }
+}
View
30 dotnet/ReportGenerator-VB/Machine.vb
@@ -0,0 +1,30 @@
+Namespace ReportGeneratorVB
+ Public Class Machine
+ Private _name As String
+ Private _bin As String
+ Private _location As String
+
+ Public Sub New(ByVal name As String, ByVal location As String)
+ Me._name = name
+ Me._location = location
+ End Sub
+
+ Public Function Take() As String
+ Dim result As String = _bin
+ _bin = Nothing
+ Return result
+ End Function
+
+ Public Function Bin() As String
+ Return _bin
+ End Function
+
+ Public Sub Put(ByVal bin As String)
+ Me._bin = bin
+ End Sub
+
+ Public Function Name() As String
+ Return _name
+ End Function
+ End Class
+End Namespace
View
13 dotnet/ReportGenerator-VB/My Project/Application.Designer.vb
@@ -0,0 +1,13 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+' This code was generated by a tool.
+' Runtime Version:2.0.50727.5446
+'
+' 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
+
View
10 dotnet/ReportGenerator-VB/My Project/Application.myapp
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <MySubMain>false</MySubMain>
+ <SingleInstance>false</SingleInstance>
+ <ShutdownMode>0</ShutdownMode>
+ <EnableVisualStyles>true</EnableVisualStyles>
+ <AuthenticationMode>0</AuthenticationMode>
+ <ApplicationType>1</ApplicationType>
+ <SaveMySettingsOnExit>true</SaveMySettingsOnExit>
+</MyApplicationData>
View
35 dotnet/ReportGenerator-VB/My Project/AssemblyInfo.vb
@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+<Assembly: AssemblyTitle("ReportGenerator-VB")>
+<Assembly: AssemblyDescription("")>
+<Assembly: AssemblyCompany("Microsoft")>
+<Assembly: AssemblyProduct("ReportGenerator-VB")>
+<Assembly: AssemblyCopyright("Copyright © Microsoft 2011")>
+<Assembly: AssemblyTrademark("")>
+
+<Assembly: ComVisible(False)>
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+<Assembly: Guid("c44edc53-096d-464c-9176-2cd580d14595")>
+
+' 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")>
View
63 dotnet/ReportGenerator-VB/My Project/Resources.Designer.vb
@@ -0,0 +1,63 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+' This code was generated by a tool.
+' Runtime Version:2.0.50727.5446
+'
+' 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", "2.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("ReportGeneratorVB.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
View
117 dotnet/ReportGenerator-VB/My Project/Resources.resx
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
View
73 dotnet/ReportGenerator-VB/My Project/Settings.Designer.vb
@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+' This code was generated by a tool.
+' Runtime Version:2.0.50727.5446
+'
+' 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", "9.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.ReportGeneratorVB.My.MySettings
+ Get
+ Return Global.ReportGeneratorVB.My.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
View
7 dotnet/ReportGenerator-VB/My Project/Settings.settings
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
+ <Profiles>
+ <Profile Name="(Default)" />
+ </Profiles>
+ <Settings />
+</SettingsFile>
View
36 dotnet/ReportGenerator-VB/Report.vb
@@ -0,0 +1,36 @@
+Imports System.Collections.Generic
+Imports System.IO
+
+Namespace ReportGeneratorVB
+ Public Class Report
+ Public Shared Sub report(output As StringWriter, machines As IList(Of Machine), robot As Robot)
+ output.Write("FACTORY REPORT" & vbLf)
+
+ Dim line As IEnumerator(Of Machine) = machines.GetEnumerator()
+ While line.MoveNext()
+ Dim machine As Machine = line.Current
+ output.Write("Machine " + machine.Name())
+
+ If machine.Bin() IsNot Nothing Then
+ output.Write(" bin=" + machine.Bin())
+ End If
+
+ output.Write(vbLf)
+ End While
+ output.Write(vbLf)
+
+ output.Write("Robot")
+ If robot.Location() IsNot Nothing Then
+ output.Write(" location=" + robot.Location().Name())
+ End If
+
+ If robot.Bin() IsNot Nothing Then
+ output.Write(" bin=" + robot.Bin())
+ End If
+
+ output.Write(vbLf)
+
+ output.Write("========" & vbLf)
+ End Sub
+ End Class
+End Namespace
View
115 dotnet/ReportGenerator-VB/ReportGenerator-VB.vbproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{82BA2937-87D4-4667-9751-B8F071F6736E}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>ReportGeneratorVB</RootNamespace>
+ <AssemblyName>ReportGeneratorVB</AssemblyName>
+ <FileAlignment>512</FileAlignment>
+ <MyType>Windows</MyType>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <OptionExplicit>On</OptionExplicit>
+ <OptionCompare>Binary</OptionCompare>
+ <OptionStrict>Off</OptionStrict>
+ <OptionInfer>On</OptionInfer>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <DefineDebug>true</DefineDebug>
+ <DefineTrace>true</DefineTrace>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DocumentationFile>ReportGeneratorVB.xml</DocumentationFile>
+ <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <DefineDebug>false</DefineDebug>
+ <DefineTrace>true</DefineTrace>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DocumentationFile>ReportGeneratorVB.xml</DocumentationFile>
+ <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.framework, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\lib\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Import Include="Microsoft.VisualBasic" />
+ <Import Include="System" />
+ <Import Include="System.Collections" />
+ <Import Include="System.Collections.Generic" />
+ <Import Include="System.Data" />
+ <Import Include="System.Diagnostics" />
+ <Import Include="System.Linq" />
+ <Import Include="System.Xml.Linq" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Machine.vb" />
+ <Compile Include="My Project\AssemblyInfo.vb" />
+ <Compile Include="My Project\Application.Designer.vb">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Application.myapp</DependentUpon>
+ </Compile>
+ <Compile Include="My Project\Resources.Designer.vb">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <Compile Include="My Project\Settings.Designer.vb">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ <Compile Include="Report.vb" />
+ <Compile Include="Robot.vb" />
+ <Compile Include="Tests\ReportTest.vb" />
+ <Compile Include="Tests\RobotTest.vb" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="My Project\Resources.resx">
+ <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.vb</LastGenOutput>
+ <CustomToolNamespace>My.Resources</CustomToolNamespace>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="My Project\Application.myapp">
+ <Generator>MyApplicationCodeGenerator</Generator>
+ <LastGenOutput>Application.Designer.vb</LastGenOutput>
+ </None>
+ <None Include="My Project\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <CustomToolNamespace>My</CustomToolNamespace>
+ <LastGenOutput>Settings.Designer.vb</LastGenOutput>
+ </None>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
View
27 dotnet/ReportGenerator-VB/Robot.vb
@@ -0,0 +1,27 @@
+Namespace ReportGeneratorVB
+ Public Class Robot
+ Private _bin As String
+ Private _location As Machine
+
+ Public Function Location() As Machine
+ Return _location
+ End Function
+
+ Public Sub MoveTo(location As Machine)
+ Me._location = location
+ End Sub
+
+ Public Sub Pick()
+ _bin = _location.Take()
+ End Sub
+
+ Public Function Bin() As String
+ Return _bin
+ End Function
+
+ Public Sub Release()
+ _location.Put(Bin)
+ _bin = Nothing
+ End Sub
+ End Class
+End Namespace
View
33 dotnet/ReportGenerator-VB/Tests/ReportTest.vb
@@ -0,0 +1,33 @@
+Imports System.Collections.Generic
+Imports System.IO
+Imports NUnit.Framework
+
+Namespace ReportGeneratorVB.Tests
+ <TestFixture()> _
+ Public Class ReportTest
+ <Test()> _
+ Public Sub TestReport()
+ Dim line As IList(Of Machine) = New List(Of Machine)()
+ line.Add(New Machine("mixer", "left"))
+
+ Dim extruder As New Machine("extruder", "center")
+ extruder.Put("paste")
+ line.Add(extruder)
+
+ Dim oven As New Machine("oven", "right")
+ oven.Put("chips")
+ line.Add(oven)
+
+ Dim robot As New Robot()
+ robot.MoveTo(extruder)
+ robot.Pick()
+
+ Dim output As New StringWriter()
+ Report.report(output, line, robot)
+
+ Dim expected As String = "FACTORY REPORT" & vbLf + "Machine mixer" & vbLf & "Machine extruder" & vbLf + "Machine oven bin=chips" & vbLf & vbLf + "Robot location=extruder bin=paste" & vbLf + "========" & vbLf
+
+ Assert.That(expected, [Is].EqualTo(output.ToString()))
+ End Sub
+ End Class
+End Namespace
View
29 dotnet/ReportGenerator-VB/Tests/RobotTest.vb
@@ -0,0 +1,29 @@
+Imports NUnit.Framework
+
+Namespace ReportGeneratorVB.Tests
+ <TestFixture()> _
+ Public Class RobotTest
+ <Test()> _
+ Public Sub TestRobot()
+ Dim sorter As New Machine("Sorter", "left")
+ sorter.Put("chips")
+ Dim oven As New Machine("Oven", "middle")
+ Dim robot As New Robot()
+
+ Assert.That("chips", [Is].EqualTo(sorter.Bin()))
+ Assert.That(oven.Bin(), [Is].Null)
+ Assert.That(robot.Location(), [Is].Null)
+ Assert.That(robot.Bin(), [Is].Null)
+
+ robot.MoveTo(sorter)
+ robot.Pick()
+ robot.MoveTo(oven)
+ robot.Release()
+
+ Assert.That(robot.Bin(), [Is].Null)
+ Assert.That(oven, [Is].EqualTo(robot.Location()))
+ Assert.That(sorter.Bin(), [Is].Null)
+ Assert.That("chips", [Is].EqualTo(oven.Bin()))
+ End Sub
+ End Class
+End Namespace
View
26 dotnet/Reporting-VS2008.sln
@@ -0,0 +1,26 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportGenerator-CS", "ReportGenerator-CS\ReportGenerator-CS.csproj", "{A544A661-A053-404A-BE68-190687ACDEF7}"
+EndProject
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ReportGenerator-VB", "ReportGenerator-VB\ReportGenerator-VB.vbproj", "{82BA2937-87D4-4667-9751-B8F071F6736E}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A544A661-A053-404A-BE68-190687ACDEF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A544A661-A053-404A-BE68-190687ACDEF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A544A661-A053-404A-BE68-190687ACDEF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A544A661-A053-404A-BE68-190687ACDEF7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {82BA2937-87D4-4667-9751-B8F071F6736E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {82BA2937-87D4-4667-9751-B8F071F6736E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {82BA2937-87D4-4667-9751-B8F071F6736E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {82BA2937-87D4-4667-9751-B8F071F6736E}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
View
BIN  dotnet/lib/nunit.framework.dll
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.