src/Misc/EFTools/EntityDesign/VisualStudio/TextTemplating/SsdlToDdlActivity.cs
/// <summary>
///     Transforms a text template that is specified in the TemplatePath property by calling the Visual Studio STextTemplatingService.
/// </summary>
/// <param name="context">The state of the current activity.</param>
Transforms a text template that is specified in the TemplatePath property by calling the Visual Studio STextTemplatingService.
Transforms a text template that is specified in the TemplatePath property by calling the Visual Studio STextTemplatingService .
protected override void Execute(NativeActivityContext context)
        {
            if (TemplatePath.Get(context) == null)
            {
                var symbolResolver = context.GetExtension<SymbolResolver>();
                var edmParameterBag = symbolResolver[typeof(EdmParameterBag).Name] as EdmParameterBag;
                var ddlTemplatePath = edmParameterBag.GetParameter<string>(EdmParameterBag.ParameterName.DDLTemplatePath);
                if (String.IsNullOrEmpty(ddlTemplatePath))
                {
                    throw new ArgumentException(
                        String.Format(CultureInfo.CurrentCulture, Resources.DatabaseCreation_NoDDLTemplatePathSpecified, DisplayName));
                }
                TemplatePath.Set(context, ddlTemplatePath);
            }
            base.Execute(context);
            Debug.Assert(!String.IsNullOrEmpty(TemplateOutput), "DDL returned from SsdlToDdl template is null or empty...");
            if (TemplateOutput == null)
            {
                throw new InvalidOperationException(
                    String.Format(CultureInfo.CurrentCulture, Resources.DatabaseCreation_ErrorTemplateOutputNotSet, DisplayName));
            }
            DdlOutput.Set(context, TemplateOutput);
        }
protected override void Execute ( NativeActivityContext context ) { if ( TemplatePath . Get ( context ) == null ) { var symbolResolver = context . GetExtension < SymbolResolver > ( ) ; var edmParameterBag = symbolResolver [ typeof ( EdmParameterBag ) . Name ] as EdmParameterBag ; var ddlTemplatePath = edmParameterBag . GetParameter < string > ( EdmParameterBag . ParameterName . DDLTemplatePath ) ; if ( String . IsNullOrEmpty ( ddlTemplatePath ) ) { throw new ArgumentException ( String . Format ( CultureInfo . CurrentCulture , Resources . DatabaseCreation_NoDDLTemplatePathSpecified , DisplayName ) ) ; } TemplatePath . Set ( context , ddlTemplatePath ) ; } base . Execute ( context ) ; Debug . Assert ( ! String . IsNullOrEmpty ( TemplateOutput ) , " " ) ; if ( TemplateOutput == null ) { throw new InvalidOperationException ( String . Format ( CultureInfo . CurrentCulture , Resources . DatabaseCreation_ErrorTemplateOutputNotSet , DisplayName ) ) ; } DdlOutput . Set ( context , TemplateOutput ) ; }
Transforms a text template that is specified in the TemplatePath property by calling the Visual Studio STextTemplatingService.
Transforms a text template that is specified in the TemplatePath property by calling the Visual Studio STextTemplatingService .
// inject the template path at runtime if an explicit one doesn't exist. // TemplatePath must either be specified at design-time in the workflow file or at runtime, passed in through EdmParameterBag.
context
NativeActivityContext
The state of the current activity.
The state of the current activity .