コード例 #1
0
        private ExtensionPointRepresentation Describe(PluginPoint extension)
        {
            ExtensionPointRepresentation representation = new ExtensionPointRepresentation(extension.Name(), extension.ForType(), extension.Description);

            extension.DescribeParameters(representation);
            return(representation);
        }
コード例 #2
0
 private static void Add(IDictionary <string, PluginPoint> extensions, PluginPoint plugin)
 {
     if (extensions[plugin.Name()] != null)
     {
         throw new System.ArgumentException("This plugin already has an plugin point with the name \"" + plugin.Name() + "\"");
     }
     extensions[plugin.Name()] = plugin;
 }
コード例 #3
0
        internal void AddExtension(Type type, PluginPoint plugin)
        {
            IDictionary <string, PluginPoint> ext = _targetToPluginMap[type];

            if (ext == null)
            {
                throw new System.InvalidOperationException("Cannot extend " + type);
            }
            Add(ext, plugin);
        }
コード例 #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: PluginPoint getExtensionPoint(Class type, String method) throws PluginLookupException
        internal PluginPoint GetExtensionPoint(Type type, string method)
        {
            IDictionary <string, PluginPoint> ext = _targetToPluginMap[type];
            PluginPoint plugin = null;

            if (ext != null)
            {
                plugin = ext[method];
            }
            if (plugin == null)
            {
                throw new PluginLookupException("No plugin \"" + method + "\" for " + type);
            }
            return(plugin);
        }
コード例 #5
0
        public override Representation Invoke <T>(GraphDatabaseAPI graphDb, string name, Type type, string method, T context, ParameterList @params)
        {
            type = typeof(T);
            PluginPoint plugin = Extension(name, type, method);

            try
            {
                return(plugin.Invoke(graphDb, context, @params));
            }
            catch (Exception e) when(e is BadInputException || e is PluginInvocationFailureException || e is BadPluginInvocationException)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new PluginInvocationFailureException(e);
            }
        }
コード例 #6
0
 public void AddRelationshipExtensions(PluginPoint plugin)
 {
     Add(_targetToPluginMap[typeof(Relationship)], plugin);
 }
コード例 #7
0
 public void AddNodeExtensions(PluginPoint plugin)
 {
     Add(_targetToPluginMap[typeof(Node)], plugin);
 }
コード例 #8
0
 public void AddGraphDatabaseExtensions(PluginPoint plugin)
 {
     Add(_targetToPluginMap[typeof(GraphDatabaseService)], plugin);
 }