Esempio n. 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));
                }
            }
        }
Esempio n. 2
0
        public void RemoveAt(int index)
        {
            NamespaceData ns = this.UniqueNamespaces[index];

            RemoveNamespaceFromSet(ns.Namespace);

            this.UniqueNamespaces.RemoveAt(index);
        }
Esempio n. 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);
                }
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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());
            }
        }
Esempio n. 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);
Esempio n. 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));
 }
Esempio n. 12
0
 protected abstract void SetValueAt(int index, NamespaceData ns);
Esempio n. 13
0
 protected abstract void InsertCore(int index, NamespaceData ns);
Esempio n. 14
0
 protected abstract void AddCore(NamespaceData ns);
 protected abstract void InsertCore(int index, NamespaceData ns);
 protected abstract void SetValueAt(int index, NamespaceData ns);
Esempio n. 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));
 }
Esempio n. 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);
 }
Esempio n. 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;
 }
Esempio n. 23
0
 protected override void AddCore(NamespaceData ns)
 {
     this.InsertCore(this.TextExpressionNamespaces.Count, ns);
 }