示例#1
0
        // Constructor
        public App()
        {
            BugSenseHandler.Instance.InitAndStartSession(new ExceptionManager(Current), RootFrame, "8279d9f3");

            Data          = new FeedHelper.FeedData();
            Data.FeedList = new ObservableCollection <string>();

            if (System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings.Count != 0)
            {
                foreach (string key in System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings.Keys)
                {
                    Data.FeedList.Add(System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings[key].ToString());
                    Debug.WriteLine(System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings[key].ToString());
                }
            }
            if (Data.FeedList.Count == 0)
            {
                App.Data.FeedList.Add("http://smartfiction.ru?json=get_recent_posts&count=4");
            }

            using (StoryDataContext context = ConnectionFactory.GetStoryDataContext())
            {
                //context.DeleteDatabase();
                if (context.DatabaseExists() == false)
                {
                    context.CreateDatabase();
                }
            }

            ViewModel = new ViewModel.MainViewModel();

            //CopyToIsolatedStorage();
            //Utilities.hyphenator = OpenLocal("Hyphenator.js");

            //ADDED
            ViewModel.FeedItems = new ObservableCollection <ViewModel.ContentItem>();
            UnhandledException += Application_UnhandledException;
            InitializeComponent();
            InitializePhoneApplication();
        }
示例#2
0
        // Constructor
        public App()
        {
            BugSenseHandler.Instance.Init(this, "a9b557af");

            Data          = new FeedHelper.FeedData();
            Data.FeedList = new ObservableCollection <string>();

            if (System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings.Count != 0)
            {
                foreach (string key in System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings.Keys)
                {
                    Data.FeedList.Add(System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings[key].ToString());
                    Debug.WriteLine(System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings[key].ToString());
                }
            }
            if (Data.FeedList.Count == 0)
            {
                App.Data.FeedList.Add("http://smartfiction.ru?json=get_recent_posts&count=4");
            }

            using (StoryDataContext context = ConnectionFactory.GetStoryDataContext())
            {
                //context.DeleteDatabase();
                if (context.DatabaseExists() == false)
                {
                    context.CreateDatabase();
                }
            }

            ViewModel = new ViewModel.MainViewModel();

            //ADDED
            ViewModel.FeedItems = new ObservableCollection <ViewModel.ContentItem>();
            BugSenseHandler.Instance.UnhandledException += Application_UnhandledException;
            //UnhandledException += Application_UnhandledException;
            InitializeComponent();
            InitializePhoneApplication();
        }