Beispiel #1
0
 internal Component(ReadOnlyComponentPrototype prototype, Entity containingEntity)
 {
     Guid             = Guid.NewGuid();
     ContainingEntity = containingEntity;
     Prototype        = prototype;
     InitializeAttributes();
 }
Beispiel #2
0
        /// <summary>
        /// Registers a new component prototype. An exception will be raised if the component with the same name is
        /// already registered.
        /// </summary>
        /// <param name="prototype">New component prototype.</param>
        public void Register(ReadOnlyComponentPrototype prototype)
        {
            if (registeredComponents.ContainsKey(prototype.Name))
            {
                throw new ComponentRegistrationException("Component with the same name is already registered.");
            }

            registeredComponents.Add(prototype.Name, prototype);

            if (RegisteredComponent != null)
            {
                RegisteredComponent(this, new RegisteredComponentEventArgs(prototype));
            }
        }
 public ComponentPrototypeGraph(Uri u, ReadOnlyComponentPrototype p) : base(u)
 {
     componentPrototype = p;
     RDFGraph.NamespaceMap.AddNamespace("eca", new Uri("http://www.dfki.de/eca#"));
     ECA_COMPONENT   = RDFGraph.CreateUriNode("eca:component");
     attributesGraph = new Graph();
     attributesGraph.NamespaceMap.AddNamespace("rdf", new Uri("http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
     attributesGraph.NamespaceMap.AddNamespace("ldp", new Uri("http://www.w3.org/ns/ldp#"));
     attributesGraph.NamespaceMap.AddNamespace("dct", new Uri("http://purl.org/dc/terms/"));
     attributesGraph.NamespaceMap.AddNamespace("rdfs", new Uri("http://www.w3.org/2000/01/rdf-schema#"));
     attributesGraph.NamespaceMap.AddNamespace("eca", new Uri("http://www.dfki.de/eca#"));
     createAttributePrototypesGraph();
     BuildRDFGraph();
     RDFGraph.Merge(attributesGraph, false);
 }
 public ComponentPrototypeDatapoint(ReadOnlyComponentPrototype p, string route) : base(route)
 {
     graph = new ComponentPrototypeGraph(new Uri(route), p);
 }
 public RegisteredComponentEventArgs(ReadOnlyComponentPrototype prototype)
 {
     Prototype = prototype;
 }