本文整理匯總了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;
//.........這裏部分代碼省略.........