コード例 #1
0
		public UserManagerController(
			IMyService myService,
			ICustomUserEventHandler customUserEventHandler,
			IOrchardServices orchardServices)
			: base(myService, customUserEventHandler, orchardServices)
		{
		}
コード例 #2
0
		protected BaseApiController(IMyService myService, ICustomUserEventHandler customUserEventHandler, IOrchardServices orchardServices)
		{
			this.MyService = myService;
			this.CustomUserEventHandler = customUserEventHandler;
			this.OrchardServices = orchardServices;
			this.T = NullLocalizer.Instance;
		}
コード例 #3
0
		public static CustomUserPart UpdateFromViewModel(this CustomUserPart self, CustomUserEdit viewModel, IMyService myService)
		{
			self.FirstName = viewModel.FirstName;
			self.LastName = viewModel.LastName;

			return self;
		}
コード例 #4
0
 /// <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();
 }
コード例 #5
0
        public FirstViewModel(IMyService myService, IMvxMessenger messenger)
        {
            _myService = myService;

            // Initialize event handlers using lambda expressions
            _events = new MyService.Events(messenger);
            DoSubscribe();
        }
コード例 #6
0
 /// <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();
 }
コード例 #7
0
 /// <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();
 }
コード例 #8
0
        /// <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");
        }
コード例 #9
0
        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();
        }
コード例 #10
0
ファイル: HelloModule.cs プロジェクト: joeyulivecn/NancyDemo
        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());
            };
        }
コード例 #11
0
        /// <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;
        }
コード例 #12
0
 public HomeController(IMyService service)
 {
     _service = service;
 }
コード例 #13
0
 public Dispatch(IMyService implementation, bool dispose)
 {
     pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation");
     this.dispose = dispose && implementation is global::System.IDisposable;
 }
コード例 #14
0
 public HomeController(IMyService myService)
 {
     _myService = myService;
 }
コード例 #15
0
 public DefaultController(IMyService myService)
 {
     _myService = myService;
 }
コード例 #16
0
 public MyServiceDecorator2(IMyService inner)
 {
     Inner = inner;
 }
コード例 #17
0
 public ServerStub(IMyService implementation, bool dispose) : this(new Dispatch(implementation, dispose), dispose)
 {
 }
コード例 #18
0
 public EchoBot(IMyService myService)
 {
     _myService = myService;
 }
コード例 #19
0
 public GreetingService(IMyService myService)
 {
     _myService = myService;
 }
コード例 #20
0
 public WeatherForecastController(ILogger <WeatherForecastController> logger, IMyService myService)
 {
     _logger        = logger;
     this.myService = myService;
 }
コード例 #21
0
 public HomeController(ILogger <HomeController> logger, IMyService myService, IHubContext <NotifyEnquiry> hubContext)
 {
     _logger     = logger;
     _myService  = myService;
     _hubContext = hubContext;
 }
コード例 #22
0
 /// <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;
 }
コード例 #23
0
 public SystemUnderTest(IMyService service)
 {
     _service = service;
 }
コード例 #24
0
        /// <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();
        }
コード例 #25
0
 public Dispatch(IMyService implementation) : this(implementation, true)
 {
 }
コード例 #26
0
 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);
 }
コード例 #27
0
 public ServiceDemoCommand(IMyService myService, IMyService2 myService2)
 {
     _myService = myService;
     _myService2 = myService2;
 }
コード例 #28
0
 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);
 }
コード例 #29
0
		public MyComp Create(IMyService serv)
		{
			return new MyComp(serv);
		}
コード例 #30
0
 public MyController(IMyService myService)
 {
     _myService = myService;
 }
コード例 #31
0
 // The system should create a new instance using this constructor, if you're using
 // Ninject's MVC extension.
 public MyActionFilter(IMyService myService)
 {
     _myService = myService;
 }
コード例 #32
0
 public YetAnotherService(IMyService myService)
 {
     MyService = myService;
 }
