Skip to content

Instantly share code, notes, and snippets.

@dschenkelman
Last active August 29, 2015 14:01
Show Gist options
  • Save dschenkelman/64a2d17fc7e7f3fe3340 to your computer and use it in GitHub Desktop.
Save dschenkelman/64a2d17fc7e7f3fe3340 to your computer and use it in GitHub Desktop.
MMC 3.0 Sample Plug-In using MVP and Unity
public class ConnectionListView : MmcListView, IConnectionListView
{
private readonly IConnectionListPresenter presenter;
public ConnectionListView()
{
var container = this.SnapIn.Tag as IUnityContainer;
if (container != null)
{
this.presenter = container.Resolve<IConnectionListPresenter>();
this.presenter.View = this;
}
}
...
}
public class ConnectionListPresenter : IConnectionListPresenter
{
private readonly IConnectionsService connectionsService;
public ConnectionListPresenter(IConnectionsService connectionsService)
{
this.connectionsService = connectionsService;
}
...
}
public ConnectionsSnapIn()
{
ConfigureContainer();
this.Tag = container;
...
}
public ConnectionsSnapIn()
{
...
var lvd = new MmcListViewDescription(MmcListViewOptions.ExcludeScopeNodes);
lvd.DisplayName = "Options";
lvd.ViewType = typeof(ConnectionListView);
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment