Ejemplo n.º 1
0
        /// <summary>
        /// Returns the card_type value
        /// </summary>
        /// <param name="cardNumber"></param>
        /// <returns></returns>
        public string GetCardType(string cardNumber)
        {
            var cards = new MingleCardCollection(this);

            cards.Parse(Convert.ToInt32(cardNumber));
            return(cards.Count == 0 ? string.Empty : cards[0].Type);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Given filter criteria, return a collection of cards
        /// </summary>
        /// <param name="filters">MingleFilter describing selection criteria</param>
        /// <returns>MingleCardCollection object</returns>
        public MingleCardCollection GetCards(Collection <string> filters)
        {
            var cards = new MingleCardCollection(this);

            cards.Parse(filters);
            return(cards);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Refreshes the list of cards indicated by this Favorite
        /// </summary>
        public MingleCardCollection GetCards()
        {
            var filters = new Collection <string>
            {
                new MingleFilter
                {
                    Name  = "view",
                    Value = Name
                }.FavoriteString,
                "page=all"
            };


            var cards = new MingleCardCollection(Project);

            try
            {
                TraceLog.WriteLine(new StackFrame().GetMethod().Name, "Loading the ResponseStream");
                var response = XElement.Parse(Project.Mingle.Get(ProjectId, "/cards.xml", filters));
                foreach (var e in response.Elements("card"))
                {
                    cards.Add(new MingleCard(e.ToString(), Project));
                }
            }
            catch (Exception ex)
            {
                TraceLog.Exception(new StackFrame().GetMethod().Name, ex);
                throw;
            }

            return(cards);
        }