Beispiel #1
0
        protected OdcmType(string name, OdcmNamespace @namespace)
            : base(name)
        {
            Namespace         = @namespace;
            DefaultProjection = new OdcmProjection()
            {
                Type         = this,
                Capabilities = OdcmCapability.DefaultOdcmCapabilities
            };

            Projection = new OdcmProjection()
            {
                Capabilities = new List <OdcmCapability>()
            };

            AddProjection(OdcmCapability.DefaultOdcmCapabilities);
        }
Beispiel #2
0
        public void AddProjection(ICollection <OdcmCapability> capabilities, OdcmObject odcmObject = null)
        {
            if (this is OdcmPrimitiveType || this is OdcmMethod)
            {
                return;
            }

            var knownCapabilities = OdcmProjection.GetWellKnownCapabilities(odcmObject, capabilities).ToList();

            var name = OdcmProjection.GetUniqueProjectionName(knownCapabilities, odcmObject);

            OdcmProjection projection;

            if (!_projectionHash.TryGetValue(name, out projection))
            {
                _projectionHash[name] = new OdcmProjection()
                {
                    Type         = this,
                    Capabilities = knownCapabilities,
                    BackLink     = odcmObject
                };
            }
        }