MonoDevelop.CSharp.Completion.CSharpTextEditorCompletion.AddAsCompletionData C# (CSharp) Method

AddAsCompletionData() static private method

Adds a type to completion list. If it's a simple type like System.String it adds the simple C# type name "string" as well.
static private AddAsCompletionData ( CompletionDataCollector col, IType type ) : void
col CompletionDataCollector
type IType
return void
		static void AddAsCompletionData (CompletionDataCollector col, IType type)
		{
			if (type == null)
				return;
			string netName = CSharpAmbience.NetToCSharpTypeName (type.FullName);
			if (!string.IsNullOrEmpty (netName) && netName != type.FullName)
				col.Add (netName);
			
			if (!String.IsNullOrEmpty (type.Namespace) && !col.IsNamespaceInScope (type.Namespace)) {
				string[] ns = type.Namespace.Split ('.');
				for (int i = 0; i < ns.Length; i++) {
					col.Add (new Namespace (ns[i]));
					if (!col.IsNamespaceInScope (ns[i]))
						return;
				}
			}
			
			col.Add (type);
		}