Пример #1
0
 public virtual void Draw()
 {
     // TODO: Needs a better way of handling ZIndex
     foreach (var e in AllElements.OrderBy(x => x.ZIndex))
     {
         e.Draw();
     }
 }
Пример #2
0
        public static string CountOfAtoms(string formula)
        {
            var chars = formula.ToCharArray();

            CountElements(AllElements, chars, 0);

            string result     = "";
            var    sortedDict = AllElements.OrderBy(kvp => kvp.Key);

            foreach (var element in sortedDict)
            {
                result += element.Key;
                if (element.Value != 1)
                {
                    result += element.Value;
                }
            }

            return(result);
        }