Exemple #1
0
 /// <summary>
 /// Load security state from <paramref name="text"/>.
 /// </summary>
 /// <param name="text">Value, received from <see cref="ToSerializedString"/>.</param>
 public override void FromSerializedString(string text)
 {
     lock (_weights.SyncRoot)
     {
         _weights.Clear();
         _weights.AddRange(text.Split(",").Select(p =>
         {
             var parts = p.Split("=");
             return(new KeyValuePair <SecurityId, decimal>(parts[0].ToSecurityId(), parts[1].To <decimal>()));
         }));
     }
 }