/// <summary> /// Ermittelt den nächsten Arbeitsschritt. /// </summary> /// <param name="selected">Die ausgewählte Erweiterung.</param> /// <returns>Der als nächstes auszuführende Arbeitsschritt.</returns> private Type GetNextStep( PlugIn selected ) { // See if new profile is required if (selected.MaximumNewProfiles > 0) { // See if we can provide single selection if (NewProfileSelector.IsValidFor( selected )) return typeof( NewProfileSelector ); // No valid selection possible return null; } // Direct jump to extension executor return typeof( PlugInExecutor ); }
/// <summary> /// Prüft, ob für die ausgewählte Aufgabe mindestens ein Geräteprofil angeboten werden kann. /// </summary> /// <param name="plugIn">Die zu prüfende Erweiterung.</param> /// <returns>Gesetzt, wenn die Erweiterung mindestens ein zulässiges Geräteprofile benötigt.</returns> public static bool IsValidFor( PlugIn plugIn ) { // None at all if (plugIn.MaximumNewProfiles < 1) return false; // Get all profiles List<Profile> profiles = new List<Profile>( ProfileManager.AllProfiles ); // Ask extension to clean up the list plugIn.FilterNewProfiles( profiles ); // Check limit if (plugIn.MaximumNewProfiles > 1) return (1 == profiles.Count); else return (0 != profiles.Count); }
/// <summary> /// Wird aktiviert, wenn eine Auswahl betätigt wird. /// </summary> /// <param name="sender">Wird ignoriert.</param> /// <param name="e">Wird ignoriert.</param> private void TaskSelected( object sender, EventArgs e ) { // Attach to selection RadioButton button = (RadioButton) sender; // Remember the selection CurrentSelection = button.Tag.GetType(); CurrentPlugIn = (PlugIn) button.Tag; // Inform parent CheckButtons(); }