Example #1
0
        static void FillClientMembers(Documentation doc, string typeFullName, string scriptsFolder)
        {
            var actAssembly = typeof(ToolkitResourceManager).Assembly;
            var type        = actAssembly.GetType(typeFullName, true);

            if (type.IsSubclassOf(typeof(ExtenderControlBase))
                ||
                type.IsSubclassOf(typeof(ScriptControlBase))
                ||
                type == typeof(ComboBox))
            {
                var clientScriptName = type
                                       .GetCustomAttributesData()
                                       .First(a => a.Constructor.DeclaringType == typeof(ClientScriptResourceAttribute))
                                       .ConstructorArguments[1]
                                       .Value;
                var jsFileName = clientScriptName + ".js";

                var jsLines       = File.ReadAllLines(Path.Combine(scriptsFolder, jsFileName));
                var commentParser = new CommentParser();
                var clientMembers = commentParser.ParseFile(jsLines, typeFullName);

                doc.Add(clientMembers, ContentType.Text);
            }
        }
Example #2
0
        public static IEnumerable <RawDoc> GetAnimationScriptsReferenceForType(string animationTypeName, string scriptsFolder)
        {
            var doc           = new Documentation();
            var commentParser = new CommentParser();
            var jsLines       = File.ReadAllLines(Path.Combine(scriptsFolder, "AnimationScripts.js"));
            var typeFullName  = "AjaxControlToolkit." + animationTypeName;

            return(commentParser.ParseFile(jsLines, typeFullName));
        }
        void FillClientMembers(Documentation doc, string typeFullName)
        {
            var actAssembly = typeof(ToolkitResourceManager).Assembly;
            var type        = actAssembly.GetType(typeFullName, true);

            if (type.IsSubclassOf(typeof(ExtenderControlBase))
                ||
                type.IsSubclassOf(typeof(ScriptControlBase))
                ||
                type == typeof(ComboBox))
            {
                var clientScriptName = type
                                       .CustomAttributes
                                       .First(a => a.AttributeType.Name == "ClientScriptResourceAttribute")
                                       .ConstructorArguments[1];
                var jsFileName = clientScriptName.Value + ".js";

                var jsLines       = System.IO.File.ReadAllLines(Server.MapPath("~/bin/Scripts/" + jsFileName));
                var commentParser = new CommentParser();
                var clientMembers = commentParser.ParseFile(jsLines, typeFullName);

                doc.Add(clientMembers, ContentType.Text);
            }
        }