Exemplo n.º 1
0
 public PropertyViewModel(SDProperty property, TypeViewModel parent, ICoreConfigSection sharpDoxConfig)
     : base(property.Identifier, parent, sharpDoxConfig)
 {
     Text          = property.Name;
     Accessibility = property.Accessibility;
     Image         = string.Format("pack://application:,,,/SharpDox.GUI;component/Resources/Icons/Properties_{0}.png", Accessibility);
 }
Exemplo n.º 2
0
 public PropertyViewModel(SDProperty property, TypeViewModel parent, ObservableCollection <string> excludedIdentifiers)
     : base(property.Identifier, parent, excludedIdentifiers)
 {
     Text          = property.Name;
     Accessibility = property.Accessibility;
     Image         = string.Format("pack://application:,,,/SharpDox.Resources;component/Icons/Properties_{0}.png", Accessibility);
 }
Exemplo n.º 3
0
        private SDProperty GetParsedProperty(IPropertySymbol property)
        {
            var syntaxReference = property.DeclaringSyntaxReferences.Any() ? property.DeclaringSyntaxReferences.Single() : null;
            var sdProperty      = new SDProperty(property.GetIdentifier())
            {
                Name           = property.Name,
                DeclaringType  = _typeRefParser.GetParsedTypeReference(property.ContainingType),
                Accessibility  = property.DeclaredAccessibility.ToString().ToLower(),
                ReturnType     = _typeRefParser.GetParsedTypeReference(property.Type),
                CanGet         = property.GetMethod != null,
                CanSet         = property.SetMethod != null,
                IsAbstract     = property.IsAbstract,
                IsVirtual      = property.IsVirtual,
                IsOverride     = property.IsOverride,
                Documentations = DocumentationParser.ParseDocumentation(property),
                Region         = syntaxReference != null ? new SDRegion
                {
                    Start     = syntaxReference.Span.Start,
                    End       = syntaxReference.Span.End,
                    StartLine = syntaxReference.SyntaxTree.GetLineSpan(syntaxReference.Span).StartLinePosition.Line + 1,
                    EndLine   = syntaxReference.SyntaxTree.GetLineSpan(syntaxReference.Span).EndLinePosition.Line + 1,
                    FilePath  = syntaxReference.SyntaxTree.FilePath,
                    Filename  = Path.GetFileName(syntaxReference.SyntaxTree.FilePath)
                } : null
            };

            ParserOptions.SDRepository.AddMember(sdProperty);
            return(sdProperty);
        }
Exemplo n.º 4
0
        private SDProperty GetParsedProperty(IProperty property)
        {
            var sdProperty = new SDProperty(property.GetIdentifier())
            {
                Name          = property.Name,
                DeclaringType = _typeParser.GetParsedType(property.DeclaringType),
                Accessibility = property.Accessibility.ToString().ToLower(),
                ReturnType    = _typeParser.GetParsedType(property.ReturnType),
                CanGet        = property.CanGet,
                CanSet        = property.CanSet,
                IsAbstract    = property.IsAbstract,
                IsVirtual     = property.IsVirtual,
                IsOverride    = property.IsOverride,
                Documentation = _documentationParser.ParseDocumentation(property)
            };

            _repository.AddMember(sdProperty);
            return(sdProperty);
        }
Exemplo n.º 5
0
        private SDProperty GetParsedProperty(IPropertySymbol property)
        {
            var sdProperty = new SDProperty(property.GetIdentifier())
            {
                Name           = property.Name,
                DeclaringType  = _typeRefParser.GetParsedTypeReference(property.ContainingType),
                Accessibility  = property.DeclaredAccessibility.ToString().ToLower(),
                ReturnType     = _typeRefParser.GetParsedTypeReference(property.Type),
                CanGet         = property.GetMethod != null,
                CanSet         = property.SetMethod != null,
                IsAbstract     = property.IsAbstract,
                IsVirtual      = property.IsVirtual,
                IsOverride     = property.IsOverride,
                Documentations = DocumentationParser.ParseDocumentation(property)
            };

            ParserOptions.SDRepository.AddMember(sdProperty);
            return(sdProperty);
        }