本文整理汇总了C#中Asset.SetAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:C# Asset.SetAttributeValue方法的具体用法?C# Asset.SetAttributeValue怎么用?C# Asset.SetAttributeValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset
的用法示例。
在下文中一共展示了Asset.SetAttributeValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveNewAssetWithCommentHasCorrectPath
public void SaveNewAssetWithCommentHasCorrectPath() {
var myAsset = new Asset(AssetType("Story"));
var storyNameDef = myAsset.AssetType.GetAttributeDefinition("Name");
myAsset.SetAttributeValue(storyNameDef, "Fred");
var subject = new Services(Meta, DataConnector);
const string changeComment = "Expected Change Comment";
const string expectedChangeComment = "Expected+Change+Comment";
var expectedUpdatePath = string.Format("Data/Story?Comment='{0}'", expectedChangeComment);
subject.Save(myAsset, changeComment);
DataRequestEventArgs e = null;
GetLastSendDataRequest(ref e);
Assert.AreEqual(myAsset.Oid.Token, "Story:1025");
Assert.AreEqual(expectedUpdatePath, e.Path);
}
示例2: CreateDisposableStory
private Asset CreateDisposableStory(string name, string scopeToken) {
var story = new Asset(storyType);
assetsToDispose.Add(story);
story.SetAttributeValue(nameDef, name);
story.SetAttributeValue(scopeDef, Oid.FromToken(scopeToken, metaModel));
services.Save(story);
return story;
}