<?xml version="1.0" encoding="utf-8"?>
<local:ProcessInputData mva:VisualBasic.Settings="Assembly references and imported namespaces for internal implementation" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:local="clr-namespace:FlowChartSample;assembly=FlowChartSample" xmlns:local1="clr-namespace:BookmarkSample;assembly=FlowChartSample" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:s4="clr-namespace:System;assembly=System.ServiceModel" xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <local:ProcessInputData.Implementation>
    <Flowchart DisplayName="计算器流程" sad:XamlDebuggerXmlReader.FileName="F:\範例程式--sknp00020_bs\Visual C# and UML\Democodes\Ch13\Ch13Sample_03\FlowChartSample\ProcessInputData.xaml">
      <Flowchart.Variables>
        <Variable x:TypeArguments="x:String" Default="0" Name="TempString" />
        <Variable x:TypeArguments="x:String" Name="TempChar" />
        <Variable x:TypeArguments="s:String[]" Default="[{&quot;+&quot;, &quot;-&quot;, &quot;*&quot;, &quot;/&quot;}]" Name="Operators" />
        <Variable x:TypeArguments="x:Int32" Default="0" Name="FirstNumber" />
        <Variable x:TypeArguments="x:Int32" Default="0" Name="SecondNumber" />
        <Variable x:TypeArguments="local:CalculationType" Name="OperatorType" />
      </Flowchart.Variables>
      <Flowchart.StartNode>
        <FlowStep x:Name="__ReferenceID0">
          <local1:RetrieveString BookmarkName="Input.Data" DisplayName="接收输入字符串" Result="[TempChar]" />
          <FlowStep.Next>
            <FlowDecision x:Name="__ReferenceID1" Condition="[Char.IsNumber(TempChar, 0)]">
              <FlowDecision.True>
                <FlowStep x:Name="__ReferenceID2">
                  <Assign DisplayName="暂存数字">
                    <Assign.To>
                      <OutArgument x:TypeArguments="x:String">[TempString]</OutArgument>
                    </Assign.To>
                    <Assign.Value>
                      <InArgument x:TypeArguments="x:String">[TempString &amp; TempChar]</InArgument>
                    </Assign.Value>
                  </Assign>
                  <FlowStep.Next>
                    <x:Reference>__ReferenceID0</x:Reference>
                  </FlowStep.Next>
                </FlowStep>
              </FlowDecision.True>
              <FlowDecision.False>
                <FlowDecision x:Name="__ReferenceID3" Condition="[Operators.Contains(TempChar)]">
                  <FlowDecision.True>
                    <FlowStep x:Name="__ReferenceID4">
                      <Assign DisplayName="取出第一个数字">
                        <Assign.To>
                          <OutArgument x:TypeArguments="x:Int32">[FirstNumber]</OutArgument>
                        </Assign.To>
                        <Assign.Value>
                          <InArgument x:TypeArguments="x:Int32">[Integer.Parse(TempString)]</InArgument>
                        </Assign.Value>
                      </Assign>
                      <FlowStep.Next>
                        <FlowStep x:Name="__ReferenceID6">
                          <Assign DisplayName="暂存字符串归零">
                            <Assign.To>
                              <OutArgument x:TypeArguments="x:String">[TempString]</OutArgument>
                            </Assign.To>
                            <Assign.Value>
                              <InArgument x:TypeArguments="x:String">0</InArgument>
                            </Assign.Value>
                          </Assign>
                          <FlowStep.Next>
                            <FlowStep x:Name="__ReferenceID5">
                              <Switch x:TypeArguments="x:String" DisplayName="选择运算符" Expression="[TempChar]">
                                <Assign x:Key="&quot;+&quot;">
                                  <Assign.To>
                                    <OutArgument x:TypeArguments="local:CalculationType">[OperatorType]</OutArgument>
                                  </Assign.To>
                                  <Assign.Value>
                                    <InArgument x:TypeArguments="local:CalculationType">[CalculationType.Add]</InArgument>
                                  </Assign.Value>
                                </Assign>
                                <Assign x:Key="&quot;-&quot;">
                                  <Assign.To>
                                    <OutArgument x:TypeArguments="local:CalculationType">[OperatorType]</OutArgument>
                                  </Assign.To>
                                  <Assign.Value>
                                    <InArgument x:TypeArguments="local:CalculationType">[CalculationType.Subtract]</InArgument>
                                  </Assign.Value>
                                </Assign>
                                <Assign x:Key="&quot;*&quot;">
                                  <Assign.To>
                                    <OutArgument x:TypeArguments="local:CalculationType">[OperatorType]</OutArgument>
                                  </Assign.To>
                                  <Assign.Value>
                                    <InArgument x:TypeArguments="local:CalculationType">[CalculationType.Multiply]</InArgument>
                                  </Assign.Value>
                                </Assign>
                                <Assign x:Key="&quot;/&quot;">
                                  <Assign.To>
                                    <OutArgument x:TypeArguments="local:CalculationType">[OperatorType]</OutArgument>
                                  </Assign.To>
                                  <Assign.Value>
                                    <InArgument x:TypeArguments="local:CalculationType">[CalculationType.Divide]</InArgument>
                                  </Assign.Value>
                                </Assign>
                              </Switch>
                              <FlowStep.Next>
                                <x:Reference>__ReferenceID0</x:Reference>
                              </FlowStep.Next>
                            </FlowStep>
                          </FlowStep.Next>
                        </FlowStep>
                      </FlowStep.Next>
                    </FlowStep>
                  </FlowDecision.True>
                  <FlowDecision.False>
                    <FlowDecision x:Name="__ReferenceID7" Condition="[TempChar = &quot;=&quot;]">
                      <FlowDecision.True>
                        <FlowStep x:Name="__ReferenceID8">
                          <Assign DisplayName="取出第二个数字">
                            <Assign.To>
                              <OutArgument x:TypeArguments="x:Int32">[SecondNumber]</OutArgument>
                            </Assign.To>
                            <Assign.Value>
                              <InArgument x:TypeArguments="x:Int32">[Integer.Parse(TempString)]</InArgument>
                            </Assign.Value>
                          </Assign>
                          <FlowStep.Next>
                            <FlowStep x:Name="__ReferenceID9">
                              <Switch x:TypeArguments="local:CalculationType" DisplayName="四则运算" Expression="[OperatorType]">
                                <Assign x:Key="Add">
                                  <Assign.To>
                                    <OutArgument x:TypeArguments="x:Int32">[Result]</OutArgument>
                                  </Assign.To>
                                  <Assign.Value>
                                    <InArgument x:TypeArguments="x:Int32">[FirstNumber + SecondNumber]</InArgument>
                                  </Assign.Value>
                                </Assign> <Assign x:Key="Subtract"><Assign.To><OutArgument x:TypeArguments="x:Int32">[Result]</OutArgument></Assign.To><Assign.Value><InArgument x:TypeArguments="x:Int32">[FirstNumber - SecondNumber]</InArgument></Assign.Value></Assign> <Assign x:Key="Multiply"><Assign.To><OutArgument x:TypeArguments="x:Int32">[Result]</OutArgument></Assign.To><Assign.Value><InArgument x:TypeArguments="x:Int32">[FirstNumber * SecondNumber]</InArgument></Assign.Value></Assign> <If x:Key="Divide" Condition="[SecondNumber = 0]"><If.Then><Assign><Assign.To><OutArgument x:TypeArguments="x:Int32">[Result]</OutArgument></Assign.To><Assign.Value><InArgument x:TypeArguments="x:Int32">0</InArgument></Assign.Value></Assign></If.Then><If.Else><Assign><Assign.To><OutArgument x:TypeArguments="x:Int32">[Result]</OutArgument></Assign.To><Assign.Value><InArgument x:TypeArguments="x:Int32">[Convert.ToInt32(FirstNumber / SecondNumber)]</InArgument></Assign.Value></Assign></If.Else></If></Switch>
                            </FlowStep>
                          </FlowStep.Next>
                        </FlowStep>
                      </FlowDecision.True>
                      <FlowDecision.False>
                        <FlowStep x:Name="__ReferenceID10">
                          <Throw DisplayName="抛出错误" Exception="[New Exception(&quot;錯誤&quot;)]" />
                        </FlowStep>
                      </FlowDecision.False>
                    </FlowDecision>
                  </FlowDecision.False>
                </FlowDecision>
              </FlowDecision.False>
            </FlowDecision>
          </FlowStep.Next>
        </FlowStep>
      </Flowchart.StartNode>
      <x:Reference>__ReferenceID0</x:Reference>
      <x:Reference>__ReferenceID1</x:Reference>
      <x:Reference>__ReferenceID2</x:Reference>
      <x:Reference>__ReferenceID3</x:Reference>
      <x:Reference>__ReferenceID4</x:Reference>
      <x:Reference>__ReferenceID5</x:Reference>
      <x:Reference>__ReferenceID6</x:Reference>
      <x:Reference>__ReferenceID7</x:Reference>
      <x:Reference>__ReferenceID8</x:Reference>
      <x:Reference>__ReferenceID9</x:Reference>
      <x:Reference>__ReferenceID10</x:Reference>
    </Flowchart>
  </local:ProcessInputData.Implementation>
</local:ProcessInputData>