本文整理汇总了C#中IPresenter类的典型用法代码示例。如果您正苦于以下问题:C# IPresenter类的具体用法?C# IPresenter怎么用?C# IPresenter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPresenter类属于命名空间,在下文中一共展示了IPresenter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Question
public Question(IPresenter master, string text, params Answer[] possibleAnswers)
{
Master = master;
Text = text;
PossibleAnswers = new BindableEnumCollection<Answer>(possibleAnswers);
Buttons = ConvertToButtons(possibleAnswers);
}
开发者ID:Buthrakaur,项目名称:WpfModularApp,代码行数:7,代码来源:Question.cs
示例2: Given
public override void Given()
{
base.Given();
_key = "Test";
_presenter = _mock.DynamicMock<IPresenter>();
}
开发者ID:RookieOne,项目名称:RPG,代码行数:7,代码来源:When_registering_a_presenter.cs
示例3: Bind
public void Bind(IPresenter presenter)
{
var presenterType = presenter.GetType();
var menu = BindingHelper.GetViewControls(presenter.View).OfType<MenuStrip>().FirstOrDefault();
if (menu == null)
return;
var items = GetMenuItems(menu);
var presenterMethods = BindingHelper.GetParameterlessActionMethods(presenterType);
foreach (var method in presenterMethods)
{
string methodName = method.Name;
var item = items.FirstOrDefault(
x => x.Name == Convensions.MenuItemPrefix + methodName.Substring(Convensions.EventHandlerPrefix.Length));
if (item == null)
continue;
var action = (Action)Delegate.CreateDelegate(typeof(Action), presenter, method.Name);
var handler = (EventHandler)((sender, args) => action());
item.Click += handler;
}
}
开发者ID:nyxiscoo1,项目名称:DipDemo,代码行数:26,代码来源:MenuClickEventBinder.cs
示例4: CommandActionsEntryPoint
public CommandActionsEntryPoint(ICommandManager commandManager, ITheaterApplicationHost appHost, IPresenter presentationManager, IPlaybackManager playbackManager, INavigator navigationService, /*IScreensaverManager screensaverManager,*/ ILogManager logManager, IEventAggregator events)
{
_commandManager = commandManager;
_defaultCommandActionMap = new DefaultCommandActionMap(appHost, presentationManager, playbackManager, navigationService, /*screensaverManager,*/ logManager, events);
_logger = logManager.GetLogger(GetType().Name);
}
开发者ID:TomGillen,项目名称:MBT,代码行数:7,代码来源:CommandActionsEntryPoint.cs
示例5: DetailForm
public DetailForm(string article)
: this()
{
if (!DesignMode)
{
_presenter = IoC.Resolve<IPresenter<IDetailView>>(new {view = this, article = article});
}
}
开发者ID:agross,项目名称:SimpleMvp,代码行数:8,代码来源:DetailForm.cs
示例6: UpdateTitle
private void UpdateTitle(IPresenter presenter)
{
var oldTitle = HtmlPage.Document.GetProperty("title");
var newTitle = _config.AlterTitle(oldTitle.ToString(), presenter);
if (!string.IsNullOrEmpty(newTitle))
HtmlPage.Document.SetProperty("title", newTitle);
}
开发者ID:Buthrakaur,项目名称:WpfModularApp,代码行数:8,代码来源:HistoryCoordinator.cs
示例7: MainForm
public MainForm()
{
InitializeComponent();
if (!DesignMode)
{
_presenter = IoC.Resolve<IPresenter<IMainFormView>>(new {view = this});
}
}
开发者ID:agross,项目名称:SimpleMvp,代码行数:8,代码来源:MainForm.cs
示例8: MainWindow
public MainWindow(IPresenter controller)
{
m_Controller = controller;
InitializeComponent();
loggerType.Items.Add(LoggerFactory.ConsoleLoggerName);
loggerType.Items.Add(LoggerFactory.MessageboxLoggerName);
loggerType.SelectedIndex = 0;
}
开发者ID:fresky,项目名称:DIExample,代码行数:8,代码来源:MainWindow.xaml.cs
示例9: Release
public void Release(IPresenter presenter)
{
container.EjectAllInstancesOf<IPresenter>();
var disposablePresenter = presenter as IDisposable;
if (disposablePresenter != null)
disposablePresenter.Dispose();
}
开发者ID:unochild,项目名称:webformsmvp,代码行数:8,代码来源:StructureMapPresenterFactory.cs
示例10: Release
/// <summary>
/// Releases the specified presenter from any of its lifestyle demands.
/// </summary>
/// <param name="presenter">The presenter to release.</param>
public void Release(IPresenter presenter)
{
var disposablePresenter = presenter as IDisposable;
if (disposablePresenter != null)
{
disposablePresenter.Dispose();
}
}
开发者ID:phiree,项目名称:dzdocs,代码行数:12,代码来源:DefaultPresenterFactory.cs
示例11: ModsPageView
public ModsPageView(IParkitect parkitect, ILogger log, IPresenter parent, IQueueableTaskManager queueableTaskManager,
IWebsite website)
: base(parkitect, website, log, AssetType.Mod, parent, "Mods")
{
_parkitect = parkitect;
_queueableTaskManager = queueableTaskManager;
_website = website;
}
开发者ID:ParkitectNexus,项目名称:ParkitectNexusClient,代码行数:8,代码来源:ModsPageView.cs
示例12: LoginContext
public LoginContext(IApplicationHost appHost, IPresenter presenter, ISessionManager sessionManager,
ILogManager logManager, IImageManager imageManager, IApiClient apiClient) : base(appHost)
{
_presenter = presenter;
_sessionManager = sessionManager;
_logManager = logManager;
_imageManager = imageManager;
_apiClient = apiClient;
}
开发者ID:TomGillen,项目名称:MBT,代码行数:9,代码来源:LoginContext.cs
示例13: SideMenuContext
public SideMenuContext(ITheaterApplicationHost appHost, IPresenter presenter, ISessionManager sessionManager, IImageManager imageManager, IApiClient apiClient)
: base(appHost)
{
_appHost = appHost;
_presenter = presenter;
_sessionManager = sessionManager;
_imageManager = imageManager;
_apiClient = apiClient;
}
开发者ID:TomGillen,项目名称:MBT,代码行数:9,代码来源:SideMenuContext.cs
示例14: SessionManager
// private readonly IPlaybackManager _playback;
public SessionManager(INavigator navService, IPresenter presenter, IApiClient apiClient, ILogger logger, ITheaterConfigurationManager config) //, IPlaybackManager playback)
{
_navService = navService;
_presenter = presenter;
_apiClient = apiClient;
_logger = logger;
_config = config;
// _playback = playback;
}
开发者ID:TomGillen,项目名称:MBT,代码行数:11,代码来源:SessionManager.cs
示例15: Release
public virtual void Release(IPresenter presenter)
{
this._container.EjectAllInstancesOf<IPresenter>();
IDisposable disposablePresenter = presenter as IDisposable;
if(disposablePresenter != null)
disposablePresenter.Dispose();
}
开发者ID:HansKindberg-Net,项目名称:HansKindberg-Web-MVP,代码行数:9,代码来源:PresenterFactory.cs
示例16: MainWindow
/// <summary>
/// Constructor
/// </summary>
/// <param name="presenter"></param>
public MainWindow(IPresenter presenter)
{
InitializeComponent();
this.Text = "System ekspercki - Marcin Foder, listopad 2015";
this.presenter = presenter;
presenter.AddCheckBoxs(inferenceModulePanel);
presenter.LoadKnowledgeEditorModule(cbFacts, cbRules, lbAllFacts, cbRuleCreatingFact, lbFactsElements, cbElements);
}
开发者ID:marcinfoder,项目名称:SystemEkspercki,代码行数:13,代码来源:MainWindow.cs
示例17: Release
/// <summary>
/// Releases the specified presenter.
/// </summary>
/// <param name="presenter">The presenter.</param>
public virtual void Release(IPresenter presenter)
{
var released = Kernel.Release(presenter);
Trace.WriteLine(string.Format("Presenter instance found and released by kernel {0}", released));
var disposablePresenter = presenter as IDisposable;
if (disposablePresenter != null)
disposablePresenter.Dispose();
}
开发者ID:phiree,项目名称:dzdocs,代码行数:14,代码来源:NinjectPresenterFactory.cs
示例18: PlaybackManager
public PlaybackManager(ITheaterConfigurationManager configurationManager, ILogger logger, IApiClient apiClient, INavigator nav, IPresenter presentationManager, IEventAggregator events)
{
_configurationManager = configurationManager;
_logger = logger;
_apiClient = apiClient;
_nav = nav;
_presentationManager = presentationManager;
_playbackStart = events.Get<PlaybackStartEventArgs>();
_playbackStop = events.Get<PlaybackStopEventArgs>();
}
开发者ID:TomGillen,项目名称:MBT,代码行数:10,代码来源:PlaybackManager.cs
示例19: Given
public override void Given()
{
base.Given();
_key = "Test";
_presenter = _mock.DynamicMock<IPresenter>();
_viewModel = _mock.DynamicMock<IViewModel>();
_facade.Register(_key, _presenter);
}
开发者ID:RookieOne,项目名称:RPG,代码行数:10,代码来源:When_showing_with_a_registered_presenter.cs
示例20: Execute
public override bool Execute()
{
mPresenter = mContainer.Resolve<IPresenter>();
string cPageException = "Cannot create page";
var menuVmDef = new ViewModelDefinition();
menuVmDef.AddQuality<MenuQuality>();
menuVmDef.AddQuality<MyQuality>();
var mainChildVmDef = new ViewModelDefinition();
mainChildVmDef.AddQuality<MainChildQuality>();
try
{
mViewModelManager.RegisterPageForViewModel<FirstViewModel, FirstPage>(mainChildVmDef);
}
catch (Exception e) when (e.Message.StartsWith(cPageException)) { }
try
{
mViewModelManager.RegisterPageForViewModel<SecondViewModel, SecondPage>(menuVmDef);
}
catch (Exception e) when (e.Message.StartsWith(cPageException)) { }
// show
var first = mPresenter.Show<FirstViewModel>().Result;
if (first == null || !first.NavTo)
{
return false;
}
var second = mPresenter.Show(
def => def.HasQuality<MyQuality>())
.Result as SecondViewModel;
if (second == null || !second.NavTo)
{
return false;
}
// close
second = mPresenter.Close(
x => x.HasQuality<MyQuality>())
.Result as SecondViewModel;
if (second == null || !second.NavFrom)
{
return false;
}
first = mPresenter.Close<FirstViewModel>().Result;
if (first == null || !first.NavFrom)
{
return false;
}
// TODO : find way to test alerts
//return PathwayCore.DisplayAlertAsync("Alert", "Are you sure?", "Ok").Result;
return true;
}
开发者ID:UizzUW,项目名称:MVPathway,代码行数:55,代码来源:PresenterDelegationTask.cs
注:本文中的IPresenter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论