本文整理匯總了C#中umbraco.cms.businesslogic.media.Media.CreateContent方法的典型用法代碼示例。如果您正苦於以下問題:C# Media.CreateContent方法的具體用法?C# Media.CreateContent怎麽用?C# Media.CreateContent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類umbraco.cms.businesslogic.media.Media
的用法示例。
在下文中一共展示了Media.CreateContent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MakeNew
/// <summary>
/// Creates a new Media
/// </summary>
/// <param name="Name">The name of the media</param>
/// <param name="dct">The type of the media</param>
/// <param name="u">The user creating the media</param>
/// <param name="ParentId">The id of the folder under which the media is created</param>
/// <returns></returns>
public static Media MakeNew(string Name, MediaType dct, BusinessLogic.User u, int ParentId)
{
Guid newId = Guid.NewGuid();
// Updated to match level from base node
CMSNode n = new CMSNode(ParentId);
int newLevel = n.Level;
newLevel++;
CMSNode.MakeNew(ParentId, _objectType, u.Id, newLevel, Name, newId);
Media tmp = new Media(newId);
tmp.CreateContent(dct);
NewEventArgs e = new NewEventArgs();
tmp.OnNew(e);
return tmp;
}