• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IHub类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IHub的典型用法代码示例。如果您正苦于以下问题:C# IHub类的具体用法?C# IHub怎么用?C# IHub使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IHub类属于命名空间,在下文中一共展示了IHub类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SearchResultsPageViewModel

        public SearchResultsPageViewModel(ApplicationSettings settings, INavigationService navigationService, IImageSearchService imageSearchService, IHub hub, IAccelerometer accelerometer, IStatusService statusService, IShareDataRequestedPump shareMessagePump)
        {
            _settings = settings;
            _navigationService = navigationService;
            _imageSearchService = imageSearchService;
            _hub = hub;
            _accelerometer = accelerometer;
            _statusService = statusService;

            HomeCommand = _navigationService.GoBackCommand;
            ViewDetailsCommand = new DelegateCommand(ViewDetails, () => SelectedImage != null);
            LoadMoreCommand = new AsyncDelegateCommand(LoadMore);
            ThumbnailViewCommand = new DelegateCommand(ThumbnailView);
            ListViewCommand = new DelegateCommand(ListView);
            SplitViewCommand = new DelegateCommand(SplitView);
            SettingsCommand = new DelegateCommand(Settings);

            AddImages(_settings.SelectedInstance.Images);
            shareMessagePump.DataToShare = _settings.SelectedInstance.QueryLink;
            _statusService.Title = _settings.SelectedInstance.Query;
            _accelerometer.Shaken += accelerometer_Shaken;
            _navigationService.Navigating += NavigatingFrom;

            UpdateCurrentView(CurrentView);
            _hub.Send(new UpdateTileImageCollectionMessage(_settings.SelectedInstance));
        }
开发者ID:schmidp,项目名称:GettingStartedWithMetroApps,代码行数:26,代码来源:SearchResultsPageViewModel.cs


示例2: HubInvokerContext

 public HubInvokerContext(IHub hub, TrackingDictionary state, MethodDescriptor methodDescriptor, object[] args)
 {
     Hub = hub;
     MethodDescriptor = methodDescriptor;
     Args = args;
     State = state;
 }
开发者ID:nonintanon,项目名称:SignalR,代码行数:7,代码来源:HubInvokerContext.cs


示例3: ProcessTurn

        public void ProcessTurn(IHub services)
        {
            var personService = services.Resolve<IPersonService>();

            var gameClockService = services.Resolve<IGameClockService>();

            foreach(var person in personService.People.Where(p => !personService.IsRetired(p)))
            {
                if (person.RetirementDate > gameClockService.CurrentDate)
                {
                    continue;
                }

                var currentWorkHistory = person.WorkHistory.FirstOrDefault(wh => !wh.EndDate.HasValue);

                if(currentWorkHistory != null)
                {
                    var employee = currentWorkHistory.Company.GetEmployee(person.Id);

                    if(!employee.IsFounder)
                    {
                        currentWorkHistory.EndDate = gameClockService.CurrentDate;

                        currentWorkHistory.EndingSalary = employee.Salary;
                    }
                }
            }
        }
开发者ID:hyjynx-studios,项目名称:bizio,代码行数:28,代码来源:PersonRetirementProcessor.cs


示例4: UserInputLoop

 internal static void UserInputLoop(IHub hub)
 {
     string userInput;
     while (!string.IsNullOrEmpty((userInput = Console.ReadLine())))
     {
         if (userInput.Equals("pose", StringComparison.OrdinalIgnoreCase))
         {
             foreach (var myo in hub.Myos)
             {
                 Console.WriteLine("Myo {0} in pose {1}.", myo.Handle, myo.Pose);
             }
         }
         else if (userInput.Equals("arm", StringComparison.OrdinalIgnoreCase))
         {
             foreach (var myo in hub.Myos)
             {
                 Console.WriteLine("Myo {0} is on {1} arm.", myo.Handle, myo.Arm.ToString().ToLower());
             }
         }
         else if (userInput.Equals("count", StringComparison.OrdinalIgnoreCase))
         {
             Console.WriteLine("There are {0} Myo(s) connected.", hub.Myos.Count);
         }
     }
 }
开发者ID:rafme,项目名称:MyoSharp,代码行数:25,代码来源:ConsoleHelper.cs


示例5: HubInvokerContext

 public HubInvokerContext(IHub hub, StateChangeTracker tracker, MethodDescriptor methodDescriptor, IList<object> args)
 {
     Hub = hub;
     MethodDescriptor = methodDescriptor;
     Args = args;
     StateTracker = tracker;
 }
开发者ID:eduaglz,项目名称:SignalR-Server,代码行数:7,代码来源:HubInvokerContext.cs


