Example #1
0
        /// <summary>
        /// Initialises a new instance of the <see cref="BrowsersSupportedSectionAnswers"/> class.
        /// </summary>
        public BrowsersSupportedSectionAnswers(IClientApplication clientApplication)
        {
            bool?mobileResponsive = clientApplication?.MobileResponsive;

            SupportedBrowsers = clientApplication?.BrowsersSupported?.Any() == true ? clientApplication?.BrowsersSupported : null;
            MobileResponsive  = mobileResponsive.ToYesNoString();
        }
        /// <summary>
        /// Initialises a new instance of the <see cref="GetBrowsersSupportedResult"/> class.
        /// </summary>
        public GetBrowsersSupportedResult(IClientApplication clientApplication)
        {
            bool?clientApplicationMobileResponsive = clientApplication?.MobileResponsive;

            BrowsersSupported = clientApplication?.BrowsersSupported ?? new HashSet <string>();
            MobileResponsive  = clientApplicationMobileResponsive.ToYesNoString();
        }
        public MobileOperatingSystemsSectionAnswers(IClientApplication clientApplication)
        {
            OperatingSystems = clientApplication?.MobileOperatingSystems?.OperatingSystems?.Any() == true
                ? clientApplication.MobileOperatingSystems?.OperatingSystems
                : null;

            OperatingSystemsDescription = clientApplication?.MobileOperatingSystems?.OperatingSystemsDescription;
        }
 /// <summary>
 /// Initialises a new instance of the <see cref="BrowserBasedSubSections"/> class.
 /// </summary>
 internal BrowserBasedSubSections(IClientApplication clientApplication)
 {
     BrowsersSupported                       = new BrowsersSupportedSection(clientApplication);
     PluginOrExtensionsSection               = new PluginOrExtensionsSection(clientApplication);
     BrowserHardwareRequirementsSection      = new BrowserHardwareRequirementsSection(clientApplication);
     BrowserAdditionalInformationSection     = new BrowserAdditionalInformationSection(clientApplication);
     BrowserConnectivityAndResolutionSection = new BrowserConnectivityAndResolutionSection(clientApplication);
     BrowserMobileFirstSection               = new BrowserMobileFirstSection(clientApplication);
 }
 public ClientApplicationTypesSubSections(IClientApplication clientApplication)
 {
     BrowserBased = clientApplication?.ClientApplicationTypes?.Contains("browser-based") == true ?
                    new BrowserBasedSection(clientApplication).IfPopulated() :
                    null;
     NativeMobile = clientApplication?.ClientApplicationTypes?.Contains("native-mobile") == true
         ? new NativeMobileSection(clientApplication).IfPopulated()
         : null;
 }
Example #6
0
 public NativeDesktopSections(IClientApplication clientApplication)
 {
     OperatingSystems      = DashboardSection.Mandatory(clientApplication.IsNativeDesktopOperatingSystemsComplete());
     ConnectionDetails     = DashboardSection.Mandatory(clientApplication.IsNativeDesktopConnectionDetailsComplete());
     MemoryAndStorage      = DashboardSection.Mandatory(clientApplication.IsNativeDesktopMemoryAndStorageComplete());
     ThirdParty            = DashboardSection.Optional(clientApplication.IsNativeDesktopThirdPartyComplete());
     HardwareRequirements  = DashboardSection.Optional(!string.IsNullOrWhiteSpace(clientApplication?.NativeDesktopHardwareRequirements));
     AdditionalInformation = DashboardSection.Optional(!string.IsNullOrWhiteSpace(clientApplication?.NativeDesktopAdditionalInformation));
 }
        public InventarioApp(IClientApplication app)
        {
            this.idEmpresa = Guid.Empty;
            this.app       = app;
            this.guid      = new SequentialGuid();

            this.animales   = this.GetListaDeAnimales();
            this.sucursales = this.GetListaDeSucursales();
        }
