示例#1
0
        public void WriteExternal(IPofWriter writer)
        {
            writer.WriteInt32(0, INTEGER);

            IPofWriter nested1 = writer.CreateNestedPofWriter(1);

            IPofWriter nested2 = nested1.CreateNestedPofWriter(0);

            nested2.WriteString(0, STRING);
            nested2.WriteSingleArray(2, FLOAT_ARRAY);

            IPofWriter nested3 = nested2.CreateNestedPofWriter(3);

            nested3.WriteArray(0, STRING_ARRAY, typeof(String));

            nested2.WriteBoolean(4, false);
            nested2.WriteRemainder(null);

            IList list = (IList)set;

            nested1.WriteCollection(1, list);
            nested1.WriteDouble(2, 2.0);
            nested1.WriteInt32(3, 5);
            nested1.WriteCollection(4, set);
            nested1.WriteDouble(10, 2.222);

            writer.WriteDouble(2, 4.444);
            writer.WriteInt32(3, 15);
        }
        public void WriteExternal(IPofWriter writer)
        {
            writer.WriteInt32(0, INTEGER);

            IPofWriter nested1 = writer.CreateNestedPofWriter(1);

            IPofWriter nested2 = nested1.CreateNestedPofWriter(0);

            nested2.WriteString(0, STRING);
            nested2.WriteObject(1, PERSON);
            nested2.WriteDoubleArray(2, DOUBLE_ARRAY);

            IPofWriter nested3 = nested2.CreateNestedPofWriter(3);

            nested3.WriteArray(0, STRING_ARRAY, typeof(String));

            nested2.WriteBoolean(4, false);
            nested2.WriteRemainder(null);

            nested1.WriteCollection(1, (ICollection <String>)set);
            nested1.WriteDouble(2, 2.0);
            nested1.WriteInt32(3, 5);
            nested1.WriteCollection(4, set, typeof(String));
            nested1.WriteObject(5, PERSON);
            nested1.WriteDouble(10, 2.222);

            writer.WriteDouble(2, 4.444);
            writer.WriteInt32(3, 15);
            writer.WriteObject(4, PERSON);
        }
 public void WriteExternal(IPofWriter writer)
 {
     writer.WriteArray(0, m_oArray);
     writer.WriteArray(1, m_sArray, typeof(String));
     writer.WriteCollection(2, m_col);
     writer.WriteCollection(3, m_colUniform, typeof(String));
     writer.WriteLongArray(4, m_sparseArray);
     writer.WriteLongArray(5, m_uniformSparseArray, typeof(String));
 }
示例#4
0
 public void Serialize(IPofWriter writer)
 {
     writer.WriteU32(0, kVersion);
     writer.WriteGuid(1, id);
     writer.WriteString(2, name);
     writer.WriteCollection(3, authors);
     writer.WriteString(4, website);
     writer.WriteCollection(5, targets.Select(target => target.Value));
 }
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void WriteExternal(IPofWriter writer)
 {
     writer.WriteObject(0, m_sFilter);
     writer.WriteInt32(1, m_nEfficiency);
     writer.WriteInt32(2, m_nSizeIn);
     writer.WriteInt32(3, m_nSizeOut);
     writer.WriteInt64(4, m_cMillis);
     writer.WriteCollection(5, m_setIndexLookupRecords);
     writer.WriteCollection(6, m_listSubSteps);
 }
 public void WriteExternal(IPofWriter writer)
 {
     writer.WriteCollection(0, getList1());
     writer.WriteCollection(1, getList2());
     writer.WriteCollection(2, getList3());
     writer.WriteDictionary(3, getMap1());
     writer.WriteDictionary(4, getMap2());
     writer.WriteDictionary(5, getMap3());
     writer.WriteInt32(6, getNumber());
     writer.WriteString(7, getText());
     writer.WriteArray(8, getChildren(), typeof(PofChild));
 }
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteInt64(0, RequestId);
            writer.WriteBoolean(1, IsFailure);

            ResultFormatType format = ResultFormat;

            writer.WriteInt32(2, (int)format);

            switch (format)
            {
            default:
            case ResultFormatType.Generic:
                writer.WriteObject(3, Result);
                break;

            case ResultFormatType.Collection:
                writer.WriteCollection(4, (ICollection)Result);
                break;

            case ResultFormatType.Map:
                writer.WriteDictionary(5, (IDictionary)Result);
                break;
            }
        }
