Ejemplo n.º 1
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            //apply all changes

            #region General tab --------------------------------------------
            // IsShowWelcome
            GlobalSetting.IsShowWelcome = chkWelcomePicture.Checked;
            GlobalSetting.SetConfig("IsShowWelcome", GlobalSetting.IsShowWelcome.ToString());

            //IsShowToolBar
            GlobalSetting.IsShowToolBar = chkShowToolBar.Checked;
            GlobalSetting.SetConfig("IsShowToolbar", GlobalSetting.IsShowToolBar.ToString());

            //IsPortableMode
            GlobalSetting.IsPortableMode = chkPortableMode.Checked;
            if (Environment.GetCommandLineArgs().ToList().IndexOf("--portable") == -1) // Check if user ia using temporary Portable mode from param
            {
                GlobalSetting.SetConfig("IsPortableMode", GlobalSetting.IsPortableMode.ToString(), true);
            }

            //AutoUpdate
            if (chkAutoUpdate.Checked)
            {
                GlobalSetting.SetConfig("AutoUpdate", DateTime.Now.ToString());
            }
            else
            {
                GlobalSetting.SetConfig("AutoUpdate", "0");
            }

            //IsAllowMultiInstances
            GlobalSetting.IsAllowMultiInstances = chkAllowMultiInstances.Checked;
            GlobalSetting.SetConfig("IsAllowMultiInstances", GlobalSetting.IsAllowMultiInstances.ToString());

            //IsPressESCToQuit
            GlobalSetting.IsPressESCToQuit = chkESCToQuit.Checked;
            GlobalSetting.SetConfig("IsPressESCToQuit", GlobalSetting.IsPressESCToQuit.ToString());

            //IsConfirmationDelete
            GlobalSetting.IsConfirmationDelete = chkConfirmationDelete.Checked;
            GlobalSetting.SetConfig("IsConfirmationDelete", GlobalSetting.IsConfirmationDelete.ToString());

            //IsScrollbarsVisible
            GlobalSetting.IsScrollbarsVisible = chkShowScrollbar.Checked;
            GlobalSetting.SetConfig("IsScrollbarsVisible", GlobalSetting.IsScrollbarsVisible.ToString());

            //BackgroundColor
            GlobalSetting.BackgroundColor = picBackgroundColor.BackColor;
            GlobalSetting.SetConfig("BackgroundColor", GlobalSetting.BackgroundColor.ToArgb().ToString());

            #endregion


            #region Image tab ----------------------------------------------
            //IsRecursiveLoading
            GlobalSetting.IsRecursiveLoading = chkFindChildFolder.Checked;
            GlobalSetting.SetConfig("IsRecursiveLoading", GlobalSetting.IsRecursiveLoading.ToString());

            //IsLoopBackViewer
            GlobalSetting.IsLoopBackViewer = chkLoopViewer.Checked;
            GlobalSetting.SetConfig("IsLoopBackViewer", GlobalSetting.IsLoopBackViewer.ToString());

            //IsImageBoosterBack
            GlobalSetting.IsImageBoosterBack = chkImageBoosterBack.Checked;
            GlobalSetting.SetConfig("IsImageBoosterBack", GlobalSetting.IsImageBoosterBack.ToString());

            //ImageLoadingOrder
            GlobalSetting.SetConfig("ImageLoadingOrder", cmbImageOrder.SelectedIndex.ToString());
            GlobalSetting.LoadImageOrderConfig();

            //IsMouseNavigation
            GlobalSetting.IsMouseNavigation = chkMouseNavigation.Checked;
            GlobalSetting.SetConfig("IsMouseNavigation", GlobalSetting.IsMouseNavigation.ToString());

            //ZoomOptimization
            GlobalSetting.ZoomOptimizationMethod = (ZoomOptimizationValue)cmbZoomOptimization.SelectedIndex;
            GlobalSetting.SetConfig("ZoomOptimization", ((int)GlobalSetting.ZoomOptimizationMethod).ToString());

            //IsThumbnailHorizontal
            GlobalSetting.IsThumbnailHorizontal = !chkThumbnailVertical.Checked;
            GlobalSetting.SetConfig("IsThumbnailHorizontal", GlobalSetting.IsThumbnailHorizontal.ToString());

            //MaxThumbnailFileSize
            GlobalSetting.SetConfig("MaxThumbnailFileSize", numMaxThumbSize.Value.ToString());

            //ThumbnailDimension
            int oldValue = GlobalSetting.ThumbnailDimension;                                                                                                                                      //backup old value
            GlobalSetting.ThumbnailDimension = cmbThumbnailDimension.SelectedItem.ToString() == "" ? GlobalSetting.ThumbnailDimension : int.Parse(cmbThumbnailDimension.SelectedItem.ToString()); //Get new value
            if (GlobalSetting.ThumbnailDimension != oldValue)                                                                                                                                     //Only change when the new value selected
            {
                GlobalSetting.SetConfig("ThumbnailDimension", GlobalSetting.ThumbnailDimension.ToString());

                //Request frmMain to update the thumbnail bar
                LocalSetting.IsThumbnailDimensionChanged = true;
            }

            //IsLoopBackSlideShow
            GlobalSetting.IsLoopBackSlideShow = chkLoopSlideshow.Checked;
            GlobalSetting.SetConfig("IsLoopBackSlideShow", GlobalSetting.IsLoopBackSlideShow.ToString());

            //SlideShowInterval
            GlobalSetting.SlideShowInterval = barInterval.Value;
            GlobalSetting.SetConfig("SlideShowInterval", GlobalSetting.SlideShowInterval.ToString());



            #endregion


            #region Language tab -------------------------------------------
            //Language
            GlobalSetting.LangPack = dsLanguages[cmbLanguage.SelectedIndex];

            #endregion


            //Force frmMain applying the configurations
            GlobalSetting.IsForcedActive = true;
        }
Ejemplo n.º 2
0
 private void cmbImageOrder_SelectedIndexChanged(object sender, EventArgs e)
 {
     GlobalSetting.SetConfig("ImageLoadingOrder", cmbImageOrder.SelectedIndex.ToString());
     GlobalSetting.LoadImageOrderConfig();
 }