コード例 #1
0
ファイル: RDPConnection.cs プロジェクト: zivalin/Terminals
        public override void ChangeDesktopSize(DesktopSize desktopSize)
        {
            Size size = DesktopSizeCalculator.GetSize(this, this.Favorite);

            try
            {
                switch (desktopSize)
                {
                case DesktopSize.AutoScale:
                case DesktopSize.FitToWindow:
                    this.client.AdvancedSettings3.SmartSizing = true;
                    break;

                case DesktopSize.FullScreen:
                    this.client.FullScreen = true;
                    break;
                }

                this.client.DesktopWidth  = size.Width;
                this.client.DesktopHeight = size.Height;
            }
            catch (Exception exc)
            {
                Logging.Error("Error trying to set the desktop dimensions", exc);
            }
        }
コード例 #2
0
        protected override void ChangeDesktopSize(DesktopSize desktopSize, System.Drawing.Size size)
        {
            try
            {
                switch (desktopSize)
                {
                case DesktopSize.Custom:
                    this.client.AdvancedSettings3.SmartSizing = false;
                    this.client.FullScreen = false;
                    break;

                case DesktopSize.AutoScale:
                case DesktopSize.FitToWindow:
                    this.client.AdvancedSettings3.SmartSizing = true;
                    this.client.FullScreen = false;
                    break;

                case DesktopSize.FullScreen:
                    this.client.FullScreen = true;
                    this.client.AdvancedSettings3.SmartSizing = false;
                    size = this.MaxSize;
                    break;
                }

                client.InvokeIfNecessary(() =>
                {
                    this.client.Height = size.Height;
                    this.client.Width  = size.Width;
                });
            }
            catch (Exception ex)
            {
                Log.Error("Error trying to set the desktop dimensions.", ex);
            }
        }
コード例 #3
0
        private static string ConvertDesktopSize(DesktopSize desktopSize)
        {
            if (desktopSize == DesktopSize.FullScreen)
            {
                return("1");
            }

            return("0");
        }
コード例 #4
0
ファイル: ExportImport.cs プロジェクト: zoroz/Terminals
        private static DesktopSize ReadDesktopSize(String str)
        {
            DesktopSize tmp = DesktopSize.AutoScale;

            if (!String.IsNullOrEmpty(str))
            {
                tmp = (DesktopSize)Enum.Parse(typeof(DesktopSize), str);
            }
            return(tmp);
        }
コード例 #5
0
        internal DesktopSize ReadDesktopSize()
        {
            DesktopSize tmp = DesktopSize.AutoScale;
            string      str = this.ReadString();

            if (!String.IsNullOrEmpty(str))
            {
                tmp = (DesktopSize)Enum.Parse(typeof(DesktopSize), str);
            }
            return(tmp);
        }
コード例 #6
0
            internal DesktopSize ReadDesktopSize()
            {
                DesktopSize tmp = DesktopSize.AutoScale;
                string      str = this.ReadString();

                try
                {
                    if (!String.IsNullOrEmpty(str))
                    {
                        tmp = (DesktopSize)Enum.Parse(typeof(DesktopSize), str);
                    }
                }
                catch
                {
                    // if the value is something like 768x1024
                    // The CodePlex Terminals holds the value 'x1024'
                    // which is a custom value.
                    // possible exception:
                    // >> System.ArgumentException: Requested value 'x1024' was not found. <<
                    return(DesktopSize.Custom);
                }

                return(tmp);
            }
コード例 #7
0
ファイル: RDPConnection.cs プロジェクト: gabrewer/Terminals
        protected override void ChangeDesktopSize(DesktopSize desktopSize, System.Drawing.Size size)
        {
            try
            {
                switch (desktopSize)
                {
                    case DesktopSize.Custom:
                        this.client.AdvancedSettings3.SmartSizing = false;
                        this.client.FullScreen = false;
                        break;

                    case DesktopSize.AutoScale:
                    case DesktopSize.FitToWindow:
                        this.client.AdvancedSettings3.SmartSizing = true;
                        this.client.FullScreen = false;
                        break;

                    case DesktopSize.FullScreen:
                        this.client.FullScreen = true;
                        this.client.AdvancedSettings3.SmartSizing = false;
                        size = this.MaxSize;
                        break;
                }

                client.InvokeIfNecessary(() =>
                {
                    this.client.Height = size.Height;
                    this.client.Width = size.Width;
                });
            }
            catch (Exception ex)
            {
                Log.Error("Error trying to set the desktop dimensions.", ex);
            }
        }
