public OptimizationSettings()
        {
            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();
            saveCmd.Description = "Save";
            saveCmd.Invoked += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();
            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.aMPM = new Choice(this);
            List<string> ampmlist = new List<string>();
            ampmlist.Add("AM");
            ampmlist.Add("PM");
            this.aMPM.Options = ampmlist;

            this.enableOptimization = new BooleanChoice(this);
            this.enableOptimization.Description = "Perform Optimization";
            this.enableOptimization.Value = true;
            this.optimizeNow = new Command();
            this.optimizeNow.Description = "Optimize Now";

            this.optimizationHour = new EditableText(this);
            this.optimizationHour.Value = "4";
            this.optimizationMinute = new EditableText(this);
            this.optimizationMinute.Value = "00";
        }
Exemplo n.º 2
0
 public static void SetupChoiceButton(this Button b, bool v, string a, BooleanChoice c)
 {
     b.GetComponentInChildren <TextMeshProUGUI> ().text = a;
     b.onClick.RemoveAllListeners();
     b.onClick.AddListener(() => { c(v); });
     b.onClick.AddListener(() => { Instance.booleanChoiceUI.SetActive(false); });
 }
Exemplo n.º 3
0
        public BackgroundSettings()
        {
            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();

            saveCmd.Description = "Save";
            saveCmd.Invoked    += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();

            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked    += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.transparancyOptions = new Choice(this);
            this.SetupTransparancyOptions();
            this.transparancyOptions.ChosenChanged += new EventHandler(transparancyOptions_ChosenChanged);

            this.rotationOptions = new Choice(this);
            this.SetupRotationOptions();


            this.enableCustomBackground             = new BooleanChoice(this);
            this.enableCustomBackground.Description = "Enable Custom Background";
            this.enableCustomBackground.Value       = Properties.Settings.Default.EnableMainPageBackDrop;
        }
        public DisplayPreferences(Guid id, Folder folder)
        {
            this.Id = id;

            ArrayList list = new ArrayList();
            foreach (ViewType v in Enum.GetValues(typeof(ViewType)))
                list.Add(ViewTypeNames.GetName(v));
            viewType.Options = list;

            this.viewType.Chosen = ViewTypeNames.GetName(Config.Instance.DefaultViewType);

            //set our dynamic choice options
            this.sortDict = folder.SortOrderOptions;
            this.sortOrders.Options = sortDict.Keys.ToArray();
            this.indexDict = folder.IndexByOptions;
            this.indexBy.Options = folder.IndexByOptions.Keys.ToArray();

            showLabels = new BooleanChoice();
            showLabels.Value = Config.Instance.DefaultShowLabels;

            verticalScroll = new BooleanChoice();
            verticalScroll.Value = Config.Instance.DefaultVerticalScroll;

            useBanner = new BooleanChoice();
            useBanner.Value = false;

            useCoverflow = new BooleanChoice();
            useCoverflow.Value = false;

            useBackdrop = new BooleanChoice();
            useBackdrop.Value = Config.Instance.ShowBackdrop;

            customParms = new Dictionary<string, string>();
            ListenForChanges();
        }
        public BackgroundSettings()
        {
            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();
            saveCmd.Description = "Save";
            saveCmd.Invoked += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();
            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.transparancyOptions = new Choice(this);
            this.SetupTransparancyOptions();
            this.transparancyOptions.ChosenChanged += new EventHandler(transparancyOptions_ChosenChanged);

            this.rotationOptions = new Choice(this);
            this.SetupRotationOptions();

            this.enableCustomBackground = new BooleanChoice(this);
            this.enableCustomBackground.Description = "Enable Custom Background";
            this.enableCustomBackground.Value = Properties.Settings.Default.EnableMainPageBackDrop;
        }
