public SimpleSyncComponent(IActor actor, IConnectionManager connectionManager)
 {
     _actor = actor;
     _connectionManager = connectionManager;
     _connectionManager.ConnectionInitialized += new EventHandler<EventArgs<IConnection>>(_connectionManager_ConnectionInitialized);
     _connectionManager.ConnectionTerminated += new EventHandler<EventArgs<IConnection>>(_connectionManager_ConnectionTerminated);
 }
Beispiel #2
0
        public VMMainPage(ILocalizationService localizationService, IPhoneCallService phoneCallService, MapItemsModel mapsItemModel, IVibrationService vibrationService, IAvailabilityService availabilityService, IConnectionManager connectionManager)
        {
            _localizationService = localizationService;
            _phoneCallService = phoneCallService;
            _mapsItemModel = mapsItemModel;
            _vibrationService = vibrationService;
            _availabilityService = availabilityService;
            _connectionManager = connectionManager;

            _dispatcherTimerChronometer = new DispatcherTimer { Interval = new TimeSpan(0, 0, 0, 1) };
            _dispatcherTimerChronometer.Tick += _dispatcherTimer_Tick;

            var dispatcherTimerAvailability = new DispatcherTimer()
            {
                Interval = new TimeSpan(0, 0, 0, 30)
            };
            dispatcherTimerAvailability.Tick += _dispatcherTimerAvailability_Tick;
            dispatcherTimerAvailability.Start();

            _mapsItemModel.GetNearMapItemsCompleted += GetNearMapItemsCompleted;

            _localizationService.Geolocator.PositionChanged += _geolocator_PositionChanged;

            SetCurrentPositionAsync();
            ZoomLevel = 15;

            _lazyPhoneCallCommand = new Lazy<DelegateCommand>(() => new DelegateCommand(PhoneCallCommandExecute));

            _lazyGetNearStationsCommand = new Lazy<DelegateCommand>(() => new DelegateCommand(GetNearStationsCommandExecute));

            _lazyStartChronometerCommand = new Lazy<DelegateCommand>(() => new DelegateCommand(StartChronometerCommandExecute));
        }
