コード例 #1
0
ファイル: BinaryTaggedDataOutput.cs プロジェクト: NeoTim/etch
        /// <summary>
        /// Constructs the BinaryTaggedDataOutput with a null buffer.
        /// </summary>
        /// <param name="vf">the value factory for the service.</param>
        /// <param name="uri">the uri used to construct the transport stack.</param>
        public BinaryTaggedDataOutput(ValueFactory vf, string uri)
            : base(vf)
        {
            this.level = vf.GetLevel();
            URL u = new URL(uri);

            stringTypeAndField = u.GetBooleanTerm(STRING_TYPE_AND_FIELD, false);
        }
コード例 #2
0
        ///<summary>Constructs the StructValue.</summary>
        ///<param name="type">the type of the struct (or the action or event if
        ///this is a message).</param>
        ///<param name="length">the expected number of name/value pairs.</param>
        public StructValue(XType type, ValueFactory vf, int length)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type == null");
            }

            if (vf == null)
            {
                throw new ArgumentNullException("vf == null");
            }

            this.type   = type;
            this.fields = new Dictionary <Field, Object>(length > 0 ? (length * 4 + 2) / 3 : DEFAULT_SIZE);
            this.level  = vf.GetLevel();
        }