protected virtual void OnMemberAddedOrUpdated(TMember member) { if (member?.Id == ImportElementId) { ImportElementAddedEvent.Set(); } }
public int ImportFile(string textOrPath, string registryName) { try { ImportElementAddedEvent.Reset(); SMA.Instance.IgnoreUserConfirmation = true; int ret = SM17Natives.Instance.Registry.ImportFile.Invoke( RegistryPtr, new DelphiUString(textOrPath), new DelphiUString(registryName)); if (ret > 0) { ImportElementId = ret; if (Members.ContainsKey(ret) == false) { ImportElementAddedEvent.WaitOne(AssemblyFactory.ExecutionTimeout); } } return(ret); } catch (Exception ex) { LogTo.Error(ex, "SM internal method call threw an exception."); return(-1); } finally { SMA.Instance.IgnoreUserConfirmation = false; ImportElementId = -1; } }