Example #1
0
        /// <summary>
        /// Sets the name to the specified value for the current context.
        ///
        /// The name is an arbitrary object.
        /// </summary>
        public void SetObjectName(ContextId context, object name, object value, ScopeMemberAttributes attributes)
        {
            int id = context.Id;

            if (id == 0)
            {
                if (_attrs != null)
                {
                    _attrs.CheckWritable(name);
                }

                _dict.AddObjectKey(name, value);
                if (attributes != ScopeMemberAttributes.None)
                {
                    if (_attrs == null)
                    {
                        _attrs = new ScopeAttributeDictionary();
                    }
                    _attrs.Set(name, attributes);
                }
            }
            else
            {
                if (_contextScopes == null)
                {
                    _contextScopes = new ContextSensitiveScope();
                }
                _contextScopes.SetObjectName(context, name, value, attributes);
            }
        }
Example #2
0
            public void Set(object name, ScopeMemberAttributes value)
            {
                if (_objectAttrs == null)
                {
                    _objectAttrs = new Dictionary <object, ScopeMemberAttributes>();
                }

                _objectAttrs[name] = value;
            }
Example #3
0
            public void Set(SymbolId name, ScopeMemberAttributes value)
            {
                if (_attrs == null)
                {
                    _attrs = new Dictionary <SymbolId, ScopeMemberAttributes>();
                }

                _attrs[name] = value;
            }
Example #4
0
        /// <summary>
        /// Sets the name to the specified value for the current context.
        ///
        /// Provides the ScopeMemberAttributes which should be set on the provided object.
        /// </summary>
        /// <exception cref="MemberAccessException">The name has already been published and marked as ReadOnly</exception>
        public void SetName(SymbolId name, object value, ScopeMemberAttributes attributes)
        {
            if (_attrs != null)
            {
                _attrs.CheckWritable(name);
            }

            if (_attrs == null)
            {
                _attrs = new ScopeAttributeDictionary();
            }
            _attrs.Set(name, attributes);
            _dict[name] = value;
        }
Example #5
0
            public void SetName(ContextId context, SymbolId name, object value, ScopeMemberAttributes attrs)
            {
                int id = context.Id;

                EnsureDictionary(id);
                EnsureAttrDict(id);

                if (_attrs != null && id < _attrs.Count)
                {
                    _attrs[id].CheckWritable(name);
                }

                _dicts[id][name] = value;
                _attrs[id].Set(name, attrs);
            }
Example #6
0
        /// <summary>
        /// Sets a name that is only available in the specified context.
        ///
        /// Provides the ScopeMemberAttributes which should be set on the provided object.
        /// </summary>
        /// <exception cref="MemberAccessException">The name has already been published and marked as ReadOnly</exception>
        public void SetName(ContextId context, SymbolId name, object value, ScopeMemberAttributes attributes)
        {
            if (_attrs != null)
            {
                _attrs.CheckWritable(name);
            }

            if (context == ContextId.Empty)
            {
                SetName(name, value);
            }
            else
            {
                if (_contextScopes == null)
                {
                    _contextScopes = new ContextSensitiveScope();
                }
                _contextScopes.SetName(context, name, value, attributes);
            }
        }
Example #7
0
            public void SetObjectName(ContextId context, object name, object value, ScopeMemberAttributes attrs)
            {
                int id = context.Id;

                EnsureDictionary(id);
                if (attrs != ScopeMemberAttributes.None)
                {
                    EnsureAttrDict(id);
                }

                if (_attrs != null && id < _attrs.Count)
                {
                    _attrs[id].CheckWritable(name);
                }

                _dicts[id].AddObjectKey(name, value);
                if (attrs != ScopeMemberAttributes.None)
                {
                    _attrs[id].Set(name, attrs);
                }
            }
Example #8
0
            public void Set(object name, ScopeMemberAttributes value) {
                if (_objectAttrs == null) _objectAttrs = new Dictionary<object, ScopeMemberAttributes>();

                _objectAttrs[name] = value;
            }