コード例 #33
0
 public MyGenericService(T value, IMyService service)
 {
     Value   = value;
     Service = service;
 }
コード例 #34
0
 public ScopedProcessingService(ILogger <ScopedProcessingService> logger, IMyService myService)
 {
     _logger    = logger;
     _myService = myService;
 }
コード例 #35
0
 public ServerStub(IMyService implementation) : this(implementation, true)
 {
 }
コード例 #36
0
 public Startup(IMyService myService)
 {
     _myService = myService;
 }
コード例 #37
0
 public EntitiesController(IMyService service)
 {
     _service = service;
 }
コード例 #38
0
 public FieldProblem_oblomov()
 {
     mocks = new MockRepository();
     service = mocks.StrictMock<IMyService>();
 }
コード例 #39
0
		public BaseMcvController(IMyService myService, ICustomUserEventHandler customUserEventHandler, IOrchardServices orchardServices)
		{
			this.MyService = myService;
			this.CustomUserEventHandler = customUserEventHandler;
			this.OrchardServices = orchardServices;
		}
コード例 #40
0
 public void Init()
 {
     mocks = new MockRepository();
     service = mocks.StrictMock<IMyService>();
 }
コード例 #41
0
 private static void TaskTest(IMyService service)
 {
     service.DoTask();
 }
コード例 #42
0
 public ClassUnderTest(IMyService myservice)
 {
     _myservice = myservice;
 }
コード例 #43
0
 public MyChannelFactory(string endpointName, string endpointAddress)
 {
     channelFactory = new ChannelFactory <IMyService>(endpointName, new EndpointAddress(endpointAddress));
     channel        = channelFactory.CreateChannel();
     ((ICommunicationObject)channel).Open();
 }
コード例 #44
0
 public ViewCViewModel(IMyService myService, IMySharedService mySharedService)
 {
     //this.Message = myService.GetMessage("ViewC [ModuleB]");
     this.Message = mySharedService.GetMessage("ViewC [ModuleB]");
 }
コード例 #45
0
ファイル: RemoteObjects.cs プロジェクト: js1987/openpetragit
 /// <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;
 }
コード例 #46
0
 public RequiresIMyService(IMyService service)
 {
     Service = service;
 }
コード例 #47
0
 public void SpinUp()
 {
     _service = A.Fake<IMyService>();
 }
コード例 #48
0
 public DoSomething(IMyService myService)
 {
     _myService = myService;
 }
コード例 #49
0
			public MyComponent(IMyService service)
			{
				this.service = service;
			}
コード例 #50
0
 // Using constructor injection to get dependencies
 public ServiceUsingHandler(IMyService service)
 {
     _service = service;
 }
コード例 #51
0
 /// <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;
 }
コード例 #52
0
 public Startup(IMyService myService)
 {
     _myService = myService;
 }
コード例 #53
0
 public FieldProblem_oblomov()
 {
     service = MockRepository.GenerateStrictMock<IMyService>();
 }
コード例 #54
0
ファイル: Posts.cs プロジェクト: xuejunhui/piranha.core
 public void Init(IMyService myService)
 {
     Value = myService.Value;
 }
コード例 #55
0
ファイル: Program.cs プロジェクト: hurricanepkt/AOPinNET
 public SlowConstructor(IMyService myService)
 {
     _myService = myService;
     Console.WriteLine("Doing something slow");
     Thread.Sleep(5000);
 }
コード例 #56
0
 public MyService(MyRemoteService remoteService, MyLocalService localService)
 {
     _remote = remoteService;
     _local  = localService;
     LoadSettings();
 }
コード例 #57
0
 public TestHarness(IMyService service)
 {
     _service = service;
 }
コード例 #58
0
 public ValuesController(IMyService service)
 {
     this.service = service;
 }
コード例 #59
0
ファイル: MyComp.cs プロジェクト: ralescano/castle
		internal MyComp(IMyService serv)
		{
			this.serv = serv;
		}
コード例 #60
0
 public void Get([FromServices] IMyService service)
 {
     service.ShowCode();
 }