Exemplo n.º 1
0
 public void CreateShares()
 {
     string [] shares = _algorithm.Share(Phrase, Threshold, NumberOfShares);
     Shares.Clear();
     foreach (var sh in shares)
     {
         ShareName shareName = new ShareName(sh);
         Shares.Add(shareName);
     }
 }
Exemplo n.º 2
0
        public void AddShares(IDictionary <string, double> shares)
        {
            foreach (var pair in shares)
            {
                Shares.Add(pair.Key, pair.Value);
            }

            if (Block.Status == BlockStatus.Confirmed)
            {
                CalculatePayouts();
            }
        }
Exemplo n.º 3
0
 public void Sell(Person seller, double summ)
 {
     if (seller.Balance >= summ)
     {
         for (int i = 0; i < summ / DefaultPrice; i++)
         {
             seller.PersonalShares.RemoveAt(0);
             Shares.Add(new Share(DefaultPrice));
         }
         seller.Balance += summ;
     }
 }
Exemplo n.º 4
0
 public void SaveChanges(Share share)
 {
     SaveChanges <Share>(share);
     for (int i = 0; i < Shares.Count; i++)
     {
         if (Shares[i].Identifier == share.Identifier)
         {
             Shares.RemoveAt(i);
             Shares.Insert(i, share);
             return;
         }
     }
     Shares.Add(share);
 }
Exemplo n.º 5
0
 public void Add(Share share) => Shares.Add(share);
Exemplo n.º 6
0
 public int Add(Share entity) => Shares.Add(entity).ShareId;
Exemplo n.º 7
0
 public void Add(Share entity) => Shares.Add(entity);