Skip to content

Commit

Permalink
add disambiguation namespaces for intellisense
Browse files Browse the repository at this point in the history
  • Loading branch information
rdavisau committed Jun 7, 2015
1 parent 7b56ea1 commit e40032b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions JsonDataContextDriver/JsonDynamicDataContextDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,20 @@ public override IEnumerable<string> GetAssembliesToAdd(IConnectionInfo cxInfo)
.Concat(new[] {typeof (JsonDataContextBase).Assembly.Location});
}

public override IEnumerable<string> GetNamespacesToAdd(IConnectionInfo cxInfo)
{
return base.GetNamespacesToAdd(cxInfo)
.Concat(_nameSpacesToAdd);
}

private List<string> _nameSpacesToAdd = new List<string>();

public override List<ExplorerItem> GetSchemaAndBuildAssembly(IConnectionInfo cxInfo,
AssemblyName assemblyToBuild, ref string nameSpace,
ref string typeName)
{
_nameSpacesToAdd = new List<string>();

var xInputs = cxInfo.DriverData.Element("inputDefs");
if (xInputs == null)
return new List<ExplorerItem>();
Expand Down Expand Up @@ -234,6 +244,8 @@ public List<GeneratedClass> GetClassesForInput(JsonInput input, string nameSpace
classDef.Substring(classDef.IndexOf(String.Format("namespace {0}", nameSpace),
StringComparison.Ordinal));

_nameSpacesToAdd.Add(finalNamespace);

return new GeneratedClass
{
Namespace = finalNamespace,
Expand Down

0 comments on commit e40032b

Please sign in to comment.