当前位置: 首页>>代码示例>>C#>>正文


C# ServiceName类代码示例

本文整理汇总了C#中ServiceName的典型用法代码示例。如果您正苦于以下问题:C# ServiceName类的具体用法?C# ServiceName怎么用?C# ServiceName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ServiceName类属于命名空间,在下文中一共展示了ServiceName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildUp

 public BuiltUpService BuildUp(ServiceName name, object target)
 {
     var dependencies = GetInjections(name);
     foreach (var dependency in dependencies)
         dependency.setter(target, dependency.value.Single());
     return new BuiltUpService(dependencies);
 }
开发者ID:undeadcat,项目名称:simple-container,代码行数:7,代码来源:DependenciesInjector.cs

示例2: EnsureInitialized

 public void EnsureInitialized(ContainerService service, ContainerContext containerContext, ContainerService root)
 {
     if (!Owned)
         return;
     var componentInstance = Instance as IInitializable;
     if (componentInstance == null)
         return;
     if (!initialized)
         lock (this)
             if (!initialized)
             {
                 var name = new ServiceName(Instance.GetType(), service.UsedContracts);
                 if (containerContext.infoLogger != null)
                     containerContext.infoLogger(name, "initialize started");
                 try
                 {
                     componentInstance.Initialize();
                 }
                 catch (Exception e)
                 {
                     throw new SimpleContainerException(string.Format("exception initializing {0}\r\n\r\n{1}", name, root.GetConstructionLog(containerContext)), e);
                 }
                 if (containerContext.infoLogger != null)
                     containerContext.infoLogger(name, "initialize finished");
                 initialized = true;
             }
 }
开发者ID:shparun,项目名称:simple-container,代码行数:27,代码来源:InstanceWrap.cs

示例3: RequestMessage

 /// <summary>
 /// Initializes a new instance of the <see cref="RequestMessage"/> class.
 /// </summary>
 /// <param name="serviceName">Name of the service.</param>
 /// <param name="username">Authentication username.</param>
 /// <param name="methodName">The name of the authentication method.</param>
 protected RequestMessage(ServiceName serviceName, string username, string methodName)
 {
     _serviceName = serviceName.ToArray();
     _userName = Utf8.GetBytes(username);
     _methodNameBytes = Ascii.GetBytes(methodName);
     _methodName = methodName;
 }
开发者ID:sshnet,项目名称:SSH.NET,代码行数:13,代码来源:RequestMessage.cs

示例4: NuGetService

        protected NuGetService(ServiceName serviceName, ServiceHost host)
        {
            Host = host;
            ServiceName = serviceName;

            TempDirectory = Path.Combine(Path.GetTempPath(), "NuGetServices", serviceName.Name);
        }
开发者ID:stephenosrajan,项目名称:NuGet.Services.Platform,代码行数:7,代码来源:NuGetService.cs

示例5: RequestMessageHost

 /// <summary>
 /// Initializes a new instance of the <see cref="RequestMessageHost"/> class.
 /// </summary>
 /// <param name="serviceName">Name of the service.</param>
 /// <param name="username">Authentication username.</param>
 /// <param name="publicKeyAlgorithm">The public key algorithm.</param>
 /// <param name="publicHostKey">The public host key.</param>
 /// <param name="clientHostName">Name of the client host.</param>
 /// <param name="clientUsername">The client username.</param>
 public RequestMessageHost(ServiceName serviceName, string username, string publicKeyAlgorithm, byte[] publicHostKey, string clientHostName, string clientUsername)
     : base(serviceName, username)
 {
     this.PublicKeyAlgorithm = publicKeyAlgorithm;
     this.PublicHostKey = publicHostKey;
     this.ClientHostName = clientHostName;
     this.ClientUsername = clientUsername;
 }
开发者ID:leocheang422,项目名称:win-sshfs,代码行数:17,代码来源:RequestMessageHost.cs

示例6: WorkService

        public WorkService(ServiceName name, ServiceHost host)
            : base(name, host)
        {
            var workConfig = host.Config.GetSection<WorkConfiguration>();

            MaxWorkers = MaxWorkers ?? workConfig.MaxWorkers;
            WorkersPerCore = WorkersPerCore ?? (workConfig.WorkersPerCore ?? DefaultWorkersPerCore);
        }
开发者ID:NuGet,项目名称:NuGet.Services.Work,代码行数:8,代码来源:WorkService.cs

示例7: ServiceRequestMessage

        /// <summary>
        /// Initializes a new instance of the <see cref="ServiceRequestMessage"/> class.
        /// </summary>
        /// <param name="serviceName">Name of the service.</param>
        public ServiceRequestMessage(ServiceName serviceName)
        {
#if TUNING
            _serviceName = serviceName.ToArray();
#else
            ServiceName = serviceName;
#endif
        }
开发者ID:delfinof,项目名称:ssh.net,代码行数:12,代码来源:ServiceRequestMessage.cs

