本文整理汇总了C#中IClass类的典型用法代码示例。如果您正苦于以下问题:C# IClass类的具体用法?C# IClass怎么用?C# IClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IClass类属于命名空间,在下文中一共展示了IClass类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GetProject
IProject GetProject(IClass c)
{
if (c != null) {
return c.ProjectContent.Project as IProject;
}
return null;
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:7,代码来源:RegisteredTestFrameworks.cs
示例17: ReflectionField
public ReflectionField(FieldInfo fieldInfo, IClass declaringType) : base(declaringType, fieldInfo.Name)
{
this.ReturnType = ReflectionReturnType.Create(this, fieldInfo.FieldType, false);
ModifierEnum modifiers = ModifierEnum.None;
if (fieldInfo.IsInitOnly) {
modifiers |= ModifierEnum.Readonly;
}
if (fieldInfo.IsStatic) {
modifiers |= ModifierEnum.Static;
}
if (fieldInfo.IsAssembly) {
modifiers |= ModifierEnum.Internal;
}
if (fieldInfo.IsPrivate) { // I assume that private is used most and public last (at least should be)
modifiers |= ModifierEnum.Private;
} else if (fieldInfo.IsFamily || fieldInfo.IsFamilyOrAssembly) {
modifiers |= ModifierEnum.Protected;
} else if (fieldInfo.IsPublic) {
modifiers |= ModifierEnum.Public;
} else {
modifiers |= ModifierEnum.Internal;
}
if (fieldInfo.IsLiteral) {
modifiers |= ModifierEnum.Const;
}
this.Modifiers = modifiers;
}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:32,代码来源:ReflectionField.cs
示例18: CreateMethod
public PythonMethod CreateMethod(IClass c)
{
if (IsConstructor) {
return new PythonConstructor(c, methodDefinition);
}
return new PythonMethod(c, methodDefinition);
}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:7,代码来源:PythonMethodDefinition.cs
示例19: GetPrimaryDeclaredElementForClass
public static IDeclaredElement GetPrimaryDeclaredElementForClass(IClass @class)
{
string className = @class.ShortName;
var cache = @class.GetPsiServices().Solution.GetComponent<PsiCache>();
List<IPsiSymbol> symbols = cache.GetSymbols(PsiRenamesFactory.NameFromCamelCase(className)).ToList();
if (symbols.Count > 0)
{
IPsiSymbol symbol = symbols.ToArray()[0];
ITreeNode element =
symbol.SourceFile.GetPsiFile<PsiLanguage>(new DocumentRange(symbol.SourceFile.Document, 0)).FindNodeAt(new TreeTextRange(new TreeOffset(symbol.Offset), 1));
while (element != null)
{
if (element is IDeclaredElement)
{
{
return (IDeclaredElement)element;
}
}
element = element.Parent;
}
{
return null;
}
}
return null;
}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:26,代码来源:DerivedDeclaredElementUtil.cs
示例20: Insertion
public Insertion(IClass @class, Guid id)
{
if (@class == null)
throw new ArgumentNullException ("class");
Class = @class;
Id = id;
}
开发者ID:jlallana,项目名称:screw2,代码行数:7,代码来源:Insertion.cs
注:本文中的IClass类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论