public SortSearchAndFilterMenuManager() { // Create the contextual menu instances. Assembly assembly = Assembly.GetExecutingAssembly(); using (TextReader textReader = new StreamReader(assembly.GetManifestResourceStream("Etk.Excel.Resources.ViewSortSearchAndFilterContextualMenu.xml"))) { string menuXml = textReader.ReadToEnd(); sortSearchAndFilersMenu = ContextualMenuFactory.CreateInstance(menuXml); } }
public RequestsManager([Import] IContextualMenuManager contextualMenuManager) { try { // Create the contextual menu instances. Assembly assembly = Assembly.GetExecutingAssembly(); using (TextReader textReader = new StreamReader(assembly.GetManifestResourceStream("Etk.Excel.Resources.RequestsManagerContextualMenu.xml"))) { string menuXml = textReader.ReadToEnd(); RequestManagementMenu = ContextualMenuFactory.CreateInstance(menuXml); } // Declare the contextual menus activators. contextualMenuManager.OnContextualMenusRequested += ManageRequestsContexualMenu; } catch (Exception ex) { throw new EtkException($"UDF manager initialization failed:{ex.Message}", ex); } }