public CodeReferenceEdgeType(
     CodeReferenceType type,
     CodeReferenceDirection direction)
 {
     Type      = type;
     Direction = direction;
 }
Exemple #2
0
        void Parse()
        {
            Match m = codeReferenceRx.Match(DdueCodeReference);

            if (m.Success)
            {
                _exampleName = m.Groups["exampleName"].Value;
                _snippetId   = m.Groups["snippetId"].Value;
                _examplePath = m.Groups["examplePath"].Value;
                _title       = m.Groups["title"].Value;
                // The default value of _type is CodeReferenceType.Invalid, if it isn't set in the following
                // block.
                if (m.Groups["type"].Length > 0)
                {
                    try {
                        _type = (CodeReferenceType)Enum.Parse(typeof(CodeReferenceType), m.Groups["type"].Value, true);
                    }
                    catch (ArgumentException) {
                        // _type = CodeReferenceType.Invalid
                    }
                }
                else if (m.Groups["exampleName"].Length > 0 && m.Groups["snippetId"].Length > 0)
                {
                    _type = CodeReferenceType.Snippet;
                }
            }
        }
 /// <summary>
 /// Only outbound references have a CodeRange. All outbound references should have a code range even if the
 /// range is unknown (-1), but inbound references have no range at all (null).
 /// </summary>
 public CodeReferenceEndpoint(
     CodeReferenceType type,
     CodebaseElementName endpoint)
 {
     Type     = type;
     Endpoint = endpoint;
 }