コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientSourcedString"/> class.
 /// Copy Constructor
 /// </summary>
 /// <param name="value">Another instance of a ClientSourcedString</param>
 public ClientSourcedString(ClientSourcedString value)
 {
     // Protect against self reference.
     if (this != value)
     {
         this._trusted   = value._trusted;
         this._untrusted = value._untrusted;
     }
 }
コード例 #2
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            ClientSourcedString css = value as ClientSourcedString;

            if (css == null)
            {
                throw new InvalidCastException();
            }

            writer.WriteValue(css.ToTrustedString());
        }
コード例 #3
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            ClientSourcedString css = (string)reader.Value;

            return(css);
        }