// (c) Microsoft Corporation
function AddDefaultServerScriptToWizard(selProj)
{
wizard.AddSymbol("DEFAULT_SERVER_SCRIPT", "JavaScript");
}
function AddDefaultClientScriptToWizard(selProj)
{
var prjScriptLang = selProj.Properties("DefaultClientScript").Value;
// 0 = JScript
// 1 = VBScript
if(prjScriptLang == 0)
{
wizard.AddSymbol("DEFAULT_CLIENT_SCRIPT", "JavaScript");
}
else
{
wizard.AddSymbol("DEFAULT_CLIENT_SCRIPT", "VBScript");
}
}
function AddDefaultDefaultHTMLPageLayoutToWizard(selProj)
{
var prjPageLayout = selProj.Properties("DefaultHTMLPageLayout").Value;
// 0 = FlowLayout
// 1 = GridLayout
if(prjPageLayout == 0)
{
wizard.AddSymbol("DEFAULT_HTML_LAYOUT", "FlowLayout");
}
else
{
wizard.AddSymbol("DEFAULT_HTML_LAYOUT", "GridLayout");
}
}
function OnFinish(selProj, selObj)
{
var oldSuppressUIValue = true;
try
{
oldSuppressUIValue = dte.SuppressUI;
var strProjectName = wizard.FindSymbol("PROJECT_NAME");
var strSafeProjectName = CreateSafeName(strProjectName);
wizard.AddSymbol("SAFE_PROJECT_NAME", strSafeProjectName);
SetTargetFullPath(selObj);
var strProjectPath = wizard.FindSymbol("TARGET_FULLPATH");
var strTemplatePath = wizard.FindSymbol("TEMPLATES_PATH");
//用户自定义代码开始
var strPaths = strProjectPath.split('\\');
var curResPath = "";
var bFindModules = false;
for(index = strPaths.length-1;index>=0;index--)
{
if(strPaths[index]=='modules')
{
bFindModules = true;
break;
}
curResPath = "../";
}
if(bFindModules==false)
curResPath = "";
var curJsPath = curResPath "Jscript/common.js";
var curCssPath = curResPath "style/common.css";
var curImgPath = curResPath "images"
var curctlPath = curResPath "Jscript/controlpanel.js"
wizard.AddSymbol("ITABBY_JS_SRC", curJsPath);
wizard.AddSymbol("ITABBY_CSS_SRC", curCssPath);
wizard.AddSymbol("ITABBY_IMG_SRC", curImgPath);
wizard.AddSymbol("ITABBY_CTL_SRC", curctlPath);
//用户自定义代码结束
var strTpl = "";
var strName = "";
var InfFile = CreateInfFile();
// add the default project props for the aspx file before we
// render it
AddDefaultServerScriptToWizard(selProj);
AddDefaultClientScriptToWizard(selProj);
AddDefaultTargetSchemaToWizard(selProj);
AddDefaultDefaultHTMLPageLayoutToWizard(selProj);
// render our file
AddFilesToCSharpProject(selObj, strProjectName, strProjectPath, InfFile, true);
AddReferencesForWebForm(selProj);
}
catch(e)
{
if( e.description.length > 0 )
SetErrorInfo(e);
return e.number;
}
finally
{
dte.SuppressUI = oldSuppressUIValue;
if( InfFile )
InfFile.Delete();
}
}
function SetFileProperties(oFileItem, strFileName)
{
if(strFileName == "WebForm1.aspx")
{
oFileItem.Properties("SubType").Value = "Form";
}
}