Merge branch 'master' of git://hg.uk.xensource.com/carbon/trunk/xenadmin

This commit is contained in:
Konstantina Chremmou 2013-11-27 09:50:30 +00:00
commit f209c47abd
2 changed files with 1640 additions and 9 deletions

View File

@ -1,4 +1,35 @@
using System;
/* Copyright (c) Citrix Systems Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms,
* with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.InteropServices;
@ -34,13 +65,24 @@ namespace XenAdmin.ConsoleView
{
this.parent = parent;
this.size = size;
rdpControl = rdpClient6 = new MsRdpClient6();
RDPConfigure(size);
// CA-96135: Try adding rdpControl to parent.Controls list; this will throw exception when
// MsRdpClient6 control cannot be created (there is no appropriate version of dll present)
parent.Controls.Add(rdpControl);
try
{
rdpControl = rdpClient6 = new MsRdpClient6();
RDPConfigure(size);
// CA-96135: Try adding rdpControl to parent.Controls list; this will throw exception when
// MsRdpClient6 control cannot be created (there is no appropriate version of dll present)
parent.Controls.Add(rdpControl);
}
catch (Exception ex)
{
Log.Error("MsRdpClient6 control cannot be added.", ex);
if (parent.Controls.Contains(rdpControl))
parent.Controls.Remove(rdpControl);
rdpClient6 = null;
}
rdpControl.Resize += resizeHandler;
}
@ -66,7 +108,8 @@ namespace XenAdmin.ConsoleView
private void RDPAddOnDisconnected()
{
rdpClient6.OnDisconnected += rdpClient_OnDisconnected;
if (rdpClient6 != null)
rdpClient6.OnDisconnected += rdpClient_OnDisconnected;
}
private void RDPSetSettings()
@ -137,7 +180,8 @@ namespace XenAdmin.ConsoleView
{
if (Connected == 1)
{
rdpClient6.Disconnect();
if (rdpClient6 != null)
rdpClient6.Disconnect();
}
}
catch(InvalidComObjectException ex)

File diff suppressed because it is too large Load Diff