private string UnwrapName(IJsDeclaration declaration) { var current = declaration; while (current is Idioms.WrappedParent) { current = ((Idioms.WrappedParent)current).Parent; } return current.Name; }
private string UnwrapName(IJsDeclaration declaration) { var current = declaration; while (current is Idioms.WrappedParent) { current = ((Idioms.WrappedParent)current).Parent; } return(current.Name); }
private void VisitDeclaration(IJsDeclaration declaration) { if (declaration is JsParameter) { ((JsParameter)declaration).Accept(this); } else if (declaration is JsVariableDeclarator) { ((JsVariableDeclarator)declaration).Accept(this); } }
private JsNode VisitDeclaration(IJsDeclaration declaration) { if (declaration is JsParameter) { return(((JsParameter)declaration).Accept(this)); } else if (declaration is JsVariableDeclarator) { return(((JsVariableDeclarator)declaration).Accept(this)); } else { throw new Exception(); } }
public JsDeclarationReferenceExpression(IJsDeclaration declaration) { Declaration = declaration; }
public void ImplementInterfaceOnAdhocObject(JsBlockStatement block, IJsDeclaration declaration, ITypeSymbol interfaceType, IDictionary<IMethodSymbol, JsExpression> methodImplementations) { foreach (var member in interfaceType.GetMembers().Where(x => Equals(x.ContainingType, interfaceType))) { if (member is IMethodSymbol) { var method = (IMethodSymbol)member; var implementation = methodImplementations[method]; block.Add(MapInterfaceMethod(declaration.GetReference(), method, implementation)); } /* else if (member is IPropertySymbol) { var property = (IPropertySymbol)member; if (property.GetMethod != null) { var getter = methodImplementations[property.GetMethod]; block.Add(MapInterfaceMethod(declaration.GetReference(), property.GetMethod, getter)); } if (property.SetMethod != null) { var setter = methodImplementations[property.SetMethod]; block.Add(MapInterfaceMethod(declaration.GetReference(), property.SetMethod, setter)); } } else if (member is IEventSymbol) { var @event = (IEventSymbol)member; var adder = methodImplementations[@event.AddMethod]; var remover = methodImplementations[@event.RemoveMethod]; block.Add(MapInterfaceMethod(declaration.GetReference(), @event.AddMethod, adder)); block.Add(MapInterfaceMethod(declaration.GetReference(), @event.RemoveMethod, remover)); } */ } }
public ReferenceParameterDeclaration(IJsDeclaration declaration) { this.declaration = declaration; }
public WrappedParent(IJsDeclaration parent) { this.parent = parent; Name = parent.Name; }