Beispiel #3
0
 public ChirpPostController(IChirpRepository a_repository, ILogger<ChirpPostController> a_logger, IConnectionManager a_connectionManager, UserManager<ChirpUser> a_userManager)
 {
     m_repository = a_repository;
     m_logger = a_logger;
     m_connectionManager = a_connectionManager;
     m_userManager = a_userManager;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow" /> class.
        /// </summary>
        public MainWindow(ILogger logger, IPlaybackManager playbackManager, IImageManager imageManager, IApplicationHost appHost, IPresentationManager appWindow, IUserInputManager userInput, ITheaterConfigurationManager config, INavigationService nav, IScreensaverManager screensaverManager, IConnectionManager connectionManager)
            : base()
        {
            _logger = logger;
            _appHost = appHost;
            _appWindow = appWindow;
            _config = config;
            _playbackManager = playbackManager;
            UserInputManager = userInput;
            NavigationManager = nav;

            Loaded += MainWindow_Loaded;

            InitializeComponent();

            RotatingBackdrops = new RotatingBackdropsViewModel(_config, imageManager, playbackManager, logger, screensaverManager, connectionManager);

            _config.ConfigurationUpdated += _config_ConfigurationUpdated;
            _playbackManager.PlaybackStarted += _playbackManager_PlaybackStarted;
            _playbackManager.PlaybackCompleted += _playbackManager_PlaybackCompleted;

            //Timeline.DesiredFrameRateProperty.OverrideMetadata(
            //    typeof(Timeline),
            //    new FrameworkPropertyMetadata { DefaultValue = 30 }
            //);
        }
        public PageContentViewModel(INavigationService navigationService, ISessionManager sessionManager, IPlaybackManager playbackManager, ILogger logger, ITheaterApplicationHost appHost, IConnectionManager connectionManager, IPresentationManager presentationManager)
        {
            NavigationService = navigationService;
            SessionManager = sessionManager;
            PlaybackManager = playbackManager;
            Logger = logger;
            AppHost = appHost;
            ConnectionManager = connectionManager;
            PresentationManager = presentationManager;

            MasterCommands = new MasterCommandsViewModel(navigationService, sessionManager, presentationManager, connectionManager, logger, appHost);

            NavigationService.Navigated += NavigationServiceNavigated;
            SessionManager.UserLoggedIn += SessionManagerUserLoggedIn;
            SessionManager.UserLoggedOut += SessionManagerUserLoggedOut;
            PlaybackManager.PlaybackStarted += PlaybackManager_PlaybackStarted;
            PlaybackManager.PlaybackCompleted += PlaybackManager_PlaybackCompleted;            

            _dispatcher = Dispatcher.CurrentDispatcher;

            _clockTimer = new Timer(ClockTimerCallback, null, 0, 10000);

            IsLoggedIn = SessionManager.CurrentUser != null;
            var page = NavigationService.CurrentPage;
            IsOnHomePage = page is IHomePage;
            IsOnFullscreenVideo = page is IFullscreenVideoPage;
        }
 /// <summary>
 /// Initializes a new instance of the MovieViewModel class.
 /// </summary>
 public MovieViewModel(INavigationService navigationService, IConnectionManager connectionManager)
     : base(navigationService, connectionManager)
 {
     CanUpdateFavourites = true;
     if (IsInDesignMode)
     {
         SelectedMovie = new BaseItemDto
         {
             Id = "6536a66e10417d69105bae71d41a6e6f",
             Name = "Jurassic Park",
             SortName = "Jurassic Park",
             Overview = "Lots of dinosaurs eating people!",
             People = new[]
             {
                 new BaseItemPerson {Name = "Steven Spielberg", Type = "Director"},
                 new BaseItemPerson {Name = "Sam Neill", Type = "Actor"},
                 new BaseItemPerson {Name = "Richard Attenborough", Type = "Actor"},
                 new BaseItemPerson {Name = "Laura Dern", Type = "Actor"}
             }
         };
     }
     else
     {
         WireCommands();
     }
 }
 /// <summary>
 /// Initializes a new instance of the ChannelsViewModel class.
 /// </summary>
 public LiveTvChannelsViewModel(INavigationService navigationService, IConnectionManager connectionManager)
     : base(navigationService, connectionManager)
 {
     if (IsInDesignMode)
     {
         Channels = new List<ChannelInfoDto>
         {
             new ChannelInfoDto
             {
                 Name = "BBC One",
                 Number = "1",
                 CurrentProgram = new BaseItemDto
                 {
                     Name = "Sherlock"
                 }
             },
             new ChannelInfoDto
             {
                 Name = "BBC Two",
                 Number = "2",
                 CurrentProgram = new BaseItemDto
                 {
                     Name = "Top Gear"
                 }
             }
         };
         GroupChannels().ConfigureAwait(false);
     }
 }
 /// <summary>
 /// Initializes a new instance of the TrailerViewModel class.
 /// </summary>
 public TrailerViewModel(INavigationService navigation, IConnectionManager connectionManager)
     : base(navigation, connectionManager)
 {
     if (IsInDesignMode)
     {
         SelectedTrailer = new BaseItemDto
         {
             Name = "Jurassic Park 3D",
             Overview =
                 "Universal Pictures will release Steven Spielberg\u2019s groundbreaking masterpiece JURASSIC PARK in 3D on April 5, 2013.  With his remastering of the epic into a state-of-the-art 3D format, Spielberg introduces the three-time Academy Award\u00AE-winning blockbuster to a new generation of moviegoers and allows longtime fans to experience the world he envisioned in a way that was unimaginable during the film\u2019s original release.  Starring Sam Neill, Laura Dern, Jeff Goldblum, Samuel L. Jackson and Richard Attenborough, the film based on the novel by Michael Crichton is produced by Kathleen Kennedy and Gerald R. Molen.",
             PremiereDate = DateTime.Parse("2013-04-05T00:00:00.0000000"),
             Id = "4aed3d79a0c4c2a0ac9c91fb7a641f1a",
             ProductionYear = 2013,
             People = new[]
             {
                 new BaseItemPerson {Name = "Steven Spielberg", Type = "Director"},
                 new BaseItemPerson {Name = "Sam Neill", Type = "Actor"},
                 new BaseItemPerson {Name = "Richard Attenborough", Type = "Actor"},
                 new BaseItemPerson {Name = "Laura Dern", Type = "Actor"}
             }
         };
         CastAndCrew = Utils.GroupCastAndCrew(SelectedTrailer.People);
     }
     else
     {
         WireCommands();
     }
 }
 public void Setup()
 {
     this.mocks = new MockRepository();
     this.mockConnectionManager = this.mocks.StrictMock<IConnectionManager>();
     this.dummyConnection = this.mocks.Stub<Connection>();
     Dependencies.Container.RegisterInstance<IConnectionManager>(this.mockConnectionManager);
 }
 public GitHubConnectSection0(ISimpleApiClientFactory apiFactory,
     ITeamExplorerServiceHolder holder,
     IConnectionManager manager,
     IPackageSettings settings)
     : base(apiFactory, holder, manager, settings, 0)
 {
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="VMBase" /> class.
 /// </summary>
 /// <param name="aggregator">The aggregator.</param>
 /// <param name="regionManager">The region manager.</param>
 /// <param name="connectionManager"></param>
 /// <param name="interactionService"></param>
 /// <param name="loggerFacade"></param>
 /// <exception cref="System.ArgumentNullException">
 ///     Any parameter
 /// </exception>
 public ApplicationMenuViewModel(IEventAggregator aggregator, IRegionManager regionManager,
     IConnectionManager connectionManager,
     IInteractionService interactionService, ILoggerFacade loggerFacade)
     : base(aggregator, regionManager, connectionManager, interactionService, loggerFacade)
 {
     EventAggregator.GetEvent<UserAuthCompletedEvent>().Subscribe(OnUserAuth);
 }
 public DlnaServerService(IDlnaManager dlnaManager, IContentDirectory contentDirectory, IConnectionManager connectionManager, IConfigurationManager config)
 {
     _dlnaManager = dlnaManager;
     _contentDirectory = contentDirectory;
     _connectionManager = connectionManager;
     _config = config;
 }
 public UserListViewModel(IPresentationManager presentationManager, IConnectionManager connectionManager, IImageManager imageManager, ISessionManager sessionManager, INavigationService navigation)
 {
     SessionManager = sessionManager;
     ImageManager = imageManager;
     ConnectionManager = connectionManager;
     PresentationManager = presentationManager;
 }
Beispiel #14
0
        /// <summary>
        /// Initializes a new instance of the TvViewModel class.
        /// </summary>
        public TvViewModel(INavigationService navigationService, IConnectionManager connectionManager, IMessageBoxService messageBox) 
            : base(navigationService, connectionManager)
        {
            _messageBox = messageBox;
            RecentItems = new ObservableCollection<BaseItemDto>();
            Episodes = new List<BaseItemDto>();
            CanUpdateFavourites = true;
            if (IsInDesignMode)
            {
                SelectedTvSeries = new BaseItemDto
                {
                    Name = "Scrubs"
                };
                SelectedSeason = new BaseItemDto
                {
                    Name = "Season 1"
                };
                Episodes = new[]
                {
                    new BaseItemDto
                    {
                        Id = "e252ea3059d140a0274282bc8cd194cc",
                        Name = "1x01 - Pilot",
                        Overview =
                            "A Kindergarten teacher starts speaking gibberish and passed out in front of her class. What looks like a possible brain tumor does not respond to treatment and provides many more questions than answers for House and his team as they engage in a risky trial-and-error approach to her case. When the young teacher refuses any additional variations of treatment and her life starts slipping away, House must act against his code of conduct and make a personal visit to his patient to convince her to trust him one last time."
                    }
                }.ToList();
                SelectedEpisode = Episodes[0];

            }
            else
            {
                WireCommands();
            }
        }
        /// <summary>
        /// Initializes a new instance of the GuideViewModel class.
        /// </summary>
        public GuideViewModel(INavigationService navigationService, IConnectionManager connectionManager)
            : base(navigationService, connectionManager)
        {
            if (IsInDesignMode)
            {
                SelectedChannel = new ChannelInfoDto
                {
                    Name = "BBC One",
                    Number = "1"
                };

                Programmes = new ObservableCollection<BaseItemDto>
                {
                    new BaseItemDto
                    {
                        StartDate = new DateTime(2014, 1, 16, 6, 0, 0),
                        Name = "Breakfast News",
                        EpisodeTitle = "16/01/2013",
                        Overview = "The latest news, sport, business and weather from the BBC's Breakfast Team"
                    },
                    new BaseItemDto
                    {
                        StartDate = new DateTime(2014, 1, 16, 9, 15, 0),
                        Name = "Wanted Down Under",
                        EpisodeTitle = "Series 8, Davidson Family",
                        Overview = "A mum and son want to move toAustralia, but can they presaude the rest of the family?"
                    }
                };
            }
        }
        /// <summary>
        /// Initializes a new instance of the PushViewModel class.
        /// </summary>
        public SettingsViewModel(
            IConnectionManager connectionManager,
            INavigationService navigationService,
            IApplicationSettingsService applicationSettings, 
            IMessageBoxService messageBox,
            IServerInfoService serverInfo)
            : base(navigationService, connectionManager)
        {
            _applicationSettings = applicationSettings.Legacy;
            _messageBox = messageBox;
            _serverInfo = serverInfo;

            if (IsInDesignMode)
            {
                FoundServers = new ObservableCollection<ServerInfo>
                {
                    new ServerInfo{Id = Guid.NewGuid().ToString(), Name = "Home", LocalAddress = "http://192.168.0.2:8096"}
                };
            }
            else
            {
                LoadingFromSettings = true;
                SendTileUpdates = SendToastUpdates = true;
                RegisteredText = AppResources.DeviceNotRegistered;
                LoadingFromSettings = false;

                SetStreamingQuality();

                _ignoreRunUnderLockChanged = true;
                RunUnderLock = App.SpecificSettings.PlayVideosUnderLock;
                _ignoreRunUnderLockChanged = false;
            }
        }
Beispiel #17
0
 /// <summary>
 /// Constructs the player hub
 /// </summary>
 /// <param name="manager">The player hub connection manager</param>
 public playerHub(IConnectionManager manager)
 {
     // Make sure the player hub context is avaiable when needed.
     serviceHelpers.playerHubContext = manager.GetHubContext<playerHub>();
     // Create or get the playerSignals instance
     _signals = playerSignals.Instance;
 }
 public Connection(IConnectionManager cm, HostAddress hostAddress, string userName)
 {
     manager = cm;
     HostAddress = hostAddress;
     Username = userName;
     Repositories = new ObservableCollection<ISimpleRepositoryModel>();
 }
 public SyncOptionsControl()
 {
     InitializeComponent();
     DataContext = this;
     _connectionManager = SimpleIoc.Default.GetInstance<IConnectionManager>();
     _logger = new WPLogger(GetType());
 }
        /// <summary>
        /// Initializes a new instance of the PlaylistViewModel class.
        /// </summary>
        public NowPlayingViewModel(INavigationService navigationService, IConnectionManager connectionManager, IStorageService storageService)
            :base (navigationService, connectionManager)
        {
            _playlistChecker = new DispatcherTimer { Interval = new TimeSpan(0, 0, 3) };
            _playlistChecker.Tick += PlaylistCheckerOnTick;

            Playlist = new ObservableCollection<PlaylistItem>();
            SelectedItems = new List<PlaylistItem>();
            if (IsInDesignMode)
            {
                Playlist = new ObservableCollection<PlaylistItem>
                {
                    new PlaylistItem {Artist = "John Williams", Album = "Jurassic Park OST", Id = 1, IsPlaying = true, TrackName = "Jurassic Park Theme"},
                    new PlaylistItem {Artist = "John Williams", Album = "Jurassic Park OST", Id = 2, IsPlaying = false, TrackName = "Journey to the Island"},
                    new PlaylistItem {Artist = "John Williams", Album = "Jurassic Park OST", Id = 10, IsPlaying = false, TrackName = "Incident at Isla Nublar"}
                };
                NowPlayingItem = Playlist[0];
            }
            else
            {
                _playlistHelper = new PlaylistHelper(storageService);
                BackgroundAudioPlayer.Instance.PlayStateChanged += OnPlayStateChanged;
                GetPlaylistItems();
                IsPlaying = BackgroundAudioPlayer.Instance.PlayerState == PlayState.Playing;
            }
        }
 public PlaybackProgressReporter(IConnectionManager connectionManager, IMediaPlayer mediaPlayer, ILogger logger, IPlaybackManager playback)
 {
     _connectionManager = connectionManager;
     _mediaPlayer = mediaPlayer;
     _logger = logger;
     _playback = playback;
 }
        /// <summary>
        /// Initializes a new instance of the FolderViewModel class.
        /// </summary>
        public FolderViewModel(INavigationService navigationService, IConnectionManager connectionManager)
            : base(navigationService, connectionManager)
        {
            RecentItems = new ObservableCollection<BaseItemDto>();
            RandomItems = new ObservableCollection<BaseItemDto>();

            if (IsInDesignMode)
            {
                SelectedFolder = new BaseItemDto
                {
                    Name = "Movies"
                };
                RecentItems.Add(new BaseItemDto
                {
                    Id = "6536a66e10417d69105bae71d41a6e6f",
                    Name = "Jurassic Park",
                    SortName = "Jurassic Park",
                    Overview = "Lots of dinosaurs eating people!",
                    People = new[]
                    {
                        new BaseItemPerson {Name = "Steven Spielberg", Type = "Director"},
                        new BaseItemPerson {Name = "Sam Neill", Type = "Actor"},
                        new BaseItemPerson {Name = "Richard Attenborough", Type = "Actor"},
                        new BaseItemPerson {Name = "Laura Dern", Type = "Actor"}
                    }

                });
            }
            else
            {
                WireCommands();
                GroupBy = GroupBy.Name;
            }
        }
 public MultiServerSync(IConnectionManager connectionManager, ILogger logger, ILocalAssetManager userActionAssetManager, IFileTransferManager fileTransferManager)
 {
     _connectionManager = connectionManager;
     _logger = logger;
     _localAssetManager = userActionAssetManager;
     _fileTransferManager = fileTransferManager;
 }
 /// <summary>
 /// Initializes a new instance of the ChooseProfileViewModel class.
 /// </summary>
 public ChooseProfileViewModel(IConnectionManager connectionManager, INavigationService navigationService)
     : base(navigationService, connectionManager)
 {
     Profiles = new ObservableCollection<UserDto>();
     if (IsInDesignMode)
     {
         Profiles = new ObservableCollection<UserDto>
         {
             new UserDto
             {
                 Id = new Guid("dd425709431649698e92d86b1f2b00fa").ToString(),
                 Name = "ScottIsAFool"
             },
             new UserDto
             {
                 Id = new Guid("dab28e40cfbc43658082f55a44cf139a").ToString(),
                 Name = "Redshirt",
                 LastLoginDate = DateTime.Now.AddHours(-1)
             }
         };
     }
     else
     {
         WireCommands();
     }
 }
        /// <summary>
        /// Initializes a new instance of the ActorViewModel class.
        /// </summary>
        public ActorViewModel(IConnectionManager connectionManager, INavigationService navigationService)
            : base (navigationService, connectionManager)
        {
            if (IsInDesignMode)
            {
                SelectedPerson = new BaseItemPerson {Name = "Jeff Goldblum"};
                var list = new List<BaseItemDto>
                {
                    new BaseItemDto
                    {
                        Id = "6536a66e10417d69105bae71d41a6e6f",
                        Name = "Jurassic Park",
                        SortName = "Jurassic Park",
                        Overview = "Lots of dinosaurs eating people!",
                        People = new[]
                        {
                            new BaseItemPerson {Name = "Steven Spielberg", Type = "Director"},
                            new BaseItemPerson {Name = "Sam Neill", Type = "Actor"},
                            new BaseItemPerson {Name = "Richard Attenborough", Type = "Actor"},
                            new BaseItemPerson {Name = "Laura Dern", Type = "Actor"}
                        }
                    }
                };

                Films = Utils.GroupItemsByName(list).Result;
            }
        
        }
        public InternalDirectShowPlayer(ILogManager logManager, IHiddenWindow hiddenWindow, IPresentationManager presentation, ISessionManager sessionManager, IPlaybackManager playbackManager, ITheaterConfigurationManager config, IIsoManager isoManager, IUserInputManager inputManager, IZipClient zipClient, IHttpClient httpClient, IConnectionManager connectionManager)
        {
            _logger = logManager.GetLogger("InternalDirectShowPlayer");
            _hiddenWindow = hiddenWindow;
            _presentation = presentation;
            _sessionManager = sessionManager;
            _httpClient = httpClient;
            _connectionManager = connectionManager;
            _playbackManager = playbackManager;
            _config = config;
            _isoManager = isoManager;
            _inputManager = inputManager;
            _zipClient = zipClient;

            _config.Configuration.InternalPlayerConfiguration.VideoConfig.SetDefaults();
            _config.Configuration.InternalPlayerConfiguration.AudioConfig.SetDefaults();
            _config.Configuration.InternalPlayerConfiguration.SubtitleConfig.SetDefaults();
            _config.Configuration.InternalPlayerConfiguration.COMConfig.SetDefaults();

            //use a static object so we keep the libraries in the same place. Doesn't usually matter, but the EVR Presenter does some COM hooking that has problems if we change the lib address.
            //if (_privateCom == null)
            //    _privateCom = new URCOMLoader(_config, _zipClient);
            URCOMLoader.Instance.Initialize(_config, _zipClient, logManager);

            EnsureMediaFilters();
        }
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IConnectionManager connectionManager, INavigationService navigationService, IPlaybackManager playbackManager)
            : base(navigationService, connectionManager)
        {
            _playbackManager = playbackManager;
            Folders = new ObservableCollection<BaseItemDto>();
            RecentItems = new ObservableCollection<BaseItemDto>();
            FavouriteItems = new ObservableCollection<BaseItemDto>();
            InProgressItems = new ObservableCollection<BaseItemDto>();
            UserViews = new ObservableCollection<BaseItemDto>();

            if (IsInDesignMode)
            {
                Folders.Add(new BaseItemDto { Id = "78dbff5aa1c2101b98ebaf42b72a988d", Name = "Movies", UserData = new UserItemDataDto { UnplayedItemCount = 6 } });
                RecentItems.Add(new BaseItemDto { Id = "2fc6f321b5f8bbe842fcd0eed089561d", Name = "A Night To Remember" });
            }
            else
            {
                WireCommands();
                DummyFolder = new BaseItemDto
                {
                    Type = "folder",
                    Name = AppResources.LabelRecent.ToLower()
                };
            }
        }
 public ClientsViewModel(IEventAggregator aggregator, IRegionManager regionManager,
     IConnectionManager connectionManager, IInteractionService interactionService, ILoggerFacade loggerFacade) :
         base(aggregator, regionManager, connectionManager, interactionService, loggerFacade)
 {
     //aggregator.GetEvent<BootstrappingCompleteUiEvent>().Subscribe(BootstrappCompletedHandler);
     AdditionalRoomsValues = new ObservableCollection<string> {"Yes", "No"};
 }
Beispiel #29
0
        public Session(string target, IConnectionManager connectionManager)
        {
            this.connectionManager = connectionManager;

            this.Target = target;
            this.Name = target;

            this.connection = connectionManager.GetClientConnection(target);
            if (connection == null)
            {
                connection = connectionManager.AddClientConnection(target);
                connection.ConnectionReset += connection_ConnectionReset;
                connection.ConnectionTimedOut += connection_ConnectionTimedOut;
                connection.RemoteErrorOccurred += connection_RemoteErrorOccurred;
            }
            //authComponent = (AuthenticationComponent)connection.GetClientComponent(ComponentNamesExtended.Authentication);
            //clientInfoComponent = (ClientInfoClientComponent)connection.GetClientComponent(ComponentNamesExtended.ClientInfoProvider);
            //loggingConfigurator = (XmppLoggingConfiguratorComponent)connection.GetClientComponent(ComponentNamesExtended.XmppLoggingConfigurator);
            //fileShareComponent = (FileShareClientComponent)connection.GetClientComponent(ComponentNamesExtended.FileShare);

            authComponent = new AuthenticationComponent() { ClientConnection = connection };
            clientInfoComponent = new ClientInfoClientComponent() { ClientConnection = connection };
            loggingConfigurator = new XmppLoggingConfiguratorComponent() { ClientConnection = connection };
            fileShareComponent = new FileShareClientComponent() { ClientConnection = connection };

            //CommandInfo info = new CommandInfo();

            commands.Add("get-status", new CommandInfo() { ParameterCount = 0, CommandMethod = getStatusCommand, CheckConnection = false});
            commands.Add("connect", new CommandInfo() { ParameterCount = 0, CommandMethod = connectCommand, CheckConnection = false });
            commands.Add("disconnect", new CommandInfo() { ParameterCount = 0, CommandMethod = disconnectCommand });
            commands.Add("userauth", new CommandInfo() { ParameterCount = 1, CommandMethod = userauthCommand });
            commands.Add("get-info", new CommandInfo() { ParameterCount = 0, CommandMethod = getInfoCommand });
            commands.Add("exit-session", new CommandInfo() { CheckConnection=false, ParameterCount = 0, CommandMethod = exitSessionCommand });

            commands.Add("logger.get-enabled", new CommandInfo() { ParameterCount = 0, CommandMethod = loggerGetEnabledCommand });
            commands.Add("logger.set-enabled", new CommandInfo() { ParameterCount = 1, CommandMethod = loggerSetEnabledCommand });
            commands.Add("logger.get-loglevel", new CommandInfo() { ParameterCount = 0, CommandMethod = loggerGetLogLevelCommand });
            commands.Add("logger.set-loglevel", new CommandInfo() { ParameterCount = 1, CommandMethod = loggerSetLogLevelCommand });
            commands.Add("logger.get-recipient", new CommandInfo() { ParameterCount = 0, CommandMethod = loggerGetRecipientCommand });
            commands.Add("logger.set-recipient", new CommandInfo() { ParameterCount = 1, CommandMethod = loggerSetRecipientCommand });
            commands.Add("logger.get-debuglogging", new CommandInfo() { ParameterCount = 0, CommandMethod = loggerGetDebugLoggingCommand });
            commands.Add("logger.set-debuglogging", new CommandInfo() { ParameterCount = 1, CommandMethod = loggerSetDebugLoggingCommand });
            commands.Add("logger.test-logging", new CommandInfo() { ParameterCount = 1, CommandMethod = loggerTestLoggingCommand });

            commands.Add("fileshare.add-directory", new CommandInfo() { ParameterCount = 2, CommandMethod = fileshareAddDirectoryCommand });
            commands.Add("fileshare.remove-directory", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareRemoveDirectoryCommand });
            commands.Add("fileshare.get-directory", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareGetDirectoryCommand });
            commands.Add("fileshare.get-file", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareGetFileCommand });
            commands.Add("fileshare.add-permission", new CommandInfo() { ParameterCount = -2, CommandMethod = fileshareAddPermissionCommand });
            commands.Add("fileshare.remove-permission", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareRemovePermissionCommand });
            commands.Add("fileshare.get-mounts", new CommandInfo() { ParameterCount = 0, CommandMethod = fileshareGetMountsCommand });
            commands.Add("fileshare.check-permission", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareCheckPermissionCommand });
            commands.Add("fileshare.get-permissions", new CommandInfo() { ParameterCount = 0, CommandMethod = fileshareGetPermissionsCommand });
            commands.Add("fileshare.get-rootdirectory", new CommandInfo() { ParameterCount = 0, CommandMethod = fileshareGetRootDirectoryCommand });
            commands.Add("fileshare.set-rootdirectory", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareSetRootDirectoryCommand });

            commands.Add("fileshare.create-snapshot", new CommandInfo() { ParameterCount = 0, CommandMethod = fileshareCreateSnapshotCommand });
            commands.Add("fileshare.get-snapshots", new CommandInfo() { ParameterCount = 0, CommandMethod = fileshareGetSnapshotsCommand });
        }
 public StartupWizardPage(INavigationService nav, IConnectionManager connectionManager, IPresentationManager presentation, ILogger logger)
 {
     _nav = nav;
     _connectionManager = connectionManager;
     _presentation = presentation;
     _logger = logger;
     InitializeComponent();
 }
 public AgentsWebSocketCommandInvocator(IConnectionManager connectionManager)
 {
     _connectionManager = connectionManager;
 }
