示例#1
0
 public ServerBuilder(string httpsAddress, ControllerEventHandlers controllerHandlers, string identity, bool isSecured)
 {
     try
     {
         _httpsAddress = httpsAddress;
         _controllerHandlers = controllerHandlers;
         _identity = identity;
         _isSecured = isSecured;
     }
     catch (Exception ex)
     {
         Tools.Instance.Logger.LogError(ex.ToString());
     }
 }
示例#2
0
 /// <summary>
 /// method used to initialize the Model module
 /// </summary>
 /// <param name="handlers"></param>
 public void IntializeModel(ControllerEventHandlers handlers)
 {
     try
     {
         _identity = new Identity(SystemConfiguration.Instance.FriendlyName);
         SystemConfiguration.Instance.MyIdentity = _identity.GenerateIdentity(SystemConfiguration.Instance.MyAddress, SystemConfiguration.Instance.Port, SystemConfiguration.Instance.ServicePath);
         //_dvContacts = _contactsDAL.LoadContacts(SystemConfiguration.Instance.DataBasePath);
         _contactsDAL.LoadContacts(SystemConfiguration.Instance.DataBasePath);
         ContactEndpoint myEndpoint = IdentityResolver.ResolveIdentity(((Identity)Identity).MyIdentity );
         _serverController = new ServerController(myEndpoint, ((Identity)Identity).MyIdentity, handlers, _useSecurity);
     }
     catch (Exception ex)
     {
         Tools.Instance.Logger.LogError(ex.ToString());
     }
 }
示例#3
0
 public ServerController(ContactEndpoint endpoint, string identity, ControllerEventHandlers handlers, bool isSecured)
 {
     try
     {
         _isSecured = isSecured;
         _myEndpoint = endpoint;
         if (endpoint.Port != 0)
         {
             _address = "https://" + endpoint.Address + ":" + (endpoint.Port + 1).ToString() + endpoint.Path;
         }
         else
         {
             _address = "https://" + endpoint.Address + endpoint.Path;
         }
         Builder serverBuilder = new ServerBuilder(_address, handlers, identity, isSecured);
         Director.Instance.Construct(serverBuilder);
         _server = (ServiceHost)serverBuilder.GetResult();
     }
     catch (Exception ex)
     {
         Tools.Instance.Logger.LogError(ex.ToString());
     }
 }
示例#4
0
 public MViewerServer(ControllerEventHandlers controllerHandlers, string identity)
 {
     _identity = identity;
     _controllerHandlers = controllerHandlers;
 }
示例#5
0
 public override void BuildUri(string httpsAddress, ControllerEventHandlers controllerHandlers, string identity)
 {
     try
     {
         _httpsAddress = httpsAddress;
         _httpURI = new Uri(httpsAddress.Replace("https", "http"), UriKind.Absolute);
         int httpPort = _httpURI.Port - 1;
         string httpAddress = _httpURI.ToString().Replace(_httpURI.Port.ToString(), httpPort.ToString());
         _httpURI = new Uri(httpAddress, UriKind.Absolute);
     }
     catch (Exception ex)
     {
         Tools.Instance.Logger.LogError(ex.ToString());
     }
 }
示例#6
0
 public virtual void BuildUri(string httpsAddress, ControllerEventHandlers controllerHandlers, string identity) { }