public CreatedMockStorageLinkConnectionEventArgs(MockStorageLinkWebService mockWebService, StorageLinkConnection storageLinkConnection)
        {
            Util.ThrowIfParameterNull(storageLinkConnection, "connection");

            MockWebService        = mockWebService;
            StorageLinkConnection = storageLinkConnection;
        }
        private void Refresh(object state)
        {
            lock (_refreshLock)
            {
                MoveLocalCredentials();

                List <StorageLinkCredentials> allCreds = GetAllStorageLinkCredentials();

                // remove all storagelink connections that have out-of-date credentials
                RemoveAll(s => null == allCreds.Find(c => c.Host == s.Host && c.Username == s.Username && c.Password == s.Password));

                // now add new storagelink connections
                foreach (StorageLinkCredentials creds in allCreds)
                {
                    if (Find(s => s.Host == creds.Host && s.Username == creds.Username) == null)
                    {
                        StorageLinkConnection con;

                        if (Program.RunInAutomatedTestMode)
                        {
                            var mockWebService = new MockStorageLinkWebService(creds.Host, creds.Username, creds.Password);
                            con = new StorageLinkConnection(_synchronizer(), mockWebService);

                            OnCreatedMockStorageLinkConnection(new CreatedMockStorageLinkConnectionEventArgs(mockWebService, con));
                        }
                        else
                        {
                            con = new StorageLinkConnection(_synchronizer(), creds.Host, creds.Username, creds.Password);
                        }

                        Invoke(() => InsertItem(Count, con));
                    }
                }
            }
        }
 public void SetUp()
 {
     _ws = new MockStorageLinkWebService("Mock", "bla", "bla");
     _con = new StorageLinkConnection(null, _ws);
 }