public ResultObject InstallSessionHostsCertificate(RdsServer rdsServer)
 {
     return RemoteDesktopServicesController.InstallSessionHostsCertificate(rdsServer);
 }
 public void SetRDServerNewConnectionAllowed(bool newConnectionAllowed, RdsServer server) {
     this.Invoke("SetRDServerNewConnectionAllowed", new object[] {
                 newConnectionAllowed,
                 server});
 }
 /// <remarks/>
 public void SetRDServerNewConnectionAllowedAsync(bool newConnectionAllowed, RdsServer server) {
     this.SetRDServerNewConnectionAllowedAsync(newConnectionAllowed, server, null);
 }
 public void RemoveSessionHostServersFromCollection(string organizationId, string collectionName, RdsServer[] servers) {
     this.Invoke("RemoveSessionHostServersFromCollection", new object[] {
                 organizationId,
                 collectionName,
                 servers});
 }
 /// <remarks/>
 public void RemoveSessionHostServersFromCollectionAsync(string organizationId, string collectionName, RdsServer[] servers) {
     this.RemoveSessionHostServersFromCollectionAsync(organizationId, collectionName, servers, null);
 }
 /// <remarks/>
 public void AddRdsServersToDeploymentAsync(RdsServer[] servers, object userState) {
     if ((this.AddRdsServersToDeploymentOperationCompleted == null)) {
         this.AddRdsServersToDeploymentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRdsServersToDeploymentOperationCompleted);
     }
     this.InvokeAsync("AddRdsServersToDeployment", new object[] {
                 servers}, this.AddRdsServersToDeploymentOperationCompleted, userState);
 }
 public void AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server) {
     this.Invoke("AddSessionHostServerToCollection", new object[] {
                 organizationId,
                 collectionName,
                 server});
 }
 public void BindServers(RdsServer[] servers)
 {
     gvServers.DataSource = servers;
     gvServers.DataBind();
 }
 public bool AddRdsServersToDeployment(RdsServer[] servers)
 {
     try
     {
         Log.WriteStart("'{0}' AddRdsServersToDeployment", ProviderSettings.ProviderName);
         var result = RDSProvider.AddRdsServersToDeployment(servers);
         Log.WriteEnd("'{0}' AddRdsServersToDeployment", ProviderSettings.ProviderName);
         return result;
     }
     catch (Exception ex)
     {
         Log.WriteError(String.Format("'{0}' AddRdsServersToDeployment", ProviderSettings.ProviderName), ex);
         throw;
     }
 }
 protected static int CompareAccount(RdsServer server1, RdsServer server2)
 {
     return string.Compare(server1.FqdName, server2.FqdName);
 }
        public void SetServers(RdsServer[] servers)
		{
            BindServers(servers, false);
		}
        protected List<RdsServer> GetGridViewServers(SelectedState state)
        {
            List<RdsServer> servers = new List<RdsServer>();
            for (int i = 0; i < gvServers.Rows.Count; i++)
            {
                GridViewRow row = gvServers.Rows[i];
                CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect");
                if (chkSelect == null)
                    continue;

                RdsServer server = new RdsServer();
                server.Id = (int)gvServers.DataKeys[i][0];
                server.FqdName = ((Literal)row.FindControl("litFqdName")).Text;
                server.Status = ((Literal)row.FindControl("litStatus")).Text;
                var rdsCollectionId = ((HiddenField)row.FindControl("hdnRdsCollectionId")).Value;

                if (!string.IsNullOrEmpty(rdsCollectionId))
                {
                    server.RdsCollectionId = Convert.ToInt32(rdsCollectionId);
                }

                if (state == SelectedState.All ||
                    (state == SelectedState.Selected && chkSelect.Checked) ||
                    (state == SelectedState.Unselected && !chkSelect.Checked))
                    servers.Add(server);
            }

            return servers;
        }
        protected void BindServers(RdsServer[] newServers, bool preserveExisting)
		{
			// get binded addresses
            List<RdsServer> servers = new List<RdsServer>();
			if(preserveExisting)
                servers.AddRange(GetGridViewServers(SelectedState.All));

            // add new servers

            if (newServers != null)
			{
                foreach (RdsServer newServer in newServers)
				{
					// check if exists
					bool exists = false;
                    foreach (RdsServer server in servers)
					{
                        if (server.Id == newServer.Id)
						{
							exists = true;
							break;
						}
					}

					if (exists)
						continue;

                    servers.Add(newServer);
				}
			}

            gvServers.DataSource = servers;
            gvServers.DataBind();
		}
 public static void UpdateRDSServer(RdsServer server)
 {
     UpdateRDSServer(server.Id, server.ItemId, server.Name, server.FqdName, server.Description,
         server.RdsCollectionId, server.ConnectionEnabled);
 }
 /// <remarks/>
 public System.IAsyncResult BeginAddRdsServersToDeployment(RdsServer[] servers, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("AddRdsServersToDeployment", new object[] {
                 servers}, callback, asyncState);
 }
 public void RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server)
 {
     try
     {
         Log.WriteStart("'{0}' RemoveSessionHostServerFromCollection", ProviderSettings.ProviderName);
         RDSProvider.RemoveSessionHostServerFromCollection(organizationId, collectionName, server);
         Log.WriteEnd("'{0}' RemoveSessionHostServerFromCollection", ProviderSettings.ProviderName);
     }
     catch (Exception ex)
     {
         Log.WriteError(String.Format("'{0}' RemoveSessionHostServerFromCollection", ProviderSettings.ProviderName), ex);
         throw;
     }
 }
 /// <remarks/>
 public void AddRdsServersToDeploymentAsync(RdsServer[] servers) {
     this.AddRdsServersToDeploymentAsync(servers, null);
 }
 public void SetRDServerNewConnectionAllowed(bool newConnectionAllowed, RdsServer server)
 {
     try
     {
         Log.WriteStart("'{0}' SetRDServerNewConnectionAllowed", ProviderSettings.ProviderName);
         RDSProvider.SetRDServerNewConnectionAllowed(newConnectionAllowed, server);
         Log.WriteEnd("'{0}' SetRDServerNewConnectionAllowed", ProviderSettings.ProviderName);
     }
     catch (Exception ex)
     {
         Log.WriteError(String.Format("'{0}' SetRDServerNewConnectionAllowed", ProviderSettings.ProviderName), ex);
         throw;
     }
 }
 public bool RemoveCollection(string organizationId, string collectionName, RdsServer[] servers) {
     object[] results = this.Invoke("RemoveCollection", new object[] {
                 organizationId,
                 collectionName,
                 servers});
     return ((bool)(results[0]));
 }
 public void MoveSessionHostsToCollectionOU(RdsServer[] servers, string collectionName, string organizationId) {
     this.Invoke("MoveSessionHostsToCollectionOU", new object[] {
                 servers,
                 collectionName,
                 organizationId});
 }
 /// <remarks/>
 public void AddSessionHostServersToCollectionAsync(string organizationId, string collectionName, RdsServer[] servers) {
     this.AddSessionHostServersToCollectionAsync(organizationId, collectionName, servers, null);
 }
 /// <remarks/>
 public System.IAsyncResult BeginMoveSessionHostsToCollectionOU(RdsServer[] servers, string collectionName, string organizationId, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("MoveSessionHostsToCollectionOU", new object[] {
                 servers,
                 collectionName,
                 organizationId}, callback, asyncState);
 }
 /// <remarks/>
 public System.IAsyncResult BeginRemoveSessionHostServersFromCollection(string organizationId, string collectionName, RdsServer[] servers, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("RemoveSessionHostServersFromCollection", new object[] {
                 organizationId,
                 collectionName,
                 servers}, callback, asyncState);
 }
 /// <remarks/>
 public void MoveSessionHostsToCollectionOUAsync(RdsServer[] servers, string collectionName, string organizationId) {
     this.MoveSessionHostsToCollectionOUAsync(servers, collectionName, organizationId, null);
 }
 /// <remarks/>
 public void RemoveSessionHostServersFromCollectionAsync(string organizationId, string collectionName, RdsServer[] servers, object userState) {
     if ((this.RemoveSessionHostServersFromCollectionOperationCompleted == null)) {
         this.RemoveSessionHostServersFromCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveSessionHostServersFromCollectionOperationCompleted);
     }
     this.InvokeAsync("RemoveSessionHostServersFromCollection", new object[] {
                 organizationId,
                 collectionName,
                 servers}, this.RemoveSessionHostServersFromCollectionOperationCompleted, userState);
 }
 /// <remarks/>
 public void MoveSessionHostsToCollectionOUAsync(RdsServer[] servers, string collectionName, string organizationId, object userState) {
     if ((this.MoveSessionHostsToCollectionOUOperationCompleted == null)) {
         this.MoveSessionHostsToCollectionOUOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMoveSessionHostsToCollectionOUOperationCompleted);
     }
     this.InvokeAsync("MoveSessionHostsToCollectionOU", new object[] {
                 servers,
                 collectionName,
                 organizationId}, this.MoveSessionHostsToCollectionOUOperationCompleted, userState);
 }
 /// <remarks/>
 public System.IAsyncResult BeginSetRDServerNewConnectionAllowed(bool newConnectionAllowed, RdsServer server, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("SetRDServerNewConnectionAllowed", new object[] {
                 newConnectionAllowed,
                 server}, callback, asyncState);
 }
 public bool AddRdsServersToDeployment(RdsServer[] servers) {
     object[] results = this.Invoke("AddRdsServersToDeployment", new object[] {
                 servers});
     return ((bool)(results[0]));
 }
 /// <remarks/>
 public void SetRDServerNewConnectionAllowedAsync(bool newConnectionAllowed, RdsServer server, object userState) {
     if ((this.SetRDServerNewConnectionAllowedOperationCompleted == null)) {
         this.SetRDServerNewConnectionAllowedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetRDServerNewConnectionAllowedOperationCompleted);
     }
     this.InvokeAsync("SetRDServerNewConnectionAllowed", new object[] {
                 newConnectionAllowed,
                 server}, this.SetRDServerNewConnectionAllowedOperationCompleted, userState);
 }
 public ResultObject UpdateRdsServer(RdsServer rdsServer)
 {
     return RemoteDesktopServicesController.UpdateRdsServer(rdsServer);
 }