示例#8
0
            public void Serialize(IPofWriter writer)
            {
                int i = 0;

                writer.WriteObject(i++, key);
                writer.WriteS32(i++, level);
                writer.WriteCollection(i++, friends);
            }
示例#9
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        /// <seealso cref="Request.WriteExternal"/>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteCollection(1, Keys);

            // release state
            Keys = null;
        }
 public void Serialize(IPofWriter writer) {
    writer.WriteS32(0, packetId);
    writer.WriteFloat(1, leftX);
    writer.WriteFloat(2, leftY);
    writer.WriteFloat(3, rightX);
    writer.WriteFloat(4, rightY);
    writer.WriteFloat(5, leftTrigger);
    writer.WriteFloat(6, rightTrigger);
    writer.WriteCollection(7, buttons);
 }
示例#11
0
        /// <summary>
        /// Serialize a user type instance to a POF stream by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <remarks>
        /// An implementation of <b>IPofSerializer</b> is required to follow
        /// the following steps in sequence for writing out an object of a
        /// user type:
        /// <list type="number">
        /// <item>
        /// <description>
        /// If the object is evolvable, the implementation must set the
        /// version by calling <see cref="IPofWriter.VersionId"/>.
        /// </description>
        /// </item>
        /// <item>
        /// <description>
        /// The implementation may write any combination of the properties of
        /// the user type by using the "write" methods of the
        /// <b>IPofWriter</b>, but it must do so in the order of the property
        /// indexes.
        /// </description>
        /// </item>
        /// <item>
        /// <description>
        /// After all desired properties of the user type have been written,
        /// the implementation must terminate the writing of the user type by
        /// calling <see cref="IPofWriter.WriteRemainder"/>.
        /// </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// <param name="writer">
        /// The <b>IPofWriter</b> with which to write the object's state.
        /// </param>
        /// <param name="o">
        /// The object to serialize.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public void Serialize(IPofWriter writer, object o)
        {
            IPrincipal principal  = (IPrincipal)o;
            IList      identities = new ArrayList(1);

            identities.Add(principal.Identity);

            writer.WriteCollection(0, identities);
            writer.WriteRemainder(null);
        }
示例#12
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing
        /// its state using the specified <see cref="IPofWriter"/>
        /// object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's
        /// state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteBoolean(10, IsRedirect);
            if (IsRedirect)
            {
                writer.WriteCollection(11, RedirectList);
            }
        }
 /// <summary>
 /// Serializes this processor into a POF stream.
 /// </summary>
 /// <param name="writer">
 /// The POF writer.
 /// </param>
 public override void WriteExternal(IPofWriter writer)
 {
     writer.WriteInt64(0, m_lockId);
     writer.WriteBoolean(1, m_newSession);
     writer.WriteBoolean(2, m_initialized);
     writer.WriteInt64(3, m_timeout);
     writer.WriteBinary(4, m_binModel);
     writer.WriteDictionary(5, m_externalAttributes, typeof(String), typeof(Binary));
     writer.WriteCollection(6, m_obsoleteExternalAttributes, typeof(String));
 }
 public void Serialize(IPofWriter writer)
 {
     writer.WriteS32(0, packetId);
     writer.WriteFloat(1, leftX);
     writer.WriteFloat(2, leftY);
     writer.WriteFloat(3, rightX);
     writer.WriteFloat(4, rightY);
     writer.WriteFloat(5, leftTrigger);
     writer.WriteFloat(6, rightTrigger);
     writer.WriteCollection(7, buttons);
 }
        /// <summary>
        /// Write the exception to the specified stream.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to write to.
        /// </param>
        /// <param name="e">
        /// The <b>Exception</b> to write.
        /// </param>
        public static void WriteException(IPofWriter writer, Exception e)
        {
            string name;

            string[] arrTrace;

            if (e is PortableException)
            {
                PortableException pe = (PortableException)e;
                name     = pe.Name;
                arrTrace = pe.FullStackTrace;
            }
            else
            {
                name     = e.GetType().FullName;
                arrTrace = new string[] { e.StackTrace };
            }

            writer.WriteString(0, name);
            writer.WriteString(1, e.Message);
            writer.WriteCollection(2, new ArrayList(arrTrace), typeof(string));
            writer.WriteObject(3, e.InnerException);
        }
