예제 #1
0
        internal static string GetHelpURLFromAttribute(System.Type objectType)
        {
            HelpURLAttribute customAttribute = (HelpURLAttribute)Attribute.GetCustomAttribute((MemberInfo)objectType, typeof(HelpURLAttribute));

            if (customAttribute != null)
            {
                return(customAttribute.URL);
            }
            return((string)null);
        }
        /// <summary>
        /// Draws a documentation link for the service.
        /// </summary>
        protected void RenderDocumentation(Object profileObject)
        {
            if (profileObject == null)
            {   // Can't proceed if profile is null.
                return;
            }

            HelpURLAttribute helpURL = profileObject.GetType().GetCustomAttribute <HelpURLAttribute>();

            if (helpURL != null)
            {
                InspectorUIUtility.RenderDocumentationButton(helpURL.URL);
            }
        }
예제 #3
0
        private void OnEnable()
        {
            n = (Node)target;
            if (n != null)
            {
                TaskInspector = CreateEditor(n.Task);
                TaskInfo      = MoonReflection.GetNodeData(n.Task.GetType());
            }

            tooltipPosition = serializedObject.FindProperty("tooltipPosition");
            Tooltip         = serializedObject.FindProperty("Tooltip");

            Nodedoc = MoonReflection.GetAttribute(n.Task.GetType(), typeof(HelpURLAttribute), true) as HelpURLAttribute;
        }
예제 #4
0
        /// <summary>
        /// Render a documentation header with button if Object contains HelpURLAttribute
        /// </summary>
        /// <param name="targetType">Type to test for HelpURLAttribute</param>
        /// <returns>true if object drawn and button clicked, false otherwise</returns>
        public static bool RenderHelpURL(Type targetType)
        {
            bool result = false;

            if (targetType != null)
            {
                HelpURLAttribute helpURL = targetType.GetCustomAttribute <HelpURLAttribute>();
                if (helpURL != null)
                {
                    result = RenderDocumentationSection(helpURL.URL);
                }
            }

            return(result);
        }
예제 #5
0
        internal static string GetHelpURLFromAttribute(System.Type objectType)
        {
            HelpURLAttribute customAttribute = (HelpURLAttribute)Attribute.GetCustomAttribute(objectType, typeof(HelpURLAttribute));

            return(customAttribute?.URL);
        }