public static ContainerSpecification GetSpecification(ApplicationName application)
        {
            switch (application)
            {
                //based on case, we need to include methods to register only necessary components.
            }

            return null;
        }
예제 #2
0
 /// <summary>Snippet for GetApplication</summary>
 public void GetApplicationRequestObject()
 {
     // Snippet: GetApplication(GetApplicationRequest, CallSettings)
     // Create client
     ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.Create();
     // Initialize request argument(s)
     GetApplicationRequest request = new GetApplicationRequest
     {
         ApplicationName = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
     };
     // Make the request
     Application response = applicationServiceClient.GetApplication(request);
     // End snippet
 }
예제 #3
0
        /// <summary>Snippet for DeleteApplicationAsync</summary>
        public async Task DeleteApplicationResourceNamesAsync()
        {
            // Snippet: DeleteApplicationAsync(ApplicationName, CallSettings)
            // Additional: DeleteApplicationAsync(ApplicationName, CancellationToken)
            // Create client
            ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();

            // Initialize request argument(s)
            ApplicationName name = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
            // Make the request
            await applicationServiceClient.DeleteApplicationAsync(name);

            // End snippet
        }
        public void TestContent()
        {
            CastDate currentDate = new CastDate {
                Time = 1484953200000
            };
            ReportData reportData = TestUtility.PrepareApplicationReportData("ReportGenerator",
                                                                             null, @".\Data\CurrentBCresults.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2", currentDate,
                                                                             null, null, null, null, null, null);

            var component = new ApplicationName();
            Dictionary <string, string> config = new Dictionary <string, string>();
            var str = component.Content(reportData, config);

            Assert.AreEqual("ReportGenerator", str);
        }
예제 #5
0
        public static void Initialize(System.Fabric.ServiceContext context)
        {
            ApplicationName = context.CodePackageActivationContext.ApplicationName;
            string typeName = context.CodePackageActivationContext.ApplicationTypeName;

            typeName = typeName.Remove(typeName.Length - 4, 4);
            string unqualifiedApplicationName = $"{Constant.FabricScheme}/{typeName}";
            string environmentName            = ApplicationName.Replace(unqualifiedApplicationName, "");

            if (environmentName.Length > 1)
            {
                // remove the . character to get the environment name extracted
                EnvironmentName = environmentName.Substring(1, environmentName.Length - 1);
            }
        }