示例6: VoipChannel

 public VoipChannel(IHub hub, CoreDispatcher dispatcher,
                    VoipContext context)
 {
     _hub = hub;
     Dispatcher = dispatcher;
     Context = context;
 }
开发者ID:openpeer,项目名称:ChatterBox,代码行数:7,代码来源:VoipChannel.cs


示例7: JiraServiceViewModel

        protected JiraServiceViewModel(IHub messageHub)
        {
            MessageHub = messageHub;

            SettingsCommand = new DelegateCommand(OpenSettings);
            SearchCommand = new DelegateCommand(ShowSearchPane);
        }
开发者ID:iinteractive,项目名称:jira-win8-client,代码行数:7,代码来源:JiraServiceViewModel.cs


示例8: ProcessTurn

        public void ProcessTurn(IHub services)
        {
            var companyService = services.Resolve<ICompanyService>();

            var gameClockService = services.Resolve<IGameClockService>();

            foreach(var company in companyService.Companies)
            {
                foreach(var project in company.Projects)
                {
                    if (IsProjectComplete(project))
                    {
                        CompleteProject(company, project);

                        companyService.ProcessTransaction(company, TransactionType.Project, project.Value, $"Completed {project.Definition.Name} project.");

                    }
                    else
                    {
                        var deadline = project.ExtensionDeadline.HasValue ?
                                       project.ExtensionDeadline.Value :
                                       project.Deadline;

                        if (gameClockService.CurrentDate >= deadline)
                        {
                            FailProject(company, project);
                        }
                    }
                }
            }
        }
开发者ID:hyjynx-studios,项目名称:bizio,代码行数:31,代码来源:ProjectProgressProcessor.cs


示例9: OnBeforeReconnect

        protected override bool OnBeforeReconnect(IHub hub)
        {
            SignalRContext.ConnectionIdToSessionId[hub.Context.ConnectionId] = hub.GetSessionId();

            Storage session = hub.GetSession();
            session[InternalSessionKeys.DisconnectTimeKey] = null;
            return base.OnBeforeReconnect(hub);
        }
开发者ID:vgichar,项目名称:shah,代码行数:8,代码来源:HubSessionMigrationFilter.cs


示例10: OnBeforeDisconnect

 protected override bool OnBeforeDisconnect(IHub hub, bool stopCalled)
 {
     if (stopCalled)
     {
         hub.ClearSession();
     }
     return base.OnBeforeDisconnect(hub, stopCalled);
 }
开发者ID:vgichar,项目名称:shah,代码行数:8,代码来源:SessionLifetimeFilter.cs


示例11: IssueViewModel

        public IssueViewModel(IHub messageHub, ISettings settings, IDialogService dialogService, IJiraService service)
            : base(messageHub)
        {
            _dialogService = dialogService;
            _settings = (ApplicationSettings)settings;
            _service = service;

            LoadIssueComments();
        }
开发者ID:iinteractive,项目名称:jira-win8-client,代码行数:9,代码来源:IssueViewModel.cs


示例12: ServiceCore

        protected ServiceCore(IHub services)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            _services = services;
        }
开发者ID:hyjynx-studios,项目名称:bizio,代码行数:9,代码来源:ServiceCore.cs


示例13: OnAfterDisconnect

        protected override void OnAfterDisconnect(IHub hub, bool stopCalled)
        {
            string sessionId;
            SignalRContext.ConnectionIdToSessionId.TryRemove(hub.Context.ConnectionId, out sessionId);

            Storage session = hub.GetSession();
            session[InternalSessionKeys.DisconnectTimeKey] = DateTime.Now;
            base.OnAfterDisconnect(hub, stopCalled);
        }
开发者ID:vgichar,项目名称:shah,代码行数:9,代码来源:HubSessionMigrationFilter.cs