Beispiel #32
0
 public static void Create(IConnectionManager connectionManager, string databaseName)
 => new CreateDatabaseTask(databaseName)
 {
     ConnectionManager = connectionManager
 }.Execute();
Beispiel #33
0
 public TwoColumnsTableFixture(IConnectionManager connection, string tableName)
 {
     this.Connection = connection;
     this.TableName  = tableName;
     RecreateTable();
 }
Beispiel #34
0
 public DbMerge(IConnectionManager connectionManager, string tableName, int batchSize) : this(tableName, batchSize)
 {
     ConnectionManager = connectionManager;
 }
Beispiel #35
0
 public static void DropIfExists(IConnectionManager connectionManager, string schemaName)
 => new DropSchemaTask(schemaName)
 {
     ConnectionManager = connectionManager
 }.DropIfExists();
 public SignalrHubResolver(IConnectionManager connectionManager)
 {
     _connectionManager = connectionManager;
 }
Beispiel #37
0
 /// <param name="connectionManager">Sets the <see cref="ConnectionManager" /></param>
 /// <param name="tableName">Sets the <see cref="TableName" /></param>
 public DbSource(IConnectionManager connectionManager, string tableName) : this(tableName)
 {
     ConnectionManager = connectionManager;
 }
 public ConnectionManagerBehavior(bool inbound, IConnectionManager connectionManager, ILogger logger)
 {
     this.logger            = logger;
     this.Inbound           = inbound;
     this.ConnectionManager = connectionManager as ConnectionManager;
 }
        public FullNodeBroadcasterManager(IConnectionManager connectionManager, IMempoolValidator mempoolValidator) : base(connectionManager)
        {
            Guard.NotNull(mempoolValidator, nameof(mempoolValidator));

            this.mempoolValidator = mempoolValidator;
        }
