private void ClientOnGetAllSecurityGroupsCompleted(object sender, GetAllSecurityGroupsCompletedEventArgs e) { if (!e.Result.HasError) { foreach (var pair in e.Result.Result) { SecurityGroups.Add(PermissionLevel.Convert(pair.Key), pair.Value); } foreach (var valuePair in SecurityGroups) { foreach (var item in valuePair.Value) { if (AllSecurityGroups.All(q => q.GroupId != item.GroupId)) { AllSecurityGroups.Add(item); } } } MapManager.QueryDomainsCompleted.RegisterEvent(OnAcquireDomainsCompleted); MapManager.QueryDomainsAsync(); } else { SuperMessageBoxService.ShowError("Error Occurred", "An error occurred while retrieving the groups with Glyma permissions.", Close); } }
private void ClientOnGetAllSecurityGroupsCompleted(object sender, GetAllSecurityGroupsCompletedEventArgs e) { if (e.UserState is Guid) { var guid = (Guid)e.UserState; if (ObjectDictionary.ContainsKey(guid) && GetAllSecurityGroupsCompletedEventHandlers.ContainsKey(guid)) { GetAllSecurityGroupsCompletedEventHandlers[guid](ObjectDictionary[guid], e); GetAllSecurityGroupsCompletedEventHandlers.Remove(guid); ObjectDictionary.Remove(guid); } } }
private void ClientOnGetAllSecurityGroupsCompleted(object sender, GetAllSecurityGroupsCompletedEventArgs e) { if (e.UserState is Guid) { var guid = (Guid) e.UserState; if (ObjectDictionary.ContainsKey(guid) && GetAllSecurityGroupsCompletedEventHandlers.ContainsKey(guid)) { GetAllSecurityGroupsCompletedEventHandlers[guid](ObjectDictionary[guid], e); GetAllSecurityGroupsCompletedEventHandlers.Remove(guid); ObjectDictionary.Remove(guid); } } }