Example #9
0
            public void Set(SymbolId name, ScopeMemberAttributes value) {
                if (_attrs == null) _attrs = new Dictionary<SymbolId, ScopeMemberAttributes>();

                _attrs[name] = value;
            }
Example #10
0
            public void SetObjectName(ContextId context, object name, object value, ScopeMemberAttributes attrs) {
                int id = context.Id;

                EnsureDictionary(id);
                if (attrs != ScopeMemberAttributes.None) EnsureAttrDict(id);

                if (_attrs != null && id < _attrs.Count) _attrs[id].CheckWritable(name);

                _dicts[id].AddObjectKey(name, value);
                if (attrs != ScopeMemberAttributes.None) _attrs[id].Set(name, attrs);
            }
Example #11
0
            public void SetName(ContextId context, SymbolId name, object value, ScopeMemberAttributes attrs) {
                int id = context.Id;

                EnsureDictionary(id);
                EnsureAttrDict(id);

                if (_attrs != null && id < _attrs.Count) _attrs[id].CheckWritable(name);

                _dicts[id][name] = value;
                _attrs[id].Set(name, attrs);
            }
Example #12
0
        /// <summary>
        /// Sets the name to the specified value for the current context.
        /// 
        /// The name is an arbitrary object.
        /// </summary>
        public void SetObjectName(ContextId context, object name, object value, ScopeMemberAttributes attributes) {
            //int id = context.Id;
            //if (id == 0) {
            //    if (_attrs != null) _attrs.CheckWritable(name);

                _dict.AddObjectKey(name, value);
            //    if (attributes != ScopeMemberAttributes.None) {
            //        if (_attrs == null) _attrs = new ScopeAttributeDictionary();
            //        _attrs.Set(name, attributes);
            //    }
            //} else {
            //    if (_contextScopes == null) _contextScopes = new ContextSensitiveScope();
            //    _contextScopes.SetObjectName(context, name, value, attributes);
            //}
        }
Example #13
0
        /// <summary>
        /// Sets a name that is only available in the specified context.
        /// 
        /// Provides the ScopeMemberAttributes which should be set on the provided object.
        /// </summary>
        /// <exception cref="MemberAccessException">The name has already been published and marked as ReadOnly</exception>
        public void SetName(ContextId context, SymbolId name, object value, ScopeMemberAttributes attributes) {
            if (_attrs != null) _attrs.CheckWritable(name);

            if (context == ContextId.Empty) {
                SetName(name, value);
            } else {
                if (_contextScopes == null) _contextScopes = new ContextSensitiveScope();
                _contextScopes.SetName(context, name, value, attributes);
            }
        } 
Example #14
0
        /// <summary>
        /// Sets the name to the specified value for the current context.
        /// 
        /// Provides the ScopeMemberAttributes which should be set on the provided object.
        /// </summary>
        /// <exception cref="MemberAccessException">The name has already been published and marked as ReadOnly</exception>
        public void SetName(SymbolId name, object value, ScopeMemberAttributes attributes)
        {

#if FULL
            if (_attrs != null) _attrs.CheckWritable(name);

            if (_attrs == null) {
                _attrs = new ScopeAttributeDictionary();
            }
            _attrs.Set(name, attributes);   
#endif

          _dict[name] = value;
        }
Example #15
0
 /// <summary>
 /// Sets the name to the specified value for the current context.
 /// 
 /// Provides the ScopeMemberAttributes which should be set on the provided object.
 /// </summary>
 /// <exception cref="MemberAccessException">The name has already been published and marked as ReadOnly</exception>
 public void SetName(SymbolId name, object value, ScopeMemberAttributes attributes)
 {
     _dict[name] = value;
 }
Example #16
0
 /// <summary>
 /// Sets the name to the specified value for the current context.
 ///
 /// Provides the ScopeMemberAttributes which should be set on the provided object.
 /// </summary>
 /// <exception cref="MemberAccessException">The name has already been published and marked as ReadOnly</exception>
 public void SetName(SymbolId name, object value, ScopeMemberAttributes attributes)
 {
     _dict[name] = value;
 }