本文整理汇总了C#中IPropertyBag.Write方法的典型用法代码示例。如果您正苦于以下问题:C# IPropertyBag.Write方法的具体用法?C# IPropertyBag.Write怎么用?C# IPropertyBag.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyBag
的用法示例。
在下文中一共展示了IPropertyBag.Write方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WritePropertyBag
/// <summary>
/// Writes property values into a property bag.
/// </summary>
/// <param name="pb">Property bag.</param>
/// <param name="propName">Name of property.</param>
/// <param name="val">Value of property.</param>
public static void WritePropertyBag(IPropertyBag pb, string propName, object val)
{
try
{
pb.Write(propName, ref val);
}
catch (Exception e)
{
throw new ApplicationException(e.Message);
}
}
示例2: WritePropertyBag
/// <summary>
/// Writes property values into a property bag.
/// </summary>
/// <param name="pb">Property bag.</param>
/// <param name="propName">Name of property.</param>
/// <param name="val">Value of property.</param>
private void WritePropertyBag(IPropertyBag propertyBag, string propertyName, object value)
{
try
{
propertyBag.Write(propertyName, ref value);
}
catch (Exception ex)
{
//ExceptionHelper.HandleException(Resources.T4TemplaterPipelineComponentName, ex);
//TraceHelper.WriteLineIf(traceEnabled, ex.Message, EventLogEntryType.Error);
throw; ;
}
}
示例3: WritePropertyBag
/// <summary>
/// Writes property values into a property bag.
/// </summary>
/// <param name="propertyBag">Property bag.</param>
/// <param name="propertyName">Name of property.</param>
/// <param name="value">Value of property.</param>
protected static void WritePropertyBag(IPropertyBag propertyBag, string propertyName, object value)
{
propertyBag.Write(propertyName, ref value);
}
示例4: WriteInfo
private void WriteInfo(LibraryInfo info, IPropertyBag pBag)
{
var reference = new LibraryInfo(info.Type, null, null);
object val;
if (reference.CompileOption != info.CompileOption)
{
val = info.CompileOption.ToString();
pBag.Write(info.Type + ".Compile", ref val);
}
if (reference.Name != info.Name)
{
val = info.Name;
pBag.Write(info.Type + ".Name", ref val);
}
if (reference.Target != info.Target)
{
val = info.Target;
pBag.Write(info.Type + ".Target", ref val);
}
if (reference.Dependencies != info.Dependencies)
{
val = info.Dependencies;
pBag.Write(info.Type + ".Dependencies", ref val);
}
if (reference.Namespace != info.Namespace)
{
val = info.Namespace;
pBag.Write(info.Type + ".Namespace", ref val);
}
if (reference.WithActiveRecord != info.WithActiveRecord)
{
val = info.WithActiveRecord.ToString();
pBag.Write(info.Type + ".ActiveRecord", ref val);
}
if (reference.WithHelperMethods != info.WithHelperMethods)
{
val = info.WithHelperMethods.ToString();
pBag.Write(info.Type + ".HelperMethods", ref val);
}
if (reference.WithManualJson != info.WithManualJson)
{
val = info.WithManualJson.ToString();
pBag.Write(info.Type + ".WithManualJson", ref val);
}
if (reference.UseUtc != info.UseUtc)
{
val = info.UseUtc.ToString();
pBag.Write(info.Type + ".UseUtc", ref val);
}
if (reference.Legacy != info.Legacy)
{
val = info.Legacy.ToString();
pBag.Write(info.Type + ".Legacy", ref val);
}
if (reference.MinimalSerialization != info.MinimalSerialization)
{
val = info.MinimalSerialization.ToString();
pBag.Write(info.Type + ".MinimalSerialization", ref val);
}
if (reference.NoPrepareExecute != info.NoPrepareExecute)
{
val = info.NoPrepareExecute.ToString();
pBag.Write(info.Type + ".NoPrepareExecute", ref val);
}
}
示例5: Save
public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties)
{
object val = (object)this.PackagePath;
propertyBag.Write(PackagePathPropertyName, ref val);
val = (object)this.DataVariable;
propertyBag.Write(DataVariablePropertyName, ref val);
}