Пример #1
0
        public IDXVCSService CreateService(string serviceUrl)
        {
            if (isServiceRegistered)
            {
                try {
                    int version = service.GetServiceVersion();
                    return(service);
                }
                catch {
                }
            }
            EndpointAddress myEndpointAddress      = new EndpointAddress(new Uri(serviceUrl), new SpnEndpointIdentity(String.Empty));
            ServiceEndpoint point                  = GZipMessageEncodingBindingElement.CreateEndpoint(myEndpointAddress);
            ChannelFactory <IDXVCSService> factory = new Factory(point);

            factory.Credentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Identification;
            IDXVCSService   newService = factory.CreateChannel();
            IContextChannel newChannel = (IContextChannel)newService;

            newChannel.OperationTimeout = TimeSpan.MaxValue;
            newChannel.Open();
            service             = newService;
            isServiceRegistered = true;
            service             = new ServiceWrapper(newService);
            return(service);
        }
Пример #2
0
        internal DXVcsRepository(IDXVCSService service) {
            if (service == null)
                throw new ArgumentNullException("service");

            this.service = service;

            bool isAdmin;
            if (!this.service.IsCorrectUser(out isAdmin))
                throw new ApplicationException("Invalid user name");
        }
Пример #3
0
        public IDXVCSService GetService(string serviceUrl)
        {
            EndpointAddress myEndpointAddress      = new EndpointAddress(new Uri(serviceUrl), new SpnEndpointIdentity(String.Empty));
            ServiceEndpoint point                  = GZipMessageEncodingBindingElement.CreateEndpoint(myEndpointAddress, typeof(IDXVCSService));
            ChannelFactory <IDXVCSService> factory = new Factory(point);

            factory.Credentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Identification;
            IDXVCSService   newService = factory.CreateChannel();
            IContextChannel newChannel = (IContextChannel)newService;

            newChannel.OperationTimeout = TimeSpan.FromSeconds(10);
            newChannel.Open();
            return(new ServiceWrapper(newService));
        }
Пример #4
0
 public FileHistory(string vcsFile, IDXVCSService service)
 {
     this.vcsFile = vcsFile;
     this.service = service;
 }