Пример #1
0
        /// <summary>
        /// This <see cref="ITaskInfoProvider.GetTaskInfo"/> implementation applies
        /// either <see cref="TaskInfoByXmlAttributeProvider"/> or
        /// <see cref="TaskInfoByAttributesProvider"/> depending on what attributes
        /// the task type is equipped with.
        /// </summary>
        #endregion
        public override TaskInfo GetTaskInfo(Type taskType)
        {
            TaskAttribute ta = GetTaskAttribute(taskType);

            if ((ta != null) && (ta.Xml != null))
            {
                return(new TaskInfoByXmlAttributeProvider().GetTaskInfo(taskType));
            }
            else
            {
                return(new TaskInfoByAttributesProvider().GetTaskInfo(taskType));
            }
        }
Пример #2
0
        private XmlElement GetTaskRootElement(Type taskType)
        {
            TaskAttribute taskAttr = GetTaskAttribute(taskType);

            if (taskAttr == null)
            {
                return(null);
            }

            XmlDocument taskXml = new XmlDocument();

            taskXml.LoadXml("<taskConfiguration></taskConfiguration>");
            taskXml.DocumentElement.InnerXml = taskAttr.Xml;
            return(taskXml.DocumentElement);
        }
        /// <summary>
        /// Extracts task information from <see cref="InteractionPointAttribute"/>,
        /// <see cref="NavTargetAttribute"/>, <see cref="AdjacentPointsAttribute"/>
        /// attributes applied to the task type and its members.
        /// </summary>
        #endregion
        public override TaskInfo GetTaskInfo(Type taskType)
        {
            TaskInfo result = new TaskInfo();

            TaskAttribute ta = GetTaskAttribute(taskType);

            if (ta != null)
            {
                result.NavigatorType = ta.NavigatorType;
            }

            IList iPointInfWrappers = CreateIPointInfos(taskType, result.InteractionPoints);

            FillNavTargets(taskType, iPointInfWrappers, result.InteractionPoints);

            return(result);
        }
Пример #4
0
        /// <summary>
        /// Generates task information from the <see cref="TaskAttribute"/>
        /// attribute applied to a task type.
        /// </summary>
        /// <seealso cref="ITaskInfoProvider"/>
        /// <seealso cref="TaskAttribute"/>
        #endregion
        public override TaskInfo GetTaskInfo(Type taskType)
        {
            TaskInfo result = new TaskInfo();

            TaskAttribute ta = GetTaskAttribute(taskType);

            if (ta != null)
            {
                result.NavigatorType = ta.NavigatorType;
            }

            InteractionPointInfoWrapper[] iPointInfoWrappers = CreateInteractionPointInfos(
                taskType, result.InteractionPoints);

            foreach (InteractionPointInfoWrapper iPointWrapper in iPointInfoWrappers)
            {
                FillNavTargets(iPointWrapper, result.InteractionPoints);
            }

            return(result);
        }