示例#1
0
 private UserServiceFactory(string address, ServiceInfo serviceInfo, IUserServiceCallback userServiceCallback)
 {
     this.binding         = CremaHost.CreateBinding(serviceInfo);
     this.endPointAddress = new EndpointAddress($"net.tcp://{address}:{serviceInfo.Port}/UserService");
     this.instanceContext = new InstanceContext(userServiceCallback ?? (this));
     if (Environment.OSVersion.Platform != PlatformID.Unix)
     {
         this.instanceContext.SynchronizationContext = SynchronizationContext.Current;
     }
 }
示例#2
0
        public static UserServiceClient CreateServiceClient(string address, ServiceInfo serviceInfo, IUserServiceCallback userServiceCallback)
        {
            var factory = new UserServiceFactory(address, serviceInfo, userServiceCallback);

            return(new UserServiceClient(factory.instanceContext, factory.binding, factory.endPointAddress));
        }
示例#3
0
 public BaseViewModel()
 {
     _userServiceCallback = this;
     usersSite            = new InstanceContext(_userServiceCallback);
     UserServiceClient    = new UserServiceClient(usersSite);
 }