public static ReleaseProvider ( |
||
component | ||
return | void |
private void RefreshItems() { List <SWF.MenuItem> itemsToDelete = new List <SWF.MenuItem> (itemProviders.Keys); foreach (SWF.MenuItem item in Menu.MenuItems) { MenuItemProvider itemProvider; if (!itemProviders.TryGetValue(item, out itemProvider)) { itemProvider = GetItemProvider(item); if (itemProvider != null) { AddChildProvider(itemProvider); } } else { itemsToDelete.Remove(item); } } foreach (SWF.MenuItem item in itemsToDelete) { MenuItemProvider itemProvider; if (itemProviders.TryGetValue(item, out itemProvider)) { itemProviders.Remove(item); itemProvider.Terminate(); RemoveChildProvider(itemProvider); ProviderFactory.ReleaseProvider(itemProvider.Component); } } }
private static void OnUIAUnPopup (object sender, PopupEventArgs args) { ToolTip tooltip = (ToolTip) sender; ToolTipProvider provider = (ToolTipProvider) ProviderFactory.GetProvider (tooltip); provider.Hide (args.AssociatedControl); ProviderFactory.ReleaseProvider (tooltip); }
private static void OnUIAHelpUnRequested(object sender, SWF.ControlEventArgs args) { SWF.HelpProvider helpProvider = (SWF.HelpProvider)sender; HelpProvider provider = (HelpProvider)ProviderFactory.GetProvider(helpProvider); provider.Hide(args.Control); ProviderFactory.ReleaseProvider(helpProvider); }
public ToolBarButtonProvider RemoveButtonAt(int index) { ToolBarButtonProvider button = null; if (index < toolBar.Buttons.Count) { button = (ToolBarButtonProvider) ProviderFactory.GetProvider(toolBar.Buttons [index]); ProviderFactory.ReleaseProvider(toolBar.Buttons [index]); } return(button); }
void HandleContextMenuCollapse(object sender, EventArgs e) { FragmentControlProvider contextMenuProvider = (FragmentControlProvider) ProviderFactory.FindProvider(contextMenu); if (contextMenuProvider == null) { return; } contextMenuProvider.Terminate(); RemoveChildProvider(contextMenuProvider); ProviderFactory.ReleaseProvider(contextMenu); // TODO: Need to handle disposal of some parent without close happening? }
public override void FinalizeChildControlStructure() { if (Menu != null) { Menu.MenuChanged -= OnMenuChanged; } foreach (MenuItemProvider itemProvider in itemProviders.Values) { RemoveChildProvider(itemProvider); ProviderFactory.ReleaseProvider(itemProvider.Component); } OnNavigationChildrenCleared(); }
public static void HandleContextMenuStripClosed(object sender, EventArgs e) { var contextMenuStrip = (ContextMenuStrip)sender; var contextMenuStripProvider = (FragmentControlProvider)ProviderFactory.FindProvider(contextMenuStrip); if (contextMenuStripProvider == null) { return; } GetParentProvider(contextMenuStrip).RemoveChildProvider(contextMenuStripProvider); contextMenuStripProvider.Terminate(); ProviderFactory.ReleaseProvider(contextMenuStrip); // TODO: Need to handle disposal of some parent without close happening? }
protected void HandleChildComponentRemoved(Component childComponent) { var childProvider = Navigation.TryGetChild(childComponent); if (childProvider == null) { return; } // Event source: // Parent of removed child runtimeId: The child that was // removed. (pg 6 of fxref_uiautomationtypes_p2.pdf) RemoveChildProvider(childProvider); if (childComponent is SWF.Control childCcontrol) { childCcontrol.VisibleChanged -= OnChildControlVisibleChanged; } ProviderFactory.ReleaseProvider(childComponent); }
protected virtual void DestroyProvider(Component component) { ProviderFactory.ReleaseProvider(component); }