本文整理汇总了C#中IService类的典型用法代码示例。如果您正苦于以下问题:C# IService类的具体用法?C# IService怎么用?C# IService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IService类属于命名空间,在下文中一共展示了IService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SearchController
public SearchController(IService<SearchRequest, SearchModel> service, IStudentSchoolAreaLinks studentSchoolLinks, ICurrentUserClaimInterrogator currentUserClaimInterrogator, IGradeLevelUtilitiesProvider gradeLevelUtilitiesProvider)
{
this.service = service;
this.studentSchoolLinks = studentSchoolLinks;
this.currentUserClaimInterrogator = currentUserClaimInterrogator;
this.gradeLevelUtilitiesProvider = gradeLevelUtilitiesProvider;
}
开发者ID:sybrix,项目名称:EdFi-App,代码行数:7,代码来源:SearchController.cs
示例2: JsonRpcDispatcher
public JsonRpcDispatcher(IService service, IServiceProvider serviceProvider)
{
if (service == null)
throw new ArgumentNullException("service");
_service = service;
if (serviceProvider == null)
{
//
// No service provider supplied so check if the RPC service
// itself is our service provider.
//
serviceProvider = service as IServiceProvider;
//
// If no service provider found so far, then create a default
// one.
//
if (serviceProvider == null)
serviceProvider = new ServiceContainer();
}
_serviceProvider = serviceProvider;
}
开发者ID:BackupTheBerlios,项目名称:tamjb,代码行数:27,代码来源:JsonRpcDispatcher.cs
示例3: GenerateSchemaClasses
/// <summary>
/// Generates all schema classes for the specified service
/// </summary>
/// <param name="service"></param>
/// <returns></returns>
public CodeNamespace GenerateSchemaClasses(IService service)
{
service.ThrowIfNull("service");
logger.Debug("Starting to generate schemas for {1} in namespace {0}", schemaNamespace, service.Name);
LogDecorators();
var codeNamespace = new CodeNamespace(schemaNamespace);
codeNamespace.Imports.Add(new CodeNamespaceImport("System"));
codeNamespace.Imports.Add(new CodeNamespaceImport("System.Collections"));
codeNamespace.Imports.Add(new CodeNamespaceImport("System.Collections.Generic"));
SchemaGenerator generator = new SchemaGenerator(decorators);
// Generate implementation details
IDictionary<JsonSchema, SchemaImplementationDetails> implementationDetails =
implementationDetailsGenerator.GenerateDetails(service);
// Generate schemas
foreach (var schemaPair in service.Schemas)
{
logger.Debug("Generating Schema {0}", schemaPair.Key);
// Create schema
codeNamespace.Types.Add(
generator.CreateClass(schemaPair.Value, implementationDetails, service.Schemas.Keys));
}
return codeNamespace;
}
开发者ID:JANCARLO123,项目名称:google-apis,代码行数:32,代码来源:GoogleSchemaGenerator.cs
示例4: Init
public void Init()
{
container = new UnityContainer();
ContainerBootstrap.RegisterTypes(container);
service = container.Resolve<IService>();
}
开发者ID:raphonks,项目名称:Test,代码行数:7,代码来源:HomeControllerTest.cs
示例5: JsonRpcDispatcher
public JsonRpcDispatcher(IService service)
{
if (service == null)
throw new ArgumentNullException("service");
_service = service;
}
开发者ID:madalingavanarescu,项目名称:jayrock,代码行数:7,代码来源:JsonRpcDispatcher.cs
示例6: ServiceRunner
public ServiceRunner(IService service, string serviceName)
{
if (service == null) throw new ArgumentNullException("service");
if (serviceName == null) throw new ArgumentNullException("serviceName");
_service = service;
ServiceName = serviceName;
}
开发者ID:vjohnson01,项目名称:Tools,代码行数:7,代码来源:ServiceRunner.cs
示例7: SetUp
public void SetUp()
{
_lastService = null;
_manager = null;
_defaultRegistry = (registry =>
{
//registry.ForRequestedType<IService>()
// .AddInstances(
// Instance<ColorService>().WithName("Red").WithProperty("color").
// EqualTo(
// "Red"),
// Object<IService>(new ColorService("Yellow")).WithName("Yellow"),
// ConstructedBy<IService>(
// delegate { return new ColorService("Purple"); })
// .WithName("Purple"),
// Instance<ColorService>().WithName("Decorated").WithProperty("color")
// .
// EqualTo("Orange")
// );
registry.ForRequestedType<IService>().AddInstances(x =>
{
x.OfConcreteType<ColorService>().WithName("Red").WithProperty("color").EqualTo("Red");
x.Object(new ColorService("Yellow")).WithName("Yellow");
x.ConstructedBy(() => new ColorService("Purple")).WithName("Purple");
x.OfConcreteType<ColorService>().WithName("Decorated").WithProperty("color").EqualTo("Orange");
});
});
}
开发者ID:joshuaflanagan,项目名称:structuremap,代码行数:33,代码来源:InterceptAllInstancesOfPluginTypeTester.cs
示例8: CharacteristicDetail_TISensor
public CharacteristicDetail_TISensor (IAdapter adapter, IDevice device, IService service, ICharacteristic characteristic)
{
InitializeComponent ();
this.characteristic = characteristic;
Title = characteristic.Name;
}
开发者ID:Roddoric,项目名称:Monkey.Robotics,代码行数:7,代码来源:CharacteristicDetail_TISensor.xaml.cs
示例9: DecorateClass
public void DecorateClass(IService service, CodeTypeDeclaration serviceClass)
{
serviceClass.Members.Add(CreateVersionField(service));
serviceClass.Members.Add(CreateNameField(service));
serviceClass.Members.Add(CreateUriField(service));
serviceClass.Members.Add(CreateDiscoveryVersionField(service));
}
开发者ID:nick0816,项目名称:LoggenCSG,代码行数:7,代码来源:VersionInformationServiceDecorator.cs
示例10: LogInAsController
public LogInAsController(IService<CanLogInAsUserRequest, CanLogInAsUserModel> service, ILocalEducationAgencyAreaLinks localEducationAgencyAreaLinks,
ISignInRequestMessageProvider signInRequestMessageProvider)
{
this.service = service;
this.localEducationAgencyAreaLinks = localEducationAgencyAreaLinks;
this.signInRequestMessageProvider = signInRequestMessageProvider;
}
开发者ID:sybrix,项目名称:EdFi-App,代码行数:7,代码来源:LogInAsController.cs
示例11: MultipleServiceManager
public MultipleServiceManager(ILog log, IService[] services)
{
this.log = log;
this.services = services.OrderBy(s => s.StartIndex).ToArray();
ServiceName = "IronFoundryDEA"; // NB: must match installer Product.wxs
AutoLog = true;
}
开发者ID:BrianMMcClain,项目名称:ironfoundry,代码行数:7,代码来源:MultipleServiceManager.cs
示例12: CommandServicePresenter
public CommandServicePresenter(IView view, IService service,
ICommandExecutor executor)
{
_view = view;
_service = service;
_executor = executor;
}
开发者ID:butaji,项目名称:Sapphire,代码行数:7,代码来源:CommandServicePresenter.cs
示例13: ServiceRunner
public ServiceRunner(IService service, string server, IDefaultBindingFactory defaultBindingFactory, IServerUriFactory serverUriFactory)
{
_service = service;
_server = server;
_defaultBindingFactory = defaultBindingFactory;
_serverUriFactory = serverUriFactory;
}
开发者ID:guozanhua,项目名称:phmi,代码行数:7,代码来源:ServiceRunner.cs
示例14: CategoryController
public CategoryController(
IService<Category> categoriesService,
ICategoriesService categories)
{
this.categoriesService = categoriesService;
this.categories = categories;
}
开发者ID:tddold,项目名称:MVC-Project,代码行数:7,代码来源:CategoryController.cs
示例15: CreateNameField
internal CodeMemberField CreateNameField(IService service)
{
var name = new CodeMemberField(typeof(string), NameName);
name.Attributes = MemberAttributes.Const | MemberAttributes.Private;
name.InitExpression = new CodePrimitiveExpression(service.Name);
return name;
}
开发者ID:nick0816,项目名称:LoggenCSG,代码行数:7,代码来源:VersionInformationServiceDecorator.cs
示例16: EstablishContext
protected override void EstablishContext()
{
//Prepare supplied data collections
suppliedListOfSchoolMetricModel = GetListOfSchoolMetricModel();
//Set up the mocks
schoolMetricTableService = mocks.StrictMock<IService<SchoolMetricTableRequest, SchoolMetricTableModel>>();
metadataListIdResolver = mocks.StrictMock<IMetadataListIdResolver>();
listMetadataProvider = mocks.StrictMock<IListMetadataProvider>();
//Set expectations
Expect.Call(schoolMetricTableService.Get(null))
.Constraints(
new ActionConstraint<SchoolMetricTableRequest>(x =>
{
Assert.That(x.LocalEducationAgencyId == suppliedLocalEducationAgencyId);
Assert.That(x.MetricVariantId == suppliedMetricVariantId);
})
).Return(new SchoolMetricTableModel { SchoolMetrics = suppliedListOfSchoolMetricModel, ListMetadata = new List<MetadataColumnGroup>() });
Expect.Call(metadataListIdResolver.GetListId(ListType.SchoolMetricTable, SchoolCategory.None)).Return(
MetadataListIdResolver.SchoolMetricTableListId);
Expect.Call(listMetadataProvider.GetListMetadata(MetadataListIdResolver.SchoolMetricTableListId)).Return(getSuppliedMetadataColumnGroups());
}
开发者ID:sybrix,项目名称:EdFi-App,代码行数:25,代码来源:ExportMetricListServiceFixture.cs
示例17: CreateUriField
internal CodeMemberField CreateUriField(IService service)
{
var uri = new CodeMemberField(typeof(string), BaseUriName);
uri.Attributes = MemberAttributes.Const | MemberAttributes.Private;
uri.InitExpression = new CodePrimitiveExpression(service.BaseUri.ToString());
return uri;
}
开发者ID:nick0816,项目名称:LoggenCSG,代码行数:7,代码来源:VersionInformationServiceDecorator.cs
示例18: Add
/// <summary>
/// Add the given service (<paramref name="a_service"/>) to this listing.
/// </summary>
/// <param name="a_service">Service to add.</param>
/// <exception cref="ArgumentNullException">Thrown if <paramref name="a_service"/> is null.</exception>
public void Add(IService a_service)
{
#region Argument Validation
if (a_service == null)
throw new ArgumentNullException(nameof(a_service));
#endregion
if (a_service.Contract == null)
throw new InvalidOperationException("Service does not have a contract type.");
lock (l_servicesByTypeGuid)
{
List<IService> services;
if (_servicesByTypeGuid.ContainsKey(a_service.Contract.GUID))
services = _servicesByTypeGuid[a_service.Contract.GUID];
else
services = _servicesByTypeGuid[a_service.Contract.GUID] = new List<IService>();
services.Add(a_service);
}
if (a_service.Name != null)
{
var name = CreateServiceName(a_service.Contract, a_service.Name);
lock (l_serviceByName)
{
if (!_servicesByName.ContainsKey(name))
_servicesByName.Add(name, a_service);
}
}
}
开发者ID:jsmunroe,项目名称:SimpleIoc,代码行数:39,代码来源:ServiceContractListing.cs
示例19: RunService
public async Task RunService(IService service, CancellationToken token)
{
_logger.InfoFormat("Running service {0}", service.Name);
await TaskEx.Yield();
var blobs = _client.GetContainerReference("locks");
await blobs.CreateIfNotExistAsync();
var blob = blobs.GetBlobReference(service.Name);
while (!token.IsCancellationRequested)
{
try
{
if (service is IScheduledService)
await HandleScheduledService((IScheduledService)service, blob, token);
else if (service is IClusteredService)
await HandleClusteredService((IClusteredService)service, blob, token);
else if (service is IContinuousService)
await HandleContinuousService((IContinuousService)service, blob, token);
}
catch (OperationCanceledException)
{
// no-op
}
catch (Exception e)
{
_logger.ErrorFormat("The main task of service \"{0}\" threw an exception.", e, service.Name);
}
}
_logger.InfoFormat("Service {0} stopped", service.GetType().Name);
throw new OperationCanceledException(token);
}
开发者ID:bytenik,项目名称:CloudServiceHost,代码行数:35,代码来源:ServiceHost.cs
示例20: Invoke
public object Invoke(IService service, object[] args)
{
if (service == null)
throw new ArgumentNullException("service");
try
{
if (Method.IsStatic)
{
object[] argz = new object[args.Length + 1];
argz[0] = service;
args.CopyTo(argz, 1);
return Method.Invoke(null, argz);
}
else
{
return Method.Invoke(service, args);
}
}
catch (ArgumentException e)
{
throw TranslateException(e);
}
catch (TargetParameterCountException e)
{
throw TranslateException(e);
}
catch (TargetInvocationException e)
{
throw TranslateException(e);
}
}
开发者ID:db48x,项目名称:KeeFox,代码行数:32,代码来源:TypeMethodImpl.cs
注:本文中的IService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论