private void OnAdd()
        {
            Alpha PO = new Alpha()
            {
                Name = NewAlphaName
            };

            NewAlphaName = "";
            repo.AddAlphaAsync(PO);
            Alphas.Add(PO);
        }
示例#2
0
 /// <summary>
 /// adds all colors of the given blend
 /// </summary>
 private void AddColors(ColorBlend blend)
 {
     if (blend == null ||
         blend.Colors == null || blend.Positions == null ||
         blend.Colors.Length != blend.Positions.Length)
     {
         throw new ArgumentException("blend is invalid");
     }
     //
     for (int i = 0; i < blend.Colors.Length; i++)
     {
         if (blend.Colors[i].A != 255)
         {
             Alphas.Add(new AlphaPoint((byte)blend.Colors[i].A,
                                       (double)blend.Positions[i]));
         }
         Colors.Add(new ColorPoint(blend.Colors[i],
                                   (double)blend.Positions[i]));
     }
 }