internal void ChangeNamespace(IXmlaProperty property, string newNamespace)
        {
            XmlaPropertyKey key = new XmlaPropertyKey(property.Name, newNamespace);
            int             num = this.RemoveKey(key, property);

            property.Namespace       = newNamespace;
            this.hashStore[property] = num;
        }
        public IXmlaProperty Add(IXmlaProperty value)
        {
            this.Validate(-1, value);
            value.Parent = this.Parent;
            int num = this.items.Add(value);

            this.hashStore[value] = num;
            return(value);
        }
        private int RemoveKey(XmlaPropertyKey key, IXmlaProperty property)
        {
            if (this.hashStore.ContainsKey(key))
            {
                throw new ArgumentException(SR.Property_Already_Exists, "key");
            }
            int result = this.IndexOf(property);

            this.hashStore.Remove(property);
            return(result);
        }
        private void Replace(int index, IXmlaProperty newValue)
        {
            this.Validate(index, newValue);
            IXmlaProperty xmlaProperty = (IXmlaProperty)this.items[index];

            xmlaProperty.Parent = null;
            newValue.Parent     = this.Parent;
            this.items[index]   = newValue;
            this.hashStore.Remove(xmlaProperty);
            this.hashStore.Add(newValue, index);
        }
 public void Insert(int index, IXmlaProperty value)
 {
     this.Validate(-1, value);
     value.Parent = this.Parent;
     this.items.Insert(index, value);
     this.hashStore[value] = index;
     for (int i = this.items.Count - 1; i > index; i--)
     {
         this.hashStore[(IXmlaProperty)this.items[i]] = i;
     }
 }
        private void RemoveIndex(int index)
        {
            IXmlaProperty xmlaProperty = (IXmlaProperty)this.items[index];

            xmlaProperty.Parent = null;
            this.items.RemoveAt(index);
            this.hashStore.Remove(xmlaProperty);
            for (int i = index; i < this.items.Count; i++)
            {
                this.hashStore[(IXmlaProperty)this.items[i]] = i;
            }
        }
        public void Remove(IXmlaProperty value)
        {
            this.ValidateType(value);
            int num = this.IndexOf(value);

            if (-1 != num)
            {
                this.RemoveIndex(num);
                return;
            }
            throw new ArgumentException(SR.Property_DoesNotExist, "value");
        }
        internal void Validate(int index, IXmlaProperty value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            if (value.Parent != null && this.Parent != value.Parent)
            {
                throw new ArgumentException(SR.Property_Parent_Mismatch, "value");
            }
            if (index != this.IndexOf(value))
            {
                throw new ArgumentException(SR.Property_Already_Exists, "value");
            }
            string name = value.Name;

            if (name.Length == 0)
            {
                throw new ArgumentException(SR.Connection_PropertyNameEmpty, "Name");
            }
        }
 public int IndexOf(IXmlaProperty property)
 {
     return(this.items.IndexOf(property));
 }
 public bool Contains(IXmlaProperty property)
 {
     return(-1 != this.IndexOf(property));
 }