The Select.exe config file is setup to point at our custom page.
The issue is, although the custom page loads successfully, it loads as a second tab leaving the original tab there. But now this original tab no longer points to the default page due to changing the config file and so loads blank with a header titled "Navigation Canceled".
Our current approach from removing the default tab works only intermittently, is there a better way to prevent that default tab from ever even appearing in the first place?
Additionally, since adding this custom page occasionally (generally on the first time Select is launched since logging in/restarting computer) it will launch IE with an empty page. Nothing in our code explicitly calls a browser or webpage, so i assume this would be configuration issue(maybe related to the old start page tab?) and would like to know what solutions there are to stop this behavior.
Below is our CustomEditorPane that inherits from EditorPane to create the custom startpage and remove the old tab:
Code: Select all
class CustomEditorPane : EditorPane
{
public CustomEditorPane()
{}
protected override Control OnCreateControl()
{
var shell = GetService<IShell>();
var sps = GetService<SoftPro.Select.Client.SelectServer>();
var editorControl = new WorkBench(shell, sps);
editorControl.Disposed += (sender, args) => ClearOldStartPage();
Title = editorControl.Title;
ClearOldStartPage();
return editorControl;
}
private void ClearOldStartPage()
{
var wm = GetService<IWindowManager>();
foreach (var doc in wm.Windows.Where(x => x.Created && x.Situation == WindowSituation.Document && x.Caption == "Navigation Canceled"))
doc.Close();
}
}
Code: Select all
class CustomEditorFactory : EditorFactory
{
public CustomEditorFactory(IServiceProvider sp)
: base(sp)
{}
protected override IWindowPane OnCreateEditor(ref Uri moniker, ref string name, string view, object existingData, EditorCreateFlags flags, out object data, out Guid commandUI, ref bool mru)
{
data = null;
commandUI = new Guid("92A6C769-6AC0-4A87-97CB-96DAE703D4FC");
IWindowPane pane = null;
pane = new CustomEditorPane();
name = pane.Title;
data = pane;
return pane;
}
}