示例14: ProcessTurn

        public void ProcessTurn(IHub services)
        {
            var companyService = services.Resolve<ICompanyService>();

            foreach(var company in companyService.Companies)
            {
                var accumulations = new Dictionary<int, decimal>();

                foreach (var employee in company.Employees)
                {
                    var allocations = company.Allocations.Where(a => a.Employee == employee);

                    var skillValues = new Dictionary<int, decimal>();

                    var remainingSkillValues = new Dictionary<int, decimal>();

                    foreach (var skill in employee.Person.Skills)
                    {
                        var skillValue = CalculateEmployeeSkillValue(employee, skill);

                        skillValues.Add(skill.SkillDefinition.Id, skillValue);

                        remainingSkillValues.Add(skill.SkillDefinition.Id, skillValue);
                    }

                    foreach (var allocation in allocations)
                    {
                        foreach (var requirement in allocation.Project.Requirements)
                        {
                            if (skillValues.ContainsKey(requirement.SkillDefinition.Id))
                            {
                                var value = allocation.Percent * skillValues[requirement.SkillDefinition.Id];

                                requirement.CurrentValue += value;

                                remainingSkillValues[requirement.SkillDefinition.Id] -= value;
                            }
                        }
                    }

                    foreach (var skill in remainingSkillValues)
                    {
                        if (accumulations.ContainsKey(skill.Key))
                        {
                            accumulations[skill.Key] += skill.Value;
                        }
                        else
                        {
                            accumulations.Add(skill.Key, skill.Value);
                        }
                    }
                }

                ProcessActionAccumulations(company, accumulations);
            }
        }
开发者ID:hyjynx-studios,项目名称:bizio,代码行数:56,代码来源:EmployeeSkillsProcessor.cs


示例15: UpdateMeetingStatusToClients

 private static void UpdateMeetingStatusToClients(IHub hub)
 {
     var meetingStati = BuildMeetingsStatus();
     
     Debug.WriteLine("Meeting Status Update:");
     foreach (var m in meetingStati)
     {
         Debug.WriteLine("Meeting {0} [HAsAgent:{1}] [HasClient:{2}] [MeetingStarted:{3}]", m.MeetingId, m.AgentJoined, m.ClientJoined, m.MeetingStarted);
     }
     hub.Clients.All.meetingStatusUpdated(meetingStati);
 }
开发者ID:reactiveui-forks,项目名称:VirtualSales,代码行数:11,代码来源:MeetingHub.cs


示例16: CanPerformEvent

        public override ActionExecutionInformation CanPerformEvent(Company company, IActionData eventData, IHub services)
        {
            var companyService = services.Resolve<ICompanyService>();

            if (!companyService.CanPerformAction(company, Type))
            {
                return new ActionExecutionInformation(false, $"Company {company.Id} cannot perform turn action {Type}.", company);
            }

            return new ActionExecutionInformation(true);
        }
开发者ID:hyjynx-studios,项目名称:bizio,代码行数:11,代码来源:AdjustAllocationAction.cs


示例17: ShellViewModel

        public ShellViewModel(AppName appName, ApplicationSettings settings, INavigationService navigationService, IHub hub)
        {
            _appName = appName;
            _settings = settings;
            _navigationService = navigationService;
            _hub = hub;

            Message = "Initializing...";
            IsLoading = true;

            BackCommand = _navigationService.GoBackCommand;
        }
开发者ID:schmidp,项目名称:GettingStartedWithMetroApps,代码行数:12,代码来源:ShellViewModel.cs


示例18: IssuesViewModel

        public IssuesViewModel(IJiraService jiraService, IHub messageHub, ApplicationSettings settings, INavigationService navigationService)
            : base(messageHub)
        {
            NavigateToIssueCommand = new DelegateCommand(NavigateToIssue, () => SelectedIssue != null);
            SettingsCommand = new DelegateCommand(OpenSettings);

            _applicationSettings = settings;
            _navigationService = navigationService;
            _jiraService = jiraService;

            _applicationSettings.SelectedIssue = null;
        }
开发者ID:iinteractive,项目名称:jira-win8-client,代码行数:12,代码来源:IssuesViewModel.cs


示例19: Evaluate

        public OfferResponseReason? Evaluate(IHub services, Company company, Person person, decimal amount)
        {
            var personService = services.Resolve<IPersonService>();

            var expectedCompensation = personService.CalculateCompensationValue(person);

            if(amount >= expectedCompensation)
            {
                return null;
            }

            return OfferResponseReason.OfferValue;
        }
开发者ID:hyjynx-studios,项目名称:bizio,代码行数:13,代码来源:MoneyEvaluator.cs


示例20: CredentialsViewModel

        public CredentialsViewModel(IHub messageHub, ApplicationSettings settings)
        {
            IsSaveEnabled = true;

            _settings = settings;
            _messageHub = messageHub;

            _serverUrl = settings.ServerUrl;
            _userName = settings.UserName;
            _password = settings.Password;

            SaveCredentialsCommand = new AsyncDelegateCommand(SaveCredentials);
        }
开发者ID:iinteractive,项目名称:jira-win8-client,代码行数:13,代码来源:CredentialsViewModel.cs



注:本文中的IHub类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IHubContext类代码示例发布时间:2022-05-24
下一篇:
C# IHttpSession类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap