本文整理汇总了C#中IPluginHost.GetHostWindow方法的典型用法代码示例。如果您正苦于以下问题:C# IPluginHost.GetHostWindow方法的具体用法?C# IPluginHost.GetHostWindow怎么用?C# IPluginHost.GetHostWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPluginHost
的用法示例。
在下文中一共展示了IPluginHost.GetHostWindow方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override void Execute(IPluginHost pluginHost, Core.IO.LinuxDirectoryInfo currentDirectory, string[] args)
{
Arguments arguments = new Arguments(args ?? new string[] { });
string mode = string.Empty;
if(arguments.Contains("mode")) {
mode = arguments["mode"];
}
var form = new RebootForm( pluginHost );
form.Top = Screen.PrimaryScreen.WorkingArea.Top;
form.Left = Screen.PrimaryScreen.WorkingArea.Left;
if(pluginHost.GetHostWindow() != null) {
form.Show();
} else {
form.ShowInTaskbar = true;
form.ShowDialog();
}
}
示例2: Execute
/// <summary>
/// Executes the specified plugin host.
/// </summary>
/// <param name="pluginHost">The plugin host.</param>
/// <param name="currentDirectory">The current directory.</param>
/// <param name="args">The args.</param>
public override void Execute(IPluginHost pluginHost, Core.IO.LinuxDirectoryInfo currentDirectory, string[] args)
{
var ofd = new Core.UI.OpenFileDialog ( ) {
Title = "Open Database File",
DefaultExt = "db",
Filter = "Database Files|*.db;*.database;*.sqlite|All Files|*.*",
FilterIndex = 0,
ValidateNames = true,
CheckFileExists = true
};
ofd.CustomPlaces.Add ( new Core.UI.FileDialogCustomPlace ( "/data/data/", "data", Resources.Images.database_32xLG, delegate ( object s, EventArgs ea ) {
ofd.Navigate ( new Core.IO.LinuxDirectoryInfo ( "/data/data/" ) );
} ) );
if (ofd.ShowDialog(pluginHost.GetHostWindow()) == DialogResult.OK ) {
Open ( ofd.FileName );
}
}
示例3: Execute
/// <summary>
/// Executes the specified plugin host.
/// </summary>
/// <param name="pluginHost">The plugin host.</param>
/// <param name="currentDirectory">The current directory.</param>
/// <param name="args">The args.</param>
public override void Execute( IPluginHost pluginHost, DroidExplorer.Core.IO.LinuxDirectoryInfo currentDirectory, string[] args )
{
Arguments arguments = new Arguments ( args ?? new string[] { "/install" } );
string apkFile = string.Empty;
var apkArg = arguments.Contains ( "apk" ) ? arguments["apk"] : string.Empty;
// check that we have a file, and that it exists.
if ( !string.IsNullOrWhiteSpace(apkArg) && System.IO.File.Exists(apkArg) ) {
apkFile = apkArg;
} else {
System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog ( );
ofd.Title = "Select Android Application";
ofd.Filter = "Android Applications|*.apk";
ofd.CheckFileExists = true;
ofd.Multiselect = false;
if ( ofd.ShowDialog ( ) == DialogResult.OK ) {
apkFile = ofd.FileName;
} else {
return;
}
}
if ( File.Exists ( apkFile ) ) {
try {
var apkInfo = this.PluginHost.CommandRunner.GetLocalApkInformation ( apkFile );
var id = new InstallDialog ( this.PluginHost, arguments.Contains( "uninstall" ) ? InstallDialog.InstallMode.Uninstall : InstallDialog.InstallMode.Install, apkInfo );
if ( pluginHost != null && pluginHost.GetHostWindow() != null ) {
id.Show ( );
} else {
id.ShowInTaskbar = true;
id.ShowDialog ( );
}
} catch ( Exception ex ) {
MessageBox.Show ( ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1 );
this.LogError ( ex.Message, ex );
}
}
}
示例4: Execute
/// <summary>
/// Executes the specified plugin host.
/// </summary>
/// <param name="pluginHost">The plugin host.</param>
/// <param name="currentDirectory">The current directory.</param>
/// <param name="args">The args.</param>
public override void Execute( IPluginHost pluginHost, DroidExplorer.Core.IO.LinuxDirectoryInfo currentDirectory, string[] args )
{
if(PortManagerWindow == null ) {
PortManagerWindow = new PortManagerForm ( pluginHost );
}
if ( pluginHost != null && pluginHost.GetHostWindow ( ) != null ) {
if ( !this.PortManagerWindow.Visible ) {
PortManagerWindow.Show ( pluginHost.GetHostWindow ( ) );
}
} else {
PortManagerWindow.ShowDialog ( );
};
}
示例5: Execute
/// <summary>
/// Executes the specified plugin host.
/// </summary>
/// <param name="pluginHost">The plugin host.</param>
/// <param name="currentDirectory">The current directory.</param>
/// <param name="args">The args.</param>
public override void Execute( IPluginHost pluginHost, Core.IO.LinuxDirectoryInfo currentDirectory, string[] args )
{
ScreenRecord.StartPosition = FormStartPosition.Manual;
if (pluginHost.GetHostWindow ( ) != null ) {
if ( !this.ScreenRecord.Visible ) {
ScreenRecord.Show ( pluginHost.GetHostWindow ( ) );
}
} else {
ScreenRecord.ShowInTaskbar = true;
ScreenRecord.ShowDialog ( );
};
}
示例6: Execute
/// <summary>
/// Executes the specified plugin host.
/// </summary>
/// <param name="pluginHost">The plugin host.</param>
/// <param name="currentDirectory">The current directory.</param>
/// <param name="args">The args.</param>
public override void Execute( IPluginHost pluginHost, DroidExplorer.Core.IO.LinuxDirectoryInfo currentDirectory, string[] args )
{
if ( pluginHost != null && pluginHost.GetHostWindow() != null ) {
Dialog.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
Dialog.Show ( pluginHost.GetHostWindow ( ) );
} else {
Dialog.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
Dialog.ShowDialog ( );
}
}
示例7: Execute
/// <summary>
/// Executes the specified plugin host.
/// </summary>
/// <param name="pluginHost">The plugin host.</param>
/// <param name="currentDirectory">The current directory.</param>
/// <param name="args">The args.</param>
public override void Execute( IPluginHost pluginHost, DroidExplorer.Core.IO.LinuxDirectoryInfo currentDirectory, string[] args )
{
ConsoleWindow.StartPosition = FormStartPosition.Manual;
if ( pluginHost != null && pluginHost.GetHostWindow() != null ) {
int h = Screen.FromControl ( this.PluginHost.GetHostControl ( ) ).Bounds.Bottom - this.PluginHost.Bottom;
if ( h > 100 ) {
ConsoleWindow.Top = this.PluginHost.Bottom;
ConsoleWindow.Left = this.PluginHost.Left;
ConsoleWindow.Width = this.PluginHost.Width;
ConsoleWindow.Height = Screen.FromControl ( this.PluginHost.GetHostControl ( ) ).WorkingArea.Bottom - this.PluginHost.Bottom;
} else {
ConsoleWindow.Top = Screen.PrimaryScreen.WorkingArea.Top;
}
if ( !this.ConsoleWindow.Visible ) {
ConsoleWindow.Show ( pluginHost.GetHostWindow ( ) );
}
} else {
ConsoleWindow.ShowDialog ( );
};
}
示例8: Execute
/// <summary>
/// Executes the specified plugin host.
/// </summary>
/// <param name="pluginHost">The plugin host.</param>
/// <param name="currentDirectory">The current directory.</param>
public override void Execute( IPluginHost pluginHost, DroidExplorer.Core.IO.LinuxDirectoryInfo currentDirectory, string[] args )
{
if ( screenShotForm == null || screenShotForm.IsDisposed ) {
screenShotForm = new ScreenShotForm ( pluginHost );
}
if ( pluginHost != null && pluginHost.GetHostWindow ( ) != null ) {
Screen screen = Screen.FromControl ( pluginHost.GetHostControl ( ) );
int r = screen.Bounds.Right - ( pluginHost.Left + pluginHost.Width );
screenShotForm.StartPosition = FormStartPosition.Manual;
if ( r > 100 ) {
screenShotForm.Location = new Point ( pluginHost.Left + pluginHost.Width, pluginHost.Top );
} else {
screenShotForm.Top = Screen.PrimaryScreen.WorkingArea.Top;
screenShotForm.Left = Screen.PrimaryScreen.WorkingArea.Left;
}
if ( !screenShotForm.Visible ) {
screenShotForm.Show ( pluginHost.GetHostWindow ( ) );
}
} else {
screenShotForm.Top = Screen.PrimaryScreen.WorkingArea.Top;
screenShotForm.Left = Screen.PrimaryScreen.WorkingArea.Left;
screenShotForm.ShowDialog ( );
}
}
示例9: Execute
/// <summary>
/// Executes the specified plugin host.
/// </summary>
/// <param name="pluginHost">The plugin host.</param>
/// <param name="currentDirectory">The current directory.</param>
/// <param name="args">The args.</param>
public override void Execute( IPluginHost pluginHost, DroidExplorer.Core.IO.LinuxDirectoryInfo currentDirectory, string[] args )
{
LogCatConsole console = new LogCatConsole ( pluginHost );
console.Top = Screen.PrimaryScreen.WorkingArea.Top;
console.Left = Screen.PrimaryScreen.WorkingArea.Left;
if ( pluginHost.GetHostWindow ( ) == null ) {
Application.Run ( console );
} else {
console.Show ( );
}
}
示例10: Execute
/// <summary>
/// Executes the specified plugin host.
/// </summary>
/// <param name="pluginHost">The plugin host.</param>
/// <param name="currentDirectory">The current directory.</param>
/// <param name="args">The args.</param>
public override void Execute( IPluginHost pluginHost, DroidExplorer.Core.IO.LinuxDirectoryInfo currentDirectory, string[] args )
{
Arguments arguments = new Arguments ( args ?? new string[] { } );
string file = string.Empty;
if ( arguments.Contains( "file" ) ) {
file = arguments[ "file" ];
}
ShellConsole console = new ShellConsole ( pluginHost );
console.Top = Screen.PrimaryScreen.WorkingArea.Top;
console.Left = Screen.PrimaryScreen.WorkingArea.Left;
if ( !string.IsNullOrEmpty ( file ) ) {
console.Run ( file );
}
if(pluginHost != null && pluginHost.GetHostWindow() != null) {
console.Show();
} else {
console.ShowInTaskbar = true;
console.ShowDialog();
}
}