Exemplo n.º 1
0
        public void refresh()
        {
            ThisWasLastController twl = new ThisWasLastController("load");

            path = twl.GetFromHere();

            BinaryFormatter fm = new BinaryFormatter();
            FileStream      sm = null;

            try
            {
                sm = File.OpenRead(path);
                Model.MasterClass x = (Model.MasterClass)fm.Deserialize(sm);
                GlowingEarth.getInstance().getMaster().setTags(x.getTags());
                GlowingEarth.getInstance().getMaster().setTypes(x.getTypes());
                GlowingEarth.getInstance().getMaster().setResources(x.getResources());
                GlowingEarth.getInstance().getMaster().setTitle(x.getTitle());
                GlowingEarth.getInstance().getMaster().setSerPath(x.getSerPath());
                GlowingEarth.getInstance().getMaster().setMapItems(x.getMapItems());
            }
            catch (Exception e)
            {
                NewProjectDialog npd = new NewProjectDialog();
                npd.ShowDialog();
                twl.save();
            }
            finally
            {
                if (sm != null)
                {
                    sm.Dispose();
                    sm.Close();
                }
            }
            this.DataContext = this;
        }
Exemplo n.º 2
0
 /*----------------------------Konstruktor------------------------*/
 private GlowingEarth()
 {
     InitializeComponent();
     mc  = new Model.MasterClass();
     _mc = new Model.MasterClass();
 }
Exemplo n.º 3
0
 public void setMaster(Model.MasterClass mcc)
 {
     _mc = mcc;
     mc  = _mc;
 }