Example #8
0
 /// <summary>
 /// Initialises a new instance of the <see cref="BrowserBasedDashboardSections"/> class.
 /// </summary>
 public BrowserBasedDashboardSections(IClientApplication clientApplication)
 {
     BrowsersSupportedSection            = new BrowserBasedDashboardSection(clientApplication.IsBrowserSupportedComplete(), true);
     BrowserMobileFirstSection           = new BrowserBasedDashboardSection(clientApplication.IsMobileFirstComplete(), true);
     PluginsOrExtensionsSection          = new BrowserBasedDashboardSection(clientApplication.IsPluginsComplete(), true);
     ConnectivityAndResolutionSection    = new BrowserBasedDashboardSection(clientApplication.IsConnectivityAndResolutionComplete(), true);
     HardwareRequirementsSection         = new BrowserBasedDashboardSection(clientApplication.IsHardwareRequirementComplete(), false);
     BrowserAdditionalInformationSection = new BrowserBasedDashboardSection(clientApplication.IsAdditionalInformationComplete(), false);
 }
        public TelemetryService(IClientApplication clientApp)
        {
            _clientApp = clientApp;

            _plsVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
#if DEBUG
            _plsVersion += "-debug";  // Add a suffix so we can more easily ignore non-release versions.
#endif
        }
 internal NativeDesktopSubSections(IClientApplication clientApplication)
 {
     HardwareRequirementsSection               = new NativeDesktopHardwareRequirementsSection(clientApplication);
     OperatingSystemsSection                   = new NativeDesktopOperatingSystemsSection(clientApplication);
     NativeDesktopConnectivityDetailsSection   = new NativeDesktopConnectivityDetailsSection(clientApplication);
     NativeDesktopThirdPartySection            = new NativeDesktopThirdPartySection(clientApplication);
     NativeDesktopMemoryAndStorageSection      = new NativeDesktopMemoryAndStorageSection(clientApplication);
     NativeDesktopAdditionalInformationSection = new NativeDesktopAdditionalInformationSection(clientApplication);
 }
Example #11
0
        /// <summary>
        /// Initialises a new instance of the <see cref="ClientApplicationTypesSubSections"/> class.
        /// </summary>
        /// <param name="clientApplication"></param>
        public ClientApplicationTypesSubSections(IClientApplication clientApplication)
        {
            HashSet <string> clientApplicationTypes = clientApplication?.ClientApplicationTypes ?? new HashSet <string>();

            SetIfSelected("browser-based", clientApplicationTypes,
                          () => BrowserBasedSection = DashboardSection.Mandatory(clientApplication.IsBrowserBasedComplete()));
            SetIfSelected("native-mobile", clientApplicationTypes, () => NativeMobileSection   = DashboardSection.Mandatory(false));
            SetIfSelected("native-desktop", clientApplicationTypes, () => NativeDesktopSection = DashboardSection.Mandatory(false));
        }
Example #12
0
 internal NativeMobileSubSections(IClientApplication clientApplication)
 {
     MobileOperatingSystemsSection      = new MobileOperatingSystemsSection(clientApplication);
     NativeMobileFirstSection           = new NativeMobileFirstSection(clientApplication);
     MobileConnectionDetailsSection     = new MobileConnectionDetailsSection(clientApplication);
     MobileMemoryAndStorageSection      = new MobileMemoryAndStorageSection(clientApplication);
     HardwareRequirementsSection        = new MobileHardwareRequirementsSection(clientApplication);
     MobileThirdPartySection            = new MobileThirdPartySection(clientApplication);
     MobileAdditionalInformationSection = new MobileAdditionalInformationSection(clientApplication);
 }
Example #13
0
            public void WhenGetClientApplicationWithKnownId_ThenReturnsApp()
            {
                var app = new Mock <IClientApplication>();

                storageProvider.Setup(sp => sp.Get(It.IsAny <string>())).Returns(app.Object);

                IClientApplication result = clientManager.GetClientApplication("foo");

                Assert.Equal(app.Object, result);
            }
 public NativeMobileSections(IClientApplication clientApplication)
 {
     MobileOperatingSystems             = DashboardSection.Mandatory(clientApplication.IsMobileOperatingSystems());
     MobileFirst                        = DashboardSection.Mandatory(clientApplication.IsNativeMobileFirstComplete());
     MobileMemoryStorage                = DashboardSection.Mandatory(clientApplication.IsMobileMemoryAndStorageComplete());
     MobileConnectionDetails            = DashboardSection.Optional(clientApplication.IsMobileConnectionDetailsComplete());
     MobileComponentsDeviceCapabilities = DashboardSection.Optional(false);
     MobileHardwareRequirements         = DashboardSection.Optional(false);
     MobileAdditionalInformation        = DashboardSection.Optional(false);
 }
