本文整理汇总了C#中umbraco.cms.businesslogic.web.DocumentType.delete方法的典型用法代码示例。如果您正苦于以下问题:C# DocumentType.delete方法的具体用法?C# DocumentType.delete怎么用?C# DocumentType.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类umbraco.cms.businesslogic.web.DocumentType
的用法示例。
在下文中一共展示了DocumentType.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteDocType
private void DeleteDocType(DocumentType dt)
{
var id = dt.Id;
dt.delete();
//check with sql that it is gone
var count = Application.SqlHelper.ExecuteScalar<int>("SELECT COUNT(*) FROM umbracoNode WHERE [email protected]",
Application.SqlHelper.CreateParameter("@id", id));
Assert.AreEqual(0, count);
}
示例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;
//.........这里部分代码省略.........