コード例 #1
0
 public IImageSourcePluginAdapter CreateImageSourcePlugin(ImageSourceType sourceType)
 {
     if (sourceType.Value == "Subreddit") // nocommit, don't hard code this here, removed project dependency on SubredditImageSource
     {
         return(new ImageSourcePluginAdapter <ISubredditSettings>(_scope.Resolve <SubredditImageSource>(), _typedSettingsConverter));
     }
     throw new NotImplementedException(); // nocommit, ability to resolve the correct type reflectively
 }
コード例 #2
0
 public IImageSourceConfiguration CreateNewSource(ImageSourceType sourceType)
 {
     return(new ImageSourceConfiguration(new ImageSourceId(Guid.NewGuid()),
                                         new ImageSourceName(sourceType.Value),
                                         sourceType,
                                         new ImageSourceSettings(), // nocommit, fix up default settings
                                         TimeSpan.FromDays(1),      // nocommit, think about defaults
                                         true));
 }
コード例 #3
0
 public ImageSourceConfiguration(ImageSourceId imageSourceId,
                                 ImageSourceName imageSourceName,
                                 ImageSourceType sourceType,
                                 IImageSourceSettings settings,
                                 TimeSpan updateInterval,
                                 bool isEnabled)
 {
     ImageSourceId   = imageSourceId;
     ImageSourceName = imageSourceName;
     SourceType      = sourceType;
     Settings        = settings;
     UpdateInterval  = updateInterval;
     IsEnabled       = isEnabled;
 }