mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
correctin file ending (#5970)
This commit is contained in:
@@ -1,35 +1,35 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Common
|
||||
{
|
||||
/// <summary>
|
||||
/// This is test custom control to test the implementation.
|
||||
/// </summary>
|
||||
public class CustomControlTest : FormHandlerControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Start the preview on the Control.
|
||||
/// </summary>
|
||||
/// <param name="dataSource">Path to the file.</param>
|
||||
public override void DoPreview<T>(T dataSource)
|
||||
{
|
||||
this.InvokeOnControlThread(() =>
|
||||
{
|
||||
var filePath = dataSource as string;
|
||||
WebBrowser browser = new WebBrowser();
|
||||
|
||||
browser.DocumentText = "Test";
|
||||
browser.Navigate(filePath);
|
||||
browser.Dock = DockStyle.Fill;
|
||||
browser.IsWebBrowserContextMenuEnabled = false;
|
||||
this.Controls.Add(browser);
|
||||
base.DoPreview(dataSource);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Common
|
||||
{
|
||||
/// <summary>
|
||||
/// This is test custom control to test the implementation.
|
||||
/// </summary>
|
||||
public class CustomControlTest : FormHandlerControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Start the preview on the Control.
|
||||
/// </summary>
|
||||
/// <param name="dataSource">Path to the file.</param>
|
||||
public override void DoPreview<T>(T dataSource)
|
||||
{
|
||||
this.InvokeOnControlThread(() =>
|
||||
{
|
||||
var filePath = dataSource as string;
|
||||
WebBrowser browser = new WebBrowser();
|
||||
|
||||
browser.DocumentText = "Test";
|
||||
browser.Navigate(filePath);
|
||||
browser.Dock = DockStyle.Fill;
|
||||
browser.IsWebBrowserContextMenuEnabled = false;
|
||||
this.Controls.Add(browser);
|
||||
base.DoPreview(dataSource);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Common
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a example custom handler to show how to extend the library.
|
||||
/// </summary>
|
||||
[Guid("22a1a8e8-e929-4732-90ce-91eaff38b614")]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[ComVisible(true)]
|
||||
public class TestCustomHandler : FileBasedPreviewHandler
|
||||
{
|
||||
private CustomControlTest previewHandlerControl;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void DoPreview()
|
||||
{
|
||||
this.previewHandlerControl.DoPreview(this.FilePath);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override IPreviewHandlerControl CreatePreviewHandlerControl()
|
||||
{
|
||||
this.previewHandlerControl = new CustomControlTest();
|
||||
return this.previewHandlerControl;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Common
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a example custom handler to show how to extend the library.
|
||||
/// </summary>
|
||||
[Guid("22a1a8e8-e929-4732-90ce-91eaff38b614")]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[ComVisible(true)]
|
||||
public class TestCustomHandler : FileBasedPreviewHandler
|
||||
{
|
||||
private CustomControlTest previewHandlerControl;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void DoPreview()
|
||||
{
|
||||
this.previewHandlerControl.DoPreview(this.FilePath);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override IPreviewHandlerControl CreatePreviewHandlerControl()
|
||||
{
|
||||
this.previewHandlerControl = new CustomControlTest();
|
||||
return this.previewHandlerControl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user