Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationDialog"/> class.
 /// </summary>
 /// <param name="locationDialogFactory">The location dialog factory service.</param>
 /// <param name="resourceManager">The location resource manager.</param>
 internal LocationDialog(
     ILocationDialogFactory locationDialogFactory,
     IFavoritesManager favoritesManager,
     LocationResourceManager resourceManager = null) : base(resourceManager)
 {
     SetField.NotNull(out this.locationDialogFactory, nameof(locationDialogFactory), locationDialogFactory);
     SetField.NotNull(out this.favoritesManager, nameof(favoritesManager), favoritesManager);
 }
Esempio n. 2
0
 public TimetableViewModel(Stops station, Routes route, int?direction, IDataProvider dataProvider, IFavoritesManager favoritesManager)
 {
     Station           = station;
     Route             = route;
     _direction        = direction;
     _dataProvider     = dataProvider;
     _favoritesManager = favoritesManager;
 }
Esempio n. 3
0
 private FavoritesDummyForm(IServiceProvider provider)
 {
     _serviceManager = new ServiceManager(provider);
     _favManager     = provider.GetRequiredService <IFavoritesManager>();
     InitializeComponent();
     FillImages();
     CustomInitializeComponent();
     _serviceManager.Publish <IFavoritesDummyFormService>(new FavoritesDummyFormService(this));
     _contextMenuGenerator = new StripMenuGenerator(_serviceManager, _contextMenuStrip, "Favorites.ContextMenu");
 }
Esempio n. 4
0
		private FavoritesDummyForm(IServiceProvider provider)
		{
			_serviceManager = new ServiceContainer(provider);
			_favManager = provider.GetRequiredService<IFavoritesManager>();
			InitializeComponent();
			FillImages();
			CustomInitializeComponent();
			_serviceManager.Publish<IFavoritesDummyFormService>(new FavoritesDummyFormService(this));
			_contextMenuGenerator = new StripMenuGenerator(_serviceManager, _contextMenuStrip, "Favorites.ContextMenu");
		}
Esempio n. 5
0
        public StateObject([NotNull] IServiceProvider serviceProvider, [NotNull]string filename)
        {
            if (serviceProvider == null)
                throw new ArgumentNullException("serviceProvider");
            if (filename == null)
                throw new ArgumentNullException("filename");

            _serviceProvider = serviceProvider;
            _favManager = serviceProvider.GetRequiredService<IFavoritesManager>();
            _filename = filename;
        }
        public static bool TryGetFavoritesPlugin(this PanaceaServices core, out IFavoritesManager plugin)
        {
            plugin = null;
            var favorites = core.PluginLoader.GetPlugins <IFavoritesPlugin>().FirstOrDefault();

            if (favorites == null)
            {
                return(false);
            }
            plugin = favorites.GetManager();
            return(true);
        }
Esempio n. 7
0
 internal EditFavoriteLocationDialog(
     ILocationDialogFactory locationDialogFactory,
     IFavoritesManager favoritesManager,
     string favoriteName,
     Location favoriteLocation,
     LocationResourceManager resourceManager)
     : base(resourceManager)
 {
     SetField.NotNull(out this.locationDialogFactory, nameof(locationDialogFactory), locationDialogFactory);
     SetField.NotNull(out this.favoritesManager, nameof(favoritesManager), favoritesManager);
     SetField.NotNull(out this.favoriteName, nameof(favoriteName), favoriteName);
     SetField.NotNull(out this.favoriteLocation, nameof(favoriteLocation), favoriteLocation);
 }
Esempio n. 8
0
        public StateObject([NotNull] IServiceProvider serviceProvider, [NotNull] string filename)
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException("serviceProvider");
            }
            if (filename == null)
            {
                throw new ArgumentNullException("filename");
            }

            _serviceProvider = serviceProvider;
            _favManager      = serviceProvider.GetRequiredService <IFavoritesManager>();
            _filename        = filename;
        }
Esempio n. 9
0
 public FavoriteLocationRetrieverDialog(
     bool supportsKeyboard,
     IFavoritesManager favoritesManager,
     ILocationDialogFactory locationDialogFactory,
     ILocationCardBuilder cardBuilder,
     IGeoSpatialService geoSpatialService,
     LocationOptions options,
     LocationRequiredFields requiredFields,
     LocationResourceManager resourceManager)
     : base(geoSpatialService, options, requiredFields, resourceManager)
 {
     SetField.NotNull(out this.favoritesManager, nameof(favoritesManager), favoritesManager);
     SetField.NotNull(out this.locationDialogFactory, nameof(locationDialogFactory), locationDialogFactory);
     SetField.NotNull(out this.cardBuilder, nameof(cardBuilder), cardBuilder);
     this.supportsKeyboard = supportsKeyboard;
 }
Esempio n. 10
0
        public FavoritesSelectFolderForm(
            IServiceProvider provider,
            FavoritesFolder folders, bool newItem)
        {
            _favManager = provider.GetRequiredService<IFavoritesManager>();
            InitializeComponent();

            if (!newItem)
            {
                _comment.Visible = false;
                _commentLabel.Visible = false;
            }

            _folderView.SmallImageList = FavoritesDummyForm.Instance.TreeImages;

            if (folders.ShowLinks)
                folders.ShowLinks = false;
            _folderView.Nodes = folders;
        }
Esempio n. 11
0
        public FavoritesSelectFolderForm(
            IServiceProvider provider,
            FavoritesFolder folders, bool newItem)
        {
            _favManager = provider.GetRequiredService <IFavoritesManager>();
            InitializeComponent();

            if (!newItem)
            {
                _comment.Visible      = false;
                _commentLabel.Visible = false;
            }

            _folderView.SmallImageList = FavoritesDummyForm.Instance.TreeImages;

            if (folders.ShowLinks)
            {
                folders.ShowLinks = false;
            }
            _folderView.Nodes = folders;
        }
Esempio n. 12
0
 public FavoritesViewModel(IFavoritesManager favoritesManager, IDataProvider dataProvider)
 {
     _favoritesManager = favoritesManager;
     _dataProvider     = dataProvider;
 }
Esempio n. 13
0
 public FavoritesCommandTarget(IServiceProvider serviceProvider)
     : base(serviceProvider)
 {
     _favManager = serviceProvider.GetRequiredService <IFavoritesManager>();
 }
Esempio n. 14
0
 internal AddFavoriteLocationDialog(IFavoritesManager favoritesManager, Location location, LocationResourceManager resourceManager) : base(resourceManager)
 {
     SetField.NotNull(out this.favoritesManager, nameof(favoritesManager), favoritesManager);
     SetField.NotNull(out this.location, nameof(location), location);
 }
Esempio n. 15
0
 public FavoritesCommandTarget(IServiceProvider serviceProvider)
     : base(serviceProvider)
 {
     _favManager = serviceProvider.GetRequiredService<IFavoritesManager>();
 }