本文整理汇总了C#中PropertyBag.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyBag.Remove方法的具体用法?C# PropertyBag.Remove怎么用?C# PropertyBag.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyBag
的用法示例。
在下文中一共展示了PropertyBag.Remove方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoExecute
/// <summary>
/// </summary>
/// <param name="context"></param>
protected override void DoExecute(IMansionContext context)
{
// get the properties which to edit
var properties = new PropertyBag(GetAttributes(context));
properties.Remove("target");
properties.Remove("global");
using (context.Stack.Push("Properties", properties))
ExecuteChildTags(context);
// store the updated node
var record = context.Repository.Create(context, properties);
// push the new node to the stack
context.Stack.Push(GetRequiredAttribute<string>(context, "target"), record, GetAttribute<bool>(context, "global")).Dispose();
}
示例2: Accept
public void Accept()
{
var updated = new PropertyBag(Get());
Admixture.ForEach(kvp => updated.Add(kvp.Key, kvp.Value));
Changes.ForEach(kvp => updated[kvp.Key] = kvp.Value);
Leakage.ForEach(kvp => updated.Remove(kvp.Key));
Set(updated);
}
示例3: DoExecute
/// <summary>
/// </summary>
/// <param name="context"></param>
protected override void DoExecute(IMansionContext context)
{
// get arguments
var parentSource = GetRequiredAttribute<Node>(context, "parentSource");
// get the properties which to edit
var newProperties = new PropertyBag(GetAttributes(context));
newProperties.Remove("parentSource");
newProperties.Remove("target");
newProperties.Remove("global");
using (context.Stack.Push("NewProperties", newProperties, false))
ExecuteChildTags(context);
// store the updated node
var createdNode = context.Repository.CreateNode(context, parentSource, newProperties);
// push the new node to the stack
context.Stack.Push(GetRequiredAttribute<string>(context, "target"), createdNode, GetAttribute<bool>(context, "global")).Dispose();
}
示例4: DoExecute
/// <summary>
/// </summary>
/// <param name="context"></param>
protected override void DoExecute(IMansionContext context)
{
// get arguments
var record = GetRequiredAttribute<Record>(context, "source");
// get the properties which to edit
var editProperties = new PropertyBag(GetAttributes(context));
editProperties.Remove("source");
using (context.Stack.Push("Properties", editProperties))
ExecuteChildTags(context);
// store the updated node
context.Repository.Update(context, record, editProperties);
}
示例5: DoToInsertStatement
/// <summary>
///
/// </summary>
/// <param name="context"></param>
/// <param name="queryBuilder"></param>
/// <param name="newProperties"></param>
protected override void DoToInsertStatement(IMansionContext context, ModificationQueryBuilder queryBuilder, IPropertyBag newProperties)
{
var extendedProperties = new PropertyBag(newProperties);
// remove all properties starting with an underscore
var unstoredPropertyNames = extendedProperties.Names.Where(candidate => candidate.StartsWith("_")).ToList();
foreach (var propertyName in unstoredPropertyNames)
extendedProperties.Remove(propertyName);
// get the conversion service
var conversionService = context.Nucleus.ResolveSingle<IConversionService>();
// set the column value
queryBuilder.AddColumnValue("extendedProperties", conversionService.Convert<byte[]>(context, extendedProperties), DbType.Binary);
}
示例6: PropertyBag_ExternalModification_DeleteProperty
public void PropertyBag_ExternalModification_DeleteProperty()
{
var bag = new PropertyBag { { "foo", 123 }, { "bar", 456 } };
engine.AddHostObject("bag", bag);
Assert.AreEqual(456, engine.Evaluate("bag.bar"));
bag.Remove("bar");
Assert.AreSame(Undefined.Value, engine.Evaluate("bag.bar"));
}