当前位置: 首页>>代码示例>>C#>>正文


C# IHub类代码示例

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


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


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