コード例 #1
0
 public void CreateNetwork()
 {
     NetworkAction networkAction = new NetworkAction(DatabaseManager.ConnectionFor(dbName), newNetwork, true);
     networkAction.Completed += networkAction_Completed;
     networkAction.RunAsync();
     AutoResetEvent.WaitOne();
     DatabaseManager.ConnectionFor(dbName).LoadCache(DatabaseManager.ConnectionFor(dbName).Session);
     Assert.AreEqual(networks + 1, DatabaseManager.ConnectionFor(dbName).Cache.Networks.Length);
 }
コード例 #2
0
 public void CreateExternalNetwork()
 {
     Assert.True(DatabaseManager.ConnectionFor(dbName).Cache.PIFs.Length > 0);
     PIF pif = DatabaseManager.ConnectionFor(dbName).Cache.PIFs[0];
     NetworkAction networkAction = new NetworkAction(DatabaseManager.ConnectionFor(dbName), newNetwork, pif, 2);
     networkAction.Completed += new System.EventHandler<System.EventArgs>(networkAction_Completed);
     networkAction.RunAsync();
     AutoResetEvent.WaitOne();
     DatabaseManager.RefreshCacheFor(dbName);
     Assert.AreEqual(networks + 1, DatabaseManager.ConnectionFor(dbName).Cache.Networks.Length);
 }
コード例 #3
0
 public void DeleteNetwork()
 {
     CreateNetwork();
     Network network = FindCreatedNetwork();
     Assert.NotNull(network);
     NetworkAction networkAction = new NetworkAction(DatabaseManager.ConnectionFor(dbName), network, false);
     networkAction.Completed += new System.EventHandler<System.EventArgs>(networkAction_Completed);
     networkAction.RunAsync();
     AutoResetEvent.WaitOne();
     DatabaseManager.RefreshCacheFor(dbName);
     Assert.AreEqual(networks, DatabaseManager.ConnectionFor(dbName).Cache.Networks.Length);
 }
コード例 #4
0
ファイル: NetworkList.cs プロジェクト: agimofcarmen/xenadmin
        private void DoRemoveNetwork()
        {
            if (SelectedVif != null)
            {
                VM vm = XenObject as VM;

                var action = new DeleteVIFAction(SelectedVif);
                action.Completed += action_Completed;
                action.RunAsync();
            }
            else if(SelectedNetwork != null)
            {
                NetworkAction action = new NetworkAction(XenObject.Connection, SelectedNetwork,false);
                action.Completed += action_Completed;
                action.RunAsync();
            }
        }
コード例 #5
0
ファイル: NetworkList.cs プロジェクト: ChrisH4rding/xenadmin
        private void DoRemoveNetwork()
        {
            Program.MainWindow.AllowHistorySwitch = true;

            if (SelectedVif != null)
            {
                VM vm = XenObject as VM;

                var action = new DeleteVIFAction(SelectedVif);
                action.Completed += action_Completed;
                action.RunAsync();
            }
            else if(SelectedNetwork != null)
            {
                NetworkAction action = new NetworkAction(XenObject.Connection, SelectedNetwork,false);
                action.Completed += action_Completed;
                action.RunAsync();
            }
        }