private VolumeChangeEventArgs ConvertEventArrivedEventArgsToVolumeChangeEventArgs(EventArrivedEventArgs e) { VolumeChangeEventArgs resVolumeChangeEventArgs = new VolumeChangeEventArgs { DriveName = e.NewEvent.Properties["DriveName"].Value.ToString(), TimeCreated = new DateTime(Int64.Parse(e.NewEvent.Properties["TIME_CREATED"].Value.ToString())) }; switch (Int32.Parse(e.NewEvent.Properties["EventType"].Value.ToString())) { case 1: resVolumeChangeEventArgs.EventType = EventType.ConfigurationChanged; break; case 2: resVolumeChangeEventArgs.EventType = EventType.DeviceArrival; break; case 3: resVolumeChangeEventArgs.EventType = EventType.DeviceRemoval; break; case 4: resVolumeChangeEventArgs.EventType = EventType.Docking; break; default: resVolumeChangeEventArgs.EventType = EventType.Undefined; break; } return(resVolumeChangeEventArgs); }
// Use this to trigger the event protected virtual void ThisVolumeChanged(MonoBehaviour sender, VolumeChangeEventArgs e) { VolumeChangedEventHandler handler = OnVolumeChange; if(handler != null) { handler(sender, e); } }
protected virtual void OnVolumeChanged(IVolumeDevice device, VolumeChangeEventArgs args) { var handler = VolumeChanged; if (handler != null) { handler(device, args); } }
private void _spotify_OnVolumeChange(object sender, VolumeChangeEventArgs e) { if (InvokeRequired) { Invoke(new Action(() => _spotify_OnVolumeChange(sender, e))); return; } volumeLabel.Text = (e.NewVolume * 100).ToString(CultureInfo.InvariantCulture); }
private void OnVolumeChangedInternal(object sender, VolumeChangeEventArgs e) { SetVolumeInternal(new VolumeInfo() { //Times 100 since Volume value is between 0-1 CurrentVolume = (float)e.NewVolume * 100f, //OldVolume = (float)e.OldVolume, MaxVolume = MAX_VOLUME_AMOUNT, }); }
void mic_VolumeChanged(IVolumeDevice device, VolumeChangeEventArgs args) { // Loop through all mics and check all mics are equal to the calling devices status // If not return so we don't call event for the group foreach (ShureCeilingMic mic in this) { if (device.VolumeMute != mic.VolumeMute) { return; } } if (VolumeChanged != null) { VolumeChanged(this, new VolumeChangeEventArgs(VolumeLevelChangeEventType.MuteChanged)); } }
private void OnVolumeChangeHandler(object sender, VolumeChangeEventArgs e) { OnVolumeChangeHandler(); }
private static void DOnDriveRemovedEvent(object sender, VolumeChangeEventArgs volumeChangeEventArgs) { Console.WriteLine("Drive " + volumeChangeEventArgs.DriveName + " is removed"); }
private static void DOnDriveConfigurationChangedEvent(object sender, VolumeChangeEventArgs volumeChangeEventArgs) { Console.WriteLine("Drive " + volumeChangeEventArgs.DriveName + " configuration changed"); }
private static void DOnDriveDockingEvent(object sender, VolumeChangeEventArgs volumeChangeEventArgs) { Console.WriteLine("Drive " + volumeChangeEventArgs.DriveName + " is docking"); }
private void volumechange(VolumeChangeEventArgs e) { }
private void volumeChange(VolumeChangeEventArgs e) { }
private void volumechange(VolumeChangeEventArgs e) { label11.Text = ((int)(mh.GetVolume() * 100)).ToString(); }
private void volumechange(VolumeChangeEventArgs e) { label11.Text = ((int)(mh.GetVolume() * 100)).ToString(); }
private void SpotifyLocalAPI_OnVolumeChange(object sender, VolumeChangeEventArgs e) { this.VolumeChanged?.Invoke(this, new SpotifyVolumeChangedEventArgs(e.OldVolume, e.NewVolume)); }
void _spotify_OnVolumeChange(VolumeChangeEventArgs e) { volumeLabel.Text = (e.NewVolume * 100).ToString(CultureInfo.InvariantCulture); }
private static void VolumeChange(VolumeChangeEventArgs e) { Volume = ((int)(e.new_volume * 100)).ToString() + "%"; }