ScriptFactory.CreateNewScriptBasedOnTemplate Method (String, String, Boolean, )

Creates a temporary query file with specified extension based on given template, opens it in Misc project, which will create a snapshot of the file, and delete the previously created query file. Without this method, Visual Studio would always create a new file with the same extension as the template.

Namespace:  Microsoft.SqlServer.Management.UI.VSIntegration.Editors
Assembly:  SQLEditors.VS (in SQLEditors.VS.dll)

Syntax

'Declaration
Public Sub CreateNewScriptBasedOnTemplate ( _
    fullPathToTemplate As String, _
    desiredExtension As String, _
    isInParamSubstMode As Boolean, _
    projectToAddScriptTo As IVsProject _
)
'Usage
Dim instance As ScriptFactory
Dim fullPathToTemplate As String
Dim desiredExtension As String
Dim isInParamSubstMode As Boolean
Dim projectToAddScriptTo As IVsProject

instance.CreateNewScriptBasedOnTemplate(fullPathToTemplate, _
    desiredExtension, isInParamSubstMode, _
    projectToAddScriptTo)
public void CreateNewScriptBasedOnTemplate(
    string fullPathToTemplate,
    string desiredExtension,
    bool isInParamSubstMode,
    IVsProject projectToAddScriptTo
)
public:
void CreateNewScriptBasedOnTemplate(
    String^ fullPathToTemplate, 
    String^ desiredExtension, 
    bool isInParamSubstMode, 
    IVsProject^ projectToAddScriptTo
)
member CreateNewScriptBasedOnTemplate : 
        fullPathToTemplate:string * 
        desiredExtension:string * 
        isInParamSubstMode:bool * 
        projectToAddScriptTo:IVsProject -> unit 
public function CreateNewScriptBasedOnTemplate(
    fullPathToTemplate : String, 
    desiredExtension : String, 
    isInParamSubstMode : boolean, 
    projectToAddScriptTo : IVsProject
)

Parameters

  • fullPathToTemplate
    Type: System.String
    A string value that specifies the full path to the script.
  • desiredExtension
    Type: System.String
    A string value that specifies the extension for the new query that will be created based on template.
  • isInParamSubstMode
    Type: System.Boolean
    A Boolean value that specifies whether the query editor should start in template params substitution mode or in regular mode.
  • projectToAddScriptTo
    Type: IVsProject
    A IVsProject that is currently loaded.