Beispiel #1
0
        protected void AddExportMenuItems(object[] elements, Catalogue catalogue)
        {
            var subMenuItem = new ContextSubMenuItem("Export To");

            AddTaskMenuItem(subMenuItem);

            // Look for RepositoryWriters in the environment.

            Module module = ConfigurationManager.GetCatalogue(catalogue.EnvironmentContext).Modules[Constants.Module.Name];

            if (module != null)
            {
                foreach (RepositoryType repositoryType in module.RepositoryTypes)
                {
                    if (IsWriter(repositoryType))
                    {
                        AddMenuItem(subMenuItem, new ContextMenuItem(repositoryType.RepositoryDisplayName, string.Empty, new MenuCommandHandler((new ExportRepositoryHandler(repositoryType, elements, catalogue, Snapin.GetMainWindow())).Export)));
                    }
                }
            }
        }
Beispiel #2
0
        protected void AddImportMenuItems(ICatalogueElement element)
        {
            // Create the Read menu.

            var subMenuItem = new ContextSubMenuItem("Import From");

            AddTaskMenuItem(subMenuItem);

            // Look for RepositoryReaders in the environment.

            Module module = ConfigurationManager.GetCatalogue().Modules[Constants.Module.Name];

            if (module != null)
            {
                foreach (RepositoryType repositoryType in module.RepositoryTypes)
                {
                    if (IsReader(repositoryType))
                    {
                        var handler = new ImportRepositoryHandler(repositoryType, element.Catalogue.RepositoryLink, Snapin.GetMainWindow());
                        AddMenuItem(subMenuItem, new ContextMenuItem(repositoryType.RepositoryDisplayName, string.Empty, new MenuCommandHandler(handler.Import)));
                    }
                }
            }
        }