/// <summary> /// Recursively updates the name map for a given object, mapping an identifier to a .Net object. /// </summary> /// <param name="nameMap">The name map being constructed</param> /// <param name="currentObject">The object to add</param> private void BuildNameMap(Dictionary <String, DotNetObject> nameMap, DotNetObject currentObject) { if (currentObject == null || currentObject.GetFullName() == null) { return; } nameMap[currentObject.GetFullName()] = currentObject; currentObject?.Children?.ForEach(x => this.BuildNameMap(nameMap, x)); }
/// <summary> /// Adds a .Net object to the project explorer. /// </summary> /// <param name="dotNetObjectViewModel">The view model of the .Net object.</param> private void AddDotNetObject(DotNetObjectViewModel dotNetObjectViewModel) { DotNetObject dotNetObject = dotNetObjectViewModel.DotNetObject; DotNetItem dotnetItem = new DotNetItem( dotNetObject.Name, dotNetObject.ElementType == DataType.Boolean ? DataType.Byte : dotNetObject.ElementType, dotNetObject.GetFullName()); ProjectExplorerViewModel.GetInstance().AddProjectItems(dotnetItem); }
/// <summary> /// Adds a .Net object to the project explorer. /// </summary> /// <param name="dotNetObjectViewModel">The view model of the .Net object.</param> private void AddDotNetObject(DotNetObjectViewModel dotNetObjectViewModel) { DotNetObject dotNetObject = dotNetObjectViewModel.DotNetObject; DotNetItem dotnetItem = new DotNetItem( dotNetObject.Name, dotNetObject.ElementType == typeof(Boolean) ? typeof(Byte) : dotNetObject.ElementType, dotNetObject.GetFullName() ); ProjectExplorerViewModel.GetInstance().AddNewProjectItems(true, dotnetItem); }
/// <summary> /// Adds a .Net object to the project explorer. /// </summary> /// <param name="dotNetObjectViewModel">The view model of the .Net object.</param> private void AddDotNetObject(DotNetObjectViewModel dotNetObjectViewModel) { DotNetObject dotNetObject = dotNetObjectViewModel.DotNetObject; AddressItem addressItem = new AddressItem(); addressItem.Description = dotNetObject.Name; addressItem.ElementType = dotNetObject.ElementType == typeof(Boolean) ? typeof(Byte) : dotNetObject.ElementType; addressItem.BaseIdentifier = dotNetObject.GetFullName(); addressItem.ResolveType = AddressResolver.ResolveTypeEnum.DotNet; ProjectExplorerViewModel.GetInstance().AddNewProjectItems(true, addressItem); }