Example #1
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.";
                }
            }
        }
Example #2
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;
            }
        }