当前位置: 首页>>代码示例>>C#>>正文


C# IClass类代码示例

本文整理汇总了C#中IClass的典型用法代码示例。如果您正苦于以下问题:C# IClass类的具体用法?C# IClass怎么用?C# IClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IClass类属于命名空间,在下文中一共展示了IClass类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CodeType

		/// <summary>
		/// Note that projectContent may be different to the IClass.ProjectContent since the class
		/// is retrieved from the namespace contents and could belong to a separate project or
		/// referenced assembly.
		/// </summary>
		public CodeType(IProjectContent projectContent, IClass c)
			: base(c)
		{
			this.Class = c;
			this.ProjectContent = projectContent;
			InfoLocation = GetInfoLocation(projectContent, c);
		}
开发者ID:Netring,项目名称:SharpDevelop,代码行数:12,代码来源:CodeType.cs

示例2: GetRectangleClass

        private IClass GetRectangleClass()
        {
            var variables = new string[] { "x", "y", "width", "height" };
            var methods = new string[]
                    {
                        "x ^x",
                        "y ^y",
                        "x: newX x := newX",
                        "y: newY y := newY",
                        "area ^x*y",
                        "width ^width",
                        "height ^height",
                        "width: newWidth width := newWidth",
                        "height: newHeight height := newHeight",
                        "side: newSide x := newSide. y := newSide"
                    };

            if (this.rectangleClass == null)
            {
                this.rectangleClass = ParserTests.CompileClass(
                    "Rectangle",
                    variables,
                    methods);
            }

            return this.rectangleClass;
        }
开发者ID:ajlopez,项目名称:AjTalk,代码行数:27,代码来源:ObjectTests.cs

示例3: DefaultField

 public DefaultField(IReturnType type, string name, ModifierEnum m, DomRegion region, IClass declaringType)
     : base(declaringType, name)
 {
     this.ReturnType = type;
     this.Region = region;
     this.Modifiers = m;
 }
开发者ID:SergeTruth,项目名称:OxyChart,代码行数:7,代码来源:DefaultField.cs

示例4: add_Type

        // create
        public static TypeDeclaration add_Type(this NamespaceDeclaration namespaceDeclaration, IClass iClass)
        {
            // move to method IClass.typeDeclaration();
            var typeName = iClass.Name;

            var newType = namespaceDeclaration.type(typeName);		// check if already exists and if it does return it
            if (newType != null)
                return newType;

            const Modifiers modifiers = Modifiers.None | Modifiers.Public;
            newType = new TypeDeclaration(modifiers, new List<AttributeSection>());
            newType.Name = typeName;

            foreach (var baseType in iClass.BaseTypes)
            {
                if (baseType.FullyQualifiedName != "System.Object")  // no need to include this one
                    newType.BaseTypes.Add(new TypeReference(baseType.FullyQualifiedName));
            }

            namespaceDeclaration.AddChild(newType);

            return newType;

            //return namespaceDeclaration.add_Type(iClass.Name);
        }
开发者ID:njmube,项目名称:FluentSharp,代码行数:26,代码来源:TypeDeclaration_ExtensionMethods.cs

示例5: CreateFileCodeModelNamespace

		FileCodeModelCodeNamespace CreateFileCodeModelNamespace(IClass c)
		{
			var codeNamespace = new FileCodeModelCodeNamespace(compilationUnit.ProjectContent, c.Namespace);
			AddCodeElement(codeNamespace);
			fileCodeModelNamespaces.Add(codeNamespace);
			return codeNamespace;
		}
开发者ID:GMRyujin,项目名称:SharpDevelop,代码行数:7,代码来源:FileCodeModelCodeElements.cs

示例6: PrefetchPolicyBuilder

        // Indexer declaration
        public PrefetchPolicy this[IClass @class]
        {
            get
            {
                PrefetchPolicy prefetchPolicy;
                if (!this.prefetchPolicyByClass.TryGetValue(@class, out prefetchPolicy))
                {
                    var prefetchPolicyBuilder = new PrefetchPolicyBuilder();

                    foreach (var roleType in @class.RoleTypes)
                    {
                        prefetchPolicyBuilder.WithRule(roleType);
                    }

                    foreach (var associationType in @class.AssociationTypes)
                    {
                        prefetchPolicyBuilder.WithRule(associationType);
                    }

                    prefetchPolicy = prefetchPolicyBuilder.Build();
                    this.prefetchPolicyByClass[@class] = prefetchPolicy;
                }

                return prefetchPolicy;
            }
        }
开发者ID:whesius,项目名称:allors,代码行数:27,代码来源:Prefetchers.cs

