コード例 #1
0
        /// <summary>
        /// NotifyIconWrapper クラス を生成、初期化します。
        /// </summary>
        public NotifyIconWrapper()
        {
            // コンポーネントの初期化
            InitializeComponent();

            // タイマーのインスタンスを生成
            _timeInterval = new TimeInterval();
            _timeInterval.LoadJson();
            _pomodoroTime = new PomodoroTimer(_timeInterval);
            _pomodoroTime.PomodoroTimerTickEventHandler += new PomodoroTimer.TimerTickEventHandler(CallBackEventProgress);

            // Window の初期化
            _settingsVM    = new SettingsVM(_timeInterval);
            _endPomodoroVM = new EndPomodoroVM(_pomodoroTime);
            _taskListVM    = new TaskListVM();

            // コンテキストメニューのイベントを設定
            this.toolStripMenuItem_Exit.Click      += this.toolStripMenuItem_Exit_Click;
            this.toolStripMenuItem_Start.Click     += this.toolStripMenuItem_Start_Click;
            this.toolStripMenuItem_Break.Click     += this.toolStripMenuItem_Break_Click;
            this.toolStripMenuItem_LongBreak.Click += this.toolStripMenuItem_LongBreak_Click;
            this.toolStripMenuItem_Settings.Click  += this.toolStripMenuItem_Settings_Click;
            this.toolStripMenuItem_TaskEdit.Click  += this.toolStripMenuItem_TaskEdit_Click;

            // TextBox の初期化
            toolStripMenuItem_TimeText.Text = "00:00";
        }
