Esempio n. 1
0
 public ServerConnection(string url)
 {
     using(Log.Scope("ServerConnection constructor"))
     {
         Log.Debug("connecting to {0}", url);
         try
         {
             if(_instance != null)
             {
                 _instance.Dispose();
                 _instance = null;
             }
         }
         catch { }
         if(url == null)
             throw new ArgumentNullException("url");
         _url = url;
         this.Server = new LPSClientShared.LPSServer.Server(url);
         this.Server.CookieContainer = CookieContainer;
         this.cached_datasets = new Dictionary<string, DataSet>();
         _instance = this;
         resource_manager = new ResourceManager(this);
         configuration_store = new ConfigurationStore();
     }
 }
Esempio n. 2
0
 public ChangesUpdater(string url, string login, string password, int sink, int security)
 {
     this.datasets = new Dictionary<string, List<DataSet>>();
     this.terminate = false;
     this.server = new LPSClientShared.LPSServer.Server(url);
     this.server.CookieContainer = new System.Net.CookieContainer();
     this.server.Login(login, password);
     this.sink = sink;
     this.security = security;
     lock(typeof(GLib.Thread))
     {
         if(!GLib.Thread.Supported)
             GLib.Thread.Init();
     }
     CheckUpdatesAsync();
 }
Esempio n. 3
0
 public void Dispose()
 {
     using(Log.Scope("ServerConnection.Dispose"))
     {
         try
         {
             FlushCache();
             this.Configuration.Dispose();
             this.configuration_store = null;
             this.Resources.Dispose();
             this.resource_manager = null;
             this.Logout();
         }
         catch(Exception err)
         {
             Log.Error(err);
         }
         this.Server.Dispose();
         this.Server = null;
     }
 }