示例7: AddClassMemberBookmarks

		void AddClassMemberBookmarks(IClass c)
		{
			if (c.IsSynthetic) return;
			if (!c.Region.IsEmpty) {
				bookmarks.Add(new ClassBookmark(c));
			}
			foreach (IClass innerClass in c.InnerClasses) {
				AddClassMemberBookmarks(innerClass);
			}
			foreach (IMethod m in c.Methods) {
				if (m.Region.IsEmpty || m.IsSynthetic) continue;
				bookmarks.Add(new ClassMemberBookmark(m));
			}
			foreach (IProperty m in c.Properties) {
				if (m.Region.IsEmpty || m.IsSynthetic) continue;
				bookmarks.Add(new ClassMemberBookmark(m));
			}
			foreach (IField f in c.Fields) {
				if (f.Region.IsEmpty || f.IsSynthetic) continue;
				bookmarks.Add(new ClassMemberBookmark(f));
			}
			foreach (IEvent e in c.Events) {
				if (e.Region.IsEmpty || e.IsSynthetic) continue;
				bookmarks.Add(new ClassMemberBookmark(e));
			}
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:26,代码来源:IconBarManager.cs

示例8: MakeTypeResult

		void MakeTypeResult(IClass c)
		{
			if (c != null)
				resolveResult = new TypeResolveResult(callingClass, resolver.CallingMember, c);
			else
				ClearResult();
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:7,代码来源:ResolveVisitor.cs

示例9: IsValidTestMethod

        public bool IsValidTestMethod(IProject project, IClass testClass, IMethod testMethod)
        {
            if (project == null || testClass == null || testMethod == null)
                return false;

            return IsValidTestMethod(project, testClass.GetClrName().FullName, testMethod.ShortName);
        }
开发者ID:jbogard,项目名称:ReSharperFixieRunner,代码行数:7,代码来源:TestIdentifier.cs

示例10: IsValidTestClass

        public bool IsValidTestClass(IProject project, IClass testClass)
        {
            if (project == null || testClass == null)
                return false;

            return IsValidTestClass(project, testClass.GetClrName().FullName);
        }
开发者ID:jbogard,项目名称:ReSharperFixieRunner,代码行数:7,代码来源:TestIdentifier.cs

示例11: AllorsPredicateRoleInstanceofSql

 internal AllorsPredicateRoleInstanceofSql(AllorsExtentFilteredSql extent, IRoleType role, IObjectType instanceType, IClass[] instanceClasses)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleInstanceOf(role, instanceType);
     this.role = role;
     this.instanceClasses = instanceClasses;
 }
开发者ID:whesius,项目名称:allors,代码行数:7,代码来源:RoleInstanceOf.cs

示例12: ValidateClassNames

        public void ValidateClassNames(ValidationContext context, IClass cls)
        {
            // Property and Role names must be unique within a class hierarchy.

            List<string> foundNames = new List<string>();
            List<IProperty> allPropertiesInHierarchy = new List<IProperty>();
            List<IProperty> superRoles = new List<IProperty>();
            FindAllAssocsInSuperClasses(superRoles, cls.SuperClasses);

            foreach (IProperty p in cls.GetOutgoingAssociationEnds()) { superRoles.Add(p); }
            foreach (IProperty p in superRoles) { allPropertiesInHierarchy.Add(p); }
            foreach (IProperty p in cls.Members) { allPropertiesInHierarchy.Add(p); }

            foreach (IProperty attribute in allPropertiesInHierarchy)
            {
                string name = attribute.Name;
                if (!string.IsNullOrEmpty(name) && foundNames.Contains(name))
                {
                    context.LogError(
                      string.Format("Duplicate property or role name '{0}' in class '{1}'", name, cls.Name),
                      "001", cls);
                }
                foundNames.Add(name);
            }
        }
开发者ID:keithshort1,项目名称:MyLoProto,代码行数:25,代码来源:PLDBValidationConstraints.cs

示例13: ClassProxy

 public ClassProxy(IClass c)
 {
     this.FullyQualifiedName  = c.FullyQualifiedName;
     this.Documentation       = c.Documentation;
     this.modifiers           = c.Modifiers;
     this.classType           = c.ClassType;
 }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:7,代码来源:ClassProxy.cs

示例14: GetSourceFiles

		public IEnumerable<OpenedFile> GetSourceFiles(out OpenedFile designerCodeFile)
		{
			// get new initialize components
			ParseInformation info = ParserService.ParseFile(this.viewContent.PrimaryFileName, this.viewContent.PrimaryFileContent);
			ICompilationUnit cu = info.CompilationUnit;
			foreach (IClass c in cu.Classes) {
				if (FormsDesignerSecondaryDisplayBinding.BaseClassIsFormOrControl(c)) {
					this.currentClassPart = c;
					this.initializeComponents = FormsDesignerSecondaryDisplayBinding.GetInitializeComponents(c);
					if (this.initializeComponents != null) {
						string designerFileName = this.initializeComponents.DeclaringType.CompilationUnit.FileName;
						if (designerFileName != null) {
							
							designerCodeFile = FileService.GetOrCreateOpenedFile(designerFileName);
							
							CompoundClass compound = c.GetCompoundClass() as CompoundClass;
							if (compound == null) {
								return new [] {designerCodeFile};
							} else {
								return compound.Parts
									.Select(cl => FileService.GetOrCreateOpenedFile(cl.CompilationUnit.FileName))
									.Distinct();
							}
							
						}
					}
				}
			}
			
			throw new FormsDesignerLoadException("Could not find InitializeComponent method in any part of the open class.");
		}
开发者ID:TiberiuGal,项目名称:SharpDevelop,代码行数:31,代码来源:AbstractDesignerGenerator.cs

示例15: AllorsPredicateAssociationInstanceofSql

 internal AllorsPredicateAssociationInstanceofSql(AllorsExtentFilteredSql extent, IAssociationType association, IObjectType instanceType, IClass[] instanceClasses)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.ValidateAssociationInstanceof(association, instanceType);
     this.association = association;
     this.instanceClasses = instanceClasses;
 }
开发者ID:whesius,项目名称:allors,代码行数:7,代码来源:AssociationInstanceOf.cs


注:本文中的IClass类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。