Beispiel #1
0
        public IBusControl CreateBus(IBusServiceConfigurator busServiceConfigurator, string serviceName)
        {
            serviceName = serviceName.ToLowerInvariant().Trim().Replace(" ", "_");

            var hostSettings = new SettingsAdapter(_settings, serviceName);

            if (hostSettings.ServiceUri == null)
            {
                throw new ConfigurationException("The ServiceBus ServiceUri setting has not been configured");
            }

            return(AzureBusFactory.CreateUsingServiceBus(configurator =>
            {
                var host = configurator.Host(hostSettings.ServiceUri, h =>
                {
                    h.SharedAccessSignature(s =>
                    {
                        s.KeyName = hostSettings.KeyName;
                        s.SharedAccessKey = hostSettings.SharedAccessKey;
                        s.TokenTimeToLive = hostSettings.TokenTimeToLive;
                        s.TokenScope = hostSettings.TokenScope;
                    });
                });

                if (_log.IsInfoEnabled)
                {
                    _log.Info($"Configuring Host: {hostSettings.ServiceUri}");
                }

                var serviceConfigurator = new ServiceBusServiceConfigurator(configurator, host);

                busServiceConfigurator.Configure(serviceConfigurator);
            }));
        }
        public IBusControl CreateBus(IBusServiceConfigurator busServiceConfigurator, string serviceName)
        {
            serviceName = serviceName.ToLowerInvariant().Trim().Replace(" ", "_");

            var hostSettings = new SettingsAdapter(_settings, serviceName);

            if (hostSettings.ServiceUri == null)
                throw new ConfigurationException("The ServiceBus ServiceUri setting has not been configured");

            return AzureBusFactory.CreateUsingServiceBus(configurator =>
            {
                var host = configurator.Host(hostSettings.ServiceUri, h =>
                {
                    h.SharedAccessSignature(s =>
                    {
                        s.KeyName = hostSettings.KeyName;
                        s.SharedAccessKey = hostSettings.SharedAccessKey;
                        s.TokenTimeToLive = hostSettings.TokenTimeToLive;
                        s.TokenScope = hostSettings.TokenScope;
                    });
                });

                if (_log.IsInfoEnabled)
                    _log.Info($"Configuring Host: {hostSettings.ServiceUri}");

                var serviceConfigurator = new ServiceBusServiceConfigurator(configurator, host);

                busServiceConfigurator.Configure(serviceConfigurator);
            });
        }
        public void CanConvertStringSettingsToEncodingUsingConverters()
        {
            var model = new SettingsAdapter().Create <DataCoding>(_dict);

            Assert.That(model.Encoding1, Is.TypeOf(typeof(UTF8Encoding)));
            Assert.That(model.Encoding2, Is.TypeOf(typeof(ASCIIEncoding)));
        }
Beispiel #4
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                var stat    = SettingsAdapter.Songstime();
                var endsong = SettingsAdapter.Starttime();


                if (TimeBetween(DateTime.Now, stat.TimeOfDay, endsong.TimeOfDay))
                {
                    if (player.playState != WMPPlayState.wmppsPlaying)
                    {
                        var index = Settings.Default.file;

                        // Get the media item at the fourth position in the current playlist.
                        var media = player.currentPlaylist.get_Item(index);

                        // Play the media item.

                        player.Ctlcontrols.playItem(media);
                        //  player.Ctlcontrols.currentPosition = Settings.Default.lasttime;

                        materialRaisedButton1.Enabled = false;
                        //   timer1.Stop();
                        //nowplaying.Text =@"Now playing : "
                        //   + axWindowsMediaPlayer1.currentMedia.name.ToShortDots(30);
                        //duration.Text = axWindowsMediaPlayer1.currentMedia.getMarkerTime(0).ToString();
                    }
                }
            }
            catch
            { //
            }
        }
 private void button4_Click(object sender, EventArgs e)
 {
     try
     {
         _settingsProxy.PointsSource = (int)pointsSourceComboBox.SelectedItem;
         _settingsProxy.PointsCount  = Convert.ToInt32(countNumeric.Value);
         if (listComboBox.SelectedItem != null)
         {
             _settingsProxy.SelectedListId = (listComboBox.SelectedItem as PointListProxy).Id;
         }
         else
         {
             PointListProxy pointListProxy = new PointListProxy()
             {
                 Name = "List1"
             };
             _settingsProxy.SelectedListId = PointListAdapter.SaveItem(pointListProxy).PointListId;
         }
         _settingsProxy.ControlType         = (int)controlTypeComboBox.SelectedItem;
         _settingsProxy.DisplayTime         = Convert.ToInt32(displayTimeNumeric.Value);
         _settingsProxy.Interval            = Convert.ToInt32(intervalNumeric.Value);
         _settingsProxy.BackgroundColorArgb = ColorButton.BackColor.ToArgb();
         SettingsAdapter.SaveSettings(_settingsProxy);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, ex.GetType().ToString());
     }
 }