示例8: RequestMessagePublicKeyConstructorTest

 public void RequestMessagePublicKeyConstructorTest()
 {
     ServiceName serviceName = new ServiceName(); // TODO: Initialize to an appropriate value
     string username = string.Empty; // TODO: Initialize to an appropriate value
     string keyAlgorithmName = string.Empty; // TODO: Initialize to an appropriate value
     byte[] keyData = null; // TODO: Initialize to an appropriate value
     RequestMessagePublicKey target = new RequestMessagePublicKey(serviceName, username, keyAlgorithmName, keyData);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
开发者ID:delfinof,项目名称:ssh.net,代码行数:9,代码来源:RequestMessagePublicKeyTest.cs

示例9: RequestMessageHost

 /// <summary>
 /// Initializes a new instance of the <see cref="RequestMessageHost"/> class.
 /// </summary>
 /// <param name="serviceName">Name of the service.</param>
 /// <param name="username">Authentication username.</param>
 /// <param name="publicKeyAlgorithm">The public key algorithm.</param>
 /// <param name="publicHostKey">The public host key.</param>
 /// <param name="clientHostName">Name of the client host.</param>
 /// <param name="clientUsername">The client username.</param>
 /// <param name="signature">The signature.</param>
 public RequestMessageHost(ServiceName serviceName, string username, string publicKeyAlgorithm, byte[] publicHostKey, string clientHostName, string clientUsername, byte[] signature)
     : base(serviceName, username, "hostbased")
 {
     PublicKeyAlgorithm = Ascii.GetBytes(publicKeyAlgorithm);
     PublicHostKey = publicHostKey;
     ClientHostName = Ascii.GetBytes(clientHostName);
     ClientUsername = Utf8.GetBytes(clientUsername);
     Signature = signature;
 }
开发者ID:REALTOBIZ,项目名称:SSH.NET,代码行数:19,代码来源:RequestMessageHost.cs

示例10: MethodNameTest

 public void MethodNameTest()
 {
     ServiceName serviceName = new ServiceName(); // TODO: Initialize to an appropriate value
     string username = string.Empty; // TODO: Initialize to an appropriate value
     RequestMessage target = new RequestMessage(serviceName, username); // TODO: Initialize to an appropriate value
     string actual;
     actual = target.MethodName;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
开发者ID:pecegit,项目名称:sshnet,代码行数:9,代码来源:RequestMessageTest.cs

示例11: MethodNameTest

 public void MethodNameTest()
 {
     ServiceName serviceName = new ServiceName(); // TODO: Initialize to an appropriate value
     string username = string.Empty; // TODO: Initialize to an appropriate value
     string keyAlgorithmName = string.Empty; // TODO: Initialize to an appropriate value
     byte[] keyData = null; // TODO: Initialize to an appropriate value
     RequestMessagePublicKey target = new RequestMessagePublicKey(serviceName, username, keyAlgorithmName, keyData); // TODO: Initialize to an appropriate value
     string actual;
     actual = target.MethodName;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
开发者ID:delfinof,项目名称:ssh.net,代码行数:11,代码来源:RequestMessagePublicKeyTest.cs

示例12: LoadData

 /// <summary>
 /// Called when type specific data need to be loaded.
 /// </summary>
 protected override void LoadData()
 {
     var serviceName = this.ReadAsciiString();
     switch (serviceName)
     {
         case "ssh-userauth":
             this.ServiceName = ServiceName.UserAuthentication;
             break;
         case "ssh-connection":
             this.ServiceName = ServiceName.Connection;
             break;
     }
 }
开发者ID:npcook,项目名称:terminal,代码行数:16,代码来源:ServiceAcceptMessage.cs

示例13: SignatureTest

 [Ignore] // placeholder
 public void SignatureTest()
 {
     ServiceName serviceName = new ServiceName(); // TODO: Initialize to an appropriate value
     string username = string.Empty; // TODO: Initialize to an appropriate value
     string keyAlgorithmName = string.Empty; // TODO: Initialize to an appropriate value
     byte[] keyData = null; // TODO: Initialize to an appropriate value
     RequestMessagePublicKey target = new RequestMessagePublicKey(serviceName, username, keyAlgorithmName, keyData); // TODO: Initialize to an appropriate value
     byte[] expected = null; // TODO: Initialize to an appropriate value
     target.Signature = expected;
     var actual = target.Signature;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
开发者ID:sshnet,项目名称:SSH.NET,代码行数:14,代码来源:RequestMessagePublicKeyTest.cs

示例14: LoadData

        /// <summary>
        /// Called when type specific data need to be loaded.
        /// </summary>
        protected override void LoadData()
        {
#if TUNING
            ServiceName = ReadBinary().ToServiceName();
#else
            var serviceName = ReadAsciiString();
            switch (serviceName)
            {
                case "ssh-userauth":
                    ServiceName = ServiceName.UserAuthentication;
                    break;
                case "ssh-connection":
                    ServiceName = ServiceName.Connection;
                    break;
            }
#endif
        }
开发者ID:delfinof,项目名称:ssh.net,代码行数:20,代码来源:ServiceAcceptMessage.cs

示例15: DetectInjections

 private Injection[] DetectInjections(ServiceName name)
 {
     var memberSetters = provider.GetMembers(name.Type);
     var result = new Injection[memberSetters.Length];
     for (var i = 0; i < result.Length; i++)
     {
         var member = memberSetters[i].member;
         try
         {
             result[i].value = container.Resolve(member.MemberType(),
                 name.Contracts.Concat(InternalHelpers.ParseContracts(member)));
             result[i].value.CheckSingleInstance();
         }
         catch (SimpleContainerException e)
         {
             const string messageFormat = "can't resolve member [{0}.{1}]";
             throw new SimpleContainerException(string.Format(messageFormat, member.DeclaringType.FormatName(), member.Name), e);
         }
         result[i].setter = memberSetters[i].setter;
     }
     return result;
 }
开发者ID:undeadcat,项目名称:simple-container,代码行数:22,代码来源:DependenciesInjector.cs


注:本文中的ServiceName类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。