コード例 #2
0
 private void _saveConfigFile(object obj)
 {
     if (ProjectControlVM.CanRun)
     {
         SettingsVM.SaveConfigFile(ProjectControlVM.SelectedProject.SelectedRun.ConfigFilePath);
     }
     else
     {
         var config = JsonConvert.SerializeObject(SettingsVM, Formatting.Indented);
         ProjectControlVM.AddTask(ProjectControlVM.SelectedProject);
         using (StreamWriter outputFile = new StreamWriter(ProjectControlVM.SelectedProject.SelectedRun.ConfigFilePath))
         {
             outputFile.WriteLine(config);
         }
         if (File.Exists(ProjectControlVM.SelectedProject.SelectedRun.ConfigFilePath))
         {
             try
             {
                 SettingsVM.ReadConfigFile(ProjectControlVM.SelectedProject.SelectedRun.ConfigFilePath);
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
         if (CurrentView is SettingsViewModel)
         {
             CurrentView = SettingsVM;
         }
     }
 }
コード例 #3
0
        public ActionResult ChangePassword(SettingsVM changeObj)
        {
            if (ModelState.IsValid)
            {
                using (db)
                {
                    var usr = db.UserAccounts.Where(u => u.UserName.Equals(User.Identity.Name.ToString())).FirstOrDefault();
                    var doesPasswordMatch = Crypto.VerifyHashedPassword(usr.Password, changeObj.ChangePasswordVM.OldPassword);
                    if (doesPasswordMatch == true)
                    {
                        var newHashedPassword = Crypto.HashPassword(changeObj.ChangePasswordVM.NewPassword);

                        usr.Password = newHashedPassword;
                        db.Entry(usr).CurrentValues.SetValues(usr);
                        db.SaveChanges();
                        TempData["SuccessPass"] = true;
                    }
                    else
                    {
                        TempData["FailPass"] = true;
                    }
                    ModelState.Clear();
                }
            }
            return(RedirectToAction("Index", "Settings"));
        }
        public async Task <IActionResult> Index()
        {
            var user = await _userManager.GetUserAsync(User);

            var currentprofile = db.Profile.FirstOrDefault(p => p.UsersId == user.Id);

            if (currentprofile.Disabled)
            {
                return(RedirectToAction("Ban", "Home", new { currentprofile.id }));
            }

            // take blocked users
            List <Users> BlockedUsers = new List <Users>();
            List <Users> Allusers     = db.Users.ToList();

            List <Blocklist> blcList = db.Blocklist.Where(b => b.blockerId == user.Id).ToList();

            foreach (var item in blcList)
            {
                BlockedUsers.Add(Allusers.FirstOrDefault(u => u.Id == item.blockedId));
            }

            var model = new SettingsVM()
            {
                Profile   = db.Profile.FirstOrDefault(p => p.UsersId == user.Id),
                User      = user,
                Blocklist = BlockedUsers
            };

            return(View(model));
        }
コード例 #5
0
        public ResponseVM ProfileUpdate(SettingsVM obj, int userID)
        {
            Users user = db.Users.Find(userID);

            user.Username = obj.username;
            if (!string.IsNullOrWhiteSpace(obj.phone))
            {
                user.Phone = obj.phone;
            }
            else
            {
                user.Phone = null;
            }
            user.Email     = obj.email;
            user.Password  = obj.password;
            user.CountryID = obj.countryID;

            db.SaveChanges();

            return(new ResponseVM
            {
                responseCode = 200,
                responseMessage = "Ok."
            });
        }
コード例 #6
0
        public async Task <IActionResult> AppSettings()
        {
            CreateBreadCrumb(new[] { new { Name = "Home", ActionUrl = "#" },
                                     new { Name = "Settings", ActionUrl = "/Account/AppSettings" } });

            BaseViewModel VModel = null;

            var TempVModel = new SettingsVM
            {
                MailSettings       = new MailSettingBM(),
                AppGeneralSettings = new GeneralSettingBM()
            };

            var oMailSetup = await _AppSettingService.GetMailSetting().ConfigureAwait(false);

            TempVModel.MailSettings = oMailSetup;

            var oGeneralSetup = await _AppSettingService.GetAppGeneralSetting().ConfigureAwait(false);

            TempVModel.AppGeneralSettings = oGeneralSetup;

            VModel = await GetViewModel(TempVModel);

            return(View(VModel));
        }
コード例 #7
0
ファイル: Settings.xaml.cs プロジェクト: SamirHafez/Bantu
        public Settings()
        {
            InitializeComponent();
            DataContext = this;

            SettingsVM = new SettingsVM();
        }
コード例 #8
0
        public async Task <JsonResult> AppSettings(SettingsVM model)
        {
            if (ModelState.IsValid)
            {
                CommonResponce result      = null;
                string         ActivityMsg = "";
                if (model.Flag.Equals("GENERALSetting"))
                {
                    result = await _AppSettingService.SaveGeneralSetting(model.AppGeneralSettings).ConfigureAwait(false);

                    ActivityMsg = "Changed App Settings";
                }
                else
                {
                    result = await _AppSettingService.SaveMailSetting(model.MailSettings).ConfigureAwait(false);

                    ActivityMsg = "Changed Email Settings";
                }

                if (result.Stat)
                {
                    await GetBaseService().AddActivity(ActivityType.Update, model.BUserID, model.BUserName, "Settings", ActivityMsg);

                    return(Json(new { stat = true, msg = "Successfully Changed settings" }));
                }
                else
                {
                    return(Json(new { stat = false, msg = result.StatusMsg }));
                }
            }
            else
            {
                return(Json(new { stat = false, msg = "Invalid application settings" }));
            }
        }
コード例 #9
0
        public ActionResult Settings(SettingsVM settingsVM)
        {
            var userId   = User.Identity.GetUserId();
            var settings = _context.Settings.Where(x => x.UserId == userId).FirstOrDefault();

            if (settings != null)
            {
                settings.StartTime = settingsVM.StartTime;
                settings.EndTime   = settingsVM.EndTime;
                settings.IsAutoAcceptAppointment = settingsVM.IsAutoAcceptAppointment;
                settings.SendEmailNotification   = settingsVM.SendEmailNotification;
                _context.SaveChanges();
            }
            else
            {
                settings           = new Settings();
                settings.UserId    = userId;
                settings.StartTime = settingsVM.StartTime;
                settings.EndTime   = settingsVM.EndTime;
                settings.IsAutoAcceptAppointment = settingsVM.IsAutoAcceptAppointment;
                settings.SendEmailNotification   = settingsVM.SendEmailNotification;
                _context.Settings.Add(settings);
                _context.SaveChanges();
            }
            return(RedirectToActionPermanent("Index", "Appointment"));
        }
コード例 #10
0
        public SettingsDialog()
        {
            InitializeComponent();

            DataContext = _viewModel = new SettingsVM();
            Loaded     += SettingsDialog_Loaded;
        }
コード例 #11
0
        /// <summary>
        /// Get all settings
        /// </summary>
        /// <returns>Settings object</returns>
        public SettingsVM Get()
        {
            var vm = new SettingsVM();

            vm.Settings = GetSettings();

            return(vm);
        }
コード例 #12
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (ViewModel == null)
     {
         ViewModel = new SettingsVM();
     }
     base.OnNavigatedTo(e);
 }
コード例 #13
0
        private async void SaveAddressDetailsClicked(object sender, RoutedEventArgs e)
        {
            if (ViewModel == null)
            {
                ViewModel = DataContext as SettingsVM;
            }

            await ViewModel.SaveAddress(ViewModel.UserAddress);
        }
コード例 #14
0
        private async void RestoreButtonClicked(object sender, RoutedEventArgs e)
        {
            if (ViewModel == null)
            {
                ViewModel = DataContext as SettingsVM;
            }

            await ViewModel.Restore();
        }
コード例 #15
0
        public SettingsWindow()
        {
            InitializeComponent();

            _vm = this.AssertViewModel <SettingsVM>();

            Translations.LanguageChanged += Translations_LanguageChanged;
            WindowUtils.InitWindow(this);
        }
コード例 #16
0
        public LogAtomDetailsConverter()
        {
            LogView logView = ServiceLocator.Current.GetInstance <LogView>();

            matchers = logView.Matchers;

            MainViewModel vm = ServiceLocator.Current.GetInstance <MainViewModel>();

            settingsVM = vm.SettingsVM;
        }
コード例 #17
0
        public SettingsPage()
        {
            InitializeComponent();

            viewModel = new SettingsVM();

            BindingContext = viewModel;

            Title = "Configurações";
        }
コード例 #18
0
 public SettingsUserControl()
 {
     InitializeComponent();
     // Create SettingsVM to bind data from. import dirs from it.
     // and add method NotifyServerRemove to listen to each property (handler) change.
     this.svm                = new SettingsVM();
     PropertyChanged        += this.svm.NotifyServerRemove;
     this.DataContext        = this.svm;
     handlerList.ItemsSource = this.svm.HandlerDirsList;
 }
コード例 #19
0
ファイル: Settings.xaml.cs プロジェクト: RemSoftDev/Wouter
        public Settings()
        {
            InitializeComponent();

            DataContext = new SettingsVM();

            var fb = new ApplicationBarMenuItem(AppResources.SendFeedback);

            fb.Click += SendFeedbackClick;
            ApplicationBar.MenuItems.Add(fb);
        }
コード例 #20
0
        public MainPage()
        {
            InitializeComponent();
            DataContext = this;

            Games    = new ObservableCollection <GameVM>();
            Player   = new PlayerVM();
            Settings = new SettingsVM();

            Manager.GameEventToast += ReceivedToast;
        }
コード例 #21
0
        public MenuVM()
        {
            tableVM    = new TableVM();
            accountVM  = new AccountVM();
            settingsVM = new SettingsVM();
            infoVM     = new InfoVM();

            CurrentActionVM = tableVM;

            // Повесить команды на MenuButtonClick
            MenuButtonClick = new RelayCommand(ClickExecute);
        }
コード例 #22
0
ファイル: Settings (copy).cs プロジェクト: RemSoftDev/Wouter
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Settings);
            SetSupportActionBar(FindViewById <Android.Support.V7.Widget.Toolbar> (Resource.Id.toolbar));

            this.SupportActionBar.Title = AppResources.PageTitleSettings;            //.ToUpper ();

                        #if DEBUG
            screenshotview = FindViewById(Resource.Id.contentpanel);
                        #endif

            SettingsVM   vm   = new SettingsVM();
            NotifySinker sink = new NotifySinker(vm);

            Binding.Make(this, Resource.Id.chk_breakfast, vm, x => x.BreakfastReminder);
            Binding.Make(this, Resource.Id.chk_lunch, vm, x => x.LunchReminder);
            Binding.Make(this, Resource.Id.chk_dinner, vm, x => x.DinnerReminder);
            Binding.Make(this, Resource.Id.chk_endofday, vm, x => x.SnackReminder);

            Binding.Make(this, Resource.Id.edt_breakfast, vm, x => x.BreakfastReminderTime);
            Binding.Make(this, Resource.Id.edt_lunch, vm, x => x.LunchReminderTime);
            Binding.Make(this, Resource.Id.edt_dinner, vm, x => x.DinnerReminderTime);
            Binding.Make(this, Resource.Id.edt_endofday, vm, x => x.SnackReminderTime);

            pinbutton        = this.FindViewById <Button> (Resource.Id.PinToStart);
            pinbutton.Click += PinToStart;
            //Binding.Make(this, Resource.Id.PinToStart, vm, x => {PinToStart();});

            this.FindViewById <TextView> (Resource.Id.caloriesTitle).Text = vm.CaloriesTitle;
            Binding.Make(this, Resource.Id.caloriesGoal, vm, x => x.CalorieGoal);
            this.FindViewById <TextView> (Resource.Id.totalFatTitle).Text = vm.TotalFatTitle;
            Binding.Make(this, Resource.Id.totalFatGoal, vm, x => x.TotalFatGoal);
            this.FindViewById <TextView> (Resource.Id.carbsTitle).Text = vm.CarbsTitle;
            Binding.Make(this, Resource.Id.carbsGoal, vm, x => x.CarbsGoal);
            this.FindViewById <TextView> (Resource.Id.proteinTitle).Text = vm.ProteinTitle;
            Binding.Make(this, Resource.Id.proteinGoal, vm, x => x.ProteinGoal);

            Binding.Make(this, Resource.Id.chk_snacksCombined, vm, x => x.SnacksCombined, sink);
            Binding.Make(this, Resource.Id.chk_snacksCombined, vm, x => x.SnacksCombinedVisibility, sink);
            Binding.Make(this, Resource.Id.chk_snackMorningEnabled, vm, x => x.SnackMorningEnabled, sink);
            Binding.Make(this, Resource.Id.chk_snackMorningEnabled, vm, x => x.SnackMorningVisibility, sink);
            Binding.Make(this, Resource.Id.chk_snackEarlyAfternoonEnabled, vm, x => x.SnackEarlyAfternoonEnabled, sink);
            Binding.Make(this, Resource.Id.chk_snackEarlyAfternoonEnabled, vm, x => x.SnackEarlyAfternoonVisibility, sink);
            Binding.Make(this, Resource.Id.chk_snackAfternoonEnabled, vm, x => x.SnackAfternoonEnabled, sink);
            Binding.Make(this, Resource.Id.chk_snackAfternoonEnabled, vm, x => x.SnackAfternoonVisibility, sink);
            Binding.Make(this, Resource.Id.chk_snackEveningEnabled, vm, x => x.SnackEveningEnabled, sink);
            Binding.Make(this, Resource.Id.chk_snackEveningEnabled, vm, x => x.SnackEveningVisibility, sink);
            Binding.Make(this, Resource.Id.chk_snackMidnightEnabled, vm, x => x.SnackMidnightEnabled, sink);
            Binding.Make(this, Resource.Id.chk_snackMidnightEnabled, vm, x => x.SnackMidnightVisibility, sink);
        }