Beispiel #40
0
 public static void DropIfExists(IConnectionManager connectionManager, string databaseName)
 => new DropDatabaseTask(databaseName)
 {
     ConnectionManager = connectionManager
 }.DropIfExists();
Beispiel #41
0
        public NavigationService(IThemeManager themeManager, Func <IPlaybackManager> playbackManagerFactory, IPresentationManager presentationManager, ITheaterConfigurationManager config, Func <ISessionManager> sessionFactory, IApplicationHost appHost, IInstallationManager installationManager, IImageManager imageManager, ILogger logger, Func <IUserInputManager> userInputManagerFactory, IHiddenWindow hiddenWindow, IConnectionManager connectionManager)
        {
            _themeManager           = themeManager;
            _playbackManagerFactory = playbackManagerFactory;
            _presentationManager    = presentationManager;
            _config                  = config;
            _sessionFactory          = sessionFactory;
            _appHost                 = appHost;
            _installationManager     = installationManager;
            _imageManager            = imageManager;
            _logger                  = logger;
            _userInputManagerFactory = userInputManagerFactory;
            _hiddenWindow            = hiddenWindow;
            _connectionManager       = connectionManager;

            presentationManager.WindowLoaded += presentationManager_WindowLoaded;
        }
 public ClientManager(ISocketManager socketManager, IConnectionManager connectionManager)
 {
     _socketManager     = socketManager;
     _connectionManager = connectionManager;
 }