コード例 #8
0
ファイル: HTTPConnection.cs プロジェクト: schifflee/Terminals
 protected override void ChangeDesktopSize(DesktopSize desktopSize, System.Drawing.Size size)
 {
 }
コード例 #9
0
ファイル: Connection.cs プロジェクト: gbachs/Terminals
 /// <summary>
 /// Default empty implementation to be overriden by connection
 /// </summary>
 public virtual void ChangeDesktopSize(DesktopSize size)
 {
 }
コード例 #10
0
 protected override void ChangeDesktopSize(DesktopSize desktopSize, System.Drawing.Size size)
 {
     this.ResizeClient();
 }
コード例 #11
0
        public override void ChangeDesktopSize(DesktopSize desktopSize)
        {
            Size size = ConnectionManager.GetSize(this, this.Favorite);

            try
            {
                switch (desktopSize)
                {
                    case DesktopSize.AutoScale:
                    case DesktopSize.FitToWindow:
                        this.client.AdvancedSettings3.SmartSizing = true;
                        break;
                    case DesktopSize.FullScreen:
                        this.client.FullScreen = true;
                        break;
                }

                this.client.DesktopWidth = size.Width;
                this.client.DesktopHeight = size.Height;
            }
            catch (Exception exc)
            {
                Logging.Error("Error trying to set the desktop dimensions", exc);
            }
        }
コード例 #12
0
 protected abstract void ChangeDesktopSize(DesktopSize desktopSize, System.Drawing.Size size);
コード例 #13
0
 public static Size GetSize(ConnectionBase connection, DesktopSize desktopSize, int desktopSizeWidth, int desktopSizeHeight)
 {
     return GetSize(connection, new FavoriteConfigurationElement { DesktopSize = desktopSize, DesktopSizeWidth = desktopSizeWidth, DesktopSizeHeight = desktopSizeHeight });
 }
コード例 #14
0
 /// <summary>
 /// Default empty implementation to be overriden by connection
 /// </summary>
 public virtual void ChangeDesktopSize(DesktopSize size)
 {
 }
コード例 #15
0
 public static Size GetSize(ConnectionBase connection, DesktopSize desktopSize, int desktopSizeWidth, int desktopSizeHeight)
 {
     return(GetSize(connection, new FavoriteConfigurationElement {
         DesktopSize = desktopSize, DesktopSizeWidth = desktopSizeWidth, DesktopSizeHeight = desktopSizeHeight
     }));
 }
コード例 #16
0
ファイル: ICAConnection.cs プロジェクト: RSchwoerer/Terminals
 protected override void ChangeDesktopSize(DesktopSize desktopSize, System.Drawing.Size size)
 {
     this.iIcaClient.DesiredHRes = size.Width;
     this.iIcaClient.DesiredVRes = size.Height;
 }
コード例 #17
0
 protected override void ChangeDesktopSize(DesktopSize desktopSize, System.Drawing.Size size)
 {
     this.ResizeClient();
 }
コード例 #18
0
 protected abstract void ChangeDesktopSize(DesktopSize desktopSize, System.Drawing.Size size);
