private void ClientOnRestoreRootMapInheritanceCompleted(object sender, RestoreRootMapInheritanceCompletedEventArgs e) { if (e.UserState is Guid) { var guid = (Guid)e.UserState; if (ObjectDictionary.ContainsKey(guid) && RestoreRootMapInheritanceCompletedEventHandlers.ContainsKey(guid)) { RestoreRootMapInheritanceCompletedEventHandlers[guid](ObjectDictionary[guid], e); RestoreRootMapInheritanceCompletedEventHandlers.Remove(guid); ObjectDictionary.Remove(guid); } } }
public void RestoreRootMapInheritanceAsync(object context, EventHandler <RestoreRootMapInheritanceCompletedEventArgs> action, Guid parentGuid, Guid objectGuid) { var guid = Guid.NewGuid(); ObjectDictionary.Add(guid, context); RestoreRootMapInheritanceCompletedEventHandlers.Add(guid, action); Client.RestoreRootMapInheritanceAsync(App.Params.SiteUrl, new GlymaSecurableObject { SecurableParentUid = parentGuid, SecurableObjectUid = objectGuid }, guid); }