Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VB6UnresolvedMethod"/> class.
 /// </summary>
 /// <param name="method">The instance of <see cref="IVbMethod"/> that is the source of this entity.</param>
 /// <param name="file">The file that is the source of this entity.</param>
 /// <param name="typeReference">The <see cref="IUnresolvedTypeReference"/> that this member is a child of. May be null.</param>
 /// <param name="typeDefinition">The <see cref="IUnresolvedTypeDefinition"/> that this entity is a child of. May be null.</param>
 internal VB6UnresolvedMethod(IVbMethod method, IUnresolvedFile file, ITypeReference typeReference, IUnresolvedTypeDefinition typeDefinition)
     : base(method, file, typeReference, typeDefinition)
 {
     if (method == null)
     {
         throw new ArgumentNullException("method");
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VB6UnresolvedMethod"/> class.
 /// </summary>
 /// <param name="method">The instance of <see cref="IVbMethod"/> that is the source of this entity.</param>
 /// <param name="file">The file that is the source of this entity.</param>
 /// <param name="typeReference">The <see cref="IUnresolvedTypeReference"/> that this member is a child of. May be null.</param>
 /// <param name="typeDefinition">The <see cref="IUnresolvedTypeDefinition"/> that this entity is a child of. May be null.</param>
 internal VB6UnresolvedMethod(IVbMethod method, IUnresolvedFile file, ITypeReference typeReference, IUnresolvedTypeDefinition typeDefinition)
     : base(method, file, typeReference, typeDefinition)
 {
     if (method == null)
     {
         throw new ArgumentNullException("method");
     }
 }
Exemplo n.º 3
0
        protected override DomRegion GetRegion()
        {
            IVbMethod method = (IVbMethod)this.Member;

            int startLine = method.Location.Line;
            int startCol  = method.Location.Column;
            int endLine   = startLine;
            int endCol    = startCol;

            if (method.EndStatementLocation != null)
            {
                endLine = method.EndStatementLocation.Line;
                endCol  = method.EndStatementLocation.Column;
            }

            return(new DomRegion(startLine, startCol, endLine, endCol));
        }
Exemplo n.º 4
0
        private void DisplayElementProperties(object tag)
        {
            if (tag == null)
            {
                return;
            }

            if (tag is ClassElement || tag is ModuleElement || tag is FormElement)
            {
                try
                {
                    ElementBase element = (ElementBase)tag;

                    using (Stream stream = _fileReader.Read(element, _project))
                    {
                        VbPartitionedFile content = _fileReader.ReadPartitionedFile(element, stream);
                        txtEdit.Text = content.Source;
                    }
                }
                catch (Exception)
                {
                }
            }
            else
            {
                IVbMember member = tag as IVbMember;
                if (member != null)
                {
                    AddPropertyListViewItem("(Declaration)", member.ToVbDeclaration());
                    AddPropertyListViewItem("(Member type)", member.GetType().Name);

                    AddPropertyListViewItem("Name", member.Name);
                    AddPropertyListViewItem("Line", member.Location.Line);
                    AddPropertyListViewItem("Column", member.Location.Column);
                    AddPropertyListViewItem("Visibility", member.Visibility);

                    IVbMethod method = member as IVbMethod;
                    if (method != null)
                    {
                        AddPropertyListViewItem("Kind", method.MethodKind);
                        AddPropertyListViewItem("Return type", method.ReturnType.TypeName);

                        AddPropertyListViewItem("End Line", method.EndStatementLocation.Line);
                        AddPropertyListViewItem("End Column", method.EndStatementLocation.Column);

                        AddPropertyListViewItem("(Parameter count)", method.Parameters.Count);
                        for (int i = 0; i < method.Parameters.Count; i++)
                        {
                            IVbParameter parameter = method.Parameters[i];

                            AddPropertyListViewItem(string.Format("Param {0} (Declaration)", i), parameter.ToVbDeclaration());
                            AddPropertyListViewItem(string.Format("Param {0}: Access", i), parameter.Access);
                            AddPropertyListViewItem(string.Format("Param {0}: Name", i), parameter.Name);
                            AddPropertyListViewItem(string.Format("Param {0}: Line", i), parameter.Location.Line);
                            AddPropertyListViewItem(string.Format("Param {0}: Column", i), parameter.Location.Column);
                            AddPropertyListViewItem(string.Format("Param {0}: Type", i), parameter.Type.TypeName);

                            if (parameter.IsOptional)
                            {
                                AddPropertyListViewItem(string.Format("Param {0}: Is optional", i), true);
                                AddPropertyListViewItem(string.Format("Param {0}: Default value", i), parameter.OptionalDefaultValue);
                            }
                        }
                    }

                    IVbAttribute attribute = member as IVbAttribute;
                    if (attribute != null)
                    {
                        AddPropertyListViewItem("Value", attribute.Value);
                    }
                }
                else
                {
                    txtEdit.Clear();
                }
            }
        }
Exemplo n.º 5
0
        protected override DomRegion GetRegion()
        {
            IVbMethod method = (IVbMethod)this.Member;

            return(new DomRegion(method.Location.Line, method.Location.Column, method.EndStatementLocation.Line, method.EndStatementLocation.Column));
        }