コード例 #23
0
        /// <summary>
        /// Get all settings
        /// </summary>
        /// <returns>Settings object</returns>
        public SettingsVM Get()
        {
            if (!Security.IsAuthorizedTo(Rights.AccessAdminSettingsPages))
            {
                throw new System.UnauthorizedAccessException();
            }

            var vm = new SettingsVM();

            vm.Settings = GetSettings();

            return(vm);
        }
コード例 #24
0
        private async void ToggleSwitch_Toggled(object sender, RoutedEventArgs e)
        {
            ViewModel = DataContext as SettingsVM;
            var toggleSwitch = sender as ToggleSwitch;

            if (toggleSwitch?.IsOn == true)
            {
                await ViewModel.OneDriveSetupAsync();
            }
            else if (toggleSwitch?.IsOn == false)
            {
                await ViewModel.LogOutAsync();
            }
        }
コード例 #25
0
        private async void AddressChecked(object sender, RoutedEventArgs e)
        {
            if (ViewModel == null)
            {
                ViewModel = DataContext as SettingsVM;
            }
#if NETFX_CORE
            if (ViewModel == null)
            {
                return;
            }
#endif
            ViewModel.UserAddress.Type = AddressType.Billing;
        }
コード例 #26
0
        public SettingsPage()
            : base()
        {
            InitializeComponent();
            base.Initialize();

            this.Loaded += new RoutedEventHandler(SettingsPage_Loaded);

            viewModel = Resources["ViewModel"] as SettingsVM;

#if SCREENSHOT
            SystemTray.IsVisible = false;
#endif
        }