Example #15
0
            public void WhenCreateClientApplicationWithNewName_ThenCreatesNewApp()
            {
                storageProvider.Setup(sp => sp.Get(It.IsAny <string>())).Returns((IClientApplication)null);

                IClientApplication result = clientManager.CreateClientApplication("foo");

                storageProvider.Verify(sp => sp.Add(It.IsAny <IClientApplication>()), Times.Once());
                Assert.NotNull(result);
                Assert.Equal("foo", result.Name);
                Assert.False(!result.ClientIdentifier.HasValue());
                Assert.False(!result.ClientSecret.HasValue());
            }
Example #16
0
            public void WhenRegisterClientApplicationWithExistingIdentifier_ThenReturnsNull()
            {
                var app = new Mock <IClientApplication>();

                storageProvider.Setup(sp => sp.Find(It.IsAny <string>())).Returns(new[]
                {
                    app.Object
                });

                IClientApplication result = clientManager.RegisterClientApplication(new ClientApplication());

                Assert.Null(result);
            }
Example #17
0
        /// <summary>
        ///     Returns the specified client from the store.
        /// </summary>
        public IClientDescription GetClient(string clientIdentifier)
        {
            Guard.NotNullOrEmpty(() => clientIdentifier, clientIdentifier);

            IClientApplication clientApp =
                ClientApplicationsManager.GetClientApplicationByClientIdentifier(clientIdentifier);

            if (clientApp != null)
            {
                return(new ClientDescription(clientApp.ClientSecret, null, ClientType.Confidential));
            }

            return(null);
        }
Example #18
0
        private async Task <NativeMobileResult> GetNativeMobileSectionAsync(IClientApplication clientApplication)
        {
            mockMediator.Setup(
                m => m.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>()))
            .ReturnsAsync(clientApplication);

            var result = await nativeMobileController.GetNativeMobileAsync(SolutionId) as ObjectResult;

            result?.StatusCode.Should().Be(StatusCodes.Status200OK);

            mockMediator.Verify(
                m => m.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>()));

            return(result?.Value as NativeMobileResult);
        }
Example #19
0
        private async Task <BrowserBasedResult> GetBrowserBasedSectionAsync(IClientApplication clientApplication)
        {
            _mockMediator.Setup(m =>
                                m.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>()))
            .ReturnsAsync(clientApplication);

            var result = (await _browserBasedController.GetBrowserBasedAsync(SolutionId).ConfigureAwait(false)) as ObjectResult;

            result.StatusCode.Should().Be((int)HttpStatusCode.OK);

            _mockMediator.Verify(
                m => m.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>()),
                Times.Once);
            return(result.Value as BrowserBasedResult);
        }
Example #20
0
 public void Setup()
 {
     _mockMediator = new Mock <IMediator>();
     _mockMediator.Setup(x => x.Send(It.Is <UpdateSolutionConnectivityAndResolutionCommand>(command =>
                                                                                            command.Id == SolutionId), It.IsAny <CancellationToken>()))
     .ReturnsAsync(() => _validationResult);
     _clientApplication = Mock.Of <IClientApplication>(c => c.MinimumConnectionSpeed == "1 PPH" && c.MinimumDesktopResolution == "1x1");
     _mockMediator.Setup(x => x.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId),
                                     It.IsAny <CancellationToken>()))
     .ReturnsAsync(() => _clientApplication);
     _controller       = new ConnectivityAndResolutionController(_mockMediator.Object);
     _validationResult = new RequiredResult();
     _viewModel        = new UpdateSolutionConnectivityAndResolutionViewModel {
         MinimumConnectionSpeed = "1 PPH (Pigeon Per Hour)", MinimumDesktopResolution = "1x1"
     };
 }