Beispiel #6
0
        private void frmSettings_Load(object sender, EventArgs e)
        {
            start.Text         = SettingsAdapter.Starttime().ToString("HH:mm:ss tt");
            ptime.Text         = SettingsAdapter.PeriodTime().ToString();
            stime.Text         = SettingsAdapter.Songstime().ToString("HH:mm:ss tt");
            list.Text          = SettingsAdapter.Playlist();
            _path              = SettingsAdapter.Playlist();
            inttime.Text       = SettingsAdapter.Interval().ToString();
            lunch.Text         = SettingsAdapter.Lunch().ToString();
            themelight.Checked = SettingsAdapter.Theme();
            themedark.Checked  = !themelight.Checked;
            RegistryKey k = Registry.CurrentUser.OpenSubKey(
                @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);

            try
            {
                if (k != null)
                {
                    startup.Checked = !string.IsNullOrEmpty(k.GetValue("Bell").ToString());

                    k.Close();
                }
            }
            catch (Exception)
            {
                if (k != null)
                {
                    k.Close();
                }
                startup.Checked = false;
                //MessageBox.Show(ex.Message);
            }
        }
        public override void OnViewCreated (View view, Bundle savedInstanceState)
        {
            base.OnViewCreated (view, savedInstanceState);

            ListView.SetClipToPadding (false);
            ListAdapter = new SettingsAdapter ();
        }
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            ListView.SetClipToPadding(false);
            ListAdapter = new SettingsAdapter();
        }
        public ServiceBusHostBusFactory(ISettingsProvider settingsProvider)
        {
            ServiceBusSettings settings;
            if (!settingsProvider.TryGetSettings("ServiceBus", out settings))
                throw new ConfigurationException("The ServiceBus settings were not available");

            _hostSettings = new SettingsAdapter(settings);
        }
        private static void SaveThemeInSettings(ElementTheme theme)
        {
            var settingsAdapter = new SettingsAdapter();

            settingsAdapter.AddOrUpdate(SETTINGS_KEY, theme.ToString());

            ThemeManager.ChangeTheme(theme == ElementTheme.Dark ? AppTheme.Dark : AppTheme.Light);
        }
        public RabbitMqHostBusFactory(ISettingsProvider settingsProvider)
        {
            RabbitMqSettings settings;
            if (!settingsProvider.TryGetSettings("RabbitMQ", out settings))
                throw new ConfigurationException("The RabbitMQ settings were not available");

            _hostSettings = new SettingsAdapter(settings);
        }
Beispiel #12
0
 protected void Application_Start(object sender, EventArgs e)
 {
     var settings = new SettingsAdapter().Create<ISettings>(WebConfigurationManager.AppSettings);
     FilterConfig.Configure(GlobalFilters.Filters);
     RouteConfig.Configure(RouteTable.Routes);
     ControllerBuilder.Current.SetControllerFactory(new Mvc.CustomControllerFactory(settings));
     ViewEngines.Engines.Clear();
     ViewEngines.Engines.Add(new FeatureBasedRazorViewEngine());
 }
Beispiel #13
0
 public FrmSettings()
 {
     InitializeComponent();
     Title = Text;
     _materialSkinManager.AddFormToManage(this);
     _materialSkinManager.Theme = SettingsAdapter.Theme()
         ? MaterialSkinManager.Themes.Light : MaterialSkinManager.Themes.Dark;
     _materialSkinManager.ColorScheme = new ColorScheme(Primary.Indigo600,
                                                        Primary.Indigo700, Primary.Indigo200, Accent.Red700, TextShade.White);
 }
