Tâche 1 : créer l'application de note de frais simple
Dans cette tâche, vous créez le fichier projet et l'application Windows Form utilisée dans le reste de ce didacticiel. Le fichier projet contient les références d'assembly nécessaires à la plupart des applications Windows Workflow Foundation. Au fur et à mesure de votre progression dans le didacticiel, vous modifierez ce fichier pour ajouter de nouveaux fichiers projets.
L'application Windows Form contient l'interface utilisateur complète pour le didacticiel. Toutefois, vous ajouterez une logique supplémentaire au Windows Form au fur et à mesure que vous créerez le workflow séquentiel dans les exercices restants.
Cette tâche contient des procédures pour créer les fichiers à l'aide de Visual Studio ou d'un éditeur de texte avec le Kit de développement logiciel autonome.
Utilisation de Visual Studio.
Cette section décrit comment créer le projet et les fichiers d'application dans Visual Studio.
Pour créer le projet SimpleExpenseReport
Dans Visual Studio, cliquez sur Fichier, pointez vers Nouveau, puis Projet. Si vous souhaitez créer un projet C#, sélectionnez Visual C#, puis Windows, choisissez Application Windows et nommez le projet
SimpleExpenseReport
. Cliquez sur OK. Si vous souhaitez créer un projet Visual Basic, sélectionnez Visual Basic, Windows, puis suivez les étapes précédentes.Dans l'Explorateur de solutions, cliquez avec le bouton droit de la souris sur Références, puis cliquez sur Ajouter une référence. Dans l'onglet .NET, cliquez sur chacune des options suivantes, puis cliquez sur OK pour les ajouter au projet.
System.Configuration
System.Workflow.Activities
System.Workflow.ComponentModel
System.Workflow.Runtime
System.Design
System.Drawing.Design
System.Transactions
System.Web
System.Web.Services
Création et exécution de l'application Windows Form
Ensuite, vous créez l'application Windows Form qui contiendra l'interface utilisateur pour le reste du didacticiel.
Pour créer et exécuter l'application Windows Form de note de frais simple
Dans Explorateur de solutions, double-cliquez sur Program.cs ou Program.vb pour l'ouvrir dans le volet d'éditeur de code sur la gauche.
Ajoutez le code suivant pour l'application Windows Form.
using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using System.Collections.Generic; using System.Workflow.Runtime; using System.Workflow.Runtime.Hosting; using System.Workflow.Activities; using System.Threading; namespace Microsoft.Samples.Workflow.Tutorials.SequentialWorkflow { public class MainForm : Form { private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox result; private System.Windows.Forms.Label label2; private System.Windows.Forms.Button submitButton; private System.Windows.Forms.Label approvalState; private System.Windows.Forms.Button approveButton; private System.Windows.Forms.Button rejectButton; private System.Windows.Forms.TextBox amount; private System.Windows.Forms.Panel panel1; private System.ComponentModel.IContainer components = null; public MainForm() { InitializeComponent(); // Collapse approve/reject panel this.Height = this.MinimumSize.Height; } protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.result = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.submitButton = new System.Windows.Forms.Button(); this.approvalState = new System.Windows.Forms.Label(); this.approveButton = new System.Windows.Forms.Button(); this.rejectButton = new System.Windows.Forms.Button(); this.amount = new System.Windows.Forms.TextBox(); this.panel1 = new System.Windows.Forms.Panel(); this.panel1.SuspendLayout(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(10, 13); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(43, 13); this.label1.TabIndex = 1; this.label1.Text = "Amount"; // // result // this.result.Location = new System.Drawing.Point(13, 70); this.result.Name = "result"; this.result.ReadOnly = true; this.result.Size = new System.Drawing.Size(162, 20); this.result.TabIndex = 1; this.result.TabStop = false; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(10, 54); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(37, 13); this.label2.TabIndex = 3; this.label2.Text = "Result"; // // submitButton // this.submitButton.Enabled = false; this.submitButton.Location = new System.Drawing.Point(56, 95); this.submitButton.Name = "submitButton"; this.submitButton.Size = new System.Drawing.Size(75, 23); this.submitButton.TabIndex = 2; this.submitButton.Text = "Submit"; this.submitButton.Click += new System.EventHandler(this.submitButton_Click); // // approvalState // this.approvalState.AutoSize = true; this.approvalState.Location = new System.Drawing.Point(10, 9); this.approvalState.Name = "approvalState"; this.approvalState.Size = new System.Drawing.Size(49, 13); this.approvalState.TabIndex = 4; this.approvalState.Text = "Approval"; // // approveButton // this.approveButton.Enabled = false; this.approveButton.Location = new System.Drawing.Point(11, 25); this.approveButton.Name = "approveButton"; this.approveButton.Size = new System.Drawing.Size(75, 23); this.approveButton.TabIndex = 0; this.approveButton.Text = "Approve"; this.approveButton.Click += new System.EventHandler(this.approveButton_Click); // // rejectButton // this.rejectButton.Enabled = false; this.rejectButton.Location = new System.Drawing.Point(86, 25); this.rejectButton.Name = "rejectButton"; this.rejectButton.Size = new System.Drawing.Size(75, 23); this.rejectButton.TabIndex = 1; this.rejectButton.Text = "Reject"; this.rejectButton.Click += new System.EventHandler(this.rejectButton_Click); // // amount // this.amount.Location = new System.Drawing.Point(13, 29); this.amount.MaxLength = 9; this.amount.Name = "amount"; this.amount.Size = new System.Drawing.Size(162, 20); this.amount.TabIndex = 0; this.amount.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.amount_KeyPress); this.amount.TextChanged += new System.EventHandler(this.amount_TextChanged); // // panel1 // this.panel1.Controls.Add(this.approvalState); this.panel1.Controls.Add(this.approveButton); this.panel1.Controls.Add(this.rejectButton); this.panel1.Location = new System.Drawing.Point(7, 124); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(172, 66); this.panel1.TabIndex = 8; // // MainForm // this.AcceptButton = this.submitButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(187, 201); this.MinimumSize = new System.Drawing.Size(197, 155); this.Controls.Add(this.result); this.Controls.Add(this.label2); this.Controls.Add(this.panel1); this.Controls.Add(this.amount); this.Controls.Add(this.submitButton); this.Controls.Add(this.label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "MainForm"; this.Text = "Simple Expense Report"; this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } private void submitButton_Click(object sender, EventArgs e) { } private void approveButton_Click(object sender, EventArgs e) { } private void rejectButton_Click(object sender, EventArgs e) { } private void amount_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsControl(e.KeyChar) && (!Char.IsDigit(e.KeyChar))) e.KeyChar = Char.MinValue; } private void amount_TextChanged(object sender, EventArgs e) { submitButton.Enabled = amount.Text.Length > 0; } } static class Program { [STAThread] static void Main() { Application.EnableVisualStyles(); Application.Run(new MainForm()); } } }
Ajoutez le code suivant pour l'application Windows Form.
using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using System.Collections.Generic; using System.Workflow.Runtime; using System.Workflow.Runtime.Hosting; using System.Workflow.Activities; using System.Threading; namespace Microsoft.Samples.Workflow.Tutorials.SequentialWorkflow { public class MainForm : Form { private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox result; private System.Windows.Forms.Label label2; private System.Windows.Forms.Button submitButton; private System.Windows.Forms.Label approvalState; private System.Windows.Forms.Button approveButton; private System.Windows.Forms.Button rejectButton; private System.Windows.Forms.TextBox amount; private System.Windows.Forms.Panel panel1; private System.ComponentModel.IContainer components = null; public MainForm() { InitializeComponent(); // Collapse approve/reject panel this.Height = this.MinimumSize.Height; } protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.result = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.submitButton = new System.Windows.Forms.Button(); this.approvalState = new System.Windows.Forms.Label(); this.approveButton = new System.Windows.Forms.Button(); this.rejectButton = new System.Windows.Forms.Button(); this.amount = new System.Windows.Forms.TextBox(); this.panel1 = new System.Windows.Forms.Panel(); this.panel1.SuspendLayout(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(10, 13); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(43, 13); this.label1.TabIndex = 1; this.label1.Text = "Amount"; // // result // this.result.Location = new System.Drawing.Point(13, 70); this.result.Name = "result"; this.result.ReadOnly = true; this.result.Size = new System.Drawing.Size(162, 20); this.result.TabIndex = 1; this.result.TabStop = false; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(10, 54); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(37, 13); this.label2.TabIndex = 3; this.label2.Text = "Result"; // // submitButton // this.submitButton.Enabled = false; this.submitButton.Location = new System.Drawing.Point(56, 95); this.submitButton.Name = "submitButton"; this.submitButton.Size = new System.Drawing.Size(75, 23); this.submitButton.TabIndex = 2; this.submitButton.Text = "Submit"; this.submitButton.Click += new System.EventHandler(this.submitButton_Click); // // approvalState // this.approvalState.AutoSize = true; this.approvalState.Location = new System.Drawing.Point(10, 9); this.approvalState.Name = "approvalState"; this.approvalState.Size = new System.Drawing.Size(49, 13); this.approvalState.TabIndex = 4; this.approvalState.Text = "Approval"; // // approveButton // this.approveButton.Enabled = false; this.approveButton.Location = new System.Drawing.Point(11, 25); this.approveButton.Name = "approveButton"; this.approveButton.Size = new System.Drawing.Size(75, 23); this.approveButton.TabIndex = 0; this.approveButton.Text = "Approve"; this.approveButton.Click += new System.EventHandler(this.approveButton_Click); // // rejectButton // this.rejectButton.Enabled = false; this.rejectButton.Location = new System.Drawing.Point(86, 25); this.rejectButton.Name = "rejectButton"; this.rejectButton.Size = new System.Drawing.Size(75, 23); this.rejectButton.TabIndex = 1; this.rejectButton.Text = "Reject"; this.rejectButton.Click += new System.EventHandler(this.rejectButton_Click); // // amount // this.amount.Location = new System.Drawing.Point(13, 29); this.amount.MaxLength = 9; this.amount.Name = "amount"; this.amount.Size = new System.Drawing.Size(162, 20); this.amount.TabIndex = 0; this.amount.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.amount_KeyPress); this.amount.TextChanged += new System.EventHandler(this.amount_TextChanged); // // panel1 // this.panel1.Controls.Add(this.approvalState); this.panel1.Controls.Add(this.approveButton); this.panel1.Controls.Add(this.rejectButton); this.panel1.Location = new System.Drawing.Point(7, 124); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(172, 66); this.panel1.TabIndex = 8; // // MainForm // this.AcceptButton = this.submitButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(187, 201); this.MinimumSize = new System.Drawing.Size(197, 155); this.Controls.Add(this.result); this.Controls.Add(this.label2); this.Controls.Add(this.panel1); this.Controls.Add(this.amount); this.Controls.Add(this.submitButton); this.Controls.Add(this.label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "MainForm"; this.Text = "Simple Expense Report"; this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } private void submitButton_Click(object sender, EventArgs e) { } private void approveButton_Click(object sender, EventArgs e) { } private void rejectButton_Click(object sender, EventArgs e) { } private void amount_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsControl(e.KeyChar) && (!Char.IsDigit(e.KeyChar))) e.KeyChar = Char.MinValue; } private void amount_TextChanged(object sender, EventArgs e) { submitButton.Enabled = amount.Text.Length > 0; } } static class Program { [STAThread] static void Main() { Application.EnableVisualStyles(); Application.Run(new MainForm()); } } }
Ajoutez le code suivant pour l'application Windows Form.
using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using System.Collections.Generic; using System.Workflow.Runtime; using System.Workflow.Runtime.Hosting; using System.Workflow.Activities; using System.Threading; namespace Microsoft.Samples.Workflow.Tutorials.SequentialWorkflow { public class MainForm : Form { private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox result; private System.Windows.Forms.Label label2; private System.Windows.Forms.Button submitButton; private System.Windows.Forms.Label approvalState; private System.Windows.Forms.Button approveButton; private System.Windows.Forms.Button rejectButton; private System.Windows.Forms.TextBox amount; private System.Windows.Forms.Panel panel1; private System.ComponentModel.IContainer components = null; public MainForm() { InitializeComponent(); // Collapse approve/reject panel this.Height = this.MinimumSize.Height; } protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.result = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.submitButton = new System.Windows.Forms.Button(); this.approvalState = new System.Windows.Forms.Label(); this.approveButton = new System.Windows.Forms.Button(); this.rejectButton = new System.Windows.Forms.Button(); this.amount = new System.Windows.Forms.TextBox(); this.panel1 = new System.Windows.Forms.Panel(); this.panel1.SuspendLayout(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(10, 13); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(43, 13); this.label1.TabIndex = 1; this.label1.Text = "Amount"; // // result // this.result.Location = new System.Drawing.Point(13, 70); this.result.Name = "result"; this.result.ReadOnly = true; this.result.Size = new System.Drawing.Size(162, 20); this.result.TabIndex = 1; this.result.TabStop = false; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(10, 54); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(37, 13); this.label2.TabIndex = 3; this.label2.Text = "Result"; // // submitButton // this.submitButton.Enabled = false; this.submitButton.Location = new System.Drawing.Point(56, 95); this.submitButton.Name = "submitButton"; this.submitButton.Size = new System.Drawing.Size(75, 23); this.submitButton.TabIndex = 2; this.submitButton.Text = "Submit"; this.submitButton.Click += new System.EventHandler(this.submitButton_Click); // // approvalState // this.approvalState.AutoSize = true; this.approvalState.Location = new System.Drawing.Point(10, 9); this.approvalState.Name = "approvalState"; this.approvalState.Size = new System.Drawing.Size(49, 13); this.approvalState.TabIndex = 4; this.approvalState.Text = "Approval"; // // approveButton // this.approveButton.Enabled = false; this.approveButton.Location = new System.Drawing.Point(11, 25); this.approveButton.Name = "approveButton"; this.approveButton.Size = new System.Drawing.Size(75, 23); this.approveButton.TabIndex = 0; this.approveButton.Text = "Approve"; this.approveButton.Click += new System.EventHandler(this.approveButton_Click); // // rejectButton // this.rejectButton.Enabled = false; this.rejectButton.Location = new System.Drawing.Point(86, 25); this.rejectButton.Name = "rejectButton"; this.rejectButton.Size = new System.Drawing.Size(75, 23); this.rejectButton.TabIndex = 1; this.rejectButton.Text = "Reject"; this.rejectButton.Click += new System.EventHandler(this.rejectButton_Click); // // amount // this.amount.Location = new System.Drawing.Point(13, 29); this.amount.MaxLength = 9; this.amount.Name = "amount"; this.amount.Size = new System.Drawing.Size(162, 20); this.amount.TabIndex = 0; this.amount.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.amount_KeyPress); this.amount.TextChanged += new System.EventHandler(this.amount_TextChanged); // // panel1 // this.panel1.Controls.Add(this.approvalState); this.panel1.Controls.Add(this.approveButton); this.panel1.Controls.Add(this.rejectButton); this.panel1.Location = new System.Drawing.Point(7, 124); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(172, 66); this.panel1.TabIndex = 8; // // MainForm // this.AcceptButton = this.submitButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(187, 201); this.MinimumSize = new System.Drawing.Size(197, 155); this.Controls.Add(this.result); this.Controls.Add(this.label2); this.Controls.Add(this.panel1); this.Controls.Add(this.amount); this.Controls.Add(this.submitButton); this.Controls.Add(this.label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "MainForm"; this.Text = "Simple Expense Report"; this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } private void submitButton_Click(object sender, EventArgs e) { } private void approveButton_Click(object sender, EventArgs e) { } private void rejectButton_Click(object sender, EventArgs e) { } private void amount_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsControl(e.KeyChar) && (!Char.IsDigit(e.KeyChar))) e.KeyChar = Char.MinValue; } private void amount_TextChanged(object sender, EventArgs e) { submitButton.Enabled = amount.Text.Length > 0; } } static class Program { [STAThread] static void Main() { Application.EnableVisualStyles(); Application.Run(new MainForm()); } } }
Cliquez sur Déboguer, pointez vers Démarrer le débogage, l'application Windows Form doit ressembler à la figure suivante :
Utilisation d'un éditeur de texte
Cette section décrit comment créer le projet et les fichiers d'application à l'aide d'un éditeur de texte en dehors de Visual Studio.
Suivez ces étapes pour créer le fichier projet pour l'application de note de frais. Si vous utilisez C#, attribuez l'extension de nom de fichier .csproj au fichier projet. Si vous utilisez Visual Basic, attribuez-lui une extension de nom de fichier .vbproj.
Pour créer le fichier projet SimpleExpenseReport
Dans le répertoire de projet, créez un nouveau fichier nommé SimpleExpenseReport.
Utilisez l'extension .csproj pour un projet C# ou .vbproj pour un projet Visual Basic.
Copiez et collez le code suivant dans ce fichier projet.
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="https://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{37000091-C9D4-4954-B65E-5EED0AD2CD55}</ProjectGuid> <ProjectTypeGuids>{D59BE175-2ED0-4C54-BE3D-CDAA9F3214C8};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids> <OutputType>WinExe</OutputType> <StartupObject> </StartupObject> <RootNamespace>SimpleExpenseReport</RootNamespace> <AssemblyName>SimpleExpenseReport</AssemblyName> <MyType>WindowsFormsWithCustomSubMain</MyType> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <DefineDebug>true</DefineDebug> <DefineTrace>true</DefineTrace> <IncrementalBuild>true</IncrementalBuild> <OutputPath>bin\</OutputPath> <DefineConstants>_MyType="Windows"</DefineConstants> <DocumentationFile>SimpleExpenseReport.xml</DocumentationFile> <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugSymbols>false</DebugSymbols> <DefineDebug>false</DefineDebug> <DefineTrace>true</DefineTrace> <IncrementalBuild>false</IncrementalBuild> <Optimize>true</Optimize> <OutputPath>bin\</OutputPath> <DefineConstants>_MyType="Windows"</DefineConstants> <DocumentationFile>SimpleExpenseReport.xml</DocumentationFile> <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <ItemGroup> <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <Name>System</Name> <SpecificVersion>True</SpecificVersion> </Reference> <Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <Name>System.Data</Name> <SpecificVersion>True</SpecificVersion> </Reference> <Reference Include="System.Deployment" /> <Reference Include="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <Name>System.Transactions</Name> <SpecificVersion>True</SpecificVersion> </Reference> <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <Name>System.Xml</Name> <SpecificVersion>True</SpecificVersion> </Reference> <Reference Include="System.Workflow.Activities, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Name>System.Workflow.Activities</Name> <SpecificVersion>True</SpecificVersion> </Reference> <Reference Include="System.Workflow.ComponentModel, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Name>System.Workflow.ComponentModel</Name> <SpecificVersion>True</SpecificVersion> </Reference> <Reference Include="System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Name>System.Workflow.Runtime</Name> <SpecificVersion>True</SpecificVersion> </Reference> <Reference Include="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Name>System.Design</Name> <SpecificVersion>True</SpecificVersion> </Reference> <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Name>System.Drawing</Name> <SpecificVersion>True</SpecificVersion> </Reference> <Reference Include="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Name>System.Drawing.Design</Name> <SpecificVersion>True</SpecificVersion> </Reference> <Reference Include="System.Windows.Forms"> <Name>System.Windows.Forms</Name> </Reference> <Reference Include="mscorlib"> <Name>mscorlib</Name> </Reference> <Reference Include="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86"> <Name>System.Web</Name> <SpecificVersion>True</SpecificVersion> </Reference> <Reference Include="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Name>System.Web.Services</Name> <SpecificVersion>True</SpecificVersion> </Reference> </ItemGroup> <ItemGroup> <Import Include="Microsoft.VisualBasic" /> <Import Include="System" /> <Import Include="System.Collections" /> <Import Include="System.Data" /> <Import Include="System.Diagnostics" /> </ItemGroup> <ItemGroup> <Compile Include="Program.vb"> <SubType>Form</SubType> </Compile> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.Targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.0\Workflow.VisualBasic.Targets" /> <PropertyGroup> <PreBuildEvent> </PreBuildEvent> <PostBuildEvent> </PostBuildEvent> </PropertyGroup> </Project>
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="https://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{37000091-C9D4-4954-B65E-5EED0AD2CD55}</ProjectGuid> <OutputType>WinExe</OutputType> <RootNamespace>Microsoft.Samples.Workflow.Tutorials.SequentialWorkflow</RootNamespace> <AssemblyName>SimpleExpenseReport</AssemblyName> <ProjectTypeGuids>{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> <StartupObject> </StartupObject> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>.\bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <DebugSymbols>false</DebugSymbols> <Optimize>true</Optimize> <OutputPath>.\bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <ItemGroup> <Reference Include="System.configuration" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Workflow.Activities" /> <Reference Include="System.Workflow.ComponentModel" /> <Reference Include="System.Workflow.Runtime" /> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Design" /> <Reference Include="System.Drawing" /> <Reference Include="System.Drawing.Design" /> <Reference Include="System.Transactions" /> <Reference Include="System.Xml" /> <Reference Include="System.Web" /> <Reference Include="System.Web.Services" /> </ItemGroup> <ItemGroup> <Compile Include="Program.cs"> <SubType>Form</SubType> </Compile> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.0\Workflow.Targets" /> </Project>
Compilation du code
- Pour plus d'informations sur la compilation du code, consultez Compilation du code.
Dans Tâche 2 : créer le workflow séquentiel, vous créez le fichier source de workflow que vous pouvez utiliser pour le reste du didacticiel.
Voir aussi
Tâches
Tâche 2 : créer le workflow séquentiel
Concepts
Autres ressources
Sequential Workflow With Parameters
Simple Sequential Workflow
Copyright ©2007 par Microsoft Corporation. Tous droits réservés.