Пример #1
0
        public object this[int index]
        {
            get
            {
                return(this.UniqueNamespaces[index]);
            }
            set
            {
                NamespaceData ns = value as NamespaceData;
                if (ns == null)
                {
                    throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
                }

                if (Lookup(ns.Namespace) == -1)
                {
                    this.SetValueAt(index, ns);
                    this.UniqueNamespaces[index] = ns;
                }
                else
                {
                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.NamespaceListNoDuplicate));
                }
            }
        }
Пример #2
0
        public void RemoveAt(int index)
        {
            NamespaceData ns = this.UniqueNamespaces[index];

            RemoveNamespaceFromSet(ns.Namespace);

            this.UniqueNamespaces.RemoveAt(index);
        }
Пример #3
0
        protected override void InsertCore(int index, NamespaceData ns)
        {
            this.TextExpressionNamespaces.Insert(index, ns.Namespace);

            if (this.AvailableNamespaces.ContainsKey(ns.Namespace))
            {
                foreach (string assembly in this.AvailableNamespaces[ns.Namespace])
                {
                    this.AddAssemblyToSet(assembly);
                }
            }
        }
Пример #4
0
        public void Remove(object value)
        {
            NamespaceData ns = value as NamespaceData;

            if (ns == null)
            {
                throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
            }

            int index = this.Lookup(ns.Namespace);

            if (index != -1)
            {
                RemoveAt(index);
            }
        }
Пример #5
0
        public void Insert(int index, object value)
        {
            NamespaceData ns = value as NamespaceData;

            if (ns == null)
            {
                throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
            }

            if (Lookup(ns.Namespace) == -1)
            {
                this.UniqueNamespaces.Insert(index, ns);
                this.InsertCore(index, ns);
            }
            else
            {
                throw FxTrace.Exception.AsError(new InvalidOperationException());
            }
        }
Пример #6
0
        public int Add(object value)
        {
            NamespaceData ns = value as NamespaceData;

            if (ns == null)
            {
                throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
            }

            if (Lookup(ns.Namespace) == -1)
            {
                this.AddCore(ns);
                return(((IList)this.UniqueNamespaces).Add(ns));
            }
            else
            {
                return(-1);
            }
        }
 protected abstract void AddCore(NamespaceData ns);
Пример #8
0
 protected override void SetValueAt(int index, NamespaceData ns)
 {
     this.TextExpressionNamespaces[index] = ns.Namespace;
 }
        protected override void InsertCore(int index, NamespaceData ns)
        {
            this.TextExpressionNamespaces.Insert(index, ns.Namespace);

            if (this.AvailableNamespaces.ContainsKey(ns.Namespace))
            {                
                foreach (string assembly in this.AvailableNamespaces[ns.Namespace])
                {
                    this.AddAssemblyToSet(assembly);
                }
            }
        }
 protected override void SetValueAt(int index, NamespaceData ns)
 {
     RemoveNamespaceFromSet(this.UniqueNamespaces[index].Namespace);
     this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
 }
 protected override void AddCore(NamespaceData ns)
 {
     this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
 }
Пример #12
0
 protected abstract void SetValueAt(int index, NamespaceData ns);
Пример #13
0
 protected abstract void InsertCore(int index, NamespaceData ns);
Пример #14
0
 protected abstract void AddCore(NamespaceData ns);
 protected abstract void InsertCore(int index, NamespaceData ns);
 protected abstract void SetValueAt(int index, NamespaceData ns);
Пример #17
0
 protected override void AddCore(NamespaceData ns)
 {
     this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
 }
 protected override void InsertCore(int index, NamespaceData ns)
 {
     this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
 }
Пример #19
0
 protected override void InsertCore(int index, NamespaceData ns)
 {
     this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
 }
 protected override void AddCore(NamespaceData ns)
 {
     this.InsertCore(this.TextExpressionNamespaces.Count, ns);
 }
Пример #21
0
 protected override void SetValueAt(int index, NamespaceData ns)
 {
     RemoveNamespaceFromSet(this.UniqueNamespaces[index].Namespace);
     this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
 }
 protected override void SetValueAt(int index, NamespaceData ns)
 {
     this.TextExpressionNamespaces[index] = ns.Namespace;
 }
Пример #23
0
 protected override void AddCore(NamespaceData ns)
 {
     this.InsertCore(this.TextExpressionNamespaces.Count, ns);
 }