當前位置: 首頁>>代碼示例>>C#>>正文


C# DocumentType.delete方法代碼示例

本文整理匯總了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);
        }
開發者ID:elrute,項目名稱:Triphulcas,代碼行數:12,代碼來源:DocumentTypeTest.cs

示例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;

//.........這裏部分代碼省略.........
開發者ID:elrute,項目名稱:Triphulcas,代碼行數:101,代碼來源:installedPackage.aspx.cs


注:本文中的umbraco.cms.businesslogic.web.DocumentType.delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。