Skip to content

Commit

Permalink
Fixed issue with CRefPath.Parse method not correctly parsing indexor …
Browse files Browse the repository at this point in the history
…properties.
  • Loading branch information
barry-jones committed Nov 12, 2014
1 parent 42ca29b commit 6151a75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
17 changes: 5 additions & 12 deletions Source/TheBoxSoftware.API.LiveDocumenter/CRefPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,15 @@ private void Parse()
if (this.PathType != CRefTypes.Error)
{
string[] items;
if (this.PathType != CRefTypes.Method)
int startParams = this.crefPath.IndexOf('(');
if (startParams == -1)
{
items = this.crefPath.Substring(this.crefPath.IndexOf(':') + 1).Split('.');
}
else
else
{
int startParams = this.crefPath.IndexOf('(');
if (startParams == -1)
{
items = this.crefPath.Substring(this.crefPath.IndexOf(':') + 1).Split('.');
}
else
{
items = this.crefPath.Substring(this.crefPath.IndexOf(':') + 1, this.crefPath.IndexOf('(') - 2).Split('.');
this.Parameters = this.crefPath.Substring(this.crefPath.IndexOf('('));
}
items = this.crefPath.Substring(this.crefPath.IndexOf(':') + 1, this.crefPath.IndexOf('(') - 2).Split('.');
this.Parameters = this.crefPath.Substring(this.crefPath.IndexOf('('));
}

switch (this.PathType)
Expand Down
13 changes: 4 additions & 9 deletions Source/TheBoxSoftware.Reflection/Comments/CRefPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,13 @@ private void Parse()
if (this.PathType != CRefTypes.Error)
{
string[] items;
if (this.PathType != CRefTypes.Method) {
int startParams = this.crefPath.IndexOf('(');
if (startParams == -1) {
items = this.crefPath.Substring(this.crefPath.IndexOf(':') + 1).Split('.');
}
else {
int startParams = this.crefPath.IndexOf('(');
if (startParams == -1) {
items = this.crefPath.Substring(this.crefPath.IndexOf(':') + 1).Split('.');
}
else {
items = this.crefPath.Substring(this.crefPath.IndexOf(':') + 1, this.crefPath.IndexOf('(') - 2).Split('.');
this.Parameters = this.crefPath.Substring(this.crefPath.IndexOf('('));
}
items = this.crefPath.Substring(this.crefPath.IndexOf(':') + 1, this.crefPath.IndexOf('(') - 2).Split('.');
this.Parameters = this.crefPath.Substring(this.crefPath.IndexOf('('));
}

switch (this.PathType) {
Expand Down

0 comments on commit 6151a75

Please sign in to comment.