예제 #6
0
 public virtual ApiKeyInfo AddApiKey()
 {
     if (ApplicationName.Equals(ApplicationDiagnosticInfo.UnknownApplication))
     {
         throw new ApplicationNameNotSpecifiedException();
     }
     CoreServices.ApplicationRegistration.Data.Application app = CompositeRepository.Query <CoreServices.ApplicationRegistration.Data.Application>(a => a.Name.Equals(base.ApplicationName)).FirstOrDefault();
     if (app == null)
     {
         throw new InvalidOperationException("Application not registered");
     }
     AddApiKey(ApplicationRegistrationRepository, app, out CoreServices.ApplicationRegistration.Data.ApiKey key);
     return(new ApiKeyInfo {
         ApplicationClientId = key.ClientId, ApiKey = key.SharedSecret, ApplicationName = ApplicationName
     });
 }
        public void DeleteApplicationResourceNames()
        {
            moq::Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new moq::Mock <ApplicationService.ApplicationServiceClient>(moq::MockBehavior.Strict);
            DeleteApplicationRequest request = new DeleteApplicationRequest
            {
                ApplicationName = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteApplication(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ApplicationServiceClient client = new ApplicationServiceClientImpl(mockGrpcClient.Object, null);

            client.DeleteApplication(request.ApplicationName);
            mockGrpcClient.VerifyAll();
        }
예제 #8
0
        private ProviderConfiguration(NameValueCollection config)
        {
            EnableLoggingIfParametersAvailable(config);
            // Get connection host, port and password.
            // host, port, accessKey and ssl are firest fetched from appSettings if not found there than taken from web.config
            ConnectionString    = GetConnectionString(config);
            Host                = GetStringSettings(config, "host", "127.0.0.1");
            Port                = GetIntSettings(config, "port", 0);
            AccessKey           = GetStringSettings(config, "accessKey", null);
            UseSsl              = GetBoolSettings(config, "ssl", true);
            RedisSerializerType = GetStringSettings(config, "redisSerializerType", null);
            ConnectionMultiplexerFactoryType = GetStringSettings(config, "connectionMultiplexerFactoryType", null);
            // All below parameters are only fetched from web.config
            DatabaseId      = GetIntSettings(config, "databaseId", 0);
            ApplicationName = GetStringSettings(config, "applicationName", null);
            if (ApplicationName == null)
            {
                try
                {
                    ApplicationName = HostingEnvironment.ApplicationVirtualPath;
                    if (String.IsNullOrEmpty(ApplicationName))
                    {
                        ApplicationName = System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName;

                        int indexOfDot = ApplicationName.IndexOf('.');
                        if (indexOfDot != -1)
                        {
                            ApplicationName = ApplicationName.Remove(indexOfDot);
                        }
                    }

                    if (String.IsNullOrEmpty(ApplicationName))
                    {
                        ApplicationName = "/";
                    }
                }
                catch (Exception e)
                {
                    ApplicationName = "/";
                    LogUtility.LogInfo(e.Message);
                }
            }

            ConnectionTimeoutInMilliSec = GetIntSettings(config, "connectionTimeoutInMilliseconds", 0);
            OperationTimeoutInMilliSec  = GetIntSettings(config, "operationTimeoutInMilliseconds", 0);
        }
        public async Task DeleteApplicationAsync()
        {
            Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new Mock <ApplicationService.ApplicationServiceClient>(MockBehavior.Strict);
            DeleteApplicationRequest expectedRequest = new DeleteApplicationRequest
            {
                ApplicationName = new ApplicationName("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteApplicationAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <Empty>(Task.FromResult(expectedResponse), null, null, null, null));
            ApplicationServiceClient client = new ApplicationServiceClientImpl(mockGrpcClient.Object, null);
            ApplicationName          name   = new ApplicationName("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
            await client.DeleteApplicationAsync(name);

            mockGrpcClient.VerifyAll();
        }
        public void DeleteApplication()
        {
            Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new Mock <ApplicationService.ApplicationServiceClient>(MockBehavior.Strict);
            DeleteApplicationRequest expectedRequest = new DeleteApplicationRequest
            {
                ApplicationName = new ApplicationName("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteApplication(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            ApplicationServiceClient client = new ApplicationServiceClientImpl(mockGrpcClient.Object, null);
            ApplicationName          name   = new ApplicationName("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");

            client.DeleteApplication(name);
            mockGrpcClient.VerifyAll();
        }
        public static DocumentationIdentifier GetIdentifierByAppliactionName(ApplicationName name)
        {
            switch (name)
            {
            case ApplicationName.None:
                return(DocumentationIdentifier.Default);

            case ApplicationName._3dPrintingPrinter:
                return(DocumentationIdentifier._3dPrinters);

            case ApplicationName._3dPrintingMaterial:
                return(DocumentationIdentifier._3dMaterials);

            default:
                return(DocumentationIdentifier.Default);
            }
        }
        /// <summary>Snippet for GetApplicationAsync</summary>
        public async Task GetApplicationRequestObjectAsync()
        {
            // Snippet: GetApplicationAsync(GetApplicationRequest, CallSettings)
            // Additional: GetApplicationAsync(GetApplicationRequest, CancellationToken)
            // Create client
            ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetApplicationRequest request = new GetApplicationRequest
            {
                ApplicationName = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
            };
            // Make the request
            Application response = await applicationServiceClient.GetApplicationAsync(request);

            // End snippet
        }
예제 #13
0
        public static Canvas GetIconByName(ApplicationName name)
        {
            var canvas = new Canvas();

            switch (name)
            {
            case ApplicationName.Dashboard:
                canvas.Children.Add(new PackIconMaterial {
                    Kind = PackIconMaterialKind.ViewDashboardOutline
                });
                break;

            case ApplicationName._3dPrintingMaterial:
                canvas.Children.Add(new PackIconModern {
                    Kind = PackIconModernKind.Box
                });
                break;

            case ApplicationName._3dPrintingPrinter:
                canvas.Children.Add(new PackIconMaterial {
                    Kind = PackIconMaterialKind.Printer3dNozzleOutline
                });
                break;

            case ApplicationName._3dPrintingCalcualtion:
                canvas.Children.Add(new PackIconModern {
                    Kind = PackIconModernKind.Calculator
                });
                break;

            case ApplicationName.EventLog:
                canvas.Children.Add(new PackIconModern {
                    Kind = PackIconModernKind.DebugStepInto
                });
                break;

            default:
                canvas.Children.Add(new PackIconModern {
                    Kind = PackIconModernKind.SmileyFrown
                });
                break;
            }

            return(canvas);
        }
        public async stt::Task DeleteApplicationResourceNamesAsync()
        {
            moq::Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new moq::Mock <ApplicationService.ApplicationServiceClient>(moq::MockBehavior.Strict);
            DeleteApplicationRequest request = new DeleteApplicationRequest
            {
                ApplicationName = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteApplicationAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            ApplicationServiceClient client = new ApplicationServiceClientImpl(mockGrpcClient.Object, null);
            await client.DeleteApplicationAsync(request.ApplicationName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            await client.DeleteApplicationAsync(request.ApplicationName, st::CancellationToken.None);

            mockGrpcClient.VerifyAll();
        }
        public static IInstanceProvider GetContainer(ContainerType containerType, ApplicationName application)
        {
            IInstanceProvider instanceProvider = null;

            var containerSpecification = ContainerSpecificationFactory.GetSpecification(application);
            switch (containerType)
            {
                case ContainerType.Windsor:
                    var windsorContainerResolver = new WindsorContainerResolver(containerSpecification);
                    instanceProvider = windsorContainerResolver.GetContainer();
                    break;
                case ContainerType.StructureMap:
                case ContainerType.NInject:
                    throw new NotImplementedException("No implementation for these provider types...");
            }

            return instanceProvider;
        }
예제 #16
0
        /// <inheritdoc />
        protected override void InitializeTarget()
        {
            var customerToken = CustomerToken?.Render(LogEventInfo.CreateNullEvent());

            if (!string.IsNullOrWhiteSpace(customerToken))
            {
                LogglyConfig.Instance.CustomerToken = customerToken;

                var applicationName = ApplicationName?.Render(LogEventInfo.CreateNullEvent());
                if (!string.IsNullOrWhiteSpace(applicationName))
                {
                    LogglyConfig.Instance.ApplicationName = applicationName;
                }
            }

            var endPointHostName = EndpointHostname?.Render(LogEventInfo.CreateNullEvent());

            if (!string.IsNullOrWhiteSpace(endPointHostName))
            {
                var endpointPort = EndpointPort?.Render(LogEventInfo.CreateNullEvent());
                if (!int.TryParse(endpointPort ?? string.Empty, out var endpointPortNumber))
                {
                    endpointPortNumber = 0; // Let Loggly guess from LogTransport-enum
                }

                var forwardedForIp = ForwardedForIp?.Render(LogEventInfo.CreateNullEvent());
                if (string.IsNullOrEmpty(forwardedForIp))
                {
                    forwardedForIp = null;
                }

                LogglyConfig.Instance.Transport = new TransportConfiguration()
                {
                    EndpointHostname = endPointHostName,
                    EndpointPort     = endpointPortNumber,
                    LogTransport     = LogTransport,
                    ForwardedForIp   = forwardedForIp,
                }.GetCoercedToValidConfig();
            }

            base.InitializeTarget();
            _pendingTaskCount = 0;
            _client           = ClientFactory.Invoke();
        }
예제 #17
0
        protected override void ProcessRecord()
        {
            if (ShouldProcess("Report Activity", "Get-GRepActivity"))
            {
                string _dateStartString = string.Empty;
                string _dateEndString   = string.Empty;

                switch (ParameterSetName)
                {
                case "string":
                    _dateStartString = StartTime;
                    _dateEndString   = EndTime;
                    break;

                case "datetime":
                    _dateStartString = StartDateTime.HasValue ?
                                       XmlConvert.ToString(StartDateTime.Value, XmlDateTimeSerializationMode.Local) : null;

                    _dateEndString = EndDateTime.HasValue ?
                                     XmlConvert.ToString(EndDateTime.Value, XmlDateTimeSerializationMode.Local) : null;
                    break;
                }

                var properties = new dotNet.Reports.Activities.ActivitiesListProperties()
                {
                    StartTime      = _dateStartString,
                    EndTime        = _dateEndString,
                    CustomerId     = CustomerId,
                    ActorIpAddress = ActorIpAddress,
                    EventName      = EventName,
                    Filters        = Filters
                };

                if (MaxResults.HasValue)
                {
                    properties.TotalResults = MaxResults.Value;
                }

                //Allow for the use of 'all'
                string _userKey = (UserKey == "all") ? "all" : GetFullEmailAddress(UserKey, authUserInfo);

                WriteObject(activities.List(_userKey, ApplicationName.ToString(), properties, StandardQueryParams: StandardQueryParams).SelectMany(x => x.Items).ToList());
            }
        }
예제 #18
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hash = 17;

                if (ApplicationName != null)
                {
                    hash = hash * 23 + ApplicationName.GetHashCode();
                }

                if (TaskName != null)
                {
                    hash = hash * 23 + TaskName.GetHashCode();
                }

                return(hash);
            }
        }
예제 #19
0
        protected override void Execute(NativeActivityContext context)
        {
            try
            {
                string          userName        = UserName.Get(context);
                string          password        = Password.Get(context);
                string          applicationName = ApplicationName.Get(context);
                bool            result          = false;
                PersistanceType pt = new PersistanceType();
                if (PersistType == "LocalComputer")
                {
                    pt = PersistanceType.LocalComputer;
                }
                else if (PersistType == "Enterprise")
                {
                    pt = PersistanceType.Enterprise;
                }
                else if (PersistType == "Session")
                {
                    pt = PersistanceType.Session;
                }

                result = new Credential
                {
                    Target          = applicationName,
                    Username        = userName,
                    Password        = password,
                    PersistanceType = pt,
                    Type            = CredentialType.Generic
                }.Save();

                Result.Set(context, result);
            }
            catch (Exception ex)
            {
                Result.Set(context, false);
                Log.Logger.LogData(ex.Message + " in activity CellValue_Clear", LogLevel.Error);
                if (!ContinueOnError)
                {
                    context.Abort();
                }
            }
        }
예제 #20
0
        // If your activity returns a value, derive from CodeActivity<TResult>
        // and return the value from the Execute method.
        protected override void Execute(CodeActivityContext context)
        {
            //(Workspace.Get(context)).TryGetLocalItemForServerItem(
            RegistrationHelper registrationHelper = new RegistrationHelper();
            string             appName            = ApplicationName.Get(context);
            string             tlb = TLB.Get(context);

            string comAssemblyPath = COMAssembly.Get(context);

            if (InstallAssembly.Get(context))
            {
                registrationHelper.InstallAssembly(comAssemblyPath, ref appName, ref tlb, InstallationFlags.Default);
                ApplicationName.Set(context, appName);
                TLB.Set(context, tlb);
            }
            else
            {
                registrationHelper.UninstallAssembly(comAssemblyPath, appName);
            }
        }
예제 #21
0
        public static string GetTranslatedNameByName(ApplicationName name)
        {
            switch (name)
            {
            case ApplicationName._3dPrintingMaterial:
                return(Resources.Localization.Strings.AppName3dPrinterMaterialOverview);

            case ApplicationName._3dPrintingPrinter:
                return(Resources.Localization.Strings.AppName3dPrinterOverview);

            case ApplicationName._3dPrintingCalcualtion:
                return(Resources.Localization.Strings.AppName3dPrintCostCalculator);

            case ApplicationName.EventLog:
                return(Resources.Localization.Strings.AppNameEventLog);

            default:
                return(Resources.Localization.Strings.AppNameNotFound);
            }
        }
        public static IInstanceProvider GetContainer(ContainerType containerType, ApplicationName application)
        {
            IInstanceProvider instanceProvider = null;

            var containerSpecification = ContainerSpecificationFactory.GetSpecification(application);

            switch (containerType)
            {
            case ContainerType.Windsor:
                var windsorContainerResolver = new WindsorContainerResolver(containerSpecification);
                instanceProvider = windsorContainerResolver.GetContainer();
                break;

            case ContainerType.StructureMap:
            case ContainerType.NInject:
                throw new NotImplementedException("No implementation for these provider types...");
            }

            return(instanceProvider);
        }
예제 #23
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hash = 17;

                if (ApplicationName != null)
                {
                    hash = hash * 23 + ApplicationName.GetHashCode();
                }

                hash = hash * 23 + Stage.GetHashCode();
                hash = hash * 23 + MajorVersion.GetHashCode();
                hash = hash * 23 + FeatureNumber.GetHashCode();
                hash = hash * 23 + HotfixNumber.GetHashCode();
                hash = hash * 23 + Build.GetHashCode();

                return(hash);
            }
        }
예제 #24
0
 private void SetAppNameProvider(UserManager mgr, ILogger logger)
 {
     if (string.IsNullOrEmpty(ApplicationName) || ApplicationName.Equals(DefaultConfiguration.DefaultApplicationName))
     {
         Type appNameResolverType    = Type.GetType(ApplicationNameResolverType);
         Type defaultAppNameProvider = typeof(DefaultConfigurationApplicationNameProvider);
         if (appNameResolverType == null)
         {
             appNameResolverType = defaultAppNameProvider;
             if (!SuppressMessages)
             {
                 logger.AddEntry("Specified ApplicationNameResolverType\r\n\r\n\t{0}\r\n\r\nwas not found, will use {1} instead", LogEventType.Warning, ApplicationNameResolverType, defaultAppNameProvider.FullName);
             }
         }
         mgr.ApplicationNameProvider = appNameResolverType.Construct <IApplicationNameProvider>();
     }
     else
     {
         mgr.ApplicationNameProvider = new StaticApplicationNameProvider(ApplicationName);
     }
 }
 protected override void Execute(NativeActivityContext context)
 {
     try
     {
         bool   result          = false;
         string applicationName = ApplicationName.Get(context);
         result = new Credential {
             Target = applicationName
         }.Delete();
         Result.Set(context, result);
     }
     catch (Exception ex)
     {
         Result.Set(context, false);
         Log.Logger.LogData(ex.Message + " in activity CellValue_Clear", LogLevel.Error);
         if (!ContinueOnError)
         {
             context.Abort();
         }
     }
 }
        protected override void Execute(NativeActivityContext context)
        {
            try
            {
                bool   result          = false;
                string applicationName = ApplicationName.Get(context);

                //  var cm = new Credential { Target = applicationName, Type=CredentialType.Generic, PersistanceType = PersistanceType.LocalComputer};
                var cm = new Credential {
                    Target = applicationName
                };
                if (cm.Exists())
                {
                    if (!cm.Load())
                    {
                        Result.Set(context, false);
                        return;
                    }
                }
                else
                {
                    Result.Set(context, false);
                    return;
                }

                //UserPass is just a class with two string properties for user and pass
                UserName.Set(context, cm.Username);
                Password.Set(context, cm.Password);
                Result.Set(context, true);
            }
            catch (Exception ex)
            {
                Result.Set(context, false);
                Log.Logger.LogData(ex.Message + " in activity CellValue_Clear", LogLevel.Error);
                if (!ContinueOnError)
                {
                    context.Abort();
                }
            }
        }
 protected override void Execute(NativeActivityContext context)
 {
     try
     {
         bool   result          = false;
         string applicationName = ApplicationName.Get(context);
         //  var cm = new Credential { Target = applicationName, Type=CredentialType.Generic, PersistanceType = PersistanceType.LocalComputer};
         var cm = new Credential {
             Target = applicationName
         };
         Result.Set(context, cm.Exists());
     }
     catch (Exception ex)
     {
         Result.Set(context, false);
         Log.Logger.LogData(ex.Message + " in activity CellValue_Clear", LogLevel.Error);
         if (!ContinueOnError)
         {
             context.Abort();
         }
     }
 }
        public async stt::Task CreateApplicationRequestObjectAsync()
        {
            moq::Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new moq::Mock <ApplicationService.ApplicationServiceClient>(moq::MockBehavior.Strict);
            CreateApplicationRequest request = new CreateApplicationRequest
            {
                ParentAsProfileName = ProfileName.FromProjectTenantProfile("[PROJECT]", "[TENANT]", "[PROFILE]"),
                Application         = new Application(),
            };
            Application expectedResponse = new Application
            {
                ApplicationName      = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
                Profile              = "profile1b48977d",
                JobAsJobName         = JobName.FromProjectTenantJob("[PROJECT]", "[TENANT]", "[JOB]"),
                CompanyAsCompanyName = CompanyName.FromProjectTenantCompany("[PROJECT]", "[TENANT]", "[COMPANY]"),
                ApplicationDate      = new gt::Date(),
                Stage           = Application.Types.ApplicationStage.OfferAccepted,
                State           = Application.Types.ApplicationState.Unspecified,
                Interviews      = { new Interview(), },
                Referral        = false,
                CreateTime      = new wkt::Timestamp(),
                UpdateTime      = new wkt::Timestamp(),
                OutcomeNotes    = "outcome_notes38ed921d",
                Outcome         = Outcome.Neutral,
                IsMatch         = false,
                JobTitleSnippet = "job_title_snippet4f14afe7",
                ExternalId      = "external_id9442680e",
            };

            mockGrpcClient.Setup(x => x.CreateApplicationAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Application>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            ApplicationServiceClient client  = new ApplicationServiceClientImpl(mockGrpcClient.Object, null);
            Application responseCallSettings = await client.CreateApplicationAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Application responseCancellationToken = await client.CreateApplicationAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public static string GetTranslatedNameByName(ApplicationName name)
        {
            switch (name)
            {
            /*
             * case Name.MassSearchAndReplace:
             *  return Resources.Localization.Strings.AppNameMassSearchAndReplace;
             * case Name.SVN:
             *  return Resources.Localization.Strings.AppNameSubversionServer;
             */
            case ApplicationName._3dPrintingMaterial:
                return(Resources.Localization.Strings.AppName3dPrinterMaterialOverview);

            case ApplicationName._3dPrintingPrinter:
                return(Resources.Localization.Strings.AppName3dPrinterOverview);

            case ApplicationName._3dPrintingCalcualtion:
                return(Resources.Localization.Strings.AppName3dPrintCostCalculator);

            case ApplicationName._3dPrintingWorkstep:
                return(Resources.Localization.Strings.AppName3dPrinterWorkstep);

            case ApplicationName.MachineHourRateCalc:
                return(Resources.Localization.Strings.AppNameMachineHourRateCalculator);

            case ApplicationName.RepetierServerProDashboard:
                return(Resources.Localization.Strings.AppNameRepetierServerProDashboard);

            case ApplicationName.OctoPrintDashboard:
                return(Resources.Localization.Strings.AppNameOctoPrintDashboard);

            case ApplicationName.EventLog:
                return(Resources.Localization.Strings.AppNameEventLog);

            default:
                return(Resources.Localization.Strings.AppNameNotFound);
            }
        }
예제 #30
0
        /// <inheritdoc/>
        public override int GetHashCode()
        {
            // Overflow is fine, just wrap.
            unchecked
            {
                int hash = 17;

                hash *= 23 + ApplicationName.GetHashCode();
                hash *= 23 + ApplicationSystemId.GetHashCode();
                hash *= 23 + ApplicationVersion.GetHashCode();
                hash *= 23 + ContentDescription.GetHashCode();
                hash *= 23 + Copyright.GetHashCode();
                hash *= 23 + Corporation.GetHashCode();
                hash *= 23 + CorporationAddress.GetHashCode();
                hash *= 23 + Filename.GetHashCode();
                hash *= 23 + Language.GetHashCode();
                hash *= 23 + SourceCopyright.GetHashCode();
                hash *= 23 + SourceDate.GetHashCode();
                hash *= 23 + SourceName.GetHashCode();
                hash *= 23 + TransmissionDate.GetHashCode();

                return(hash);
            }
        }
 public EventSystemRedirectApplicationArgs(ApplicationName application, string args)
 {
     Application = application;
     Args        = args;
 }
예제 #32
0
        // Module defining this command


        // Optional custom code for this activity


        /// <summary>
        /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
        /// </summary>
        /// <param name="context">The NativeActivityContext for the currently running activity.</param>
        /// <returns>A populated instance of System.Management.Automation.PowerShell</returns>
        /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
        protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context)
        {
            System.Management.Automation.PowerShell invoker       = global::System.Management.Automation.PowerShell.Create();
            System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);

            // Initialize the arguments

            if (ApplicationName.Expression != null)
            {
                targetCommand.AddParameter("ApplicationName", ApplicationName.Get(context));
            }

            if (BasePropertiesOnly.Expression != null)
            {
                targetCommand.AddParameter("BasePropertiesOnly", BasePropertiesOnly.Get(context));
            }

            if ((ComputerName.Expression != null) && (PSRemotingBehavior.Get(context) != RemotingBehavior.Custom))
            {
                targetCommand.AddParameter("ComputerName", ComputerName.Get(context));
            }

            if (ConnectionURI.Expression != null)
            {
                targetCommand.AddParameter("ConnectionURI", ConnectionURI.Get(context));
            }

            if (Dialect.Expression != null)
            {
                targetCommand.AddParameter("Dialect", Dialect.Get(context));
            }

            if (Enumerate.Expression != null)
            {
                targetCommand.AddParameter("Enumerate", Enumerate.Get(context));
            }

            if (Filter.Expression != null)
            {
                targetCommand.AddParameter("Filter", Filter.Get(context));
            }

            if (Fragment.Expression != null)
            {
                targetCommand.AddParameter("Fragment", Fragment.Get(context));
            }

            if (OptionSet.Expression != null)
            {
                targetCommand.AddParameter("OptionSet", OptionSet.Get(context));
            }

            if (Port.Expression != null)
            {
                targetCommand.AddParameter("Port", Port.Get(context));
            }

            if (Associations.Expression != null)
            {
                targetCommand.AddParameter("Associations", Associations.Get(context));
            }

            if (ResourceURI.Expression != null)
            {
                targetCommand.AddParameter("ResourceURI", ResourceURI.Get(context));
            }

            if (ReturnType.Expression != null)
            {
                targetCommand.AddParameter("ReturnType", ReturnType.Get(context));
            }

            if (SelectorSet.Expression != null)
            {
                targetCommand.AddParameter("SelectorSet", SelectorSet.Get(context));
            }

            if (SessionOption.Expression != null)
            {
                targetCommand.AddParameter("SessionOption", SessionOption.Get(context));
            }

            if (Shallow.Expression != null)
            {
                targetCommand.AddParameter("Shallow", Shallow.Get(context));
            }

            if (UseSSL.Expression != null)
            {
                targetCommand.AddParameter("UseSSL", UseSSL.Get(context));
            }

            if (Credential.Expression != null)
            {
                targetCommand.AddParameter("Credential", Credential.Get(context));
            }

            if (Authentication.Expression != null)
            {
                targetCommand.AddParameter("Authentication", Authentication.Get(context));
            }

            if (CertificateThumbprint.Expression != null)
            {
                targetCommand.AddParameter("CertificateThumbprint", CertificateThumbprint.Get(context));
            }

            if (GetIsComputerNameSpecified(context) && (PSRemotingBehavior.Get(context) == RemotingBehavior.Custom))
            {
                targetCommand.AddParameter("ComputerName", PSComputerName.Get(context));
            }

            return(new ActivityImplementationContext()
            {
                PowerShellInstance = invoker
            });
        }
예제 #33
0
 public UserProfileFacade(ApplicationName app)
 {
     AppName = app;
 }