Beispiel #43
0
 public SqlCe4DbClient(IAdoDriver driver, IDbConnection connection, IDbTransaction transaction, IConnectionManager connectionManager, ISqlStatements sqlStatements)
     : base(driver, connection, transaction, connectionManager, sqlStatements)
 {
 }
Beispiel #44
0
 public CreateDatabaseTask(string databaseName = null, string collation = null, IConnectionManager connectionManager = null) :
     base(connectionManager)
 {
     Collation    = collation;
     DatabaseName = databaseName;
 }
 public DeviceMessageHandler(IIdentity identity, IEdgeHub edgeHub, IConnectionManager connectionManager)
 {
     this.Identity          = Preconditions.CheckNotNull(identity, nameof(identity));
     this.edgeHub           = Preconditions.CheckNotNull(edgeHub, nameof(edgeHub));
     this.connectionManager = Preconditions.CheckNotNull(connectionManager, nameof(connectionManager));
 }
Beispiel #46
0
 public Connection(IConnectionManager connectionManager)
 {
     this.connectionManager = connectionManager;
 }
Beispiel #47
0
 public CreateDatabaseTarget(IConnectionManager connectionManager, string logTableName)
 {
     this.ConnectionManager = connectionManager;
     this.LogTableName      = logTableName;
 }
 public ChatController(IChatManager chatManager, IConnectionManager connectionManager, UserManager <ApplicationUser> userManager)
 {
     _manager     = chatManager;
     _userManager = userManager;
     _chatHub     = new QuickChatHub(connectionManager, userManager);
 }
 public LightWalletBroadcasterManager(IConnectionManager connectionManager) : base(connectionManager)
 {
 }
