Exemplo n.º 1
0
 public void RemoveClass(ClassEntry ce)
 {
     if (classes == null)
     {
         return;
     }
     if ((classes is ClassEntry) && ((ClassEntry)classes == ce))
     {
         classes = null;
     }
     else
     {
         ClassEntry[] list    = (ClassEntry[])classes;
         ClassEntry[] newList = new ClassEntry [list.Length - 1];
         int          i       = 0;
         for (int n = 0; n < list.Length; n++)
         {
             if (list [n] == ce)
             {
                 continue;
             }
             if (i >= newList.Length)                            // Element to remove not found
             {
                 return;
             }
             newList [i] = list [n];
             i++;
         }
         classes = newList;
     }
 }
Exemplo n.º 2
0
        public DomTypeProxy(SerializationCodeCompletionDatabase db, ClassEntry entry)
        {
            this.db    = db;
            this.entry = entry;

            Debug.Assert(entry != null);
            base.Name      = entry.Name;
            base.Namespace = entry.Namespace;
        }
Exemplo n.º 3
0
		public DomTypeProxy (SerializationCodeCompletionDatabase db, ClassEntry entry)
		{
			this.db    = db;
			this.entry = entry;
			
			Debug.Assert (entry != null);
			base.Name      = entry.Name;
			base.Namespace = entry.Namespace;
		}
Exemplo n.º 4
0
        public void Add(ClassEntry value)
        {
            string name = ParserDatabase.GetDecoratedName(value);

            contents [name] = value;
            if (contents_ci != null)
            {
                contents_ci [name] = value;
            }
        }
Exemplo n.º 5
0
        public ClassEntry GetClass(string name, int genericArgumentCount, bool caseSensitive)
        {
            string     fullName = ParserDatabase.GetDecoratedName(name, genericArgumentCount);
            ClassEntry ne       = contents[fullName] as ClassEntry;

            if (ne != null || caseSensitive)
            {
                return(ne);
            }

            if (contents_ci == null)
            {
                BuildCaseInsensitiveTable();
            }
            return(contents_ci[fullName] as ClassEntry);
        }
Exemplo n.º 6
0
 public void AddClass(ClassEntry ce)
 {
     if (classes == null)
     {
         // No classes so far in the file. Add the first one.
         classes = ce;
     }
     else if (classes is ClassEntry)
     {
         // There is already one class. Create an array to hold the old and new reference.
         ClassEntry[] list = new ClassEntry [] { (ClassEntry)classes, ce };
         classes = list;
     }
     else
     {
         // It's already an array of class entries. Extend the array.
         ClassEntry[] list    = (ClassEntry[])classes;
         ClassEntry[] newList = new ClassEntry [list.Length + 1];
         Array.Copy(list, newList, list.Length);
         newList [newList.Length - 1] = ce;
         classes = newList;
     }
 }
		public void RemoveClass (ClassEntry ce)
		{
			if (classes == null)
				return;
			if ((classes is ClassEntry) && ((ClassEntry)classes == ce))
				classes = null;
			else {
				ClassEntry[] list = (ClassEntry[]) classes;
				ClassEntry[] newList = new ClassEntry [list.Length - 1];
				int i = 0;
				for (int n=0; n<list.Length; n++) {
					if (list [n] == ce)
						continue;
					if (i >= newList.Length)	// Element to remove not found
						return;
					newList [i] = list [n];
					i++;
				}
				classes = newList;
			}
		}
		public void AddClass (ClassEntry ce)
		{
			if (classes == null)
				// No classes so far in the file. Add the first one.
				classes = ce;
			else if (classes is ClassEntry) {
				// There is already one class. Create an array to hold the old and new reference.
				ClassEntry[] list = new ClassEntry [] { (ClassEntry) classes, ce };
				classes = list;
			} else {
				// It's already an array of class entries. Extend the array.
				ClassEntry[] list = (ClassEntry[]) classes;
				ClassEntry[] newList = new ClassEntry [list.Length + 1];
				Array.Copy (list, newList, list.Length);
				newList [newList.Length - 1] = ce;
				classes = newList;
			}
		}
		public void Remove (ClassEntry entry)
		{
			contents.Remove (ParserDatabase.GetDecoratedName (entry));
			contents_ci = null;
		}
		public void Add (ClassEntry value)
		{
			string name = ParserDatabase.GetDecoratedName (value);
			
			contents [name] = value;
			if (contents_ci != null)
				contents_ci [name] = value;
		}
Exemplo n.º 11
0
		internal static string GetDecoratedName (ClassEntry entry)
		{
			return GetDecoratedName (entry.Name, entry.TypeParameterCount);
		}
Exemplo n.º 12
0
 public void Remove(ClassEntry entry)
 {
     contents.Remove(ParserDatabase.GetDecoratedName(entry));
     contents_ci = null;
 }
Exemplo n.º 13
0
 internal static string GetDecoratedName(ClassEntry entry)
 {
     return(GetDecoratedName(entry.Name, entry.TypeParameterCount));
 }