Beispiel #14
0
        protected void Application_Start(object sender, EventArgs e)
        {
            var settings = new SettingsAdapter().Create <ISettings>(WebConfigurationManager.AppSettings);

            FilterConfig.Configure(GlobalFilters.Filters);
            RouteConfig.Configure(RouteTable.Routes);
            ControllerBuilder.Current.SetControllerFactory(new Mvc.CustomControllerFactory(settings));
            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new FeatureBasedRazorViewEngine());
        }
        public ServiceBusHostBusFactory(ISettingsProvider settingsProvider)
        {
            ServiceBusSettings settings;

            if (!settingsProvider.TryGetSettings("ServiceBus", out settings))
            {
                throw new ConfigurationException("The ServiceBus settings were not available");
            }

            _hostSettings = new SettingsAdapter(settings);
        }
Beispiel #16
0
        public RabbitMqHostBusFactory(ISettingsProvider settingsProvider)
        {
            RabbitMqSettings settings;

            if (!settingsProvider.TryGetSettings("RabbitMQ", out settings))
            {
                throw new ConfigurationException("The RabbitMQ settings were not available");
            }

            _hostSettings = new SettingsAdapter(settings);
        }
 private static void PutSettings <TEmulator>(object o)
     where TEmulator : IEmulator
 {
     if (Global.Emulator is TEmulator)
     {
         var settable = new SettingsAdapter(Global.Emulator);
         settable.PutSettings(o);
     }
     else
     {
         Global.Config.PutCoreSettings <TEmulator>(o);
     }
 }
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            ArrayAdapter <String> adapter = new ArrayAdapter <String>(Activity, Resource.Layout.support_simple_spinner_dropdown_item, ViewModel.CityList);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            SettingsAdapter adapter1 = new SettingsAdapter(Context, ViewModel.CityList);

            City.Adapter = adapter1;
            City.OnItemSelectedListener = this;
            City.SetSelection(ViewModel.CityList.IndexOf(ViewModel.City));
        }
Beispiel #19
0
		private void button1_Click(object sender, EventArgs e)
		{
			var settable = new SettingsAdapter(Global.Emulator);
			if (s != null && settable.HasSettings)
			{
				settable.PutSettings(s);
			}

			if (ss != null && syncsettingschanged)
				GlobalWin.MainForm.PutCoreSyncSettings(ss);

			DialogResult = DialogResult.OK;
			Close();
		}
Beispiel #20
0
        private TSetting GetSyncSettings <TEmulator, TSetting>()
            where TSetting : class, new()
            where TEmulator : IEmulator
        {
            object fromCore = null;
            var    settable = new SettingsAdapter(_emulator);

            if (settable.HasSyncSettings)
            {
                fromCore = settable.GetSyncSettings();
            }

            return(fromCore as TSetting
                   ?? _config.GetCoreSyncSettings <TEmulator, TSetting>()
                   ?? new TSetting());             // guaranteed to give sensible defaults
        }
        private void button1_Click(object sender, EventArgs e)
        {
            var settable = new SettingsAdapter(Global.Emulator);

            if (s != null && settable.HasSettings)
            {
                settable.PutSettings(s);
            }

            if (ss != null && syncsettingschanged)
            {
                GlobalWin.MainForm.PutCoreSyncSettings(ss);
            }

            DialogResult = DialogResult.OK;
            Close();
        }
