本文整理汇总了C#中Folder.GetComponents方法的典型用法代码示例。如果您正苦于以下问题:C# Folder.GetComponents方法的具体用法?C# Folder.GetComponents怎么用?C# Folder.GetComponents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder.GetComponents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddBinariesFromFolder
public void AddBinariesFromFolder(string rootSGWebDavUrl, Folder folder, string path)
{
//Try to get a reference to the sub Structure Group based on the folder title
StructureGroup sg = _engine.GetObject(rootSGWebDavUrl + path) as StructureGroup;
if (sg == null)
{
Exception ex = new Exception(String.Format("Could not find Structure Group {0}. Please create this and republish", rootSGWebDavUrl + path));
_logger.Error(ex.Message);
throw ex;
}
//Loop through all components in the folder
foreach (Component comp in folder.GetComponents(true))
{
if (comp.ComponentType == ComponentType.Multimedia)
{
AddBinary(comp, sg);
}
}
}