コード例 #1
0
        internal void ToBytes(SlpWriter writer)
        {
            StringBuilder sb = new StringBuilder();

            foreach (KeyValuePair <string, string> item in _InnerCollection)
            {
                if (sb.Length > 0)
                {
                    sb.Append(",");
                }

                sb.Append("(");
                sb.Append(writer.Escape(item.Key, Constants.ATTRIBUTETAGRESERVED));
                if (!string.IsNullOrEmpty(item.Value))
                {
                    sb.Append("=");
                    if (item.Value.StartsWith("\\FF", StringComparison.InvariantCultureIgnoreCase))
                    {
                        sb.Append(item.Value);
                    }
                    else
                    {
                        sb.Append(writer.Escape(item.Value, Constants.ATTRIBUTEVALUERESERVED));
                    }
                }
                sb.Append(")");
            }

            writer.WriteRaw(sb.ToString());
        }
コード例 #2
0
ファイル: ServiceEntry.cs プロジェクト: simongh/slpnet
        internal void ToBytes(SlpWriter writer)
        {
            if (Uri == null)
                throw new ServiceException("Service URL cannot be null.");

            writer.Write((byte)0);
            writer.Write((short)Lifetime.TotalSeconds);
            writer.Write(Uri.ToString());
            writer.Write((byte)AuthBlocks.Count);

            foreach (var item in AuthBlocks)
            {
                item.ToBytes(writer);
            }
        }
コード例 #3
0
ファイル: ServiceEntry.cs プロジェクト: simongh/slpnet
        internal void ToBytes(SlpWriter writer)
        {
            if (Uri == null)
            {
                throw new ServiceException("Service URL cannot be null.");
            }

            writer.Write((byte)0);
            writer.Write((short)Lifetime.TotalSeconds);
            writer.Write(Uri.ToString());
            writer.Write((byte)AuthBlocks.Count);

            foreach (var item in AuthBlocks)
            {
                item.ToBytes(writer);
            }
        }
コード例 #4
0
 public void Write(SlpWriter value)
 {
     value.CopyTo(_stream);
     Length += value.Length;
 }
コード例 #5
0
ファイル: SlpWriter.cs プロジェクト: simongh/slpnet
 public void Write(SlpWriter value)
 {
     value.CopyTo(_stream);
     Length += value.Length;
 }