示例#16
0
 public void Serialize(IPofWriter writer)
 {
     writer.WriteCollection(0, serviceGuids);
 }
 public void Serialize(IPofWriter writer)
 {
     writer.WriteCollection(0, processNames);
 }
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public override void WriteExternal(IPofWriter writer)
 {
     writer.WriteObject(0, m_extractor);
     writer.WriteCollection(1, (ICollection)m_value);
 }
示例#19
0
 public void WriteExternal(IPofWriter writer)
 {
     writer.WriteCollection(0, m_coll, typeof(T));
 }
 public void Serialize(IPofWriter writer)
 {
     writer.WriteS32(0, 0x12345678);
     writer.WriteCollection(1, value, true);
 }
 protected override void Serialize(IPofWriter writer, int baseSlot) {
    writer.WriteGuid(baseSlot + 0, EpochId);
    writer.WriteCollection(baseSlot + 1, OrderedParticipants);
 }
 public void Encode(IPofWriter writer, int index, object value)
 {
     COUNTER++;
     writer.WriteCollection(index, (ICollection)value);
 }
 public void Serialize(IPofWriter writer)
 {
     writer.WriteCollection(0, internalList, true);
 }
 public void Serialize(IPofWriter writer)
 {
     writer.WriteCollection(0, value, true);
 }
示例#25
0
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public void WriteExternal(IPofWriter writer)
 {
     writer.WriteObject(0, Comparer);
     writer.WriteCollection(1, Results);
 }
 protected override void Serialize(IPofWriter writer, int baseSlot) {
    writer.WriteCollection(baseSlot + 0, Blocks);
 }
示例#27
0
 public void Serialize(IPofWriter writer)
 {
     writer.WriteCollection(0, addedServiceGuids);
     writer.WriteCollection(1, removedServiceGuids);
 }
示例#28
0
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void WriteExternal(IPofWriter writer)
 {
     writer.WriteObject(0, m_filter);
     writer.WriteCollection(1, m_keys);
 }
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void WriteExternal(IPofWriter writer)
 {
     writer.WriteObject(0, m_partMask);
     writer.WriteCollection(1, m_listSteps);
 }
 /// <see cref="IPofSerializer"/>
 void IPofSerializer.Serialize(IPofWriter writer, object o)
 {
     writer.WriteCollection(0, (HashSet)o);
     writer.WriteRemainder(null);
 }
 public void Serialize(IPofWriter writer)
 {
     writer.WriteS32(0, TargetProcessId);
     writer.WriteCollection(1, Components, true);
 }
示例#32
0
 public void WriteExternal(IPofWriter writer)
 {
     writer.WriteCollection(0, set);
     writer.WriteDictionary(1, map);
 }
示例#33
0
 public void Serialize(IPofWriter writer)
 {
     writer.WriteCollection(0, processNames);
 }
 protected override void Serialize(IPofWriter writer, int baseSlot) {
    writer.WriteGuid(baseSlot + 0, Nominee);
    writer.WriteCollection(baseSlot + 1, Followers ?? new ItzWarty.Collections.HashSet<Guid>());
 }
 public void Serialize(IPofWriter writer) {
    writer.WriteCollection(0, internalList, true);
 }
 public void Serialize(IPofWriter writer)
 {
     writer.WriteU32(0, kVersion);
      writer.WriteGuid(1, id);
      writer.WriteString(2, name);
      writer.WriteCollection(3, authors);
      writer.WriteString(4, website);
      writer.WriteCollection(5, targets.Select(target => target.Value));
 }
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void WriteExternal(IPofWriter writer)
 {
     writer.WriteInt32(0, (int)m_type);
     writer.WriteCollection(1, m_listResults);
 }