本文整理汇总了C#中Asset.SaveContent方法的典型用法代码示例。如果您正苦于以下问题:C# Asset.SaveContent方法的具体用法?C# Asset.SaveContent怎么用?C# Asset.SaveContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset
的用法示例。
在下文中一共展示了Asset.SaveContent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddDefaultExtractSettingsToAsset
public static void AddDefaultExtractSettingsToAsset(Asset asset, string siteRootParentAssetId)
{
// Get starting path for all other paths
var parentAssetId = int.Parse(siteRootParentAssetId);
var parentAsset = Asset.LoadDirect(parentAssetId);
var basePath = parentAsset.AssetPath.ToString();
// Get paths needed by the site builder tool
var pro_library_folder = Asset.LoadDirect(basePath + "/Project/Library").GetLink(LinkType.Internal);
if (string.IsNullOrEmpty(pro_library_folder))
pro_library_folder = Asset.LoadDirect(basePath + "/Project/Client Library").GetLink(LinkType.Internal);
var pro_model_folder = Asset.LoadDirect(basePath + "/Project/Models").GetLink(LinkType.Internal);
var pro_nav_wrap_location = Asset.LoadDirect(basePath + "/Project/Templates/MasterPage").GetLink(LinkType.Internal);
var pro_project_folder = Asset.LoadDirect(basePath + "/Project").GetLink(LinkType.Internal);
var pro_site_root_folder = Asset.LoadDirect(basePath + "/Site Root").GetLink(LinkType.Internal);
var pro_template_folder = Asset.LoadDirect(basePath + "/Project/Templates").GetLink(LinkType.Internal);
var fields = new Dictionary<string, string>();
fields.Add("export_site_option", "yes");
fields.Add("extract_type", "project");
fields.Add("include_binaries", "true");
fields.Add("include_contents", "true");
fields.Add("include_wrappers", "true");
fields.Add("pro_library_folder", pro_library_folder);
fields.Add("pro_model_folder", pro_model_folder);
fields.Add("pro_nav_wrap_location", pro_nav_wrap_location);
fields.Add("pro_project_folder", pro_project_folder);
fields.Add("pro_site_root_folder", pro_site_root_folder);
fields.Add("pro_template_folder", pro_template_folder);
asset.SaveContent(fields);
}