本文整理汇总了C#中IWriteContext.WriteObject方法的典型用法代码示例。如果您正苦于以下问题:C# IWriteContext.WriteObject方法的具体用法?C# IWriteContext.WriteObject怎么用?C# IWriteContext.WriteObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWriteContext
的用法示例。
在下文中一共展示了IWriteContext.WriteObject方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteElements
private void WriteElements(IWriteContext context, IDictionary map, KeyValueHandlerPair
handlers)
{
IEnumerator elements = map.GetEnumerator();
while (elements.MoveNext())
{
DictionaryEntry entry = (DictionaryEntry)elements.Current;
context.WriteObject(handlers._keyHandler, entry.Key);
context.WriteObject(handlers._valueHandler, entry.Value);
}
}
示例2: WriteElements
private void WriteElements(IWriteContext context, IDictionary map, KeyValueHandlerPair
handlers)
{
IEnumerator elements = map.Keys.GetEnumerator();
while (elements.MoveNext())
{
object key = elements.Current;
context.WriteObject(handlers._keyHandler, key);
context.WriteObject(handlers._valueHandler, map[key]);
}
}
示例3: WriteElements
private void WriteElements(IWriteContext context, ICollection collection, ITypeHandler4
elementHandler)
{
IEnumerator elements = collection.GetEnumerator();
while (elements.MoveNext())
{
context.WriteObject(elementHandler, elements.Current);
}
}
示例4: WriteObject
private void WriteObject(IWriteContext context, ITypeHandler4 typeHandler, object
obj)
{
if (IsPlainObject(obj))
{
context.WriteObject(new PlainObjectHandler(), obj);
return;
}
if (Handlers4.UseDedicatedSlot(context, typeHandler))
{
context.WriteObject(obj);
}
else
{
typeHandler.Write(context, obj);
}
}
示例5: Write
public void Write(IWriteContext context, object obj)
{
context.WriteObject(TypeHandler(), new PSObjectWrapper((PSObject)obj));
}
示例6: WriteElements
protected virtual void WriteElements(IWriteContext context, object obj, ArrayInfo
info)
{
if (HandleAsByteArray(obj))
{
context.WriteBytes((byte[])obj);
}
else
{
// byte[] performance optimisation
if (HasNullBitmap(info))
{
BitMap4 nullItems = NullItemsMap(ArrayReflector(Container(context)), obj);
WriteNullBitmap(context, nullItems);
for (int i = 0; i < info.ElementCount(); i++)
{
if (!nullItems.IsTrue(i))
{
context.WriteObject(_handler, ArrayReflector(Container(context)).Get(obj, i));
}
}
}
else
{
for (int i = 0; i < info.ElementCount(); i++)
{
context.WriteObject(_handler, ArrayReflector(Container(context)).Get(obj, i));
}
}
}
}
示例7: WriteElements
private static void WriteElements(IWriteContext context, IEnumerable enumerable, ITypeHandler4 elementHandler)
{
IEnumerator elements = enumerable.GetEnumerator();
while (elements.MoveNext())
{
context.WriteObject(elementHandler, elements.Current);
}
}
示例8: WriteElements
protected override void WriteElements(IWriteContext context, object obj, ArrayInfo
info)
{
var objects = AllElements(Container(context), obj);
if (HasNullBitmap(info))
{
var nullBitMap = new BitMap4(info.ElementCount());
var nullBitMapBuffer = context.Reserve(nullBitMap.MarshalledLength());
var currentElement = 0;
while (objects.MoveNext())
{
var current = objects.Current;
if (current == null)
{
nullBitMap.SetTrue(currentElement);
}
else
{
context.WriteObject(DelegateTypeHandler(), current);
}
currentElement++;
}
nullBitMapBuffer.WriteBytes(nullBitMap.Bytes());
}
else
{
while (objects.MoveNext())
{
context.WriteObject(DelegateTypeHandler(), objects.Current);
}
}
}