当前位置: 首页>>代码示例>>C#>>正文


C# PropertyBag.Remove方法代码示例

本文整理汇总了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();
		}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:18,代码来源:CreateRecordTag.cs

示例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);
 }
开发者ID:xeno-by,项目名称:elf4b,代码行数:8,代码来源:ChangeSet.cs

示例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();
		}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:22,代码来源:AddNodeTag.cs

示例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);
		}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:17,代码来源:UpdateRecordTag.cs

示例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);
		}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:20,代码来源:ExtendedPropertiesColumn.cs

示例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"));
 }
开发者ID:dirkelfman,项目名称:ClearScript,代码行数:8,代码来源:PropertyBagTest.cs


注:本文中的PropertyBag.Remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。