protected override void InitializeCommands() { SetScopeCommand = new PresenterCommand { CanExecuteDelegate = s => true, ExecuteDelegate = s => { string scope = (string)s; PnrpScope newScope = PnrpScope.All; switch (scope.ToUpper()) { case "ALL": newScope = PnrpScope.All; break; case "GLOBAL": newScope = PnrpScope.Global; break; case "LINKLOCAL": newScope = PnrpScope.LinkLocal; break; } _pnrpService.CurrentScope = newScope; } }; }
/// <summary> /// Constructs an instance of a Cloud. /// This is not public and accessible for internal members only /// </summary> /// <param name="name">Name of the cloud</param> /// <param name="pnrpScope">scope</param> /// <param name="scopeId">id ofthe scope</param> internal Cloud(string name, PnrpScope pnrpScope, int scopeId) { Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Creating cloud with Name: {0}, PnrpScope: {1}, ScopeID: {2}", name, pnrpScope, scopeId); m_CloudName = name; m_PnrpScope = pnrpScope; m_ScopeId = scopeId; }
private void SetScopedClouds(PnrpScope scope) { _scopedClouds.Clear(); foreach (CloudInfo cloud in this.AllClouds) { if (cloud.Scope == scope || scope == PnrpScope.All) { _scopedClouds.Add(cloud); } } }
private void SetScopedRegistrations(PnrpScope scope) { _scopedRegistrations.Clear(); foreach (PeerNameRegistration reg in _registrations) { if (scope == PnrpScope.All || reg.Cloud.Scope == PnrpScope.All || reg.Cloud.Scope == scope) { _scopedRegistrations.Add(reg); } } }
private void ProcessRegistrations(PnrpScope scope) { SetScopedClouds(scope); SetScopedRegistrations(scope); foreach (CloudInfo cloud in this.CloudsInScope) { cloud.HasRegistrations = false; cloud.HasSecureRegistrations = false; var registrations = from r in this.RegistrationsInScope where r.Cloud.Scope == scope || r.Cloud.Scope == PnrpScope.All select r; if (registrations.Count() > 0) { cloud.HasRegistrations = true; } var secure = from r in registrations where r.PeerName.IsSecured select r; if (secure.Count() > 0) { cloud.HasSecureRegistrations = true; } } }
protected Cloud(SerializationInfo info, StreamingContext context) { m_CloudName = info.GetString("_CloudName"); m_PnrpScope = (PnrpScope)info.GetValue("_CloudScope", typeof(PnrpScope)); m_ScopeId = info.GetInt32("_CloudScopeId"); }
private void ProcessRegistrations(PnrpScope scope) { SetScopedClouds(scope); SetScopedRegistrations(scope); foreach (CloudInfo cloud in this.CloudsInScope) { cloud.HasRegistrations = false; cloud.HasSecureRegistrations = false; var registrations = from r in this.RegistrationsInScope where r.Cloud.Scope == scope || r.Cloud.Scope == PnrpScope.All select r; if (registrations.Count() > 0) cloud.HasRegistrations = true; var secure = from r in registrations where r.PeerName.IsSecured select r; if (secure.Count() > 0) cloud.HasSecureRegistrations = true; } }
private void SetScopedRegistrations(PnrpScope scope) { _scopedRegistrations.Clear(); foreach (PeerNameRegistration reg in _registrations) { if (scope == PnrpScope.All || reg.Cloud.Scope == PnrpScope.All || reg.Cloud.Scope == scope) _scopedRegistrations.Add(reg); } }
private void SetScopedClouds(PnrpScope scope) { _scopedClouds.Clear(); foreach (CloudInfo cloud in this.AllClouds) { if (cloud.Scope == scope || scope == PnrpScope.All) _scopedClouds.Add(cloud); } }