Example #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Entry" /> class.
        /// </summary>
        /// <param name="plugin">The plugin.</param>
        /// <exception cref="System.ArgumentNullException">plugin</exception>
        public Entry(PluginWrapper plugin)
        {
            if (plugin == null)
            {
                throw new ArgumentNullException("plugin");
            }

            Plugin = plugin;

            _userInterface        = new Lazy <FrameworkElement>(() => Plugin.Plugin.GetUserInterface( ));
            _optionsUserInterface = new Lazy <FrameworkElement>(() => Plugin.Plugin.GetOptionsUserInterface( ));
        }
Example #2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Section" /> class.
        /// </summary>
        public Section(PluginWrapper plugin)
        {
            if (plugin == null)
            {
                throw new ArgumentNullException("plugin");
            }

            Name    = plugin.Plugin.SectionName;
            Ordinal = plugin.Plugin.SectionOrdinal;

            EntriesView = new CollectionViewSource
            {
                Source = Entries
            };

            EntriesView.Filter += EntriesFilter;

            var ordinalSort = new SortDescription("Ordinal", ListSortDirection.Ascending);
            var nameSort    = new SortDescription("Name", ListSortDirection.Ascending);

            EntriesView.SortDescriptions.Add(ordinalSort);
            EntriesView.SortDescriptions.Add(nameSort);
        }