Beispiel #50
0
 public ClientServiceEventsHandler(IConnectionManager connectionManager, IResponseBuilder responseBuilder)
 {
     _connectionManager = connectionManager;
     _responseBuilder   = responseBuilder;
 }
Beispiel #51
0
 /// <param name="connectionManager">Sets the <see cref="ConnectionManager" /></param>
 public DbSource(IConnectionManager connectionManager) : this()
 {
     ConnectionManager = connectionManager;
 }
Beispiel #52
0
 public IEnumerable <SqlScript> GetScripts(IConnectionManager connectionManager)
 {
     return(sqlScripts);
 }
Beispiel #53
0
 public HubClient(IConnectionManager connectionManager, HubNamesDictionary hubNamesDictionary)
 {
     this.connectionManager  = connectionManager;
     this.hubNamesDictionary = hubNamesDictionary;
 }
Beispiel #54
0
 /// <summary>
 /// Runs the sql to clean up a schema.(Oracle and SqlServer only)
 /// </summary>
 /// <param name="connectionManager">The connection manager of the database you want to connect</param>
 /// <param name="schemaName">The name of the schema</param>
 public static void CleanUp(IConnectionManager connectionManager, string schemaName) => new CleanUpSchemaTask(schemaName)
 {
     ConnectionManager = connectionManager
 }.Execute();
