CSharpUML.UmlAttribute.Matches C# (CSharp) Method

Matches() public static method

public static Matches ( CSharpBlock block ) : bool
block CSharpBlock
return bool
        public static bool Matches(CSharpBlock block)
        {
            string line = block.Name;

            // index operator?
            if (line.Contains ("this [") && line.Contains ("]")) {
                return false;
            }

            // normal method?
            int indexBracketOpen = line.IndexOf ("(");
            int indexBracketClose = line.IndexOf (")");
            int indexEqualSign = line.IndexOf ("=");
            if (indexBracketOpen == -1 && indexBracketClose == -1) {
                return true;
            } else if (indexEqualSign < indexBracketOpen) {
                return true;
            } else {
                return false;
            }
        }

Same methods

UmlAttribute::Matches ( UmlBlock block ) : bool

Usage Example

Example #1
0
 public IEnumerable <IUmlObject> ParseContent(IEnumerable <UmlBlock> blocks)
 {
     foreach (UmlBlock subblock in blocks)
     {
         if (UmlClass.Matches(subblock))
         {
             yield return(new UmlClass(subblock));
         }
         else if (UmlEnum.Matches(subblock))
         {
             yield return(new UmlEnum(subblock));
         }
         else if (UmlMethod.Matches(subblock))
         {
             yield return(new UmlMethod(subblock, this));
         }
         else if (UmlAttribute.Matches(subblock))
         {
             yield return(new UmlAttribute(subblock, this));
         }
     }
 }
All Usage Examples Of CSharpUML.UmlAttribute::Matches