Пример #1
0
        static void LoadFromShow()
        {
            if (!File.Exists(_games_path))
            {
                _loopLinks = null;
                return;
            }

            Assembly myAssembly = Assembly.LoadFrom("Modules\\Games.dll");

            using (Stream stream = myAssembly.GetManifestResourceStream("Games.XmlFile.PicFile.xml"))
                using (XmlReader xmlReader = new XmlTextReader(stream))
                {
                    var param = from file in XDocument.Load(xmlReader).Element("Pics").Elements("Pic")
                                select ShowModel.CreateModel(
                        file.Attribute("id").Value,
                        file.Attribute("picsrc").Value,
                        file.Attribute("title").Value
                        );

                    try
                    {
                        foreach (var p in param)
                        {
                            _loopLinks.Add(p);
                        }
                    }
                    catch { }
                }
        }
Пример #2
0
        public NoticeViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
        {
            this.regionManager     = regionManager;
            this.module_Aggregator = eventAggregator;

            _showAccess = new ShowAccess();
            _loopLink   = ShowAccess.GetShow();

            moduleMsgOrder = new ModuleMsgOrder();
        }
Пример #3
0
        public void prependTest()
        {
            LoopLink <string> loop = new LoopLink <string>();

            loop.Head      = new Node <string>("B");
            loop.Tail      = new Node <string>("B");
            loop.Head.Next = loop.Head;
            loop.prepend("D");
            loop.prepend("E");
            List <string> result = new List <string>()
            {
                "E", "D", "B"
            };

            CollectionAssert.AreEqual(loop.display(), result);
        }
Пример #4
0
        public void getTest()
        {
            LoopLink <string> loop = new LoopLink <string>();

            loop.Head      = new Node <string>("B");
            loop.Tail      = new Node <string>("B");
            loop.Head.Next = loop.Head;
            loop.prepend("A");
            loop.append("C");
            loop.append("D");
            loop.append("E");
            loop.append("F");
            loop.append("G");
            loop.append("H");
            Assert.AreEqual(loop.get(5), "F");
        }
Пример #5
0
        public void insertTest()
        {
            LoopLink <string> loop = new LoopLink <string>();

            loop.Head      = new Node <string>("B");
            loop.Tail      = new Node <string>("B");
            loop.Head.Next = loop.Head;
            loop.insert(0, "A");
            loop.insert(1, "C");
            loop.insert(2, "S");
            List <string> result = new List <string>()
            {
                "A", "C", "S", "B"
            };

            CollectionAssert.AreEqual(loop.display(), result);
        }
Пример #6
0
        public void clearTest()
        {
            LoopLink <string> loop = new LoopLink <string>();

            loop.Head      = new Node <string>("B");
            loop.Tail      = new Node <string>("B");
            loop.Head.Next = loop.Head;
            loop.prepend("A");
            loop.append("C");
            loop.append("D");
            loop.append("E");
            loop.append("F");
            loop.append("G");
            loop.append("H");
            Assert.AreEqual(loop.isEmpty, false);
            loop.clear();
            Assert.AreEqual(loop.length, 0);
            Assert.AreEqual(loop.isEmpty, true);
        }
Пример #7
0
        public void removeTest()
        {
            LoopLink <string> loop = new LoopLink <string>();

            loop.Head      = new Node <string>("B");
            loop.Tail      = new Node <string>("B");
            loop.Head.Next = loop.Head;
            loop.prepend("A");
            loop.append("C");
            loop.append("D");
            loop.append("E");
            loop.append("F");
            loop.append("G");
            loop.append("H");
            loop.remove(0);
            loop.remove(2);
            loop.remove(5);
            List <string> result = new List <string>()
            {
                "B", "C", "E", "F", "G"
            };

            CollectionAssert.AreEqual(loop.display(), result);
        }
Пример #8
0
 public ShowAccess()
 {
     _loopLinks = new LoopLink <ShowModel>();
     LoadFromShow();
 }