本文整理汇总了C#中IFavorite类的典型用法代码示例。如果您正苦于以下问题:C# IFavorite类的具体用法?C# IFavorite怎么用?C# IFavorite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFavorite类属于命名空间,在下文中一共展示了IFavorite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromCofigFavorite
internal override void FromCofigFavorite(IFavorite destination, FavoriteConfigurationElement source)
{
this.SSH1 = source.SSH1;
this.AuthMethod = source.AuthMethod;
this.CertificateKey = source.KeyTag;
this.SSHKeyFile = source.SSHKeyFile;
}
示例2: ToConfigFavorite
internal override void ToConfigFavorite(IFavorite source, FavoriteConfigurationElement destination)
{
destination.SSH1 = this.SSH1;
destination.AuthMethod = this.AuthMethod;
destination.KeyTag = this.CertificateKey;
destination.SSHKeyFile = this.SSHKeyFile;
}
示例3: GetSize
public static Size GetSize(Connection connection, IFavorite favorite)
{
int height = favorite.Display.Height;
int width = favorite.Display.Width;
switch (favorite.Display.DesktopSize)
{
case DesktopSize.x640:
return new Size(640, 480);
case DesktopSize.x800:
return new Size(800, 600);
case DesktopSize.x1024:
return new Size(1024, 768);
case DesktopSize.x1152:
return new Size(1152, 864);
case DesktopSize.x1280:
return new Size(1280, 1024);
case DesktopSize.FullScreen:
width = Screen.FromControl(connection).Bounds.Width - 13;
height = Screen.FromControl(connection).Bounds.Height - 1;
return GetMaxAvailableSize(width, height);
case DesktopSize.FitToWindow:
case DesktopSize.AutoScale:
width = connection.Parent.Width;
height = connection.Parent.Height;
return GetMaxAvailableSize(width, height);
default:
return new Size(width, height);
}
}
示例4: LoadFrom
public void LoadFrom(IFavorite favorite)
{
this.FillDisplayControls(favorite);
var rdpOptions = favorite.ProtocolProperties as RdpOptions;
if (rdpOptions != null)
this.FillRdpDisplayControls(rdpOptions);
}
示例5: LoadFrom
internal void LoadFrom(IFavorite favorite)
{
foreach (var protocolControl in this.Controls.OfType<IProtocolOptionsControl>())
{
protocolControl.LoadFrom(favorite);
}
}
示例6: NewTerminalForm
public NewTerminalForm(IPersistence persistence, IFavorite favorite)
: this()
{
this.persistence = persistence;
this.InitializeFavoritePropertiesControl();
this.Init(favorite, String.Empty);
}
示例7: SaveTo
public void SaveTo(IFavorite favorite)
{
this.FillFavoriteDisplayOptions(favorite);
var rdpOptions = favorite.ProtocolProperties as RdpOptions;
if (rdpOptions != null)
this.FillFavoriteRdpDisplayOptions(rdpOptions);
}
示例8: CheckForTerminalServer
public void CheckForTerminalServer(IFavorite favorite)
{
if (favorite.Protocol == ConnectionManager.RDP)
ThreadPool.QueueUserWorkItem(new WaitCallback(this.CheckForTS), favorite);
this.IsTerminalServer = false;
}
示例9: FillDisplayControls
private void FillDisplayControls(IFavorite favorite)
{
this.cmbResolution.SelectedIndex = (Int32)favorite.Display.DesktopSize;
this.cmbColors.SelectedIndex = (Int32)favorite.Display.Colors;
this.widthUpDown.Value = favorite.Display.Width;
this.heightUpDown.Value = favorite.Display.Height;
}
示例10: Copy
/// <summary>
/// Creates deep copy of provided favorite in persistence including its toolbar button and groups memebership.
/// The copy is already added to the persistence.
/// Returns newly created favorite copy if operation was successfull; otherwise null.
/// </summary>
internal IFavorite Copy(IFavorite favorite)
{
if (favorite == null)
return null;
return this.CopyUsingPrompt(favorite);
}
示例11: Validate
internal static ValidationStates Validate(IFavorite favorite)
{
List<ValidationState> results = ValidateObject(favorite);
var executeResults = ValidateObject(favorite.ExecuteBeforeConnect);
results.AddRange(executeResults);
return new ValidationStates(results);
}
示例12: LoadFrom
public void LoadFrom(IFavorite favorite)
{
this.chkExecuteBeforeConnect.Checked = favorite.ExecuteBeforeConnect.Execute;
this.txtCommand.Text = favorite.ExecuteBeforeConnect.Command;
this.txtArguments.Text = favorite.ExecuteBeforeConnect.CommandArguments;
this.txtInitialDirectory.Text = favorite.ExecuteBeforeConnect.InitialDirectory;
this.chkWaitForExit.Checked = favorite.ExecuteBeforeConnect.WaitForExit;
}
示例13: ConvertDisplay
private static void ConvertDisplay(IFavorite result, FavoriteConfigurationElement sourceFavorite)
{
IDisplayOptions display = result.Display;
display.Colors = sourceFavorite.Colors;
display.DesktopSize = sourceFavorite.DesktopSize;
display.Width = sourceFavorite.DesktopSizeWidth;
display.Height = sourceFavorite.DesktopSizeHeight;
}
示例14: CopyUsingPrompt
private IFavorite CopyUsingPrompt(IFavorite favorite)
{
InputBoxResult result = this.copyPrompt();
if (result.ReturnCode == DialogResult.OK && !string.IsNullOrEmpty(result.Text))
return this.CopySelectedFavorite(favorite, result.Text);
return null;
}
示例15: ConvertDisplay
private static void ConvertDisplay(FavoriteConfigurationElement result, IFavorite sourceFavorite)
{
IDisplayOptions display = sourceFavorite.Display;
result.Colors = display.Colors;
result.DesktopSize = display.DesktopSize;
result.DesktopSizeWidth = display.Width;
result.DesktopSizeHeight = display.Height;
}