Example #1
0
        public App()
        {
            //// Show graphics profiling information while debugging.
            //if (System.Diagnostics.Debugger.IsAttached) {
            //    // Display the current frame rate counters.
            //    Application.Current.Host.Settings.EnableFrameRateCounter = true;

            //    // Show the areas of the app that are being redrawn in each frame.
            //    //Application.Current.Host.Settings.EnableRedrawRegions = true;

            //    // Enable non-production analysis visualization mode,
            //    // which shows areas of a page that are handed off to GPU with a colored overlay.
            //    //Application.Current.Host.Settings.EnableCacheVisualization = true;

            //    // Disable the application idle detection by setting the UserIdleDetectionMode property of the
            //    // application's PhoneApplicationService object to Disabled.
            //    // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
            //    // and consume battery power when the user is not using the phone.
            //    PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            //}

            InitializeComponent();

            var init = new Init();

            Datastores = init.GetDatastores();
        }
Example #2
0
        // Handle script reload
        private void comboBox_script_type_SelectedIndexChanged(object sender, EventArgs e)
        {
            // close all editors
            foreach (Form item in MdiChildren)
            {
                if (item is NPCEditor)
                {
                    (item as NPCEditor).Close();
                }
            }

            // creature_ai_scripts
            if (comboBox_script_type.SelectedIndex == 0)
            {
                Datastores.ReloadDB();
            }
            else
            {
                Datastores.LoadDBScripts(Info.ScriptTemplate[comboBox_script_type.SelectedIndex, 1]);
                Datastores.LoadDBScriptTexts();
            }


            UpdateNPCListBox();
        }
Example #3
0
 private void reloadDatabaseToolStripMenuItem_Click(object sender, EventArgs e)
 {
     foreach (Form item in MdiChildren)
     {
         item.Close();
     }
     creatures.npcList.Clear();
     creatures.npcsAvailable.Clear();
     summons.map.Clear();
     localized_texts.map.Clear();
     Datastores.ReloadDB();
     UpdateNPCListBox();
 }
Example #4
0
        public Datastores GetDatastores()
        {
            var dataStores = new Datastores();
            var xmlDatastoreConfiguration = new XmlDatastoreConfiguration(null, null);
            var xmlDatastore = new XmlDatastore(xmlDatastoreConfiguration);

            dataStores.AddDatastore(xmlDatastore);

            var inMemoryDatasToreConfiguration = new InMemoryDatastoreConfiguration();
            var inMemoryDatastore = new InMemoryDatastore();

            dataStores.AddDatastore(inMemoryDatastore);

            dataStores.SelectDatastore(inMemoryDatastore);
            return(dataStores);
        }
Example #5
0
        public MainPage()
        {
            InitializeComponent();


            recorder = new AudioRecorderService();

            Datastores.SetDatabase(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "pocketpro.db"));

            MessagingCenter.Subscribe <NewNotePage, Note>(this, "AddNote", async(obj, item) =>
            {
                var newItem = item as Note;
                await Datastores.Notes.AddItemAsync(newItem);
            });

            MessagingCenter.Subscribe <NewMileagePage, Mileage>(this, "AddMileage", async(obj, item) =>
            {
                var newItem = item as Mileage;
                await Datastores.Mileage.AddItemAsync(newItem);
            });
        }