コード例 #1
0
//		static ITypeResolveContext GetMLDom (MoonlightProject project)
//		{
//			return TypeSystemService.GetAssemblyDom (
//				MonoDevelop.Core.Runtime.SystemAssemblyService.GetAssemblyNameForVersion (
//					"System.Windows", GetProjectTargetFramework (project)));
//		}

        public static IEnumerable <IType> ListControlClasses(ICompilation database, INamespace namespac)
        {
            if (database == null)
            {
                yield break;
            }

            var swd = database.LookupType("System.Windows", "DependencyObject");

            //return classes if they derive from system.web.ui.control
            foreach (var cls in namespac.Types)
            {
                if (cls != null && !cls.IsAbstract && cls.IsPublic && cls.IsBaseType(swd))
                {
                    yield return(cls);
                }
            }
        }
コード例 #2
0
        public Dictionary <string, ITypeDefinition> GetToolboxItems()
        {
            Dictionary <string, ITypeDefinition> tb_items = new Dictionary <string, ITypeDefinition> ();

            var wt = ctx.LookupType("Gtk", "Widget");

            if (wt != null)
            {
                foreach (var t in wt.GetSubTypeDefinitions())
                {
                    if (IsToolboxWidget(t))
                    {
                        tb_items [t.FullName] = t;
                    }
                }
            }

            return(tb_items);
        }