Пример #1
0
        private PropertyDescriptorValue GetDescriptor(string name)
        {
            EnsureDescriptors();

            PropertyDescriptorValue desc;

            if (!_descriptors.TryGetValue(name, out desc))
            {
                _descriptors[name] = desc = new PropertyDescriptorValue(ProjectEntry);
                _descriptorDependencies.EnqueueDependents();
            }
            return(desc);
        }
Пример #2
0
        internal void DefineGetter(AnalysisUnit unit, string nameStr, IAnalysisSet analysisSet)
        {
            EnsureDescriptors();
            PropertyDescriptorValue propDesc;

            if (!_descriptors.TryGetValue(nameStr, out propDesc))
            {
                _descriptors[nameStr] = propDesc = new PropertyDescriptorValue(ProjectEntry);
                _descriptorDependencies.EnqueueDependents();
            }

            if (propDesc.Getter == null)
            {
                propDesc.Getter = new VariableDef();
            }
            propDesc.Getter.AddTypes(unit, analysisSet, declaringScope: DeclaringModule);
        }
Пример #3
0
        internal override IPropertyDescriptor GetProperty(Node node, AnalysisUnit unit, string name)
        {
            EnsureDescriptors();

            PropertyDescriptorValue desc;

            if (!_descriptors.TryGetValue(name, out desc))
            {
                _descriptors[name] = desc = new PropertyDescriptorValue(ProjectEntry);
                _descriptorDependencies.EnqueueDependents();
            }

            if (IsMutable(name))
            {
                if (desc.Values == null)
                {
                    desc.Values = new EphemeralVariableDef();
                }
                desc.Values.AddDependency(unit);
            }

            if (_linkedValues != null)
            {
                foreach (var link in _linkedValues.GetTypes(unit, DeclaringModule))
                {
                    ExpandoValue expando = link.Value as ExpandoValue;
                    if (expando._descriptors != null && expando._descriptors.ContainsKey(name))
                    {
                        return(new MergedPropertyDescriptor(
                                   this,
                                   desc,
                                   name
                                   ));
                    }
                }
            }

            return(desc);
        }
Пример #4
0
 public MergedPropertyDescriptor(ExpandoValue instance, PropertyDescriptorValue propDesc, string name)
 {
     _instance = instance;
     _propDesc = propDesc;
     _name     = name;
 }