Exemple #1
0
        public Type GetTypeFromClassName(string classname)
        {
            Type ret = GetTypeFromClassNameInternal(classname);

            if (ret == null)
            {
                // Task not already loaded,
                // Check list of pending UsingTasks
                bool          is_shortname = classname.IndexOf('.') < 0;
                UsingTaskInfo info         = new UsingTaskInfo(String.Empty, null);
                if (is_shortname)
                {
                    // Linear search UsingTaskInfo objects for short name match
                    foreach (UsingTaskInfo ut_info in usingTasksByFullName.Values)
                    {
                        if (String.Compare(ut_info.ShortName, classname, true) == 0)
                        {
                            info = ut_info;
                            break;
                        }
                    }

                    if (info.Task == null)
                    {
                        ThrowTaskNotRegistered(classname);
                    }
                }
                else
                {
                    // Look for full name match
                    if (!usingTasksByFullName.TryGetValue(classname, out info))
                    {
                        ThrowTaskNotRegistered(classname);
                    }
                }

                usingTasksByFullName.Remove(info.Task.TaskName);
                info.Task.Load(this);
                ret = GetTypeFromClassNameInternal(classname);
            }

            if (ret == null)
            {
                ThrowTaskNotRegistered(classname);
            }
            return(ret);
        }
Exemple #2
0
		public Type GetTypeFromClassName (string classname)
		{
			Type ret = GetTypeFromClassNameInternal (classname);
			if (ret == null) {
				// Task not already loaded,
				// Check list of pending UsingTasks
				bool is_shortname = classname.IndexOf ('.') < 0;
				UsingTaskInfo info = new UsingTaskInfo (String.Empty, null);
				if (is_shortname) {
					// Linear search UsingTaskInfo objects for short name match
					foreach (UsingTaskInfo ut_info in usingTasksByFullName.Values) {
						if (String.Compare (ut_info.ShortName, classname, true) == 0) {
							info = ut_info;
							break;
						}
					}

					if (info.Task == null)
						ThrowTaskNotRegistered (classname);
				} else {
					// Look for full name match
					if (!usingTasksByFullName.TryGetValue (classname, out info))
						ThrowTaskNotRegistered (classname);
				}

				usingTasksByFullName.Remove (info.Task.TaskName);
				info.Task.Load (this);
				ret = GetTypeFromClassNameInternal (classname);
			}

			if (ret == null)
				ThrowTaskNotRegistered (classname);
			return ret;
		}