/// <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); } }
/// <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; }
private void EnsureAttrDict(int id) { if (_attrs == null) { _attrs = new List <ScopeAttributeDictionary>(); } while (_attrs.Count <= id) { _attrs.Add(null); } if (_attrs[id] == null) { _attrs[id] = new ScopeAttributeDictionary(); } }
private void EnsureAttrDict(int id) { if (_attrs == null) _attrs = new List<ScopeAttributeDictionary>(); while (_attrs.Count <= id) { _attrs.Add(null); } if (_attrs[id] == null) { _attrs[id] = new ScopeAttributeDictionary(); } }
/// <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; }
/// <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); } }