Click here to Skip to main content
15,884,298 members
Articles / Programming Languages / C#

The Application Automation Layer - Using XML to generate Menus

Rate me:
Please Sign up or sign in to vote.
4.81/5 (56 votes)
5 May 200313 min read 238.3K   2.6K   194  
Exploring the issues of menu management as specified externally via an XML file, in the context of status bars, toolbars, and events.
<NewDataSet>
  <WorkflowDomain>
    <WorkflowDomainName>SingleItemSaleOrder</WorkflowDomainName>
    <Description>Cost calculation for a single item sale</Description>
    <DataSet>
      <DataSetName>CalcRetailPrice</DataSetName>
      <Description>Calculates retail price</Description>
      <DSREvent>TestComponent.CalculateRetailPrice</DSREvent>
      <Datum>
        <DatumName>Cost</DatumName>
        <Description>our cost of the item</Description>
      </Datum>
      <Datum>
        <DatumName>Retail</DatumName>
        <Description>retail cost of the item</Description>
      </Datum>
      <Datum>
        <DatumName>Qty</DatumName>
        <Description>Quantity ordered</Description>
      </Datum>
      <Datum>
        <DatumName>CostPlusPercent</DatumName>
        <Description>Discount adjustment</Description>
      </Datum>
      <Datum>
        <DatumName>RetailMinusPercent</DatumName>
        <Description>Discount adjustment</Description>
      </Datum>
    </DataSet>
    <DataSet>
      <DataSetName>CalcItemTax</DataSetName>
      <Description>Determine the tax on the item</Description>
      <DSREvent>CalculateItemTax</DSREvent>
      <Datum>
        <DatumName>TaxExempt</DatumName>
        <Description>Flag indicating customer is tax exempt</Description>
      </Datum>
      <Datum>
        <DatumName>Taxable</DatumName>
        <Description>Flag indicating item is taxable</Description>
      </Datum>
      <Datum>
        <DatumName>TaxRate</DatumName>
        <Description>Appropriate tax rate</Description>
      </Datum>
    </DataSet>
    <DataSet>
      <DataSetName>CalcFreightCharge</DataSetName>
      <Description>Calculate the freight charges for the item</Description>
      <DSREvent>CalculateFreightCharge</DSREvent>
      <Datum>
        <DatumName>ShippingMethodID</DatumName>
        <Description>Identifies shipper and method</Description>
      </Datum>
      <Datum>
        <DatumName>Hazmat</DatumName>
        <Description>Flag to identify hazardous material</Description>
      </Datum>
      <Datum>
        <DatumName>Weight</DatumName>
        <Description>The weight of the item</Description>
      </Datum>
      <Datum>
        <DatumName>LocaleID</DatumName>
        <Description>The destination location</Description>
      </Datum>
    </DataSet>
    <DataSet>
      <DataSetName>CalcTotal</DataSetName>
      <Description>Calculate the total for the sale</Description>
      <DSREvent>CalculateTotal</DSREvent>
      <Datum>
        <DatumName>RetailPrice</DatumName>
        <Description>The calculated retail price</Description>
      </Datum>
      <Datum>
        <DatumName>FreightCharge</DatumName>
        <Description>The calculated freight charge</Description>
      </Datum>
      <Datum>
        <DatumName>Tax</DatumName>
        <Description>The calculated tax amount</Description>
      </Datum>
      <Datum>
        <DatumName>AdditionalFees</DatumName>
        <Description>Any additional fees</Description>
      </Datum>
    </DataSet>
    <SingletonDatum>
      <DatumName>DiscountID</DatumName>
      <Description>Indexes the lookup table to determine discounts for this customer</Description>
    </SingletonDatum>
    <SingletonDatum>
      <DatumName>PurchaseMethodID</DatumName>
      <Description>Indexes a lookup table to determine additional fees based on purchase method</Description>
    </SingletonDatum>
    <SingletonDatum>
      <DatumName>SalePrice</DatumName>
      <Description>The final sale price factoring in quantity and discounts</Description>
      <UpdateEvent>TestComponent.SetSalePrice</UpdateEvent>
    </SingletonDatum>
    <InitialLoadSet>
      <SetName>RetailPrice</SetName>
      <InitialLoad>
        <DatumName>Cost</DatumName>
        <Value>10</Value>
      </InitialLoad>
      <InitialLoad>
        <DatumName>Retail</DatumName>
        <Value>15</Value>
      </InitialLoad>
      <InitialLoad>
        <DatumName>Qty</DatumName>
        <Value>2</Value>
      </InitialLoad>
      <InitialLoad>
        <DatumName>CostPlusPercent</DatumName>
        <Value>0</Value>
      </InitialLoad>
      <InitialLoad>
        <DatumName>RetailMinusPercent</DatumName>
        <Value>10</Value>
      </InitialLoad>
    </InitialLoadSet>
  </WorkflowDomain>
</NewDataSet>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect Interacx
United States United States
Blog: https://marcclifton.wordpress.com/
Home Page: http://www.marcclifton.com
Research: http://www.higherorderprogramming.com/
GitHub: https://github.com/cliftonm

All my life I have been passionate about architecture / software design, as this is the cornerstone to a maintainable and extensible application. As such, I have enjoyed exploring some crazy ideas and discovering that they are not so crazy after all. I also love writing about my ideas and seeing the community response. As a consultant, I've enjoyed working in a wide range of industries such as aerospace, boatyard management, remote sensing, emergency services / data management, and casino operations. I've done a variety of pro-bono work non-profit organizations related to nature conservancy, drug recovery and women's health.

Comments and Discussions