Skip to content

Commit

Permalink
MultiBackgroundWorker,mine
Browse files Browse the repository at this point in the history
  • Loading branch information
akhuang committed Feb 17, 2012
1 parent 9c6d6bf commit 49e5c5c
Show file tree
Hide file tree
Showing 22 changed files with 1,045 additions and 0 deletions.
42 changes: 42 additions & 0 deletions BackgroundWorker_Ex03/BackgroundWorker_Ex03.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackgroundWorker_Ex03", "BackgroundWorker_Ex03\BackgroundWorker_Ex03.csproj", "{5799BEFD-5343-497F-93A6-B8EE3109968D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "Core\Core.csproj", "{B246327C-BFBF-4B33-A997-D2AAA6344768}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5799BEFD-5343-497F-93A6-B8EE3109968D}.Debug|Any CPU.ActiveCfg = Debug|x86
{5799BEFD-5343-497F-93A6-B8EE3109968D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{5799BEFD-5343-497F-93A6-B8EE3109968D}.Debug|Mixed Platforms.Build.0 = Debug|x86
{5799BEFD-5343-497F-93A6-B8EE3109968D}.Debug|x86.ActiveCfg = Debug|x86
{5799BEFD-5343-497F-93A6-B8EE3109968D}.Debug|x86.Build.0 = Debug|x86
{5799BEFD-5343-497F-93A6-B8EE3109968D}.Release|Any CPU.ActiveCfg = Release|x86
{5799BEFD-5343-497F-93A6-B8EE3109968D}.Release|Mixed Platforms.ActiveCfg = Release|x86
{5799BEFD-5343-497F-93A6-B8EE3109968D}.Release|Mixed Platforms.Build.0 = Release|x86
{5799BEFD-5343-497F-93A6-B8EE3109968D}.Release|x86.ActiveCfg = Release|x86
{5799BEFD-5343-497F-93A6-B8EE3109968D}.Release|x86.Build.0 = Release|x86
{B246327C-BFBF-4B33-A997-D2AAA6344768}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B246327C-BFBF-4B33-A997-D2AAA6344768}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B246327C-BFBF-4B33-A997-D2AAA6344768}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{B246327C-BFBF-4B33-A997-D2AAA6344768}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{B246327C-BFBF-4B33-A997-D2AAA6344768}.Debug|x86.ActiveCfg = Debug|Any CPU
{B246327C-BFBF-4B33-A997-D2AAA6344768}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B246327C-BFBF-4B33-A997-D2AAA6344768}.Release|Any CPU.Build.0 = Release|Any CPU
{B246327C-BFBF-4B33-A997-D2AAA6344768}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{B246327C-BFBF-4B33-A997-D2AAA6344768}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B246327C-BFBF-4B33-A997-D2AAA6344768}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5799BEFD-5343-497F-93A6-B8EE3109968D}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BackgroundWorker_Ex03</RootNamespace>
<AssemblyName>BackgroundWorker_Ex03</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<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|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</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>
88 changes: 88 additions & 0 deletions BackgroundWorker_Ex03/BackgroundWorker_Ex03/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions BackgroundWorker_Ex03/BackgroundWorker_Ex03/Form1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace BackgroundWorker_Ex03
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

InitializeMultiDelegate();
}

private void InitializeMultiDelegate()
{
multiBackgroundWorker1.DoWork += new Core.MultiDoWorkerEventHandler(multiBackgroundWorker1_DoWork);
multiBackgroundWorker1.ProgressChanged += new Core.MultiProgressChangedEventHandler(multiBackgroundWorker1_ProgressChanged);
multiBackgroundWorker1.RunWorkerCompleted += new Core.MultiRunWorkerCompletedEventHandler(multiBackgroundWorker1_RunWorkerCompleted);
}

private void btnStart_Click(object sender, EventArgs e)
{
Random rand = new Random();
int testNumber = rand.Next(50,100);

Guid guid=Guid.NewGuid();

multiBackgroundWorker1.RunWorkerAsync(guid,
}

void multiBackgroundWorker1_DoWork(object sender, Core.MultiDoWorkEventArgs e)
{
throw new NotImplementedException();
}

void multiBackgroundWorker1_ProgressChanged(object sender, Core.MultiProgressChangedEventArgs e)
{
throw new NotImplementedException();
}
void multiBackgroundWorker1_RunWorkerCompleted(object sender, Core.MultiRunWorkerCompletedEventArgs e)
{
throw new NotImplementedException();
}

}
}
123 changes: 123 additions & 0 deletions BackgroundWorker_Ex03/BackgroundWorker_Ex03/Form1.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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>
<metadata name="multiBackgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
Loading

0 comments on commit 49e5c5c

Please sign in to comment.