Esempio n. 1
0
        private LinkLabel CreateLinkLabel(FeedUri interfaceUri)
        {
            var linkLabel = new LinkLabel {
                Text = Resources.Change, Dock = DockStyle.Fill, TextAlign = ContentAlignment.MiddleLeft
            };

            linkLabel.LinkClicked += delegate { InterfaceDialog.Show(this, interfaceUri, _solveCallback, _feedManager); };
            return(linkLabel);
        }
Esempio n. 2
0
        /// <summary>
        /// Displays a dialog allowing the user to modify <see cref="InterfacePreferences"/> and <see cref="FeedPreferences"/> for an interface.
        /// </summary>
        /// <param name="owner">The parent window the displayed window is modal to; can be <c>null</c>.</param>
        /// <param name="interfaceUri">The interface to modify the preferences for.</param>
        /// <param name="solveCallback">Called after <see cref="InterfacePreferences"/> have been changed and the <see cref="ISolver"/> needs to be rerun.</param>
        /// <param name="feedManager">The feed manager used to retrieve feeds for additional information about implementations.</param>
        public static void Show(IWin32Window?owner, FeedUri interfaceUri, Func <Selections> solveCallback, IFeedManager feedManager)
        {
            #region Sanity checks
            if (interfaceUri == null)
            {
                throw new ArgumentNullException(nameof(interfaceUri));
            }
            if (owner == null)
            {
                throw new ArgumentNullException(nameof(owner));
            }
            if (solveCallback == null)
            {
                throw new ArgumentNullException(nameof(solveCallback));
            }
            if (feedManager == null)
            {
                throw new ArgumentNullException(nameof(feedManager));
            }
            #endregion

            using var dialog = new InterfaceDialog(interfaceUri, solveCallback, feedManager);
            dialog.ShowDialog(owner);
        }
        /// <summary>
        /// Displays a dialog allowing the user to modify <see cref="InterfacePreferences"/> and <see cref="FeedPreferences"/> for an interface.
        /// </summary>
        /// <param name="owner">The parent window the displayed window is modal to; can be <see langword="null"/>.</param>
        /// <param name="interfaceUri">The interface to modify the preferences for.</param>
        /// <param name="solveCallback">Called after <see cref="InterfacePreferences"/> have been changed and the <see cref="ISolver"/> needs to be rerun.</param>
        /// <param name="feedCache">The feed cache used to retrieve feeds for additional information about implementations.</param>
        public static void Show([CanBeNull] IWin32Window owner, [NotNull] FeedUri interfaceUri, [NotNull] Func <Selections> solveCallback, [NotNull] IFeedCache feedCache)
        {
            #region Sanity checks
            if (interfaceUri == null)
            {
                throw new ArgumentNullException("interfaceUri");
            }
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }
            if (solveCallback == null)
            {
                throw new ArgumentNullException("solveCallback");
            }
            if (feedCache == null)
            {
                throw new ArgumentNullException("feedCache");
            }
            #endregion

            using (var dialog = new InterfaceDialog(interfaceUri, solveCallback, feedCache))
                dialog.ShowDialog(owner);
        }
        /// <summary>
        /// Displays a dialog allowing the user to modify <see cref="InterfacePreferences"/> and <see cref="FeedPreferences"/> for an interface.
        /// </summary>
        /// <param name="owner">The parent window the displayed window is modal to; can be <see langword="null"/>.</param>
        /// <param name="interfaceUri">The interface to modify the preferences for.</param>
        /// <param name="solveCallback">Called after <see cref="InterfacePreferences"/> have been changed and the <see cref="ISolver"/> needs to be rerun.</param>
        /// <param name="feedCache">The feed cache used to retrieve feeds for additional information about implementations.</param>
        public static void Show([CanBeNull] IWin32Window owner, [NotNull] FeedUri interfaceUri, [NotNull] Func<Selections> solveCallback, [NotNull] IFeedCache feedCache)
        {
            #region Sanity checks
            if (interfaceUri == null) throw new ArgumentNullException("interfaceUri");
            if (owner == null) throw new ArgumentNullException("owner");
            if (solveCallback == null) throw new ArgumentNullException("solveCallback");
            if (feedCache == null) throw new ArgumentNullException("feedCache");
            #endregion

            using (var dialog = new InterfaceDialog(interfaceUri, solveCallback, feedCache))
                dialog.ShowDialog(owner);
        }