RecordSwitch() public method

public RecordSwitch ( bool record ) : string
record bool
return string
Exemplo n.º 1
0
        public void RemoveMicrophone(VolumeLevel volumeControl, bool confirm)
        {
            if (confirm &&
                MessageBox.Show(LocRm.GetString("AreYouSure"), LocRm.GetString("Confirm"), MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning) == DialogResult.Cancel)
                return;

            var dr = DialogResult.No;
            if (confirm)
            {
                dr = MessageBox.Show(LocRm.GetString("DeleteAllAssociatedMedia"), LocRm.GetString("Confirm"),
                    MessageBoxButtons.YesNoCancel,
                    MessageBoxIcon.Question);
            }
            if (dr == DialogResult.Cancel)
                return;

            string folder = volumeControl.Dir.Entry + "audio\\" + volumeControl.Micobject.directory + "\\";

            volumeControl.ShuttingDown = true;
            volumeControl.MouseDown -= VolumeControlMouseDown;
            volumeControl.MouseUp -= VolumeControlMouseUp;
            volumeControl.MouseMove -= VolumeControlMouseMove;
            volumeControl.DoubleClick -= VolumeControlDoubleClick;
            volumeControl.RemoteCommand -= VolumeControlRemoteCommand;
            volumeControl.Notification -= ControlNotification;
            if (volumeControl.Recording)
                volumeControl.RecordSwitch(false);

            volumeControl.Disable();
            volumeControl.SaveFileList();

            if (InvokeRequired)
                Invoke(new Delegates.MicrophoneCommandDelegate(RemoveMicrophonePanel), volumeControl);
            else
                RemoveMicrophonePanel(volumeControl);

            if (dr == DialogResult.Yes)
            {
                try
                {
                    Directory.Delete(folder, true);
                }
                catch (Exception ex)
                {
                    LogExceptionToFile(ex);
                }
            }
        }
Exemplo n.º 2
0
        public void RemoveMicrophone(VolumeLevel volumeControl, bool confirm)
        {
            if (confirm &&
                MessageBox.Show(LocRm.GetString("AreYouSure"), LocRm.GetString("Confirm"), MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning) == DialogResult.Cancel)
                return;
            volumeControl.ShuttingDown = true;
            volumeControl.MouseDown -= VolumeControlMouseDown;
            volumeControl.MouseUp -= VolumeControlMouseUp;
            volumeControl.MouseMove -= VolumeControlMouseMove;
            volumeControl.DoubleClick -= VolumeControlDoubleClick;
            volumeControl.RemoteCommand -= VolumeControlRemoteCommand;
            volumeControl.Notification -= ControlNotificationHandler;
            if (volumeControl.Recording)
                volumeControl.RecordSwitch(false);

            volumeControl.Disable();
            volumeControl.SaveFileList();

            if (InvokeRequired)
                Invoke(new MicrophoneCommandDelegate(RemoveMicrophonePanel), volumeControl);
            else
                RemoveMicrophonePanel(volumeControl);
        }