public UserManagerController( IMyService myService, ICustomUserEventHandler customUserEventHandler, IOrchardServices orchardServices) : base(myService, customUserEventHandler, orchardServices) { }
protected BaseApiController(IMyService myService, ICustomUserEventHandler customUserEventHandler, IOrchardServices orchardServices) { this.MyService = myService; this.CustomUserEventHandler = customUserEventHandler; this.OrchardServices = orchardServices; this.T = NullLocalizer.Instance; }
public static CustomUserPart UpdateFromViewModel(this CustomUserPart self, CustomUserEdit viewModel, IMyService myService) { self.FirstName = viewModel.FirstName; self.LastName = viewModel.LastName; return self; }
/// <summary> /// Illustrates caching for parameterless methods. /// </summary> /// <param name="service"></param> private static void ParameterlessTest(IMyService service) { var names = service.GetNames(); Console.WriteLine(); names = service.GetNames(); Console.WriteLine(); }
public FirstViewModel(IMyService myService, IMvxMessenger messenger) { _myService = myService; // Initialize event handlers using lambda expressions _events = new MyService.Events(messenger); DoSubscribe(); }
/// <summary> /// Illustrates caching for single-argument methods. /// </summary> /// <param name="service"></param> private static void SingleArgumentTest(IMyService service) { var aDepts = service.GetDepartments("a"); Console.WriteLine(); aDepts = service.GetDepartments("a"); Console.WriteLine(); var bDepts = service.GetDepartments("b"); Console.WriteLine(); bDepts = service.GetDepartments("b"); Console.WriteLine(); }
/// <summary> /// Illustrates caching for methods with multiple arguments. /// </summary> /// <param name="service"></param> private static void MultipleArgumentTest(IMyService service) { var adderOne = service.GetNumber(1, 5); Console.WriteLine(); adderOne = service.GetNumber(1, 5); Console.WriteLine(); var adderTwo = service.GetNumber(1, 4); Console.WriteLine(); adderTwo = service.GetNumber(1, 4); Console.WriteLine(); var adderThree = service.GetNumber(2, 5); Console.WriteLine(); adderThree = service.GetNumber(2, 5); Console.WriteLine(); }
/// <summary> /// WcfTcpHost.ClientWindow クラスの新しいインスタンスを作成します。 /// </summary> public ClientWindow() { InitializeComponent(); // 双方向通信を行う場合、サービス側にコールバックの実装を教える必要がある。 var context = new InstanceContext(this); var proxy = new MyServiceClient(context); var info = new ClientInfo(); info.IpAddress = "192.168.150.1"; info.Port = 8000; proxy.Initialize(info); this.FProxy = proxy; this.AddLog("Hello"); this.Execute("StartCallback"); }
public void SetUp() { var binding = new BasicHttpBinding (); var address = new Uri ("http://localhost:8888/MyService"); _host = new ServiceHost (typeof(MyService)); var behavior = _host.Description.Behaviors.Find<ServiceDebugBehavior>(); behavior.IncludeExceptionDetailInFaults = true; _dispatchMessageInspector = Substitute.For<IDispatchMessageInspector>(); _host.Description.Behaviors.Add(new ServiceBehavior(_dispatchMessageInspector)); _host.AddServiceEndpoint (typeof(IMyService), binding, address); _host.Open (); _sut = new ChannelFactory<IMyService>(binding, new EndpointAddress(address)).CreateChannel(); }
public HelloModule(IMyService myService) { this.RequiresAuthentication(); this.RequiresClaims(new string[] { "admin1" }); Before += ctx => { return (this.Context.CurrentUser == null) ? new HtmlResponse(HttpStatusCode.Unauthorized) : null; }; Get["/Hello"] = parameters => { return "Hello " + myService.GetMessage(); }; Get["/users"] = parameters => { return Response.AsJson(GetAllUsers()); }; }
/// <summary> /// todoComment /// </summary> /// <param name="AUserName"></param> /// <param name="APassword"></param> /// <param name="AProcessID"></param> /// <param name="AWelcomeMessage"></param> /// <param name="ASystemEnabled"></param> /// <param name="AError"></param> /// <returns></returns> public bool ConnectToServer(String AUserName, String APassword, out Int32 AProcessID, out String AWelcomeMessage, out Boolean ASystemEnabled, out String AError) { IPrincipal LocalUserInfo; ConnectToServer(AUserName, APassword, out AProcessID, out AWelcomeMessage, out ASystemEnabled, out AError, out LocalUserInfo); FRemoteMyServiceObject = (IMyService)FConnector.GetRemoteObject(FRemotingURL_MyService, typeof(IMyService)); // // initialise object that holds references to all our remote object .NET Remoting Proxies // FRemote = new TRemote(FClientManager, FRemoteMyServiceObject); return true; }
public HomeController(IMyService service) { _service = service; }
public Dispatch(IMyService implementation, bool dispose) { pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation"); this.dispose = dispose && implementation is global::System.IDisposable; }
public HomeController(IMyService myService) { _myService = myService; }
public DefaultController(IMyService myService) { _myService = myService; }
public MyServiceDecorator2(IMyService inner) { Inner = inner; }
public ServerStub(IMyService implementation, bool dispose) : this(new Dispatch(implementation, dispose), dispose) { }
public EchoBot(IMyService myService) { _myService = myService; }
public GreetingService(IMyService myService) { _myService = myService; }
public WeatherForecastController(ILogger <WeatherForecastController> logger, IMyService myService) { _logger = logger; this.myService = myService; }
public HomeController(ILogger <HomeController> logger, IMyService myService, IHubContext <NotifyEnquiry> hubContext) { _logger = logger; _myService = myService; _hubContext = hubContext; }
/// <summary> /// References to the rest of the topmost level of the other Petra Module Namespaces will go here /// </summary> /// <returns>void</returns> public TRemote(IClientManagerInterface AClientManager, IMyService AMyServiceObject) : base(AClientManager) { UMyServiceObject = AMyServiceObject; }
public SystemUnderTest(IMyService service) { _service = service; }
/// <summary> /// Illustrates caching for methods with complex comparable arguments. /// </summary> /// <param name="service"></param> private static void ComplexTypeTest(IMyService service) { var sharedObject = new ComplexType { Name = "Isaac", Age = 32 }; var referenceType = service.ComplexTypeArgument(sharedObject); Console.WriteLine(); referenceType = service.ComplexTypeArgument(sharedObject); Console.WriteLine(); var differentObject = service.ComplexTypeArgument(new ComplexType { Name = "Isaac", Age = 32 }); Console.WriteLine(); var differentValues = service.ComplexTypeArgument(new ComplexType { Name = "Isaaced", Age = 35 }); Console.WriteLine(); }
public Dispatch(IMyService implementation) : this(implementation, true) { }
public void ShouldGenerateAutoDataAndManualDataAndDependency(string value, string data, IMyService myDependency) { // Arrange // Act // Assert Assert.False(string.IsNullOrEmpty(data)); Assert.IsAssignableFrom <IMyService>(myDependency); Assert.Equal("value1", value); }
public ServiceDemoCommand(IMyService myService, IMyService2 myService2) { _myService = myService; _myService2 = myService2; }
public void ShouldGenerateAutoDataAndManualDataAndSutWithDependencyForAllValues(string value, string data, [Frozen] IMyService myDependency, MyRootService sut) { // Arrange // Act sut.DoWork(value); // Assert myDependency.Received(1).DoWork(Arg.Is <string>(p => p == value)); Assert.NotEmpty(data); }
public MyComp Create(IMyService serv) { return new MyComp(serv); }
public MyController(IMyService myService) { _myService = myService; }
// The system should create a new instance using this constructor, if you're using // Ninject's MVC extension. public MyActionFilter(IMyService myService) { _myService = myService; }
public YetAnotherService(IMyService myService) { MyService = myService; }
public MyGenericService(T value, IMyService service) { Value = value; Service = service; }
public ScopedProcessingService(ILogger <ScopedProcessingService> logger, IMyService myService) { _logger = logger; _myService = myService; }
public ServerStub(IMyService implementation) : this(implementation, true) { }
public Startup(IMyService myService) { _myService = myService; }
public EntitiesController(IMyService service) { _service = service; }
public FieldProblem_oblomov() { mocks = new MockRepository(); service = mocks.StrictMock<IMyService>(); }
public BaseMcvController(IMyService myService, ICustomUserEventHandler customUserEventHandler, IOrchardServices orchardServices) { this.MyService = myService; this.CustomUserEventHandler = customUserEventHandler; this.OrchardServices = orchardServices; }
public void Init() { mocks = new MockRepository(); service = mocks.StrictMock<IMyService>(); }
private static void TaskTest(IMyService service) { service.DoTask(); }
public ClassUnderTest(IMyService myservice) { _myservice = myservice; }
public MyChannelFactory(string endpointName, string endpointAddress) { channelFactory = new ChannelFactory <IMyService>(endpointName, new EndpointAddress(endpointAddress)); channel = channelFactory.CreateChannel(); ((ICommunicationObject)channel).Open(); }
public ViewCViewModel(IMyService myService, IMySharedService mySharedService) { //this.Message = myService.GetMessage("ViewC [ModuleB]"); this.Message = mySharedService.GetMessage("ViewC [ModuleB]"); }
public RequiresIMyService(IMyService service) { Service = service; }
public void SpinUp() { _service = A.Fake<IMyService>(); }
public DoSomething(IMyService myService) { _myService = myService; }
public MyComponent(IMyService service) { this.service = service; }
// Using constructor injection to get dependencies public ServiceUsingHandler(IMyService service) { _service = service; }
/// <summary> /// プログラム終了時の処理を行います。 /// </summary> /// <param name="sender">イベントを送信したオブジェクトを指定します。</param> /// <param name="e">イベント引数を指定します。</param> private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e) { this.Execute("StopCallback"); this.FProxy = null; }
public FieldProblem_oblomov() { service = MockRepository.GenerateStrictMock<IMyService>(); }
public void Init(IMyService myService) { Value = myService.Value; }
public SlowConstructor(IMyService myService) { _myService = myService; Console.WriteLine("Doing something slow"); Thread.Sleep(5000); }
public MyService(MyRemoteService remoteService, MyLocalService localService) { _remote = remoteService; _local = localService; LoadSettings(); }
public TestHarness(IMyService service) { _service = service; }
public ValuesController(IMyService service) { this.service = service; }
internal MyComp(IMyService serv) { this.serv = serv; }
public void Get([FromServices] IMyService service) { service.ShowCode(); }