Пример #1
0
 private string UnwrapName(IJsDeclaration declaration)
 {
     var current = declaration;
     while (current is Idioms.WrappedParent)
     {
         current = ((Idioms.WrappedParent)current).Parent;
     }
     return current.Name;
 }
Пример #2
0
        private string UnwrapName(IJsDeclaration declaration)
        {
            var current = declaration;

            while (current is Idioms.WrappedParent)
            {
                current = ((Idioms.WrappedParent)current).Parent;
            }
            return(current.Name);
        }
Пример #3
0
 private void VisitDeclaration(IJsDeclaration declaration)
 {
     if (declaration is JsParameter)
     {
         ((JsParameter)declaration).Accept(this);
     }
     else if (declaration is JsVariableDeclarator)
     {
         ((JsVariableDeclarator)declaration).Accept(this);
     }
 }
Пример #4
0
 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();
     }
 }
Пример #5
0
 public JsDeclarationReferenceExpression(IJsDeclaration declaration)
 {
     Declaration = declaration;
 }
Пример #6
0
        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));
                }
*/
            }
        }
Пример #7
0
 public ReferenceParameterDeclaration(IJsDeclaration declaration)
 {
     this.declaration = declaration;
 }
Пример #8
0
 public WrappedParent(IJsDeclaration parent)
 {
     this.parent = parent;
     Name = parent.Name;
 }