コード例 #19
0
        public static void GetSize(ref int Height, ref int Width, Connections.Connection Connection, DesktopSize Size)
        {
            switch (Size)
            {
            case DesktopSize.x640:
                Width  = 640;
                Height = 480;
                break;

            case DesktopSize.x800:
                Width  = 800;
                Height = 600;
                break;

            case DesktopSize.x1024:
                Width  = 1024;
                Height = 768;
                break;

            case DesktopSize.x1280:
                Width  = 1280;
                Height = 1024;
                break;

            case DesktopSize.FitToWindow:
                Width  = Connection.TerminalTabPage.Width;
                Height = Connection.TerminalTabPage.Height;
                break;

            case DesktopSize.FullScreen:
                Width  = Screen.FromControl(Connection).Bounds.Width;
                Height = Screen.FromControl(Connection).Bounds.Height - 1;
                break;

            case DesktopSize.AutoScale:
                Width  = Screen.FromControl(Connection).Bounds.Width;
                Height = Screen.FromControl(Connection).Bounds.Height - 1;
                break;

            case DesktopSize.Custom:
                break;
            }
            int maxWidth  = Settings.SupportsRDP6 ? 4096 : 1600;
            int maxHeight = Settings.SupportsRDP6 ? 2048 : 1200;

            Width  = Math.Min(maxWidth, Width);
            Height = Math.Min(maxHeight, Height);;
        }
コード例 #20
0
        public void ChangeDesktopSize(System.Drawing.Size? size = null, DesktopSize? desktopSize = null)
        {
            if (this.Favorite == null && !desktopSize.HasValue)
                return;

            if (!(size.HasValue && desktopSize.HasValue))
            {
                if (desktopSize.HasValue)
                    if (size.HasValue)
                        size = GetSize(this, desktopSize.Value, size.Value.Width, size.Value.Height);
                    else
                        size = GetSize(this, desktopSize.Value, this.Favorite.DesktopSizeWidth, this.Favorite.DesktopSizeHeight);
                else
                    if (size == null)
                        size = GetSize();

                if (size == null)
                    return;
            }

            this.ChangeDesktopSize(desktopSize.HasValue ? desktopSize.Value : this.Favorite.DesktopSize, size.Value);
        }
コード例 #21
0
 public void ChangeDesktopSize(DesktopSize size)
 {
 }
コード例 #22
0
ファイル: RASProperties.cs プロジェクト: zoroz/Terminals
 public void ChangeDesktopSize(DesktopSize size)
 {
 }
コード例 #23
0
 protected override void ChangeDesktopSize(DesktopSize size, System.Drawing.Size siz)
 {
     
 }
コード例 #24
0
        private static string ConvertDesktopSize(DesktopSize desktopSize)
        {
            if (desktopSize == DesktopSize.FullScreen)
                return "1";

            return "0";
        }
コード例 #25
0
        public static void GetSize(ref int Height, ref int Width, Connections.Connection Connection, DesktopSize Size)
        {
            switch(Size) {
                case DesktopSize.x640:
                    Width = 640;
                    Height = 480;
                    break;
                case DesktopSize.x800:
                    Width = 800;
                    Height = 600;
                    break;
                case DesktopSize.x1024:
                    Width = 1024;
                    Height = 768;
                    break;
                case DesktopSize.x1280:
                    Width = 1280;
                    Height = 1024;
                    break;
                case DesktopSize.FitToWindow:
                    Width = Connection.TerminalTabPage.Width;
                    Height = Connection.TerminalTabPage.Height;
                    break;
                case DesktopSize.FullScreen:
                    Width = Screen.FromControl(Connection).Bounds.Width;
                    Height = Screen.FromControl(Connection).Bounds.Height - 1;
                    break;
                case DesktopSize.AutoScale:
                    Width = Screen.FromControl(Connection).Bounds.Width;
                    Height = Screen.FromControl(Connection).Bounds.Height - 1;
                    break;
                case DesktopSize.Custom:
                    break;
            }
            int maxWidth = Settings.SupportsRDP6 ? 4096 : 1600;
            int maxHeight = Settings.SupportsRDP6 ? 2048 : 1200;

            Width = Math.Min(maxWidth, Width);
            Height = Math.Min(maxHeight, Height); ;
        }
コード例 #26
0
ファイル: ICAConnection.cs プロジェクト: schifflee/Terminals
 protected override void ChangeDesktopSize(DesktopSize desktopSize, System.Drawing.Size size)
 {
     this.iIcaClient.DesiredHRes = size.Width;
     this.iIcaClient.DesiredVRes = size.Height;
 }