static void Main(string[] args) { using (Harjoitukset game = new Harjoitukset()) { #if !DEBUG game.IsFullScreen = true; #endif game.Run(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { harkat = new Harjoitukset(); string path = System.Web.Configuration.WebConfigurationManager.AppSettings["harjoitukset"]; path = Server.MapPath("~/" + path); try { Serialisointi.deSerialisoiHarjoitukset(path, ref harkat); bindListBox(); lblInfo.Text = "harjoituksia yht : "+harkat.harkat.Count; } catch { lblInfo.Text = "Ei ole vielä harjoituksia!"; } ViewState["harkat"] = harkat; } else { harkat = (Harjoitukset)ViewState["harkat"]; } if (Session["UserAuthentication"] != null) { LoginWindow.Visible = false; btnLogout.Visible = true; uusiHarjoitus.Visible = true; listViewContainer.Visible = true; txtKayttaja.Text = (string)Session["UserAuthentication"]; } else { Session["UserAuthentication"] = null; lblInfo.Text = null; listViewContainer.Visible = false; uusiHarjoitus.Visible = false ; LoginWindow.Visible = true; btnLogout.Visible = false; } bindList(); }