CodeGeneratorHelpers.T4.JSView.Initialize C# (CSharp) Method

Initialize() public method

Initialize the template
public Initialize ( ) : void
return void
public virtual void Initialize()
{
    if ((this.Errors.HasErrors == false))
    {
bool ControllerNameValueAcquired = false;
if (this.Session.ContainsKey("ControllerName"))
{
    this._ControllerNameField = ((string)(this.Session["ControllerName"]));
    ControllerNameValueAcquired = true;
}
if ((ControllerNameValueAcquired == false))
{
    object data = global::System.Runtime.Remoting.Messaging.CallContext.LogicalGetData("ControllerName");
    if ((data != null))
    {
        this._ControllerNameField = ((string)(data));
    }
}
bool IsMobileValueAcquired = false;
if (this.Session.ContainsKey("IsMobile"))
{
    this._IsMobileField = ((bool)(this.Session["IsMobile"]));
    IsMobileValueAcquired = true;
}
if ((IsMobileValueAcquired == false))
{
    object data = global::System.Runtime.Remoting.Messaging.CallContext.LogicalGetData("IsMobile");
    if ((data != null))
    {
        this._IsMobileField = ((bool)(data));
    }
}


    }
}

Usage Example

 public string createFromT4Template(UI5ProjectType type)
 {
     var jsTemplate = new T4.JSView
     {
         Session =
             new Dictionary<string, object>
             {
                 {"ControllerName", this.ControllerName},
                 {"IsMobile", type == UI5ProjectType.Mobile}
             }
     };
     jsTemplate.Initialize();
     return jsTemplate.TransformText();
 }
All Usage Examples Of CodeGeneratorHelpers.T4.JSView::Initialize