Click here to Skip to main content
15,885,216 members
Articles / Desktop Programming / Windows Forms

CX Part II

Rate me:
Please Sign up or sign in to vote.
4.97/5 (33 votes)
5 Aug 2009CPOL47 min read 53.7K   354   48  
Build a Metadata Designer for the CX Dynamic Composition Framework.
<?xml version="1.0" encoding="utf-8"?>
<Cx>
  <Components>
    <VisualComponent Name="ComponentList" ComponentName="DataGridView" Assembly="..\..\..\Cx.Designer.Components\bin\debug\Cx.Designer.Components.dll" Location="10, 30" Size="480, 200" />
    <VisualComponent Name="ProducerList" ComponentName="List" Assembly="..\..\..\Cx.Designer.Components\bin\debug\Cx.Designer.Components.dll" Location="10, 240" Size="250, 160" />
    <VisualComponent Name="ConsumerList" ComponentName="ListView" Assembly="..\..\..\Cx.Designer.Components\bin\debug\Cx.Designer.Components.dll" Location="280, 240" Size="300, 160" />
    <VisualComponent Name="AddComponentButton" ComponentName="CxSimpleButton" Assembly="..\..\..\Cx.Designer.Components\bin\debug\Cx.Designer.Components.dll" Location="500, 50" Size="80, 25" />
    <VisualComponent Name="Menu" ComponentName="CxMenu" Assembly="..\..\..\Cx.Designer.Components\bin\debug\Cx.Designer.Components.dll" />
    <VisualComponent Name="PropertiesButton" ComponentName="CxSimpleButton" Assembly="C:\projects2008\Cx\Cx.Designer.Components\bin\Debug\Cx.Designer.Components.dll" Location="500, 80" Size="80, 25" />
    <VisualComponent Name="DeclaredEvents" ComponentName="CxSimpleButton" Assembly="C:\projects2008\Cx\Cx.Designer.Components\bin\Debug\Cx.Designer.Components.dll" Location="500, 110" Size="80, 25" />
    <BusinessComponent Name="App" ComponentName="App" Assembly="Cx.Designer.App.exe" />
    <BusinessComponent Name="CxDesigner" ComponentName="CxDesigner" Assembly="..\..\..\Cx.Designer\bin\debug\Cx.Designer.dll" />
    <BusinessComponent Name="DesignerDataService" ComponentName="CxDesignerDataService" Assembly="..\..\..\Cx.DataService\bin\debug\Cx.DataService.dll" />
    <BusinessComponent Name="ComponentBindingConverter" ComponentName="Cx.Converters.CxBindingConverter`1[[Cx.Interfaces.ICxComponent, Cx.Interfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]" Assembly="..\..\..\Cx.Converters\bin\debug\Cx.Converters.dll" />
    <BusinessComponent Name="AppProperties" ComponentName="App" Assembly="C:\projects2008\Cx\Cx.Designer.App\bin\Debug\Cx.Designer.App.exe" />
    <BusinessComponent Name="AppEvents" ComponentName="App" Assembly="C:\projects2008\Cx\Cx.Designer.App\bin\Debug\Cx.Designer.App.exe" />
  </Components>
  <WireUps>
    <WireUp Producer="App.Initialize" Consumer="CxDesigner.InitializeDesigner" />
    <WireUp Producer="CxDesigner.RequestLoadComponents" Consumer="DesignerDataService.OnLoadComponents" />
    <WireUp Producer="DesignerDataService.ComponentListLoaded" Consumer="CxDesigner.OnComponentsLoaded" />
    <WireUp Producer="DesignerDataService.WireupsLoaded" Consumer="CxDesigner.OnWireupsLoaded" />
    <WireUp Producer="DesignerDataService.PropertyValuesLoaded" Consumer="CxDesigner.OnPropertyValuesLoaded" />
    <WireUp Producer="DesignerDataService.DeclaredEventsLoaded" Consumer="CxDesigner.OnDeclaredEventsLoaded" />
    <WireUp Producer="CxDesigner.ClearCheckedConsumers" Consumer="ConsumerList.OnClearAllCheckState" />
    <WireUp Producer="CxDesigner.CheckConsumer" Consumer="ConsumerList.OnSetCheckState" />
    <WireUp Producer="CxDesigner.ComponentListLoaded" Consumer="ComponentBindingConverter.OnConvertToSortedBindingList" />
    <WireUp Producer="ComponentBindingConverter.Converted" Consumer="ComponentList.OnData" />
    <WireUp Producer="CxDesigner.ProducerListLoaded" Consumer="ProducerList.OnData" />
    <WireUp Producer="CxDesigner.ConsumerListLoaded" Consumer="ConsumerList.OnData" />
    <WireUp Producer="ProducerList.SelectedItemChanged" Consumer="CxDesigner.OnProducerSelected" />
    <WireUp Producer="ConsumerList.ItemChecked" Consumer="CxDesigner.OnItemChecked" />
    <WireUp Producer="CxDesigner.SaveMetadata" Consumer="DesignerDataService.OnSaveMetadata" />
    <WireUp Producer="AddComponentButton.ButtonClick" Consumer="CxDesigner.OnAddComponentButton" />
    <WireUp Producer="Menu.mnuSaveClick" Consumer="CxDesigner.OnSave" />
    <WireUp Producer="Menu.mnuExitClick" Consumer="App.CloseDialog" />
    <WireUp Producer="Menu.mnuOpenClick" Consumer="CxDesigner.OnOpenMetadata" />
    <WireUp Producer="Menu.mnuNewClick" Consumer="CxDesigner.OnNewMetadata" />
    <WireUp Producer="Menu.mnuSaveAsClick" Consumer="CxDesigner.OnSaveAs" />
    <WireUp Producer="CxDesigner.AddComponent" Consumer="App.ShowModalForm" />
    <WireUp Producer="CxDesigner.OpenMetadata" Consumer="App.ShowModalForm" />
    <WireUp Producer="CxDesigner.SaveAs" Consumer="App.ShowSaveAsDialog" />
    <WireUp Producer="App.Save" Consumer="CxDesigner.OnSaveFilename" />
    <WireUp Producer="CxDesigner.FilenameSet" Consumer="App.SetCaption" />
    <WireUp Producer="PropertiesButton.ButtonClick" Consumer="CxDesigner.OnEditPropertiesButton" />
    <WireUp Producer="ComponentList.ItemSelected" Consumer="CxDesigner.OnComponentSelected" />
    <WireUp Producer="CxDesigner.EditProperties" Consumer="AppProperties.ShowModalForm" />
    <WireUp Producer="DeclaredEvents.ButtonClick" Consumer="CxDesigner.OnOpenDeclaredEvents" />
    <WireUp Producer="CxDesigner.OpenDeclaredEvents" Consumer="AppEvents.ShowModalForm" />
  </WireUps>
  <Properties ComponentName="ComponentList">
    <Property Name="Label" Value="Components:" />
    <Property Name="Anchor" Value="Top, Left, Right" />
    <Property Name="HeaderText">
      <Item Value="Name" />
      <Item Value="Component Name" />
      <Item Value="Assembly" />
    </Property>
    <Property Name="HeaderWidths">
      <Item Value="100" />
      <Item Value="125" />
      <Item Value="200" />
    </Property>
    <Property Name="DataPropertyNames">
      <Item Value="Name" />
      <Item Value="ComponentName" />
      <Item Value="AssemblyFilename" />
    </Property>
  </Properties>
  <Properties ComponentName="ProducerList">
    <Property Name="Label" Value="Producers:" />
    <Property Name="Anchor" Value="Top, Left, Bottom" />
  </Properties>
  <Properties ComponentName="ConsumerList">
    <Property Name="Label" Value="Consumers:" />
    <Property Name="ShowCheckBoxes" Value="true" />
    <Property Name="Anchor" Value="Top, Left, Bottom" />
    <Property Name="HeaderText">
      <Item Value="Consumer Method" />
    </Property>
    <Property Name="HeaderWidths">
      <Item Value="200" />
    </Property>
  </Properties>
  <Properties ComponentName="AddComponentButton">
    <Property Name="Text" Value="&amp;New" />
    <Property Name="Anchor" Value="Top, Right" />
  </Properties>
  <Properties ComponentName="PropertiesButton">
    <Property Name="Text" Value="&amp;Properties" />
    <Property Name="Anchor" Value="Top, Right" />
  </Properties>
  <Properties ComponentName="DeclaredEvents">
    <Property Name="Anchor" Value="Top, Right" />
    <Property Name="Text" Value="&amp;Events" />
  </Properties>
  <DeclaredEvents ProducerName="Menu">
    <Event Name="mnuExitClick" />
    <Event Name="mnuNewClick" />
    <Event Name="mnuOpenClick" />
    <Event Name="mnuSaveAsClick" />
    <Event Name="mnuSaveClick" />
  </DeclaredEvents>
</Cx>

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


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