コード例 #27
0
ファイル: MainWindowViewModel.cs プロジェクト: wssh/ApexParse
 private void Current_Exit(object sender, System.Windows.ExitEventArgs e)
 {
     Console.WriteLine("Saving settings");
     Settings.Default.HighlightDPS                 = HighlightDPS;
     Settings.Default.BackgroundImagePath          = BackgroundImagePath == null ? string.Empty : BackgroundImagePath;
     Settings.Default.EnabledLineSeries            = LineSeriesSettings.GetEnumValue().ToString();
     Settings.Default.DetailedDamageVisibleColumns = DetailedDamageVisibleSettings.GetEnum().ToString();
     Settings.Default.HiddenDamageTypes            = DamageTypesSettings.GetHiddenTrackersEnum().ToString();
     Settings.Default.SplitDamageTypes             = DamageTypesSettings.GetSeparatedTrackersEnum(false).ToString();
     Settings.Default.ShortenDPSReadout            = ShortenDPSReadout;
     Settings.Default.OpenGraphForSelf             = OpenGraphForSelfAutomatically;
     Settings.Default.AnonymizePlayers             = AnonymizePlayers;
     SettingsVM.SaveSettings();
     Settings.Default.Save();
     Console.WriteLine("Settings saved");
 }
コード例 #28
0
        internal Settings()
        {
            InitializeComponent();
            DataContext = new SettingsVM();

            // Acquire scan lock to prevent issues when changing hot settings
            scanLockTask = Task.Run(() =>
            {
                // Wait if currently scanning a item
                while (RatScannerMain.Instance.ScanLock)
                {
                    Thread.Sleep(25);
                }
                RatScannerMain.Instance.ScanLock = true;
            });
        }
コード例 #29
0
        public void SetHomePage()
        {
            Home     = HomeVM.GetInstance();
            MainData = DataVM.GetInstance();
            Settings = SettingsVM.GetInstance();
            CredentialForServerVM.GetInstance();
            ChildrenAddVM.GetInstance();

            MainData.backspaceButton += SetPreviousPage;
            Settings.backspaceButton += SetPreviousPage;
            Home.dataButton          += SetDataPage;
            Home.settingsButton      += SetSettingsPage;
            Home.singOut             += SetPreviousPage;

            CurrentPage = Home;
        }
コード例 #30
0
ファイル: App.xaml.cs プロジェクト: quanljh/Quan
        private async Task ApplicationSetupAsync()
        {
            // Setup the Quan Framework
            Framework.Construct <DefaultFrameworkConstruction>()
            .AddFileLogger("QuanLog.txt")
            .AddClientDataStore()
            .AddQuanWordViewModels()
            .AddQuanWordClientServices()
            .Build();

            // Ensure the client data store
            await ClientDataStore.EnsureDataStoreAsync();

            // Load new settings
            await SettingsVM.LoadAsync();
        }