Beispiel #55
0
        protected override void Load(ContainerBuilder builder)
        {
            // IMessageConverter<IRoutingMessage>
            builder.Register(c => new RoutingMessageConverter())
            .As <Core.IMessageConverter <IRoutingMessage> >()
            .SingleInstance();

            // IRoutingPerfCounter
            builder.Register(
                c =>
            {
                Routing.PerfCounter = NullRoutingPerfCounter.Instance;
                return(Routing.PerfCounter);
            })
            .As <IRoutingPerfCounter>()
            .AutoActivate()
            .SingleInstance();

            // IRoutingUserAnalyticsLogger
            builder.Register(
                c =>
            {
                Routing.UserAnalyticsLogger = NullUserAnalyticsLogger.Instance;
                return(Routing.UserAnalyticsLogger);
            })
            .As <IRoutingUserAnalyticsLogger>()
            .AutoActivate()
            .SingleInstance();

            // IRoutingUserMetricLogger
            builder.Register(
                c =>
            {
                Routing.UserMetricLogger = NullRoutingUserMetricLogger.Instance;
                return(Routing.UserMetricLogger);
            })
            .As <IRoutingUserMetricLogger>()
            .AutoActivate()
            .SingleInstance();

            // IMessageConverter<Message>
            builder.Register(c => new DeviceClientMessageConverter())
            .As <Core.IMessageConverter <Message> >()
            .SingleInstance();

            // IMessageConverter<Twin>
            builder.Register(c => new TwinMessageConverter())
            .As <Core.IMessageConverter <Twin> >()
            .SingleInstance();

            // IMessageConverter<TwinCollection>
            builder.Register(c => new TwinCollectionMessageConverter())
            .As <Core.IMessageConverter <TwinCollection> >()
            .SingleInstance();

            // IMessageConverterProvider
            builder.Register(
                c => new MessageConverterProvider(new Dictionary <Type, IMessageConverter>()
            {
                { typeof(Message), c.Resolve <Core.IMessageConverter <Message> >() },
                { typeof(Twin), c.Resolve <Core.IMessageConverter <Twin> >() },
                { typeof(TwinCollection), c.Resolve <Core.IMessageConverter <TwinCollection> >() }
            }))
            .As <IMessageConverterProvider>()
            .SingleInstance();

            // IDeviceConnectivityManager
            builder.Register(
                c =>
            {
                var edgeHubCredentials = c.ResolveNamed <IClientCredentials>("EdgeHubCredentials");
                IDeviceConnectivityManager deviceConnectivityManager = new DeviceConnectivityManager(this.connectivityCheckFrequency, TimeSpan.FromMinutes(2), edgeHubCredentials.Identity);
                return(deviceConnectivityManager);
            })
            .As <IDeviceConnectivityManager>()
            .SingleInstance();

            // IDeviceClientProvider
            builder.Register(c =>
            {
                IClientProvider underlyingClientProvider        = new ClientProvider();
                IClientProvider connectivityAwareClientProvider = new ConnectivityAwareClientProvider(underlyingClientProvider, c.Resolve <IDeviceConnectivityManager>());
                return(connectivityAwareClientProvider);
            })
            .As <IClientProvider>()
            .SingleInstance();

            // Task<ICloudConnectionProvider>
            builder.Register(
                async c =>
            {
                var messageConverterProvider = c.Resolve <IMessageConverterProvider>();
                var clientProvider           = c.Resolve <IClientProvider>();
                var tokenProvider            = c.ResolveNamed <ITokenProvider>("EdgeHubClientAuthTokenProvider");
                IDeviceScopeIdentitiesCache deviceScopeIdentitiesCache = await c.Resolve <Task <IDeviceScopeIdentitiesCache> >();
                ICloudConnectionProvider cloudConnectionProvider       = new CloudConnectionProvider(
                    messageConverterProvider,
                    this.connectionPoolSize,
                    clientProvider,
                    this.upstreamProtocol,
                    tokenProvider,
                    deviceScopeIdentitiesCache,
                    TimeSpan.FromMinutes(60));
                return(cloudConnectionProvider);
            })
            .As <Task <ICloudConnectionProvider> >()
            .SingleInstance();

            // Task<IConnectionManager>
            builder.Register(
                async c =>
            {
                var cloudConnectionProviderTask = c.Resolve <Task <ICloudConnectionProvider> >();
                var credentialsCacheTask        = c.Resolve <Task <ICredentialsCache> >();
                ICloudConnectionProvider cloudConnectionProvider = await cloudConnectionProviderTask;
                ICredentialsCache credentialsCache   = await credentialsCacheTask;
                IConnectionManager connectionManager = new ConnectionManager(
                    cloudConnectionProvider,
                    credentialsCache,
                    this.edgeDeviceId,
                    this.edgeModuleId,
                    this.maxConnectedClients);
                return(connectionManager);
            })
            .As <Task <IConnectionManager> >()
            .SingleInstance();

            // Task<IEndpointFactory>
            builder.Register(async c =>
            {
                var messageConverter = c.Resolve <Core.IMessageConverter <IRoutingMessage> >();
                IConnectionManager connectionManager = await c.Resolve <Task <IConnectionManager> >();
                return(new EndpointFactory(connectionManager, messageConverter, this.edgeDeviceId) as IEndpointFactory);
            })
            .As <Task <IEndpointFactory> >()
            .SingleInstance();

            // Task<RouteFactory>
            builder.Register(async c => new EdgeRouteFactory(await c.Resolve <Task <IEndpointFactory> >()) as RouteFactory)
            .As <Task <RouteFactory> >()
            .SingleInstance();

            // RouterConfig
            builder.Register(c => new RouterConfig(Enumerable.Empty <Route>()))
            .As <RouterConfig>()
            .SingleInstance();

            if (!this.isStoreAndForwardEnabled)
            {
                // EndpointExecutorConfig
                builder.Register(
                    c =>
                {
                    RetryStrategy defaultRetryStrategy = new FixedInterval(0, TimeSpan.FromSeconds(1));
                    TimeSpan defaultRevivePeriod       = TimeSpan.FromHours(1);
                    TimeSpan defaultTimeout            = TimeSpan.FromSeconds(60);
                    return(new EndpointExecutorConfig(defaultTimeout, defaultRetryStrategy, defaultRevivePeriod, true));
                })
                .As <EndpointExecutorConfig>()
                .SingleInstance();

                // IEndpointExecutorFactory
                builder.Register(c => new SyncEndpointExecutorFactory(c.Resolve <EndpointExecutorConfig>()))
                .As <IEndpointExecutorFactory>()
                .SingleInstance();

                // Task<Router>
                builder.Register(
                    async c =>
                {
                    var endpointExecutorFactory = c.Resolve <IEndpointExecutorFactory>();
                    var routerConfig            = c.Resolve <RouterConfig>();
                    Router router = await Router.CreateAsync(Guid.NewGuid().ToString(), this.iotHubName, routerConfig, endpointExecutorFactory);
                    return(router);
                })
                .As <Task <Router> >()
                .SingleInstance();

                // Task<ITwinManager>
                builder.Register(async c =>
                {
                    var messageConverterProvider         = c.Resolve <IMessageConverterProvider>();
                    IConnectionManager connectionManager = await c.Resolve <Task <IConnectionManager> >();
                    return(TwinManager.CreateTwinManager(connectionManager, messageConverterProvider, Option.None <IStoreProvider>()));
                })
                .As <Task <ITwinManager> >()
                .SingleInstance();
            }
            else
            {
                // EndpointExecutorConfig
                builder.Register(
                    c =>
                {
                    // Endpoint executor config values -
                    // ExponentialBackoff - minBackoff = 1s, maxBackoff = 60s, delta (used to add randomness to backoff) - 1s (default)
                    // Num of retries = int.MaxValue(we want to keep retrying till the message is sent)
                    // Revive period - period for which the endpoint should be considered dead if it doesn't respond - 1 min (we want to try continuously till the message expires)
                    // Timeout - time for which we want for the ack from the endpoint = 30s
                    // TODO - Should the number of retries be tied to the Store and Forward ttl? Not
                    // doing that right now as that value can be changed at runtime, but these settings
                    // cannot. Need to make the number of retries dynamically configurable for that.

                    TimeSpan minWait            = TimeSpan.FromSeconds(1);
                    TimeSpan maxWait            = TimeSpan.FromSeconds(60);
                    TimeSpan delta              = TimeSpan.FromSeconds(1);
                    int retries                 = int.MaxValue;
                    RetryStrategy retryStrategy = new ExponentialBackoff(retries, minWait, maxWait, delta);
                    TimeSpan timeout            = TimeSpan.FromSeconds(30);
                    TimeSpan revivePeriod       = TimeSpan.FromSeconds(30);
                    return(new EndpointExecutorConfig(timeout, retryStrategy, revivePeriod));
                })
                .As <EndpointExecutorConfig>()
                .SingleInstance();

                // ICheckpointStore
                builder.Register(c => CheckpointStore.Create(c.Resolve <IDbStoreProvider>()))
                .As <ICheckpointStore>()
                .SingleInstance();

                // IMessageStore
                builder.Register(
                    c =>
                {
                    var checkpointStore          = c.Resolve <ICheckpointStore>();
                    var dbStoreProvider          = c.Resolve <IDbStoreProvider>();
                    IStoreProvider storeProvider = new StoreProvider(dbStoreProvider);
                    IMessageStore messageStore   = new MessageStore(storeProvider, checkpointStore, TimeSpan.MaxValue);
                    return(messageStore);
                })
                .As <IMessageStore>()
                .SingleInstance();

                // IEndpointExecutorFactory
                builder.Register(
                    c =>
                {
                    var endpointExecutorConfig = c.Resolve <EndpointExecutorConfig>();
                    var messageStore           = c.Resolve <IMessageStore>();
                    IEndpointExecutorFactory endpointExecutorFactory = new StoringAsyncEndpointExecutorFactory(endpointExecutorConfig, new AsyncEndpointExecutorOptions(10, TimeSpan.FromSeconds(10)), messageStore);
                    return(endpointExecutorFactory);
                })
                .As <IEndpointExecutorFactory>()
                .SingleInstance();

                // Task<Router>
                builder.Register(
                    async c =>
                {
                    var checkpointStore         = c.Resolve <ICheckpointStore>();
                    var routerConfig            = c.Resolve <RouterConfig>();
                    var endpointExecutorFactory = c.Resolve <IEndpointExecutorFactory>();
                    return(await Router.CreateAsync(Guid.NewGuid().ToString(), this.iotHubName, routerConfig, endpointExecutorFactory, checkpointStore));
                })
                .As <Task <Router> >()
                .SingleInstance();

                // Task<ITwinManager>
                builder.Register(async c =>
                {
                    var dbStoreProvider                  = c.Resolve <IDbStoreProvider>();
                    var messageConverterProvider         = c.Resolve <IMessageConverterProvider>();
                    IConnectionManager connectionManager = await c.Resolve <Task <IConnectionManager> >();
                    return(TwinManager.CreateTwinManager(connectionManager, messageConverterProvider, Option.Some <IStoreProvider>(new StoreProvider(dbStoreProvider))));
                })
                .As <Task <ITwinManager> >()
                .SingleInstance();
            }

            // IClientCredentials "EdgeHubCredentials"
            builder.Register(
                c =>
            {
                var identityFactory = c.Resolve <IClientCredentialsFactory>();
                IClientCredentials edgeHubCredentials = this.connectionString.Map(cs => identityFactory.GetWithConnectionString(cs)).GetOrElse(
                    () => identityFactory.GetWithIotEdged(this.edgeDeviceId, this.edgeModuleId));
                return(edgeHubCredentials);
            })
            .Named <IClientCredentials>("EdgeHubCredentials")
            .SingleInstance();

            // Task<IInvokeMethodHandler>
            builder.Register(async c =>
            {
                IConnectionManager connectionManager = await c.Resolve <Task <IConnectionManager> >();
                return(new InvokeMethodHandler(connectionManager) as IInvokeMethodHandler);
            })
            .As <Task <IInvokeMethodHandler> >()
            .SingleInstance();

            // Task<IEdgeHub>
            builder.Register(
                async c =>
            {
                var routingMessageConverter = c.Resolve <Core.IMessageConverter <IRoutingMessage> >();
                var routerTask              = c.Resolve <Task <Router> >();
                var twinManagerTask         = c.Resolve <Task <ITwinManager> >();
                var invokeMethodHandlerTask = c.Resolve <Task <IInvokeMethodHandler> >();
                var connectionManagerTask   = c.Resolve <Task <IConnectionManager> >();
                Router router                            = await routerTask;
                ITwinManager twinManager                 = await twinManagerTask;
                IConnectionManager connectionManager     = await connectionManagerTask;
                IInvokeMethodHandler invokeMethodHandler = await invokeMethodHandlerTask;
                IEdgeHub hub = new RoutingEdgeHub(router, routingMessageConverter,
                                                  connectionManager, twinManager, this.edgeDeviceId, invokeMethodHandler);
                return(hub);
            })
            .As <Task <IEdgeHub> >()
            .SingleInstance();

            // Task<ConfigUpdater>
            builder.Register(
                async c =>
            {
                IMessageStore messageStore = this.isStoreAndForwardEnabled ? c.Resolve <IMessageStore>() : null;
                Router router     = await c.Resolve <Task <Router> >();
                var configUpdater = new ConfigUpdater(router, messageStore);
                return(configUpdater);
            })
            .As <Task <ConfigUpdater> >()
            .SingleInstance();

            // Task<IConfigSource>
            builder.Register(
                async c =>
            {
                RouteFactory routeFactory = await c.Resolve <Task <RouteFactory> >();
                if (this.useTwinConfig)
                {
                    var edgeHubCredentials             = c.ResolveNamed <IClientCredentials>("EdgeHubCredentials");
                    var twinCollectionMessageConverter = c.Resolve <Core.IMessageConverter <TwinCollection> >();
                    var twinMessageConverter           = c.Resolve <Core.IMessageConverter <Twin> >();
                    var twinManagerTask                  = c.Resolve <Task <ITwinManager> >();
                    var edgeHubTask                      = c.Resolve <Task <IEdgeHub> >();
                    ITwinManager twinManager             = await twinManagerTask;
                    IEdgeHub edgeHub                     = await edgeHubTask;
                    IConnectionManager connectionManager = await c.Resolve <Task <IConnectionManager> >();
                    IDeviceScopeIdentitiesCache deviceScopeIdentitiesCache = await c.Resolve <Task <IDeviceScopeIdentitiesCache> >();
                    IConfigSource edgeHubConnection = await EdgeHubConnection.Create(
                        edgeHubCredentials.Identity,
                        edgeHub,
                        twinManager,
                        connectionManager,
                        routeFactory,
                        twinCollectionMessageConverter,
                        twinMessageConverter,
                        this.versionInfo,
                        deviceScopeIdentitiesCache
                        );
                    return(edgeHubConnection);
                }
                else
                {
                    return(new LocalConfigSource(routeFactory, this.routes, this.storeAndForwardConfiguration));
                }
            })
            .As <Task <IConfigSource> >()
            .SingleInstance();

            // Task<IConnectionProvider>
            builder.Register(
                async c =>
            {
                var connectionManagerTask              = c.Resolve <Task <IConnectionManager> >();
                var edgeHubTask                        = c.Resolve <Task <IEdgeHub> >();
                IConnectionManager connectionManager   = await connectionManagerTask;
                IEdgeHub edgeHub                       = await edgeHubTask;
                IConnectionProvider connectionProvider = new ConnectionProvider(connectionManager, edgeHub);
                return(connectionProvider);
            })
            .As <Task <IConnectionProvider> >()
            .SingleInstance();

            base.Load(builder);
        }
Beispiel #56
0
 /// <summary>
 /// Runs the sql to clean up the user schema. (Oracle only)
 /// </summary>
 /// <param name="connectionManager">The connection manager of the database you want to connect</param>
 public static void CleanUp(IConnectionManager connectionManager) => new CleanUpSchemaTask()
 {
     ConnectionManager = connectionManager
 }.Execute();
Beispiel #57
0
 /// <summary>
 /// Drops a view if the view exists.
 /// </summary>
 /// <param name="connectionManager">The connection manager of the database you want to connect</param>
 /// <param name="viewName">Name of the view to drop</param>
 public static void DropIfExists(IConnectionManager connectionManager, string viewName)
 => new DropViewTask(viewName)
 {
     ConnectionManager = connectionManager
 }.DropIfExists();
Beispiel #58
0
 public static void DropIfExists(IConnectionManager connectionManager, string procedureName)
 => new DropProcedureTask(procedureName)
 {
     ConnectionManager = connectionManager
 }.DropIfExists();
Beispiel #59
0
 public static void Truncate(IConnectionManager connection, string tableName) => new TruncateTableTask(tableName)
 {
     ConnectionManager = connection
 }.Execute();
Beispiel #60
0
            public static async Task <TestDevice> Create(string deviceId, IEdgeHub edgeHub, IConnectionManager connectionManager)
            {
                IClientCredentials deviceCredentials = SetupDeviceIdentity(deviceId);
                Try <ICloudProxy>  cloudProxy        = await connectionManager.CreateCloudConnectionAsync(deviceCredentials);

                Assert.True(cloudProxy.Success);
                var deviceProxy    = Mock.Of <IDeviceProxy>();
                var deviceListener = new DeviceMessageHandler(deviceCredentials.Identity, edgeHub, connectionManager);

                deviceListener.BindDeviceProxy(deviceProxy);
                return(new TestDevice(deviceCredentials.Identity as IDeviceIdentity, deviceListener));
            }