Example #1
0
        private string BackValuesToString()
        {
            List<CardElement> backElements = new List<CardElement>();

            foreach (CardRelation singleRelation in this.BackElements)
            {
                CardElement newCardElement = new CardElement();

                TemplateElement element = singleRelation.Element;
                DrawingContent content = singleRelation.Content;

                newCardElement.TemplateElementID = element.Id;
                newCardElement.Value = content.GenerateContentValue();

                backElements.Add(newCardElement);
            }

            string backValuesStr = CardElement.RepresentToString(backElements);
            return backValuesStr;
        }
Example #2
0
        internal static IList<CardElement> ParseStringRepresentation(string cardElements)
        {
            List<CardElement> elements = new List<CardElement>();
            string[] parsableElements = cardElements.Split(new string[]{ ELEMENTS_SEPARATOR }, StringSplitOptions.RemoveEmptyEntries);

            for (int i = 0; i < parsableElements.Length; i++)
            {
                CardElement newCardElement = new CardElement();
                newCardElement.FromStringRepresentation(parsableElements[i]);
                elements.Add(newCardElement);
            }

            return elements;
        }