Beispiel #22
0
 private void SetRecyclerViewAdapters()
 {
     try
     {
         MAdapter      = new SettingsAdapter(this, "Page", PageData);
         LayoutManager = new LinearLayoutManager(this);
         MRecycler.SetLayoutManager(LayoutManager);
         MRecycler.HasFixedSize = true;
         MRecycler.SetItemViewCacheSize(10);
         MRecycler.GetLayoutManager().ItemPrefetchEnabled = true;
         MRecycler.SetAdapter(MAdapter);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Beispiel #23
0
 private void SetRecyclerViewAdapters()
 {
     try
     {
         MAdapter      = new SettingsAdapter(this, "Group", null);
         LayoutManager = new LinearLayoutManager(this);
         MRecycler.SetLayoutManager(LayoutManager);
         MRecycler.HasFixedSize = true;
         MRecycler.SetItemViewCacheSize(10);
         MRecycler.GetLayoutManager().ItemPrefetchEnabled = true;
         MRecycler.SetAdapter(MAdapter);
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
Beispiel #24
0
        private GenericCoreConfig(
            IMainFormForConfig mainForm,
            bool isMovieActive,
            bool ignoreSettings     = false,
            bool ignoreSyncSettings = false)
        {
            InitializeComponent();
            _mainForm = mainForm;

            var settable = new SettingsAdapter(_mainForm.Emulator);

            if (settable.HasSettings && !ignoreSettings)
            {
                _s = settable.GetSettings();
            }

            if (settable.HasSyncSettings && !ignoreSyncSettings)
            {
                _ss = settable.GetSyncSettings();
            }

            if (_s != null)
            {
                propertyGrid1.SelectedObject = _s;
                propertyGrid1.AdjustDescriptionHeightToFit();
            }
            else
            {
                tabControl1.TabPages.Remove(tabPage1);
            }

            if (_ss != null)
            {
                propertyGrid2.SelectedObject = _ss;
                propertyGrid2.AdjustDescriptionHeightToFit();
            }
            else
            {
                tabControl1.TabPages.Remove(tabPage2);
            }

            if (isMovieActive)
            {
                propertyGrid2.Enabled = false;                 // disable changes to sync setting when movie, so as not to confuse user
            }
        }
Beispiel #25
0
        private TSetting GetSyncSettings <TEmulator, TSetting>()
            where TSetting : class, new()
            where TEmulator : IEmulator
        {
            // should we complain if we get a successful object from the config file, but it is the wrong type?
            object fromCore = null;
            var    settable = new SettingsAdapter(_emulator);

            if (settable.HasSyncSettings)
            {
                fromCore = settable.GetSyncSettings();
            }

            return(fromCore as TSetting
                   ?? _config.GetCoreSyncSettings <TEmulator>() as TSetting
                   ?? new TSetting());             // guaranteed to give sensible defaults
        }
Beispiel #26
0
        public ApiAdapter(IDataBaseManagerFactory dbEngine, string address, string port, string table, string login, string password)
        {
            DbManager   = new DatabaseManager(dbEngine, address, port, table, login, password);
            DbConnector = new DbConnector(DbManager);

            LanguageAdapter                = new LanguageAdapter(DbConnector);
            UserAdapter                    = new UserAdapter(DbConnector);
            UserDetailsAdapter             = new UserDetailsAdapter(DbConnector);
            TransactionTypeAdapter         = new TransactionTypeAdapter(DbConnector);
            TransferTypeAdapter            = new TransferTypeAdapter(DbConnector);
            FrequencyAdapter               = new FrequencyAdapter(DbConnector);
            ImportanceAdapter              = new ImportanceAdapter(DbConnector);
            TagAdapter                     = new TagAdapter(DbConnector);
            OperationAdapter               = new OperationAdapter(DbConnector);
            OperationDetailsAdapter        = new OperationDetailsAdapter(DbConnector);
            OperationTagRelationAdapter    = new OperationTagAdapter(DbConnector);
            OperationsGroupAdapter         = new OperationsGroupAdapter(DbConnector);
            OperationsGroupRelationAdapter = new OperationsGroupTagAdapter(DbConnector);
            FilterAdapter                  = new FilterAdapter(DbConnector);
            DashboardAdapter               = new DashboardAdapter(DbConnector);
            DashboardFilterRelationAdapter = new DashboardFilterRelationAdapter(DbConnector);
            BankAdapter                    = new BankAdapter(DbConnector);
            SettingsAdapter                = new SettingsAdapter(DbConnector);
            SchematicTypeAdapter           = new SchematicTypeAdapter(DbConnector);
            SchematicAdapter               = new SchematicAdapter(DbConnector);

            LanguageMapper        = new LanguageMapper();
            UserMapper            = new UserMapper();
            UserDetailsMapper     = new UserDetailsMapper();
            TransactionTypeMapper = new TransactionTypeMapper();
            TransferTypeMapper    = new TransferTypeMapper();
            FrequencyMapper       = new FrequencyMapper();
            ImportanceMapper      = new ImportanceMapper();
            TagMapper             = new TagMapper();
            TagRelationMapper     = new RelationTagMapper();
            OperationMapper       = new OperationMapper();
            OperationsGroupMapper = new OperationsGroupMapper();
            FilterMapper          = new FilterMapper();
            DashboardMapper       = new DashboardMapper();
            DashboardFilterMapper = new DashboardFilterMapper();
            BankMapper            = new BankMapper();
            SettingsMapper        = new SettingsMapper();
            SchematicTypeMapper   = new SchematicTypeMapper();
            SchematicMapper       = new SchematicMapper();
        }
Beispiel #27
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();

                MAdapter           = null;
                SwipeRefreshLayout = null;
                MRecycler          = null;
                PageId             = null;
                PageData           = null;
                MAdView            = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Beispiel #28
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();

                MAdapter           = null !;
                SwipeRefreshLayout = null !;
                MRecycler          = null !;
                PageId             = null !;
                PageData           = null !;
                MAdView            = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        private GenericCoreConfig(MainForm mainForm, bool ignoreSettings = false, bool ignoreSyncSettings = false)
        {
            _mainForm = mainForm;
            InitializeComponent();

            var settable = new SettingsAdapter(Global.Emulator);

            if (settable.HasSettings && !ignoreSettings)
            {
                _s = settable.GetSettings();
            }

            if (settable.HasSyncSettings && !ignoreSyncSettings)
            {
                _ss = settable.GetSyncSettings();
            }

            if (_s != null)
            {
                propertyGrid1.SelectedObject = _s;
                ChangeDescriptionHeight(propertyGrid1);
            }
            else
            {
                tabControl1.TabPages.Remove(tabPage1);
            }

            if (_ss != null)
            {
                propertyGrid2.SelectedObject = _ss;
                ChangeDescriptionHeight(propertyGrid2);
            }
            else
            {
                tabControl1.TabPages.Remove(tabPage2);
            }

            if (Global.MovieSession.Movie.IsActive())
            {
                propertyGrid2.Enabled = false;                 // disable changes to sync setting when movie, so as not to confuse user
            }
        }
 private void SettingsForm_Load(object sender, EventArgs e)
 {
     try
     {
         this.Cursor    = Cursors.WaitCursor;
         _settingsProxy = SettingsAdapter.GetSettings().FirstOrDefault();
         List <PointListProxy> lists = PointListAdapter.GetItems();
         pointListProxyBindingSource.DataSource = lists;
         if (_settingsProxy != null)
         {
             pointsSourceComboBox.SelectedItem = (PointsSource)_settingsProxy.PointsSource;
             countNumeric.Value               = _settingsProxy.PointsCount;
             listComboBox.SelectedItem        = (from qr in lists where qr.Id == _settingsProxy.SelectedListId select qr).FirstOrDefault();
             controlTypeComboBox.SelectedItem = (PointsSource)_settingsProxy.ControlType;
             displayTimeNumeric.Value         = _settingsProxy.DisplayTime;
             intervalNumeric.Value            = _settingsProxy.Interval;
             ColorButton.BackColor            = Color.FromArgb(_settingsProxy.BackgroundColorArgb);
             pathToDbTextBox.Text             = Properties.Settings.Default.PathToDatabase;
         }
         else
         {
             _settingsProxy = new SettingsProxy();
         }
     }
     catch (FileNotFoundException ioEx)
     {
         if (openFileDialog1.ShowDialog() == DialogResult.OK)
         {
             Properties.Settings.Default.PathToDatabase = openFileDialog1.FileName;
             Properties.Settings.Default.Save();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.StackTrace, ex.Message);
     }
     finally
     {
         this.Cursor = Cursors.Arrow;
     }
 }
Beispiel #31
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();
                RewardedVideoAd?.OnDestroy(this);

                MAdapter           = null;
                SwipeRefreshLayout = null;
                MRecycler          = null;
                EmptyStateLayout   = null;
                GroupId            = null;
                GroupDataClass     = null;
                MAdView            = null;
                RewardedVideoAd    = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private static ElementTheme LoadThemeFromSettingsAsync(ApplicationTheme requestedTheme)
        {
            var settingsAdapter = new SettingsAdapter();
            var settingsFacade  = new SettingsFacade(settingsAdapter);

            ElementTheme cacheTheme = ElementTheme.Default;

            string themeName = settingsAdapter.GetValue(SETTINGS_KEY, string.Empty);

            if (!string.IsNullOrEmpty(themeName))
            {
                Enum.TryParse(themeName, out cacheTheme);
            }

            if (cacheTheme == ElementTheme.Default && settingsFacade.Theme.ToString() != requestedTheme.ToString())
            {
                ThemeManager.ChangeTheme(Enum.Parse <AppTheme>(requestedTheme.ToString()));
            }

            return(cacheTheme);
        }
Beispiel #33
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();
                RewardedVideoAd?.OnDestroy(this);

                MAdapter           = null !;
                SwipeRefreshLayout = null !;
                MRecycler          = null !;
                EmptyStateLayout   = null !;
                GroupId            = null !;
                GroupDataClass     = null !;
                MAdView            = null !;
                RewardedVideoAd    = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        public IBusControl CreateBus(IBusServiceConfigurator busServiceConfigurator, string serviceName)
        {
            serviceName = serviceName.ToLowerInvariant().Trim().Replace(" ", "_");

            var hostSettings = new SettingsAdapter(_settings, serviceName);

            if (hostSettings.ServiceUri == null)
            {
                throw new ConfigurationException("The ServiceBus ServiceUri setting has not been configured");
            }

            return(AzureBusFactory.CreateUsingServiceBus(configurator =>
            {
                var host = configurator.Host(hostSettings.ServiceUri, h =>
                {
                    if (!string.IsNullOrWhiteSpace(hostSettings.ConnectionString))
                    {
                        h.TokenProvider = hostSettings.TokenProvider;
                    }
                    else
                    {
                        h.SharedAccessSignature(s =>
                        {
                            s.KeyName = hostSettings.KeyName;
                            s.SharedAccessKey = hostSettings.SharedAccessKey;
                            s.TokenTimeToLive = hostSettings.TokenTimeToLive;
                            s.TokenScope = hostSettings.TokenScope;
                        });
                    }
                });

                LogContext.Info?.Log("Configuring Host: {Host}", hostSettings.ServiceUri);

                var serviceConfigurator = new ServiceBusServiceConfigurator(configurator);

                busServiceConfigurator.Configure(serviceConfigurator);
            }));
        }
        private async void SignalForm_Load(object sender, EventArgs e)
        {
            try
            {
                this.Cursor  = Cursors.WaitCursor;
                this._isBusy = true;
                //this.WindowState = FormWindowState.Maximized;
                //this.FormBorderStyle = FormBorderStyle.None;
                //this.TopMost = true;

                _settings      = SettingsAdapter.GetSettings()?.FirstOrDefault();
                _graphics      = this.CreateGraphics();
                this.BackColor = _settings.BackgroundColor;
                _graphics.Clear(_settings.BackgroundColor);
                if (_settings.PointsSource == (int)PointsSource.FromDatabase)
                {
                    _points = PointListAdapter.GetItemProxy(_settings.SelectedListId);
                }
                else
                {
                    _points = await this.CreatePoints();
                }
            }
            catch (FileNotFoundException ioEx)
            {
                MessageBox.Show("Please set database file in settings", ioEx.Message);
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace, ex.Message);
            }
            finally
            {
                this.Cursor  = Cursors.Arrow;
                this._isBusy = false;
            }
        }
Beispiel #36
0
		GenericCoreConfig(bool ignoresettings, bool ignoresyncsettings)
		{
			InitializeComponent();

			var settable = new SettingsAdapter(Global.Emulator);

			if (settable.HasSettings && !ignoresettings)
				s = settable.GetSettings();
			if (settable.HasSyncSettings && !ignoresyncsettings)
				ss = settable.GetSyncSettings();

			if (s != null)
				propertyGrid1.SelectedObject = s;
			else
				tabControl1.TabPages.Remove(tabPage1);
			if (ss != null)
				propertyGrid2.SelectedObject = ss;
			else
				tabControl1.TabPages.Remove(tabPage2);

			if (Global.MovieSession.Movie.IsActive)
				propertyGrid2.Enabled = false; // disable changes to sync setting when movie, so as not to confuse user
		}
Beispiel #37
0
        public Form1()
        {
            InitializeComponent();

            var digclk = new DigitalClockCtrl
            {
                Size     = new Size(tableLayoutPanel1.GetColumnWidths()[5], tableLayoutPanel1.GetRowHeights()[8]),
                Location = new Point(0, 0),
            };

            tableLayoutPanel1.Controls.Add(digclk, 5, 8);
            digclk.SetDigitalColor    = DigitalColor.BlueColor;
            digclk.BackColor          = MaterialSkinManager.BackgroundDark;
            player.CurrentItemChange += player_CurrentItemChange;
            Icon  = Resources.ic_launcher;
            Title = SoftwareCompleteName;
            var materialSkinManager = MaterialSkinManager.Instance;

            materialSkinManager.AddFormToManage(this);

            materialSkinManager.Theme       = SettingsAdapter.Theme() ? MaterialSkinManager.Themes.Light : MaterialSkinManager.Themes.Dark;
            materialSkinManager.ColorScheme = new ColorScheme(Primary.Indigo600,
                                                              Primary.Indigo700, Primary.Indigo200, Accent.Red100, TextShade.White);

            var t = new[] { start, classmanagment, f1, f2, f3, fd,
                            p1, attendtime
                            , p2, p3, p4,
                            interval,
                            p5, p6,
                            lunch,
                            p7, p8, end8, end0, end, yo };

            foreach (var textField in t)
            {
                textField.ReadOnly = true;
            }
        }
Beispiel #38
0
 /// <summary>
 /// send core settings to emu, setting reboot flag if needed
 /// </summary>
 public void PutCoreSettings(object o)
 {
     var settable = new SettingsAdapter(Global.Emulator);
     if (settable.HasSettings && settable.PutSettings(o))
     {
         FlagNeedsReboot();
     }
 }
        public void BasicTest()
        {
            var obja = new SettingsAdapter().Create<A>(_dict);

            CollectionAssert.AreEquivalent(obja.StringList, new[] { "a", "b", "c" });
            CollectionAssert.AreEquivalent(obja.IntList, new[] { 1, 2, 3, 4 });
        }
        public void MixedTest()
        {
            var objb = new SettingsAdapter().Create<B>(_dict);
            var objc = new SettingsAdapter().Create<C>(_dict);
            var obje = new SettingsAdapter().Create<E>(_dict);

            Assert.AreEqual("SubValue", obje.Nested.Inner);
            Assert.AreEqual("C-Value", objc.Charlie);
        }
Beispiel #41
0
 /// <summary>
 /// send core sync settings to emu, setting reboot flag if needed
 /// </summary>
 public void PutCoreSyncSettings(object o)
 {
     var settable = new SettingsAdapter(Global.Emulator);
     if (Global.MovieSession.Movie.IsActive)
     {
         GlobalWin.OSD.AddMessage("Attempt to change sync-relevant settings while recording BLOCKED.");
     }
     else if (settable.HasSyncSettings && settable.PutSyncSettings(o))
     {
         FlagNeedsReboot();
     }
 }
Beispiel #42
0
        private static void CommitCoreSettingsToConfig()
        {
            // save settings object
            var t = Global.Emulator.GetType();
            var settable = new SettingsAdapter(Global.Emulator);

            if (settable.HasSettings)
            {
                Global.Config.PutCoreSettings(settable.GetSettings(), t);
            }

            if (settable.HasSyncSettings && !Global.MovieSession.Movie.IsActive)
            {
                // don't trample config with loaded-from-movie settings
                Global.Config.PutCoreSyncSettings(settable.GetSyncSettings(), t);
            }
        }
        public void NestedTest()
        {
            var dict = new NameValueCollection()
            {
                { "B:Inner", "Invalid1" },
                { "Other:Inner", "Invalid2" },
                { typeof(E).Namespace + ":Nested:Inner", "SubValue" }
            };

            var obje = new SettingsAdapter().Create<E>(dict);
            Assert.AreEqual("SubValue", obje.Nested.Inner);
        }
		// TODO: This doesn't really belong here, but not sure where to put it
		public static void PopulateWithDefaultHeaderValues(this IMovie movie, string author = null)
		{
			movie.Author = author ?? Global.Config.DefaultAuthor;
			movie.EmulatorVersion = VersionInfo.GetEmuVersion();
			movie.SystemID = Global.Emulator.SystemId;

			var settable = new SettingsAdapter(Global.Emulator);
			if (settable.HasSyncSettings)
			{
				movie.SyncSettingsJson = ConfigService.SaveWithType(settable.GetSyncSettings());
			}

			if (Global.Game != null)
			{
				movie.GameName = PathManager.FilesystemSafeName(Global.Game);
				movie.Hash = Global.Game.Hash;
				if (Global.Game.FirmwareHash != null)
				{
					movie.FirmwareHash = Global.Game.FirmwareHash;
				}
			}
			else
			{
				movie.GameName = "NULL";
			}

			if (Global.Emulator.BoardName != null)
			{
				movie.BoardName = Global.Emulator.BoardName;
			}

			if (Global.Emulator.HasRegions())
			{
				var region = Global.Emulator.AsRegionable().Region;
				if (region == Emulation.Common.DisplayType.PAL)
				{
					movie.HeaderEntries.Add(HeaderKeys.PAL, "1");
				}
			}

			if (Global.FirmwareManager.RecentlyServed.Any())
			{
				foreach (var firmware in Global.FirmwareManager.RecentlyServed)
				{
					var key = firmware.SystemId + "_Firmware_" + firmware.FirmwareId;

					if (!movie.HeaderEntries.ContainsKey(key))
					{
						movie.HeaderEntries.Add(key, firmware.Hash);
					}
				}

			}

			if (Global.Emulator is Gameboy && (Global.Emulator as Gameboy).IsCGBMode())
			{
				movie.HeaderEntries.Add("IsCGBMode", "1");
			}

			if (Global.Emulator is SMS && (Global.Emulator as SMS).IsSG1000)
			{
				movie.HeaderEntries.Add("IsSGMode", "1");
			}

			movie.Core = ((CoreAttributes)Attribute
				.GetCustomAttribute(Global.Emulator.GetType(), typeof(CoreAttributes)))
				.CoreName;
		}
Beispiel #45
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.Settings_Main);

            listview = FindViewById<ListView> (Resource.Id.SettingsList);

            String[] map=new String[2];
            map[0]="Brzina osvježavanja lokacije.";
            map[1]="Brzina prebacivanja postavki.";

            String[] pay=new String[4];
            pay[0]="Promijeni sliku registracije";
            pay[1]="Odaberi registraciju";
            pay[2]="Poruke iz inboxa";
            pay[3]="Cijene parkiranja";

            String[] alarm=new String[1];
            alarm[0]="Omogući/Onemogući alarm";
            /*
            alarm[1]="Odaberi zvuk podsjetnika";
            alarm[2]="Odaberi vrijeme podsjetnika";
            alarm[3]="Odaberi zvuk alarma";*/

            String[] about=new String[1];
            about[0]="O autorima";

            BaseAdapter mapB = new BaseAdapterKlasa (this, map);
            BaseAdapter payB = new BaseAdapterKlasa (this, pay);
            BaseAdapter alarmB = new BaseAdapterKlasa (this, alarm);
            BaseAdapter aboutB = new BaseAdapterKlasa (this, about);

            //			ImageView ivM=FindViewById<ImageView> (Resource.Id.SettingsImage);
            //			ivM.SetImageResource (Resource.Drawable.ociscena_rega);
            //			ImageView ivP=FindViewById<ImageView> (Resource.Id.SettingsImage);
            //			ivP.SetImageResource (Resource.Drawable.main_icon);
            //
            //			ImageView ivA=FindViewById<ImageView> (Resource.Id.SettingsImage);
            //			ivA.SetImageResource (Resource.Drawable.Icon);

            SettingsAdapter sectionAdapter = new SettingsAdapter(this);
            sectionAdapter.AddSection("Mapa", mapB);
            sectionAdapter.AddSection("Plaćanje",payB);
            sectionAdapter.AddSection("Alarm", alarmB);
            sectionAdapter.AddSection("Ostalo", aboutB);

            listview.Adapter = sectionAdapter;
            listview.ItemClick += OnListItemClick;
        }