public void Dispose() { var disposable = _enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } _enumerator = null; disposable = _current as IDisposable; if (disposable != null) { disposable.Dispose(); } _current = default(TGeckoObject); _translator = null; GC.SuppressFinalize(this); }
public void Dispose() { _enumerator = null; }
internal CookieEnumerator(nsISimpleEnumerator enumerator) { _enumerator = enumerator; }
internal GeckoEnumerator(nsISimpleEnumerator enumerator, Func <TGeckoObject, TWrapper> translator) { _enumerator = enumerator; _translator = translator; }
public static nsISimpleEnumerator GetProxy (Mono.WebBrowser.IWebBrowser control, nsISimpleEnumerator obj) { object o = Base.GetProxyForObject (control, typeof(nsISimpleEnumerator).GUID, obj); return o as nsISimpleEnumerator; }
public void Dispose() { _enumerator = null; _current = default(TGeckoObject); _translator = null; }
private static void NS_CreateServicesFromCategory(string category, nsISupports origin, string observerTopic) { nsICategoryManager catMan = null; nsISimpleEnumerator enumerator = null; nsIUTF8StringEnumerator senumerator = null; try { catMan = Xpcom.GetService <nsICategoryManager>(Contracts.CategoryManager); if (catMan == null) { return; } enumerator = catMan.EnumerateCategory(category); if (enumerator == null) { return; } senumerator = Xpcom.QueryInterface <nsIUTF8StringEnumerator>(enumerator); if (senumerator == null) { return; } while (senumerator.HasMore()) { nsISupports serviceInstance = null; nsIObserver observer = null; try { string entryString = nsString.Get(senumerator.GetNext); string contractID = catMan.GetCategoryEntry(category, entryString); serviceInstance = Xpcom.GetService <nsISupports>(contractID); if (serviceInstance == null || observerTopic == null) { continue; } observer = Xpcom.QueryInterface <nsIObserver>(serviceInstance); if (observer == null) { continue; } observer.Observe(origin, observerTopic, ""); } catch (NotImplementedException) { } catch (OutOfMemoryException) { } catch (COMException) { } finally { Xpcom.FreeComObject(ref serviceInstance); Xpcom.FreeComObject(ref observer); } } } finally { Xpcom.FreeComObject(ref catMan); Xpcom.FreeComObject(ref enumerator); Xpcom.FreeComObject(ref senumerator); } }
public static nsISimpleEnumerator GetProxy(Mono.WebBrowser.IWebBrowser control, nsISimpleEnumerator obj) { object o = Base.GetProxyForObject(control, typeof(nsISimpleEnumerator).GUID, obj); return(o as nsISimpleEnumerator); }