public IHierarchicalArrangement GetArrangement(IProjectVersion version) { var mvzArrName = GetArrangementName(); var mvzArr = version.GetArrangement(mvzArrName); if (mvzArr == null) { var strSteel = version.GetArrangement("STR*STEEL"); mvzArr = strSteel.AddSubArrangement(mvzArrName); } return(mvzArr); }
private static ObjectBrowserNodeViewModel GetNode(IProjectVersion version, NapaArrangementBrowserViewModel vm, ObjectBrowserNodeViewModel root, IEnumerable <string> path) { if (!path.Any()) { return(root); } var children = GetChildren(root); ObjectBrowserItemViewModel node; if (children.TryGetValue(path.First(), out node)) { return(GetNode(version, vm, node as ObjectBrowserNodeViewModel, path.Skip(1))); } var arr = version.GetArrangement(root.Name); Napa.Alfred.EventProxy.WithDelayedEvents(() => { Napa.Alfred.EventProxy.WithDelayedGMEvents(() => { var subArr = GetSubArr(version, arr, path.First()); if (subArr == null) { throw new InvalidOperationException("Cannot create STR path " + string.Join(":", path)); } PopulateArrangement(vm, subArr, root); }); }); return(GetNode(version, vm, root, path)); }
private static IHierarchicalArrangement GetSubArr(IProjectVersion version, IHierarchicalArrangement parent, string name) { var subArr = version.GetArrangement(name); if (subArr == null) { subArr = parent.AddSubArrangement(name); } return(subArr); }