本文整理汇总了C#中umbraco.cms.businesslogic.template.Template.delete方法的典型用法代码示例。如果您正苦于以下问题:C# Template.delete方法的具体用法?C# Template.delete怎么用?C# Template.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类umbraco.cms.businesslogic.template.Template
的用法示例。
在下文中一共展示了Template.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: delete
public void delete(int id, string username, string password)
{
Authenticate(username, password);
if (id == 0) throw new Exception("ID must be specifed when updating");
cms.businesslogic.template.Template template = new cms.businesslogic.template.Template(id);
template.delete();
}
示例2: confirmUnInstall
protected void confirmUnInstall(object sender, EventArgs e)
{
bool refreshCache = false;
//Uninstall Stylesheets
foreach (ListItem li in stylesheets.Items)
{
if (li.Selected)
{
int nId;
if (int.TryParse(li.Value, out nId))
{
StyleSheet s = new StyleSheet(nId);
if (s != null)
{
s.delete();
pack.Data.Stylesheets.Remove(nId.ToString());
}
}
}
}
//Uninstall templates
foreach (ListItem li in templates.Items)
{
if (li.Selected)
{
int nId;
if (int.TryParse(li.Value, out nId))
{
Template s = new Template(nId);
if (s != null)
{
s.RemoveAllReferences();
s.delete();
pack.Data.Templates.Remove(nId.ToString());
}
}
}
}
//Uninstall macros
foreach (ListItem li in macros.Items)
{
if (li.Selected)
{
int nId;
if (int.TryParse(li.Value, out nId))
{
Macro s = new Macro(nId);
if (s != null && !String.IsNullOrEmpty(s.Name))
{
// remove from cache
runtimeMacro.GetMacro(s.Id).removeFromCache();
s.Delete();
}
pack.Data.Macros.Remove(nId.ToString());
}
}
}
//Remove Document types
foreach (ListItem li in documentTypes.Items)
{
if (li.Selected)
{
int nId;
if (int.TryParse(li.Value, out nId))
{
DocumentType s = new DocumentType(nId);
if (s != null)
{
s.delete();
pack.Data.Documenttypes.Remove(nId.ToString());
// refresh content cache when document types are removed
refreshCache = true;
}
}
}
}
//Remove Dictionary items
foreach (ListItem li in dictionaryItems.Items)
{
if (li.Selected)
{
int nId;
//.........这里部分代码省略.........