本文整理汇总了C#中IUnityContainer.ThrowIfNull方法的典型用法代码示例。如果您正苦于以下问题:C# IUnityContainer.ThrowIfNull方法的具体用法?C# IUnityContainer.ThrowIfNull怎么用?C# IUnityContainer.ThrowIfNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUnityContainer
的用法示例。
在下文中一共展示了IUnityContainer.ThrowIfNull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewModelBase
protected ViewModelBase(IUnityContainer contain, IRegionManager regman, IEventAggregator events, IChatModel cm,
ICharacterManager manager)
{
try
{
Container = contain.ThrowIfNull("contain");
RegionManager = regman.ThrowIfNull("regman");
Events = events.ThrowIfNull("events");
ChatModel = cm.ThrowIfNull("cm");
CharacterManager = manager.ThrowIfNull("manager");
RightClickMenuViewModel = new RightClickMenuViewModel(ChatModel.IsGlobalModerator, CharacterManager);
CreateReportViewModel = new CreateReportViewModel(Events, ChatModel);
ChatModel.SelectedChannelChanged += OnSelectedChannelChanged;
Events.GetEvent<NewUpdateEvent>().Subscribe(UpdateRightClickMenu);
}
catch (Exception ex)
{
ex.Source = "Generic ViewModel, init";
Exceptions.HandleException(ex);
}
}
示例2: MessageService
public MessageService(
IRegionManager regman,
IUnityContainer contain,
IEventAggregator events,
IChatModel model,
IChatConnection connection,
IListConnection api,
ICharacterManager manager,
ILoggingService logger,
IAutomationService automation)
{
this.logger = logger;
this.automation = automation;
try
{
region = regman.ThrowIfNull("regman");
container = contain.ThrowIfNull("contain");
this.events = events.ThrowIfNull("events");
this.model = model.ThrowIfNull("model");
this.connection = connection.ThrowIfNull("connection");
this.api = api.ThrowIfNull("api");
characterManager = manager.ThrowIfNull("characterManager");
this.model.SelectedChannelChanged += (s, e) => RequestNavigate(this.model.CurrentChannel.Id);
this.events.GetEvent<ChatOnDisplayEvent>()
.Subscribe(BuildHomeChannel, ThreadOption.UIThread, true);
this.events.GetEvent<RequestChangeTabEvent>()
.Subscribe(RequestNavigate, ThreadOption.UIThread, true);
this.events.GetEvent<UserCommandEvent>().Subscribe(CommandRecieved, ThreadOption.UIThread, true);
commands = new Dictionary<string, CommandHandler>
{
{"priv", OnPrivRequested},
{Commands.UserMessage, OnPriRequested},
{Commands.ChannelMessage, OnMsgRequested},
{Commands.ChannelAd, OnLrpRequested},
{Commands.UserStatus, OnStatusChangeRequested},
{"close", OnCloseRequested},
{"join", OnJoinRequested},
{Commands.UserIgnore, OnIgnoreRequested},
{"clear", OnClearRequested},
{"clearall", OnClearAllRequested},
{"_logger_open_log", OnOpenLogRequested},
{"_logger_open_folder", OnOpenLogFolderRequested},
{"code", OnChannelCodeRequested},
{"_snap_to_last_update", OnNotificationFocusRequested},
{Commands.UserInvite, OnInviteToChannelRequested},
{"who", OnWhoInformationRequested},
{"getdescription", OnChannelDescripionRequested},
{"interesting", OnMarkInterestedRequested},
{"notinteresting", OnMarkNotInterestedRequested},
{"ignoreUpdates", OnIgnoreUpdatesRequested},
{Commands.AdminAlert, OnReportRequested},
{"tempignore", OnTemporaryIgnoreRequested},
{"tempunignore", OnTemporaryIgnoreRequested},
{"tempinteresting", OnTemporaryInterestingRequested},
{"tempnotinteresting", OnTemporaryInterestingRequested},
{"handlelatest", OnHandleLatestReportRequested},
{"handlereport", OnHandleLatestReportByUserRequested}
};
}
catch (Exception ex)
{
ex.Source = "Message Daemon, init";
Exceptions.HandleException(ex);
}
}