本文整理汇总了C#中IUnresolvedMember类的典型用法代码示例。如果您正苦于以下问题:C# IUnresolvedMember类的具体用法?C# IUnresolvedMember怎么用?C# IUnresolvedMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IUnresolvedMember类属于命名空间,在下文中一共展示了IUnresolvedMember类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateEventCreationCompletionData
public ICompletionData CreateEventCreationCompletionData(string varName, IType delegateType, IEvent evt,
string parameterDefinition,
IUnresolvedMember currentMember,
IUnresolvedTypeDefinition currentType)
{
return new CompletionData(varName);
}
示例2: Update
/// <summary>
/// Updates the member model with the specified new member.
/// </summary>
public void Update(IUnresolvedMember newMember)
{
if (newMember == null)
throw new ArgumentNullException("newMember");
this.member = newMember;
RaisePropertyChanged();
}
示例3: MemberModel
public MemberModel(IEntityModelContext context, IUnresolvedMember member)
{
if (context == null)
throw new ArgumentNullException("context");
if (member == null)
throw new ArgumentNullException("member");
this.context = context;
this.member = member;
}
示例4: NewPartialCompletionData
public NewPartialCompletionData(int declarationBegin, IUnresolvedTypeDefinition type, IUnresolvedMember member)
{
DeclarationBeginningIndex = declarationBegin;
Type = type;
Member = member;
// check this:
DeclarationCategory = type.SymbolKind.ResolveDeclarationCategoryFromSymbolKind();
SetDefaultText(member.Name);
}
示例5: Node
/// <summary>
/// Initializes a new instance with no child nodes for the
/// given member.
/// </summary>
public Node(IUnresolvedMember member, IDocument document) {
this.ChildNodes = null;
this.Location = QuickFix.ForNonBodyRegion(member, document);
// Fields' BodyRegion does not include their name for some
// reason. To prevent the field's name missing, include
// the whole region for them.
if (member.SymbolKind == SymbolKind.Field)
this.Location.Text += member.Name;
}
示例6: EventCreationCompletionData
public EventCreationCompletionData(string handlerName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType, CSharpResolver contextAtCaret)
{
if (string.IsNullOrEmpty(handlerName)) {
handlerName = (evt != null ? evt.Name : "Handle");
}
this.handlerName = handlerName;
this.DisplayText = "<Create " + handlerName + ">";
this.delegateTypeReference = delegateType.ToTypeReference();
this.isStatic = callingMember != null && callingMember.IsStatic;
}
示例7: EventCreationCompletionData
public EventCreationCompletionData(string handlerName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType, CSharpResolver contextAtCaret)
{
if (string.IsNullOrEmpty(handlerName)) {
handlerName = (evt != null ? evt.Name : "Handle");
}
this.handlerName = handlerName;
this.DisplayText = StringParser.Parse("${res:CSharpBinding.Refactoring.EventCreation.EventHandlerText}", new[] { new StringTagPair("HandlerName", handlerName) });
this.delegateTypeReference = delegateType.ToTypeReference();
this.isStatic = callingMember != null && callingMember.IsStatic;
}
示例8: EventCompletionData
public EventCompletionData(string varName, IType delegateType, IEvent evt, string parameterDefinition, IUnresolvedMember currentMember, IUnresolvedTypeDefinition currentType)
{
SetDefaultText(varName);
DeclarationCategory = DeclarationCategory.Event;
// what should we do with parameterDefinition???
DelegateType = delegateType;
CurrentMember = currentMember;
CurrentType = currentType;
//Description = currentMember
}
示例9: EventCreationCompletionData
public EventCreationCompletionData(string varName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType, CSharpResolver contextAtCaret) : base(evt)
{
if (string.IsNullOrEmpty(varName)) {
this.DisplayText = "Create handler for " + (evt != null ? evt.Name : "");
}
else {
this.DisplayText = "Create handler for " + char.ToUpper(varName[0]) + varName.Substring(1) + (evt != null ? evt.Name : "");
}
this.DisplayText = "<" + this.DisplayText + ">";
this.eventDefinition = evt;
this.delegateType = delegateType;
}
示例10: GetLocalVariableTypes
public IReadOnlyList<ITypeReference> GetLocalVariableTypes(IUnresolvedMember member)
{
rwLock.EnterReadLock();
try {
ITypeReference[] result;
if (localVariableTypes.TryGetValue(member, out result))
return result;
else
return EmptyList<ITypeReference>.Instance;
} finally {
rwLock.ExitReadLock();
}
}
示例11: CanMatch
bool CanMatch(IUnresolvedMember member)
{
switch (member.SymbolKind) {
case SymbolKind.Field:
return memberType == 'F';
case SymbolKind.Property:
case SymbolKind.Indexer:
return memberType == 'P';
case SymbolKind.Event:
return memberType == 'E';
case SymbolKind.Method:
case SymbolKind.Operator:
case SymbolKind.Constructor:
case SymbolKind.Destructor:
return memberType == 'M';
default:
throw new NotSupportedException(member.SymbolKind.ToString());
}
}
示例12: CanMatch
bool CanMatch(IUnresolvedMember member)
{
switch (member.EntityType) {
case EntityType.Field:
return memberType == 'F';
case EntityType.Property:
case EntityType.Indexer:
return memberType == 'P';
case EntityType.Event:
return memberType == 'E';
case EntityType.Method:
case EntityType.Operator:
case EntityType.Constructor:
case EntityType.Destructor:
return memberType == 'M';
default:
throw new NotSupportedException(member.EntityType.ToString());
}
}
示例13: EventCreationCompletionData
public EventCreationCompletionData (CSharpCompletionTextEditorExtension ext, string varName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType) : base (null)
{
if (string.IsNullOrEmpty (varName)) {
this.DisplayText = "Handle" + (evt != null ? evt.Name : "");
} else {
this.DisplayText = "Handle" + Char.ToUpper (varName[0]) + varName.Substring (1) + (evt != null ? evt.Name : "");
}
if (declaringType != null && declaringType.Members.Any (m => m.Name == this.DisplayText)) {
for (int i = 1; i < 10000; i++) {
if (!declaringType.Members.Any (m => m.Name == this.DisplayText + i)) {
this.DisplayText = this.DisplayText + i.ToString ();
break;
}
}
}
this.editor = ext.TextEditorData;
this.parameterList = parameterList;
this.callingMember = callingMember;
this.Icon = "md-newmethod";
this.initialOffset = editor.Caret.Offset;
}
示例14: AddNewMember
public static void AddNewMember (ITypeDefinition type, IUnresolvedTypeDefinition part, IUnresolvedMember newMember, bool implementExplicit = false)
{
bool isOpen;
var data = TextFileProvider.Instance.GetTextEditorData (part.Region.FileName, out isOpen);
var parsedDocument = TypeSystemService.ParseFile (data.FileName, data.MimeType, data.Text);
var insertionPoints = GetInsertionPoints (data, parsedDocument, part);
var suitableInsertionPoint = GetSuitableInsertionPoint (insertionPoints, part, newMember);
var generator = CreateCodeGenerator (data, type.Compilation);
generator.IndentLevel = CalculateBodyIndentLevel (parsedDocument.GetInnermostTypeDefinition (type.Region.Begin));
var generatedCode = generator.CreateMemberImplementation (type, part, newMember, implementExplicit);
suitableInsertionPoint.Insert (data, generatedCode.Code);
if (!isOpen) {
try {
File.WriteAllText (type.Region.FileName, data.Text);
} catch (Exception e) {
LoggingService.LogError (GettextCatalog.GetString ("Failed to write file '{0}'.", type.Region.FileName), e);
MessageService.ShowError (GettextCatalog.GetString ("Failed to write file '{0}'.", type.Region.FileName));
}
}
}
示例15: GetCurrentMembers
public void GetCurrentMembers(int offset, out IUnresolvedTypeDefinition currentType, out IUnresolvedMember currentMember)
{
//var document = engine.document;
var location = document.GetLocation(offset);
currentType = null;
foreach (var type in unresolvedFile.TopLevelTypeDefinitions) {
if (type.Region.Begin < location)
currentType = type;
}
currentType = FindInnerType (currentType, location);
// location is beyond last reported end region, now we need to check, if the end region changed
if (currentType != null && currentType.Region.End < location) {
if (!IsInsideType (currentType, location))
currentType = null;
}
currentMember = null;
if (currentType != null) {
foreach (var member in currentType.Members) {
if (member.Region.Begin < location && (currentMember == null || currentMember.Region.Begin < member.Region.Begin))
currentMember = member;
}
}
// location is beyond last reported end region, now we need to check, if the end region changed
// NOTE: Enums are a special case, there the "last" field needs to be treated as current member
if (currentMember != null && currentMember.Region.End < location && currentType.Kind != TypeKind.Enum) {
if (!IsInsideType (currentMember, location))
currentMember = null;
}/*
var stack = GetBracketStack (engine.GetMemberTextToCaret ().Item1);
if (stack.Count == 0)
currentMember = null;*/
}