Example #21
0
 /// <summary>
 /// 初始化数据访问组件
 /// </summary>
 public void Init()
 {
     if (netEP != null && (netEP.IpAddress != ClientConfig.ServerIP || netEP.TcpPort != ClientConfig.ServerPort))
     {
         if (dataClient != null && dataClient.CommunicationState == Net.Communication.CommunicationStates.Connected)
         {
             dataClient.Disconnect();
         }
     }
     netEP                    = new CJiaEndPoint(ClientConfig.ServerIP, ClientConfig.ServerPort);
     dataClient               = CJiaClientBuilder.CreateClientApplication <CJia.Net.Service.IDataAdapter>(netEP);
     dataClient.Timeout       = 6000 * 10; //三分钟超时
     dataClient.AllowAutoPing = false;
     dataClient.PingInterval  = 30000;     //30秒
     dataClient.Connect();
     dataClient.ServiceProxy.Init(ClientCode, DbName);
 }
Example #22
0
        public DiagnosticsService(IServiceContainer services)
        {
            _services  = services;
            _clientApp = services.GetService <IClientApplication>();

            var idleTimeService = services.GetService <IIdleTimeService>();

            if (idleTimeService != null)
            {
                idleTimeService.Idle    += OnIdle;
                idleTimeService.Closing += OnClosing;

                _disposables
                .Add(() => idleTimeService.Idle -= OnIdle)
                .Add(() => idleTimeService.Idle -= OnClosing);
            }
        }
Example #23
0
            public void WhenRegisterClientApplicationWithNewApplication_ThenRegistersNewApp()
            {
                storageProvider.Setup(sp => sp.Get(It.IsAny <string>())).Returns((IClientApplication)null);

                IClientApplication result = clientManager.RegisterClientApplication(new ClientApplication
                {
                    Name             = "foo",
                    ClientIdentifier = "bar",
                    ClientSecret     = "bar2",
                });

                storageProvider.Verify(sp => sp.Add(It.IsAny <IClientApplication>()), Times.Once());
                Assert.NotNull(result);
                Assert.Equal(@"foo", result.Name);
                Assert.Equal(@"bar", result.ClientIdentifier);
                Assert.Equal(@"bar2", result.ClientSecret);
            }
Example #24
0
        private async Task <BrowserBasedResult> GetBrowserBasedSectionAsync(IClientApplication clientApplication)
        {
            mockMediator
            .Setup(m => m.Send(
                       It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId),
                       It.IsAny <CancellationToken>()))
            .ReturnsAsync(clientApplication);

            var result = (await browserBasedController.GetBrowserBasedAsync(SolutionId)) as ObjectResult;

            Assert.NotNull(result);
            result.StatusCode.Should().Be(StatusCodes.Status200OK);

            mockMediator.Verify(m => m.Send(
                                    It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId),
                                    It.IsAny <CancellationToken>()));

            return(result.Value as BrowserBasedResult);
        }
Example #25
0
 /// <summary>
 /// Initialises a new instance of the <see cref="ClientApplicationTypesSection"/> class.
 /// </summary>
 public ClientApplicationTypesSection(IClientApplication clientApplication)
 {
     Sections = new ClientApplicationTypesSubSections(clientApplication);
 }
 public BrowserMobileFirstSectionAnswers(IClientApplication clientApplication) =>
 public MobileThirdPartySection(IClientApplication clientApplication)
 {
     Answers = new MobileThirdSectionAnswers(clientApplication?.MobileThirdParty);
 }
 public MobileConnectionDetailsSection(IClientApplication clientApplication)
 {
     Answers = new MobileConnectionDetailsSectionAnswers(clientApplication?.MobileConnectionDetails);
 }
Example #29
0
 public NativeDesktopAdditionalInformationSection(IClientApplication clientApplication) =>
 internal NativeDesktopMemoryAndStorageSection(IClientApplication clientApplication)
 {
     Answers = new NativeDesktopMemoryAndStorageSectionAnswers(clientApplication.NativeDesktopMemoryAndStorage);
 }