Exemple #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());
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
 public void Write(SlpWriter value)
 {
     value.CopyTo(_stream);
     Length += value.Length;
 }
Exemple #5
0
 public void Write(SlpWriter value)
 {
     value.CopyTo(_stream);
     Length += value.Length;
 }