Ejemplo n.º 1
0
 public ViewModel()
 {
     fileOperating = false;
     username = "******";
     themesList = new ObservableCollection<GenericCard>();
     newThemeCard = new ThemeCard(username);
 }
Ejemplo n.º 2
0
        // All of the functions for the backend
        #region Functions

        public ViewModel()
        {
            fileOperating = false;
            username      = "******";
            themesList    = new ObservableCollection <GenericCard>();
            newThemeCard  = new ThemeCard(username);
        }
Ejemplo n.º 3
0
 public override void Clone(GenericCard clone)
 {
     if (clone != null)
     {
         ThemeCard cloneTheme = (ThemeCard)clone;
         Theme  = cloneTheme.Theme;
         Type   = cloneTheme.Type;
         Author = cloneTheme.Author;
     }
 }
Ejemplo n.º 4
0
        public override bool Equals(object obj)
        {
            bool isEqual = false;

            if (obj != null)
            {
                ThemeCard checkCard = (ThemeCard)obj;

                if (Theme.Equals(checkCard.Theme, StringComparison.CurrentCultureIgnoreCase))
                {
                    isEqual = true;
                }
            }

            return(isEqual);
        }
Ejemplo n.º 5
0
        void ParseThemes(XmlNodeList themeList)
        {
            string key = CardEnum.Theme.ToString();

            if (populatedLists.ContainsKey(key) == false)
            {
                populatedLists[key] = new List <GenericCard>();
            }

            ThemeCard newTheme = null;

            foreach (XmlNode theme in themeList)
            {
                newTheme = new ThemeCard();

                foreach (XmlNode child in theme.ChildNodes)
                {
                    switch (child.Name)
                    {
                    case "Author":
                    {
                        newTheme.Author = child.Value;
                        break;
                    }

                    case "Theme":
                    {
                        newTheme.Theme = child.Value;
                        break;
                    }

                    case "Type":
                    {
                        newTheme.Type = child.Value;
                        break;
                    }
                    }
                }

                populatedLists[key].Add(newTheme);
            }
        }
Ejemplo n.º 6
0
        public void SubmitItem(object card)
        {
            if (card != null)
            {
                GenericCard cardToSubmit = (GenericCard)card;

                GenericCard cloneCard = null;
                ObservableCollection <GenericCard> checkList = null;
                switch (cardToSubmit.GetStringType())
                {
                case "Theme":
                {
                    checkList = themesList;
                    cloneCard = new ThemeCard();
                    break;
                }

                default:
                    break;
                }

                GenericCard foundCard = null;
                if (checkList != null)
                {
                    foreach (GenericCard listedCard in checkList)
                    {
                        if (listedCard.Equals(card))
                        {
                            foundCard = listedCard;
                            break;
                        }
                    }

                    if (foundCard == null)
                    {
                        cloneCard.Clone(cardToSubmit);
                        checkList.Add(cloneCard);
                    }
                }
            }
        }
Ejemplo n.º 7
0
        void ParseThemes(XmlNodeList themeList)
        {
            string key = CardEnum.Theme.ToString();
            if (populatedLists.ContainsKey(key) == false)
            {
                populatedLists[key] = new List<GenericCard>();
            }

            ThemeCard newTheme = null;
            foreach(XmlNode theme in themeList)
            {
                newTheme = new ThemeCard();

                foreach(XmlNode child in theme.ChildNodes)
                {
                    switch(child.Name)
                    {
                        case "Author":
                            {
                                newTheme.Author = child.Value;
                                break;
                            }
                        case "Theme":
                            {
                                newTheme.Theme = child.Value;
                                break;
                            }
                        case "Type":
                            {
                                newTheme.Type = child.Value;
                                break;
                            }
                    }
                }

                populatedLists[key].Add(newTheme);
            }
        }
Ejemplo n.º 8
0
 public ThemeCard(ThemeCard clone) : this(clone.Author)
 {
     Theme = clone.Theme;
     Type  = clone.Type;
 }
Ejemplo n.º 9
0
        public void SubmitItem(object card)
        {
            if (card != null)
            {
                GenericCard cardToSubmit = (GenericCard)card;

                GenericCard cloneCard = null;
                ObservableCollection<GenericCard> checkList = null;
                switch (cardToSubmit.GetStringType())
                {
                    case "Theme":
                        {
                            checkList = themesList;
                            cloneCard = new ThemeCard();
                            break;
                        }
                    default:
                        break;
                }

                GenericCard foundCard = null;
                if(checkList != null)
                {
                    foreach(GenericCard listedCard in checkList)
                    {
                        if(listedCard.Equals(card))
                        {
                            foundCard = listedCard;
                            break;
                        }
                    }

                    if(foundCard == null)
                    {
                        cloneCard.Clone(cardToSubmit);
                        checkList.Add(cloneCard);
                    }
                }
            }
        }
Ejemplo n.º 10
0
 public ThemeCard(ThemeCard clone)
     : this(clone.Author)
 {
     Theme = clone.Theme;
     Type = clone.Type;
 }