public static MobileTribunal GetInstance() { if (Instance == null) { Instance = new MobileTribunal(); } return Instance; }
private static MobileTribunal Instance; //This static object allows all classes to reference the other objects in this class #endregion Fields #region Constructors private MobileTribunal() { Instance = this; //this.mainPage = page; poster = new HttpPoster(); getter = new HttpGetter(); currentCase = new ObservableCollection<CaseInfo>(); cookies = new CookieContainer(); headers = new WebHeaderCollection(); region = "na"; caseLoader = new CaseLoader(); }
// Constructor public MainPage() { InitializeComponent(); // Sample code to localize the ApplicationBar //BuildLocalizedApplicationBar(); mobileTribunal = MobileTribunal.GetInstance(); loginHandler = new LoginHandler(mobileTribunal); appSettings = IsolatedStorageSettings.ApplicationSettings; if (appSettings.Contains("Username")) { UsernameWatermark.Visibility = System.Windows.Visibility.Collapsed; UsernameField.Text = appSettings["Username"].ToString(); } if (appSettings.Contains("Remember")) { RememberCheckBox.IsChecked = true; } instance = this; }
public LoginHandler(MobileTribunal tribunal) { this.mobileTribunal = tribunal; }