Exemplo n.º 6
0
 public LibraryPage(bool showDeviceContents, MediaType mediaType)
 {
     this.UI = LibraryTemplate;
     this.ShowDeviceContents        = showDeviceContents;
     this._mediaType                = mediaType;
     this._escapePressed            = new Command(this);
     this._tracker                  = new QueryTracker();
     this._tracker.PropertyChanged += new PropertyChangedEventHandler(this.TrackerPropertyChanged);
     this._drmStateMask             = ZuneUI.DrmStateMask.All();
     this._showContentTypes         = new BooleanChoice(this);
 }
        public DisplayPreferences(Guid id)
        {
            this.Id = id;

            ArrayList list = new ArrayList();

            foreach (ViewType v in Enum.GetValues(typeof(ViewType)))
            {
                list.Add(ViewTypeNames.GetName(v));
            }
            viewType.Options = list;

            this.viewType.Chosen = ViewTypeNames.GetName(Config.Instance.DefaultViewType);

            showLabels       = new BooleanChoice();
            showLabels.Value = Config.Instance.DefaultShowLabels;

            verticalScroll       = new BooleanChoice();
            verticalScroll.Value = Config.Instance.DefaultVerticalScroll;

            useBanner       = new BooleanChoice();
            useBanner.Value = false;

            useCoverflow       = new BooleanChoice();
            useCoverflow.Value = false;

            useBackdrop       = new BooleanChoice();
            useBackdrop.Value = Config.Instance.ShowBackdrop;

            ArrayList al = new ArrayList();

            foreach (SortOrder v in Enum.GetValues(typeof(SortOrder)))
            {
                al.Add(SortOrderNames.GetName(v));
            }
            sortOrders.Options = al;

            al = new ArrayList();
            foreach (IndexType v in Enum.GetValues(typeof(IndexType)))
            {
                al.Add(IndexTypeNames.GetName(v));
            }
            indexBy.Options = al;

            sortOrders.ChosenChanged        += new EventHandler(sortOrders_ChosenChanged);
            indexBy.ChosenChanged           += new EventHandler(indexBy_ChosenChanged);
            viewType.ChosenChanged          += new EventHandler(viewType_ChosenChanged);
            showLabels.ChosenChanged        += new EventHandler(showLabels_ChosenChanged);
            verticalScroll.ChosenChanged    += new EventHandler(verticalScroll_ChosenChanged);
            useBanner.ChosenChanged         += new EventHandler(useBanner_ChosenChanged);
            useCoverflow.ChosenChanged      += new EventHandler(useCoverflow_ChosenChanged);
            useBackdrop.ChosenChanged       += new EventHandler(useBackdrop_ChosenChanged);
            thumbConstraint.PropertyChanged += new PropertyChangedEventHandler(thumbConstraint_PropertyChanged);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Create a search filter object given an Experience.
        /// </summary>
        private BooleanChoice CreateSearchPageFilter(SearchPage page, ApplicationExperience experience)
        {
            BooleanChoice filter = new BooleanChoice(page, experience.Description);

            // Stick the associated experience in dynamic data so we can fetch it later.
            filter.Data["Experience"] = experience;

            // Default the filter to "on".
            filter.Value = true;

            return(filter);
        }
Exemplo n.º 9
0
 public FamilySettingChoice(
     IModelItemOwner owner,
     string title,
     string description,
     string blockText,
     string settingId,
     bool showBlockUnrated,
     IList choices)
     : base(owner, description, choices)
 {
     this._title            = title;
     this._settingId        = settingId;
     this._showBlockUnrated = showBlockUnrated;
     this._blockUnrated     = new BooleanChoice(owner, blockText);
     this._choices          = choices;
     this.Clear();
 }
Exemplo n.º 10
0
        public DisplayPreferences(Guid id)
        {
            this.Id = id;

            ArrayList list = new ArrayList();
            foreach (ViewType v in Enum.GetValues(typeof(ViewType)))
                list.Add(ViewTypeNames.GetName(v));
            viewType.Options = list;

            this.viewType.Chosen = ViewTypeNames.GetName(Config.Instance.DefaultViewType);

            showLabels = new BooleanChoice();
            showLabels.Value = Config.Instance.DefaultShowLabels;

            verticalScroll = new BooleanChoice();
            verticalScroll.Value = Config.Instance.DefaultVerticalScroll;

            useBanner = new BooleanChoice();
            useBanner.Value = false;

            useCoverflow = new BooleanChoice();
            useCoverflow.Value = false;

            useBackdrop = new BooleanChoice();
            useBackdrop.Value = Config.Instance.ShowBackdrop;

            ArrayList al = new ArrayList();
            foreach (SortOrder v in Enum.GetValues(typeof(SortOrder)))
                al.Add(SortOrderNames.GetName(v));
            sortOrders.Options = al;

            al = new ArrayList();
            foreach (IndexType v in Enum.GetValues(typeof(IndexType)))
                al.Add(IndexTypeNames.GetName(v));
            indexBy.Options = al;

            sortOrders.ChosenChanged += new EventHandler(sortOrders_ChosenChanged);
            indexBy.ChosenChanged += new EventHandler(indexBy_ChosenChanged);
            viewType.ChosenChanged += new EventHandler(viewType_ChosenChanged);
            showLabels.ChosenChanged += new EventHandler(showLabels_ChosenChanged);
            verticalScroll.ChosenChanged += new EventHandler(verticalScroll_ChosenChanged);
            useBanner.ChosenChanged += new EventHandler(useBanner_ChosenChanged);
            useCoverflow.ChosenChanged += new EventHandler(useCoverflow_ChosenChanged);
            useBackdrop.ChosenChanged += new EventHandler(useBackdrop_ChosenChanged);
            thumbConstraint.PropertyChanged += new PropertyChangedEventHandler(thumbConstraint_PropertyChanged);
        }
 public NetworkSignInDialogHelper(
     EventHandler signInHandler,
     EventHandler cancelHandler,
     string contentUI)
     : base(contentUI)
 {
     this._signInCommand = new Command(this, Shell.LoadString(StringId.IDS_DIALOG_OK), new EventHandler(this.OnInvoked));
     if (signInHandler != null)
     {
         this._signInCommand.Invoked += signInHandler;
     }
     if (cancelHandler != null)
     {
         this.Cancel.Invoked += cancelHandler;
     }
     this._rememberPassword = new BooleanChoice(this, Shell.LoadString(StringId.IDS_PODCAST_SIGN_IN_SAVE));
 }
Exemplo n.º 12
0
        public DisplayPreferences(Guid id, Folder folder)
        {
            this.Id = id;

            ArrayList list = new ArrayList();

            foreach (ViewType v in Enum.GetValues(typeof(ViewType)))
            {
                list.Add(ViewTypeNames.GetName(v));
            }
            viewType.Options = list;

            this.viewType.Chosen = ViewTypeNames.GetName(Config.Instance.DefaultViewType);

            //set our dynamic choice options
            this.sortDict           = folder.SortOrderOptions;
            this.sortOrders.Options = sortDict.Keys.ToArray();
            this.indexDict          = folder.IndexByOptions;
            this.indexBy.Options    = folder.IndexByOptions.Keys.ToArray();

            showLabels       = new BooleanChoice();
            showLabels.Value = Config.Instance.DefaultShowLabels;

            verticalScroll       = new BooleanChoice();
            verticalScroll.Value = Config.Instance.DefaultVerticalScroll;

            useBanner       = new BooleanChoice();
            useBanner.Value = false;

            useCoverflow       = new BooleanChoice();
            useCoverflow.Value = false;

            useBackdrop       = new BooleanChoice();
            useBackdrop.Value = Config.Instance.ShowBackdrop;

            sortOrders.ChosenChanged        += new EventHandler(sortOrders_ChosenChanged);
            indexBy.ChosenChanged           += new EventHandler(indexBy_ChosenChanged);
            viewType.ChosenChanged          += new EventHandler(viewType_ChosenChanged);
            showLabels.ChosenChanged        += new EventHandler(showLabels_ChosenChanged);
            verticalScroll.ChosenChanged    += new EventHandler(verticalScroll_ChosenChanged);
            useBanner.ChosenChanged         += new EventHandler(useBanner_ChosenChanged);
            useCoverflow.ChosenChanged      += new EventHandler(useCoverflow_ChosenChanged);
            useBackdrop.ChosenChanged       += new EventHandler(useBackdrop_ChosenChanged);
            thumbConstraint.PropertyChanged += new PropertyChangedEventHandler(thumbConstraint_PropertyChanged);
        }
 protected override void OnDispose(bool disposing)
 {
     base.OnDispose(disposing);
     if (!disposing)
     {
         return;
     }
     if (this._rememberPassword != null)
     {
         this._rememberPassword.Dispose();
         this._rememberPassword = null;
     }
     if (this._signInCommand == null)
     {
         return;
     }
     this._signInCommand.Dispose();
     this._signInCommand = null;
 }
        public DisplayPreferences(Guid id, Folder folder)
        {
            this.Id = id;

            ArrayList list = new ArrayList();
            foreach (ViewType v in Enum.GetValues(typeof(ViewType)))
                list.Add(ViewTypeNames.GetName(v));
            viewType.Options = list;

            this.viewType.Chosen = ViewTypeNames.GetName(Config.Instance.DefaultViewType);

            //set our dynamic choice options
            this.sortDict = folder.SortOrderOptions;
            this.sortOrders.Options = sortDict.Keys.ToArray();
            this.indexDict = folder.IndexByOptions;
            this.indexBy.Options = folder.IndexByOptions.Keys.ToArray();

            showLabels = new BooleanChoice();
            showLabels.Value = Config.Instance.DefaultShowLabels;

            verticalScroll = new BooleanChoice();
            verticalScroll.Value = Config.Instance.DefaultVerticalScroll;

            useBanner = new BooleanChoice();
            useBanner.Value = false;

            useCoverflow = new BooleanChoice();
            useCoverflow.Value = false;

            useBackdrop = new BooleanChoice();
            useBackdrop.Value = Config.Instance.ShowBackdrop;

            sortOrders.ChosenChanged += new EventHandler(sortOrders_ChosenChanged);
            indexBy.ChosenChanged += new EventHandler(indexBy_ChosenChanged);
            viewType.ChosenChanged += new EventHandler(viewType_ChosenChanged);
            showLabels.ChosenChanged += new EventHandler(showLabels_ChosenChanged);
            verticalScroll.ChosenChanged += new EventHandler(verticalScroll_ChosenChanged);
            useBanner.ChosenChanged += new EventHandler(useBanner_ChosenChanged);
            useCoverflow.ChosenChanged += new EventHandler(useCoverflow_ChosenChanged);
            useBackdrop.ChosenChanged += new EventHandler(useBackdrop_ChosenChanged);
            thumbConstraint.PropertyChanged += new PropertyChangedEventHandler(thumbConstraint_PropertyChanged);
        }
Exemplo n.º 15
0
 protected SubscriptionEndingDialog(DateTime endDate)
     : base("res://ZuneShellResources!BillingOffer.uix#SubscriptionEndingDialogContentUI")
 {
     if (endDate >= DateTime.Today)
     {
         this.m_title     = Shell.LoadString(StringId.IDS_BILLING_SUBSCRIPTION_ENDING_TITLE);
         this.Description = string.Format(Shell.LoadString(StringId.IDS_BILLING_SUBSCRIPTION_ENDING_WARNING), endDate);
     }
     else
     {
         this.m_title     = Shell.LoadString(StringId.IDS_BILLING_SUBSCRIPTION_ENDED_TITLE);
         this.Description = Shell.LoadString(StringId.IDS_BILLING_SUBSCRIPTION_ENDED_WARNING);
     }
     this.m_subscribe                     = new Command(this, Shell.LoadString(StringId.IDS_BILLING_RENEW_SUBSCRIPTION), new EventHandler(this.OnSubscribe));
     this.m_delete                        = new Command(this, Shell.LoadString(StringId.IDS_ACCOUNT_CLEAR_SUBSCRIPTION_BUTTON), new EventHandler(this.OnDeleteInvoked));
     this.Cancel.Invoked                 += new EventHandler(this.OnCancel);
     this.m_neverShowAgain                = new BooleanChoice(this, Shell.LoadString(StringId.IDS_DONT_SHOW_THIS_MESSAGE_AGAIN));
     this.m_neverShowAgain.Value          = false;
     this.m_neverShowAgain.ChosenChanged += new EventHandler(this.OnNeverShowAgain);
 }
Exemplo n.º 16
0
        public DisplayPreferences(Guid id, Folder folder)
        {
            this.Id = id;

            ArrayList list = new ArrayList();

            foreach (ViewType v in Enum.GetValues(typeof(ViewType)))
            {
                list.Add(ViewTypeNames.GetName(v));
            }
            viewType.Options = list;

            this.viewType.Chosen = ViewTypeNames.GetName(Config.Instance.DefaultViewType);

            //set our dynamic choice options
            this.sortDict           = folder.SortOrderOptions;
            this.sortOrders.Options = sortDict.Keys.ToArray();
            this.indexDict          = folder.IndexByOptions;
            this.indexBy.Options    = folder.IndexByOptions.Keys.ToArray();

            showLabels       = new BooleanChoice();
            showLabels.Value = Config.Instance.DefaultShowLabels;

            verticalScroll       = new BooleanChoice();
            verticalScroll.Value = Config.Instance.DefaultVerticalScroll;

            useBanner       = new BooleanChoice();
            useBanner.Value = false;

            useCoverflow       = new BooleanChoice();
            useCoverflow.Value = false;

            useBackdrop       = new BooleanChoice();
            useBackdrop.Value = Config.Instance.ShowBackdrop;

            customParms = new Dictionary <string, string>();
            ListenForChanges();
        }
Exemplo n.º 17
0
        public OptimizationSettings()
        {
            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();

            saveCmd.Description = "Save";
            saveCmd.Invoked    += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();

            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked    += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.aMPM = new Choice(this);
            List <string> ampmlist = new List <string>();

            ampmlist.Add("AM");
            ampmlist.Add("PM");
            this.aMPM.Options = ampmlist;


            this.enableOptimization             = new BooleanChoice(this);
            this.enableOptimization.Description = "Perform Optimization";
            this.enableOptimization.Value       = true;
            this.optimizeNow             = new Command();
            this.optimizeNow.Description = "Optimize Now";

            this.optimizationHour         = new EditableText(this);
            this.optimizationHour.Value   = "4";
            this.optimizationMinute       = new EditableText(this);
            this.optimizationMinute.Value = "00";
        }
Exemplo n.º 18
0
        public UpdaterSettings()
        {
            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();
            saveCmd.Description = "Save";
            saveCmd.Invoked += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();
            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.enableAutomaticUpdates = new BooleanChoice(this);
            this.enableAutomaticUpdates.Description = "Enable Automatic Updates";
            this.enableAutomaticUpdates.Chosen = OMLSettings.EnableAutomaticUpdates;

            this.enableAutomaticUpdatesDailyBuilds = new BooleanChoice(this);
            this.enableAutomaticUpdatesDailyBuilds.Description = "Enable Beta Updates";
            this.enableAutomaticUpdatesDailyBuilds.Chosen = OMLSettings.EnableAutomaticUpdatesDailyBuilds;
        }
Exemplo n.º 19
0
        private void SetupTranscodingOptions()
        {
            this.transcodeAVI = new BooleanChoice(this);
            this.transcodeAVI.Description = "Transcode AVI files";
            this.transcodeMKV = new BooleanChoice(this);
            this.transcodeMKV.Description = "Transcode MKV files";
            this.transcodeOGM = new BooleanChoice(this);
            this.transcodeOGM.Description = "Transcode OGM files";
            this.preserveAudioFormat = new BooleanChoice(this);
            this.preserveAudioFormat.Description = "Preserve audio format";

            this.transcodeAVI.Chosen = OMLSettings.TranscodeAVIFiles;
            this.transcodeMKV.Chosen = OMLSettings.TranscodeMKVFiles;
            this.transcodeOGM.Chosen = OMLSettings.TranscodeOGMFiles;
            this.preserveAudioFormat.Chosen = OMLSettings.PreserveAudioOnTranscode;
        }
Exemplo n.º 20
0
        public GallerySettings()
        {
            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();

            saveCmd.Description = "Save";
            saveCmd.Invoked    += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();

            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked    += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.threeRowOptions = new Choice(this);
            this.SetupThreeRowOptions();

            this.twoRowOptions = new Choice(this);
            this.SetupTwoRowOptions();

            this.EnableAlphaJump             = new BooleanChoice(this);
            this.EnableAlphaJump.Description = "Use Alpha Jump";
            this.EnableAlphaJump.Value       = Properties.Settings.Default.GalleryEnableAlphaJump;

            this.EnableThreeRow             = new BooleanChoice(this);
            this.EnableThreeRow.Description = "Show three rows";
            this.EnableThreeRow.Value       = Properties.Settings.Default.GalleryEnableThreeRow;

            this.EnableTwoRow             = new BooleanChoice(this);
            this.EnableTwoRow.Description = "Show two rows";
            this.EnableTwoRow.Value       = Properties.Settings.Default.GalleryEnableTwoRow;

            this.selectedViewOptions = new Choice(this);
            List <string> selectedViewList = new List <string>();

            //tmp
            selectedViewList.Add(@"List view");
            selectedViewList.Add(@"Poster view");
            //selectedViewList.Add(@"Show titles in a list");
            //selectedViewList.Add(@"Show titles as posters");
            this.selectedViewOptions.Options = selectedViewList;
            //if(Properties.Settings.Default.GallerySelectedView=="list")
            //    this.selectedViewOptions.ChosenIndex = 0;
            //else
            //    this.selectedViewOptions.ChosenIndex = 1;
            this.selectedViewOptions.ChosenIndex = Properties.Settings.Default.GallerySelectedView;
            this.enablePosterOptions             = new BooleanChoice(this);
            this.enablePosterOptions.Value       = false;
            if (this.selectedViewOptions.ChosenIndex == 1)
            {
                this.enablePosterOptions.Value = true;
            }
            this.selectedViewOptions.ChosenChanged += new EventHandler(selectedViewOptions_ChosenChanged);

            this.showUnwatchedIcon             = new BooleanChoice(this);
            this.showUnwatchedIcon.Description = "Show unwatched icon";
            this.showUnwatchedIcon.Value       = OMLEngine.Settings.OMLSettings.ShowUnwatchedIcon;

            this.allowDelete             = new BooleanChoice(this);
            this.allowDelete.Description = "Allow deletion of movies";
            this.allowDelete.Value       = Properties.Settings.Default.AllowDelete;
        }
Exemplo n.º 21
0
 public void ShowBooleanChoiceUI(string a, string b, BooleanChoice c)
 {
     booleanChoiceUI.transform.GetChild(0).GetComponent <Button> ().SetupChoiceButton(true, a, c);
     booleanChoiceUI.transform.GetChild(1).GetComponent <Button> ().SetupChoiceButton(false, b, c);
     booleanChoiceUI.SetActive(true);
 }
        public DisplayPreferences(string id, Folder folder)
        {
            this.Id = new Guid(id);
            Folder = folder;

            ArrayList list = new ArrayList();
            foreach (ViewType v in Enum.GetValues(typeof(ViewType)))
                list.Add(ViewTypeNames.GetName(v));
            viewType.Options = list;

            try
            {
                this.viewType.Chosen = folder.DisplayPreferences != null ? folder.DisplayPreferences.ViewType ?? Config.Instance.DefaultViewType.ToString() : Config.Instance.DefaultViewType.ToString();
            }
            catch (ArgumentException)
            {
                Logging.Logger.ReportError("Invalid view type stored for {0}.  Setting to Poster.", folder.Name ?? folder.GetType().Name);
                viewType.Chosen = Localization.LocalizedStrings.Instance.GetString("PosterDispPref");
            }

            //set our dynamic choice options
            this.sortDict = folder.SortOrderOptions;
            this.sortOrders.Options = sortDict.Keys.ToArray();
            this.indexDict = folder.IndexByOptions;
            this.indexBy.Options = folder.IndexByOptions.Keys.ToArray();
 
            verticalScroll = new BooleanChoice {Value = folder.DisplayPreferences != null && folder.DisplayPreferences.ScrollDirection == ScrollDirection.Vertical};

            useBanner = new BooleanChoice();

            showLabels = new BooleanChoice();

            useCoverflow = new BooleanChoice {Value = false};

            useBackdrop = new BooleanChoice {Value = folder.DisplayPreferences != null ? folder.DisplayPreferences.ShowBackdrop : Config.Instance.ShowBackdrop};

            if (folder.DisplayPreferences != null)
            {
                var width = folder.DisplayPreferences.PrimaryImageWidth > 0 ? folder.DisplayPreferences.PrimaryImageWidth : Config.Instance.DefaultPosterSize.Width;
                var height = folder.DisplayPreferences.PrimaryImageHeight > 0 ? folder.DisplayPreferences.PrimaryImageHeight : Config.Instance.DefaultPosterSize.Height;
            
                customParms = folder.DisplayPreferences.CustomPrefs ?? new Dictionary<string, string>();
                thumbConstraint = new SizeRef(new Size(width, height));
                useBanner.Value = (customParms.GetValueOrDefault("MBCUseBanner", "false") == "true");
                showLabels.Value = (customParms.GetValueOrDefault("MBCShowLabels", "false") == "true");
                try
                {
                    if (Config.Instance.RememberIndexing) indexBy.Chosen = folder.DisplayPreferences.IndexBy;
                }
                catch
                {
                    indexBy.Chosen = Localization.LocalizedStrings.Instance.GetString("NoneDispPref");
                }
            }

            try
            {
                sortOrders.Chosen = folder.DisplayPreferences != null ? folder.DisplayPreferences.SortBy ?? "Name" : "Name";
            }
            catch (ArgumentException)
            {
                Logging.Logger.ReportError("Invalid sort by stored for {0}.  Setting to Name.", folder.Name ?? folder.GetType().Name);
                sortOrders.Chosen = Localization.LocalizedStrings.Instance.GetString("NameDispPref");
            }

            ListenForChanges();
        }
Exemplo n.º 23
0
        public ImageMountingSettings()
        {
            this.descriptiveText = "If your library includes DVD images OML can automatically mount them with either DAEMON Tools Lite or SlySoft Virtual CloneDrive.";
            this.commands        = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();

            saveCmd.Description = "Save";
            saveCmd.Invoked    += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();

            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked    += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            //advanced command
            Command advancedCmd = new Command();

            advancedCmd.Description = "Advanced";
            advancedCmd.Invoked    += new EventHandler(advancedCmd_Invoked);
            this.commands.Add(advancedCmd);


            this.mountingToolChoiceEnabled = new BooleanChoice(this);
            this.useAdvancedSettings       = OMLSettings.MountingToolUseAdvanced;


            this.mountingToolChoice = new Choice(this);
            List <string> toolList = new List <string>();

            if (!String.IsNullOrEmpty(MountingTool.GetMountingToolPath(MountingTool.Tool.DaemonTools)))
            {
                toolList.Add("DAEMON Tools Lite");
                this.enableDaemonTools = false;
            }
            else
            {
                //toolList.Add("DAEMON Tools Lite (Not Installed)");
                this.enableDaemonTools = true;
            }

            if (!String.IsNullOrEmpty(MountingTool.GetMountingToolPath(MountingTool.Tool.VirtualCloneDrive)))
            {
                toolList.Add("Virtual CloneDrive");
                this.enableVirtualCloneDrive = false;
            }
            else
            {
                //toolList.Add("Virtual CloneDrive (Not Installed)");
                this.enableVirtualCloneDrive = true;
            }

            if (toolList.Count == 0)
            {
                toolList.Add("None");
            }
            this.mountingToolChoice.Options = toolList;

            this.virtualDriveOptions         = new Choice(this);
            this.virtualDriveOptions.Options = MountingTool.GetAvailableDriveLetters();

            string chosenDrive = string.Format(@"{0}:\", OMLSettings.VirtualDiscDrive);

            if (this.virtualDriveOptions.Options.IndexOf(chosenDrive) > -1)
            {
                this.virtualDriveOptions.Chosen = chosenDrive;
            }
            else
            {
                this.virtualDriveOptions.ChosenIndex = this.virtualDriveOptions.Options.IndexOf(MountingTool.GetFirstFreeDriveLetter());
            }

            MountingTool.Tool selectedTool = (MountingTool.Tool)OMLSettings.MountingToolSelection;


            this.enableImageMounting             = new BooleanChoice(this);
            this.enableImageMounting.Description = "Enable Image Mounting";
            if (selectedTool != MountingTool.Tool.None)
            {
                this.enableImageMounting.Value = true;
            }
            else
            {
                this.enableImageMounting.Value = false;
            }

            if (this.mountingToolChoice.Options[0].ToString() != "None")
            {
                this.mountingToolChoiceEnabled.Value = true;
                switch (selectedTool)
                {
                case MountingTool.Tool.DaemonTools:
                    this.mountingToolChoice.ChosenIndex = 0;
                    break;

                case MountingTool.Tool.VirtualCloneDrive:
                    if (this.mountingToolChoice.Options.Count > 1)
                    {
                        this.mountingToolChoice.ChosenIndex = 1;
                    }
                    else
                    {
                        this.mountingToolChoice.ChosenIndex = 0;
                    }
                    break;
                }
            }
            else
            {
                this.mountingToolChoiceEnabled.Value = false;    //nothing detected
                this.enableSave = false;
                if (this.useAdvancedSettings == true)
                {
                    this.descriptiveText = "OML is currently configured to use advanced options for image mounting. Use \"Advanced\" to modify these settings.";
                }
                else
                {
                    this.descriptiveText = "OML was unable to automatically detect DAEMON Tools Lite or SlySoft Virtual CloneDrive. One of these tools is required for OML to automatically mount DVD images. \n\nPlease refer to the manual for installation instructions or choose \"Advanced\" if you would like to configure image mounting manually.";
                }
            }
        }
Exemplo n.º 24
0
        public ImageMountingSettingsAdvanced()
        {
            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();

            saveCmd.Description = "Save";
            saveCmd.Invoked    += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();

            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked    += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.mountingToolPath       = new EditableText(this);
            this.mountingToolPath.Value = OMLSettings.MountingToolPath;
            this.mountingToolChoice     = new Choice(this);
            List <string> toolList = new List <string>();

            toolList.Add("DAEMON Tools Lite");
            toolList.Add("Virtual CloneDrive");

            this.mountingToolChoice.Options = toolList;

            this.virtualDriveOptions         = new Choice(this);
            this.virtualDriveOptions.Options = MountingTool.GetAvailableDriveLetters();

            string chosenDrive = string.Format(@"{0}:\", OMLSettings.VirtualDiscDrive);

            if (this.virtualDriveOptions.Options.IndexOf(chosenDrive) > -1)
            {
                this.virtualDriveOptions.Chosen = chosenDrive;
            }
            else
            {
                this.virtualDriveOptions.ChosenIndex = this.virtualDriveOptions.Options.IndexOf(MountingTool.GetFirstFreeDriveLetter());
            }

            MountingTool.Tool selectedTool = (MountingTool.Tool)OMLSettings.MountingToolSelection;


            this.enableImageMounting             = new BooleanChoice(this);
            this.enableImageMounting.Description = "Manually configure image mounting";
            if (selectedTool != MountingTool.Tool.None)
            {
                this.enableImageMounting.Value = true;
            }
            else
            {
                this.enableImageMounting.Value = false;
            }

            switch (selectedTool)
            {
            case MountingTool.Tool.DaemonTools:
                this.mountingToolChoice.ChosenIndex = 0;
                break;

            case MountingTool.Tool.VirtualCloneDrive:
                this.mountingToolChoice.ChosenIndex = 1;
                break;
            }
        }
Exemplo n.º 25
0
        public GallerySettings()
        {
            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();
            saveCmd.Description = "Save";
            saveCmd.Invoked += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();
            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.threeRowOptions = new Choice(this);
            this.SetupThreeRowOptions();

            this.twoRowOptions = new Choice(this);
            this.SetupTwoRowOptions();

            this.EnableAlphaJump = new BooleanChoice(this);
            this.EnableAlphaJump.Description = "Use Alpha Jump";
            this.EnableAlphaJump.Value = Properties.Settings.Default.GalleryEnableAlphaJump;

            this.EnableThreeRow = new BooleanChoice(this);
            this.EnableThreeRow.Description = "Show three rows";
            this.EnableThreeRow.Value = Properties.Settings.Default.GalleryEnableThreeRow;

            this.EnableTwoRow = new BooleanChoice(this);
            this.EnableTwoRow.Description = "Show two rows";
            this.EnableTwoRow.Value = Properties.Settings.Default.GalleryEnableTwoRow;

            this.selectedViewOptions = new Choice(this);
            List<string> selectedViewList = new List<string>();
            //tmp
            selectedViewList.Add(@"List view");
            selectedViewList.Add(@"Poster view");
            //selectedViewList.Add(@"Show titles in a list");
            //selectedViewList.Add(@"Show titles as posters");
            this.selectedViewOptions.Options = selectedViewList;
            //if(Properties.Settings.Default.GallerySelectedView=="list")
            //    this.selectedViewOptions.ChosenIndex = 0;
            //else
            //    this.selectedViewOptions.ChosenIndex = 1;
            this.selectedViewOptions.ChosenIndex = Properties.Settings.Default.GallerySelectedView;
            this.enablePosterOptions = new BooleanChoice(this);
            this.enablePosterOptions.Value = false;
            if (this.selectedViewOptions.ChosenIndex == 1)
                this.enablePosterOptions.Value = true;
            this.selectedViewOptions.ChosenChanged += new EventHandler(selectedViewOptions_ChosenChanged);

            this.showUnwatchedIcon = new BooleanChoice(this);
            this.showUnwatchedIcon.Description = "Show unwatched icon";
            this.showUnwatchedIcon.Value = OMLEngine.Settings.OMLSettings.ShowUnwatchedIcon;

            this.allowDelete = new BooleanChoice(this);
            this.allowDelete.Description = "Allow deletion of movies";
            this.allowDelete.Value = Properties.Settings.Default.AllowDelete;
        }
        public MediaChangerManagerPage()
        {
            this.managerCommands = new ArrayListDataSet(this);

            //save command
            Command rescanCmd = new Command();
            rescanCmd.Description = "Rescan Discs";
            rescanCmd.Invoked += new EventHandler(rescanCmd_Invoked);
            this.managerCommands.Add(rescanCmd);

            this.sortCommands = new Choice(this);
            ArrayListDataSet sortSet = new ArrayListDataSet();

            Command sortByName=new Command(this);
            sortByName.Description="Sort by Name";
            sortSet.Add(sortByName);

            Command sortByType = new Command(this);
            sortByType.Description = "Sort by Type";
            sortSet.Add(sortByType);

            this.sortCommands.Options = sortSet;
            this.SortCommands.ChosenChanged += new EventHandler(SortCommands_ChosenChanged);

            this.enableMediaChangers = new BooleanChoice(this, "Enable support for media changers");
            this.enableMediaChangers.Value = Properties.Settings.Default.MediaChangersEnabled;
            this.detectMediaChangers = new BooleanChoice(this, "Detect new discs added to your changer");
            this.detectMediaChangers.Value = Properties.Settings.Default.MediaChangersDetect;
            this.retrieveMetaData = new BooleanChoice(this, "Retrieve MetaData from Microsoft");
            this.retrieveMetaData.Value = Properties.Settings.Default.MediaChangersRetrieveMetaData;
            this.manageChangers = new Command(this);
            this.manageChangers.Description = "Manage Discs";
            this.manageChangers.Invoked += delegate(object changerSender, EventArgs changerArgs)
            {
                Dictionary<string, object> manageProperties = new Dictionary<string, object>();
                manageProperties["Page"] = this;
                manageProperties["Application"] = Library.OMLApplication.Current;
                Library.OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_MediaChangerManagerPage", manageProperties);
            };

            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();
            saveCmd.Description = "Save";
            saveCmd.Invoked += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();
            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.discArray = new ArrayListDataSet();
            if (OMLApplication.Current.MediaChangers.HasMediaChangers)
            {
                foreach (DiscDataEx disc in OMLApplication.Current.MediaChangers.KnownDiscs)
                {
                    DiscCommand discItem = new DiscCommand(this);
                    discItem.Description = disc.VolumeLabel;
                    discItem.Disc = disc;
                    if (!string.IsNullOrEmpty(disc.Title))
                        discItem.Description = disc.Title;

                    discItem.Invoked += delegate(object discSender, EventArgs discArgs)
                    {
                        if(discSender is DiscCommand)
                        {
                            this.IsBusy = true;
                            Microsoft.MediaCenter.UI.Application.DeferredInvokeOnWorkerThread(beginEject, endEject, (object)discSender);
                            //((DiscCommand)discSender).Disc.Eject();
                            //this.updateDiscArray();
                        }
                    };
                    this.discArray.Add(discItem);
                }
            }

            this.DiscManagerSort = DiscManagerSortType.Name;
            this.SortList();
            //for (int i = 0; i < 20; ++i)
            //{
            //    Command c = new Command(this);
            //    c.Description = string.Format("This is a very long description of a Test Disc {0}", i.ToString());
            //    this.discArray.Add(c);
            //}
            this.DetermineShowErrorMessage();
        }
Exemplo n.º 27
0
 public CheckBox(BooleanChoice val, string str)
 {
     _Checked = val;
     _Text = str;
 }
Exemplo n.º 28
0
        public DisplayPreferences(string id, Folder folder)
        {
            this.Id = new Guid(id);
            Folder  = folder;

            ArrayList list = new ArrayList();

            foreach (ViewType v in Enum.GetValues(typeof(ViewType)))
            {
                list.Add(ViewTypeNames.GetName(v));
            }
            viewType.Options = list;

            try
            {
                this.viewType.Chosen = folder.DisplayPreferences != null ? folder.DisplayPreferences.ViewType ?? Config.Instance.DefaultViewType.ToString() : Config.Instance.DefaultViewType.ToString();
            }
            catch (ArgumentException)
            {
                Logging.Logger.ReportError("Invalid view type stored for {0}.  Setting to Poster.", folder.Name ?? folder.GetType().Name);
                viewType.Chosen = Localization.LocalizedStrings.Instance.GetString("PosterDispPref");
            }

            //set our dynamic choice options
            this.sortDict           = folder.SortOrderOptions;
            this.sortOrders.Options = sortDict.Keys.ToArray();
            this.indexDict          = folder.IndexByOptions;
            this.indexBy.Options    = folder.IndexByOptions.Keys.ToArray();

            verticalScroll = new BooleanChoice {
                Value = folder.DisplayPreferences != null && folder.DisplayPreferences.ScrollDirection == ScrollDirection.Vertical
            };

            useBanner = new BooleanChoice();

            showLabels = new BooleanChoice();

            useCoverflow = new BooleanChoice {
                Value = false
            };

            useBackdrop = new BooleanChoice {
                Value = folder.DisplayPreferences != null ? folder.DisplayPreferences.ShowBackdrop : Config.Instance.ShowBackdrop
            };

            if (folder.DisplayPreferences != null)
            {
                var width  = folder.DisplayPreferences.PrimaryImageWidth > 0 ? folder.DisplayPreferences.PrimaryImageWidth : Config.Instance.DefaultPosterSize.Width;
                var height = folder.DisplayPreferences.PrimaryImageHeight > 0 ? folder.DisplayPreferences.PrimaryImageHeight : Config.Instance.DefaultPosterSize.Height;

                customParms      = folder.DisplayPreferences.CustomPrefs ?? new Dictionary <string, string>();
                thumbConstraint  = new SizeRef(new Size(width, height));
                useBanner.Value  = (customParms.GetValueOrDefault("MBCUseBanner", "false") == "true");
                showLabels.Value = (customParms.GetValueOrDefault("MBCShowLabels", "false") == "true");
                try
                {
                    if (Config.Instance.RememberIndexing)
                    {
                        indexBy.Chosen = folder.DisplayPreferences.IndexBy;
                    }
                }
                catch
                {
                    indexBy.Chosen = Localization.LocalizedStrings.Instance.GetString("NoneDispPref");
                }
            }

            try
            {
                sortOrders.Chosen = folder.DisplayPreferences != null ? folder.DisplayPreferences.SortBy ?? "Name" : "Name";
            }
            catch (ArgumentException)
            {
                Logging.Logger.ReportError("Invalid sort by stored for {0}.  Setting to Name.", folder.Name ?? folder.GetType().Name);
                sortOrders.Chosen = Localization.LocalizedStrings.Instance.GetString("NameDispPref");
            }

            ListenForChanges();
        }
Exemplo n.º 29
0
        public MediaChangerManagerPage()
        {
            this.managerCommands = new ArrayListDataSet(this);

            //save command
            Command rescanCmd = new Command();

            rescanCmd.Description = "Rescan Discs";
            rescanCmd.Invoked    += new EventHandler(rescanCmd_Invoked);
            this.managerCommands.Add(rescanCmd);

            this.sortCommands = new Choice(this);
            ArrayListDataSet sortSet = new ArrayListDataSet();

            Command sortByName = new Command(this);

            sortByName.Description = "Sort by Name";
            sortSet.Add(sortByName);

            Command sortByType = new Command(this);

            sortByType.Description = "Sort by Type";
            sortSet.Add(sortByType);

            this.sortCommands.Options        = sortSet;
            this.SortCommands.ChosenChanged += new EventHandler(SortCommands_ChosenChanged);


            this.enableMediaChangers        = new BooleanChoice(this, "Enable support for media changers");
            this.enableMediaChangers.Value  = Properties.Settings.Default.MediaChangersEnabled;
            this.detectMediaChangers        = new BooleanChoice(this, "Detect new discs added to your changer");
            this.detectMediaChangers.Value  = Properties.Settings.Default.MediaChangersDetect;
            this.retrieveMetaData           = new BooleanChoice(this, "Retrieve MetaData from Microsoft");
            this.retrieveMetaData.Value     = Properties.Settings.Default.MediaChangersRetrieveMetaData;
            this.manageChangers             = new Command(this);
            this.manageChangers.Description = "Manage Discs";
            this.manageChangers.Invoked    += delegate(object changerSender, EventArgs changerArgs)
            {
                Dictionary <string, object> manageProperties = new Dictionary <string, object>();
                manageProperties["Page"]        = this;
                manageProperties["Application"] = Library.OMLApplication.Current;
                Library.OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_MediaChangerManagerPage", manageProperties);
            };

            this.commands = new ArrayListDataSet(this);

            //save command
            Command saveCmd = new Command();

            saveCmd.Description = "Save";
            saveCmd.Invoked    += new EventHandler(saveCmd_Invoked);
            this.commands.Add(saveCmd);

            //cancel command
            Command cancelCmd = new Command();

            cancelCmd.Description = "Cancel";
            cancelCmd.Invoked    += new EventHandler(cancelCmd_Invoked);
            this.commands.Add(cancelCmd);

            this.discArray = new ArrayListDataSet();
            if (OMLApplication.Current.MediaChangers.HasMediaChangers)
            {
                foreach (DiscDataEx disc in OMLApplication.Current.MediaChangers.KnownDiscs)
                {
                    DiscCommand discItem = new DiscCommand(this);
                    discItem.Description = disc.VolumeLabel;
                    discItem.Disc        = disc;
                    if (!string.IsNullOrEmpty(disc.Title))
                    {
                        discItem.Description = disc.Title;
                    }

                    discItem.Invoked += delegate(object discSender, EventArgs discArgs)
                    {
                        if (discSender is DiscCommand)
                        {
                            this.IsBusy = true;
                            Microsoft.MediaCenter.UI.Application.DeferredInvokeOnWorkerThread(beginEject, endEject, (object)discSender);
                            //((DiscCommand)discSender).Disc.Eject();
                            //this.updateDiscArray();
                        }
                    };
                    this.discArray.Add(discItem);
                }
            }

            this.DiscManagerSort = DiscManagerSortType.Name;
            this.SortList();
            //for (int i = 0; i < 20; ++i)
            //{
            //    Command c = new Command(this);
            //    c.Description = string.Format("This is a very long description of a Test Disc {0}", i.ToString());
            //    this.discArray.Add(c);
            //}
            this.DetermineShowErrorMessage();
        }
Exemplo n.º 30
0
 public CheckBox(BooleanChoice val, string str)
 {
     _Checked = val;
     _Text    = str;
 }