Ejemplo n.º 1
0
        public void installSet(Windows.ChangeSetsProgressDialog wnd, int max, Octgn.Data.Game game)
        {
            wnd.UpdateProgress(0, max, "Retrieving xml...", false);
            XmlSetParser xmls = xml_set;

            wnd.UpdateProgress(1, max, "Parsing retrieved xml...", false);
            xmls.check();
            bool is_spoiler_installed = true;

            Data.Set set        = null;
            string   path       = Path.Combine(Prefs.DataDirectory, "Games", game.Id.ToString(), "Sets");
            string   downloadto = Path.Combine(path) + xmls.name() + ".o8s";
            var      cli        = new WebClient();

            wnd.UpdateProgress(2, max, "Downloading new definition...", false);
            cli.Credentials = new System.Net.NetworkCredential(xmls.user(), xmls.password());
            cli.DownloadFile(xmls.link(), downloadto);
            wnd.UpdateProgress(3, max, "Checking for existence of old definition...", false);
            try
            {
                set = game.Sets.First <Data.Set>(_set => _set.Id.ToString() == xmls.uuid());
            }
            catch
            {
                is_spoiler_installed = false;
            }
            if (is_spoiler_installed)
            {
                wnd.UpdateProgress(4, max, "Removing old definition...", false);
                game.DeleteSet(set);
            }
            wnd.UpdateProgress(5, max, "Installing new definition...", false);
            game.InstallSet(downloadto);
            wnd.UpdateProgress(6, max, "Set installed correctly", false);
        }
Ejemplo n.º 2
0
    static void Main()
    {
        Furnitures.Chair chair1 = new Furnitures.Chair();
        chair1.price = 1000;
        System.Console.WriteLine("chair1:" + chair1 + "\tprice is " + chair1.price);

        Furnitures.Chair chair2 = new Furnitures.Chair();
        chair2.price = 5000;
        System.Console.WriteLine("chair2:{0}\tprice is:{1}", chair2, chair2.price);

        Data.List list1 = new Data.List();
        System.Console.WriteLine("list1 is {0}", list1);

        Furnitures.Table table1 = new Furnitures.Table();
        System.Console.WriteLine("table is {0}", table1);

        Data.Table table2 = new Data.Table();
        System.Console.WriteLine("table2 is {0}", table2);

        Data.Set set1 = new Data.Set();
        System.Console.WriteLine("set1 is {0}", set1);
    }
    static void Main()
    {
        System.Console.WriteLine("Welcome to Furniture Shop");
        Furnitures.Chair chair1 = new Furnitures.Chair();
        Furnitures.Chair chair2 = new Furnitures.Chair();
        Furnitures.Bed   bed1   = new Furnitures.Bed();

        System.Console.WriteLine("{0}\tprice{1}\tid={2}", chair2, chair2.price, chair2.GetHashCode());
        System.Console.WriteLine("{0}\tprice{1}\tid={2}", chair1, chair1.price, chair1.GetHashCode());
        System.Console.WriteLine("{0}\tprice{1}\tid={2}", bed1, bed1.price, bed1.GetHashCode());

        Data.LinkedList list = new Data.LinkedList();
        Data.Set        set  = new Data.Set();

        list.Add(20);
        list.Add(30);
        set.Add(20);
        set.Add(30);

        Data.Table table = new Data.Table(); //which table?
        table.Add(2, 3, 4);
        //System.Console.WriteLine(table.price);
    }