private void OnEnable() { _wrapper = new I3dSitesGetterWrapper(); _ptr = _wrapper.Ptr; _wrapper.Init(null, HttpCallback, _ptr); lock (SitesGetter) { SitesGetter.Add(_ptr, this); } }
/// <summary> /// Init an instance of the <see cref="I3dSitesGetterWrapper"/> class. /// </summary> public void Init(Action <I3dLogLevel, string> logCallback, I3dHttpGetCallback callback, IntPtr userdata) { _logCallback = logCallback; int code = i3d_ping_sites_getter_create(out _ptr, callback, userdata); I3dErrorValidator.Validate(code); code = i3d_ping_sites_getter_set_logger(_ptr, LogCallback, _ptr); I3dErrorValidator.Validate(code); lock (SitesGetter) { SitesGetter.Add(_ptr, this); } }