当前位置: 首页>>代码示例>>C#>>正文


C# Media.delete方法代码示例

本文整理汇总了C#中umbraco.cms.businesslogic.media.Media.delete方法的典型用法代码示例。如果您正苦于以下问题:C# Media.delete方法的具体用法?C# Media.delete怎么用?C# Media.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在umbraco.cms.businesslogic.media.Media的用法示例。


在下文中一共展示了Media.delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Delete

        public bool Delete()
        {
            cms.businesslogic.media.Media d = new cms.businesslogic.media.Media(ParentID);

            // Log
            BusinessLogic.Log.Add(BusinessLogic.LogTypes.Delete, User.GetCurrent(), d.Id, "");

            d.delete();
            return true;

        }
开发者ID:elrute,项目名称:Triphulcas,代码行数:11,代码来源:mediaTasks.cs

示例2: Delete

        public bool Delete()
        {
            cms.businesslogic.media.Media d = new cms.businesslogic.media.Media(ParentID);

            // Log
            LogHelper.Debug<mediaTasks>(string.Format("Delete media item {0} by user {1}", d.Id, User.GetCurrent().Id));

            d.delete();
            return true;

        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:11,代码来源:mediaTasks.cs

示例3: rptMedia_ItemCommand

 protected void rptMedia_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
     {
         int id = Convert.ToInt32(e.CommandArgument);
         if (e.CommandName == "delete")
         {
             Media deleteFile = new Media(id);
             deleteFile.delete();
             Response.Redirect(Request.RawUrl);
         }
     }
 }
开发者ID:wakkomail,项目名称:community-framework,代码行数:13,代码来源:MediaList.ascx.cs

示例4: delete

        public void delete(int id, string username, string password)
        {
            Authenticate(username, password);

            Media m = new Media(id);

            if (m.HasChildren)
                throw new Exception("Cannot delete Media " + id + " as it has child nodes");

            Property p = m.getProperty("umbracoFile");
            if (p != null)
            {
                if (!(p.Value == System.DBNull.Value))
                {
                    var path = _fs.GetRelativePath(p.Value.ToString());
                    if(_fs.FileExists(path))
                        _fs.DeleteFile(path, true);
                }
            }

            m.delete();

        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:23,代码来源:mediaService.cs

示例5: RecycleAndDelete

        private void RecycleAndDelete(Media m)
        {
            if (m == null)
            {
                return;
            }

            var id = m.Id;

            //check if it is already trashed
            var alreadyTrashed = m.IsTrashed;

            if (!alreadyTrashed)
            {
                //now recycle it
                m.delete();

                Assert.IsTrue(m.IsTrashed);
            }

            //now permanently delete
            m.delete(true);
            Assert.IsFalse(Media.IsNode(id));

            //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:CarlSargunar,项目名称:Umbraco-CMS,代码行数:30,代码来源:MediaTest.cs


注:本文中的umbraco.cms.businesslogic.media.Media.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。