Ejemplo n.º 1
0
 public void CopyTo(BlogPublishingPluginSettings settings)
 {
     settings.ClearOrderAndSettings();
     settings._settings.CopyFrom(_settings, true, true);
 }
        // TODO: Instead of prompting for each one, show one consolidated dialog
        private static bool PluginIsEnabled(IWin32Window owner, BlogPublishingPluginSettings settings, ContentSourceInfo plugin, bool defaultEnabled)
        {
            bool? alreadyEnabled = settings.IsEnabled(plugin.Id);
            if (alreadyEnabled != null)
                return alreadyEnabled.Value;

            // Got here? then we haven't seen this plugin before

            if (owner == null)
                return defaultEnabled;

            bool enabled = DisplayMessage.Show(MessageId.ShouldUsePlugin, owner, plugin.Name) == DialogResult.Yes;
            settings.Set(plugin.Id, enabled, settings.KnownPluginIds.Length);
            return enabled;
        }
 public void CopyTo(BlogPublishingPluginSettings settings)
 {
     settings.ClearOrderAndSettings();
     settings._settings.CopyFrom(_settings, true, true);
 }
        public static Comparison<ContentSourceInfo> CreateComparison(BlogPublishingPluginSettings settings)
        {
            return delegate (ContentSourceInfo a, ContentSourceInfo b)
                       {
                           int orderA = settings.GetOrder(a.Id) ?? 100000;
                           int orderB = settings.GetOrder(b.Id) ?? 100000;

                           if (orderA != orderB)
                               return orderA - orderB;
                           else
                               return a.LastUse.CompareTo(b.LastUse);
                       };
        }