예제 #1
0
        /// <summary>
        /// saving settings
        /// </summary>
        public void Save()
        {
            if (this.enableSave == true)
            {
                MountingTool.Tool tool = MountingTool.Tool.None;

                switch (this.mountingToolChoice.Chosen.ToString())
                {
                case "DAEMON Tools Lite":
                    tool = MountingTool.Tool.DaemonTools;
                    break;

                case "Virtual CloneDrive":
                    tool = MountingTool.Tool.VirtualCloneDrive;
                    break;

                default:
                    tool = MountingTool.Tool.None;
                    break;
                }
                if (this.EnableImageMounting.Value == false)
                {
                    tool = MountingTool.Tool.None;//set it to none if we have disabled it
                }
                OMLSettings.MountingToolPath      = MountingTool.GetMountingToolPath(tool);
                OMLSettings.MountingToolSelection = tool;

                OMLSettings.VirtualDiscDrive = virtualDriveOptions.Chosen.ToString().Replace(@":\", "");
            }
        }
예제 #2
0
        /// <summary>
        /// saving settings
        /// </summary>
        public void Save()
        {
            OMLSettings.MountingToolUseAdvanced = this.EnableImageMounting.Value;
            if (this.EnableImageMounting.Value)
            {
                MountingTool.Tool tool = MountingTool.Tool.None;

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

                case 1:
                    tool = MountingTool.Tool.VirtualCloneDrive;
                    break;

                default:
                    tool = MountingTool.Tool.None;
                    break;
                }

                OMLSettings.MountingToolPath      = MountingTool.GetMountingToolPath(tool);
                OMLSettings.MountingToolSelection = tool;

                OMLSettings.VirtualDiscDrive = virtualDriveOptions.Chosen.ToString().Replace(@":\", "");
            }
            else
            {
                OMLSettings.MountingToolSelection = MountingTool.Tool.None;
                OMLSettings.MountingToolPath      = string.Empty;
                OMLSettings.VirtualDiscDrive      = string.Empty;
            }
        }
예제 #3
0
        /// <summary>
        /// detecting changes
        /// </summary>
        /// <returns></returns>
        public bool IsDirty()
        {
            if (this.enableSave == true)
            {
                if (OMLSettings.VirtualDiscDrive != virtualDriveOptions.Chosen.ToString().Replace(@":\", ""))
                {
                    return(true);
                }
                MountingTool.Tool tool = MountingTool.Tool.None;

                switch (this.mountingToolChoice.Chosen.ToString())
                {
                case "DAEMON Tools Lite":
                    tool = MountingTool.Tool.DaemonTools;
                    break;

                case "Virtual CloneDrive":
                    tool = MountingTool.Tool.VirtualCloneDrive;
                    break;

                default:
                    tool = MountingTool.Tool.None;
                    break;
                }
                if (OMLSettings.MountingToolSelection != tool)
                {
                    return(true);
                }

                if (OMLSettings.MountingToolPath != MountingTool.GetMountingToolPath(tool))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #4
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.";
                }
            }
        }