#眉標=Software Product Line Engineering
#副標=軟體產品線工程在微軟開發平台的實踐(6)
#大標=DSL相互參考
#作者=文/圖	歐宣修



==程式1		<box>===========
<#@ template inherits="Microsoft.VisualStudio.
TextTemplating.VSHost.ModelingTextTransformation" 
debug="true"#>
<#@ output extension=".config" #>  //…(1)
<#@ assembly name="Dands.OPTIMAL.DSL.
WebConfigAppSettings.Dsl" #>  //…(2) 
<#@ import namespace="Microsoft.VisualStudio.
Modeling" #>
<#@ import namespace="Microsoft.VisualStudio.
Modeling.Diagrams" #>
<#@ import namespace="Dands.OPTIMAL.DSL.
WebConfigAppSettings" #>
<#
  
  string authenticationMode = this.
WebConfigMainModel.Elements.AuthenticationMode;
  string connectionstring = this.WebConfigMainModel.
Elements.Connectionstring;
  string appSettingsPath = this.WebConfigMainModel.
Elements.AppSettingsPath;   //…(3)
 
  bool isContentOfProjectListDecidedByUser;
  string rdMapIntefaceTypeOrInterface = null;
 
  Store store = new Store();
  store.LoadDomainModels(typeof(
CoreDesignSurfaceDomainModel), typeof(Dands.
OPTIMAL.DSL.WebConfigAppSettings.
WebConfigAppSettingsDomainModel));
  using (Transaction txLoadModel = store.
TransactionManager.BeginTransaction())
  {
    AppSettingsModel root = 
WebConfigAppSettingsSerializationHelper.
Instance.LoadModel(store, appSettingsPath, null, null);
  //…(4)    
    isContentOfProjectListDecidedByUser = 
root.Elements.IsContentOfProjectListDecidedByUser;
    rdMapIntefaceTypeOrInterface = 
root.Elements.RDMapIntefaceTypeOrInterface.ToString();
            
  }

#>
以下略…
==<end>==============





==<反灰>===========
<#@ include file="WebConfigGenerator.tt" #>
<#@ WebConfigMain processor=
"WebConfigMainDirectiveProcessor" requires=
"fileName='Test.wcm'" #>
==<end>==============