예제 #1
0
            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);
            }
예제 #2
0
        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));
        }
예제 #3
0
        private static IHierarchicalArrangement GetSubArr(IProjectVersion version,
                                                          IHierarchicalArrangement parent, string name)
        {
            var subArr = version.GetArrangement(name);

            if (subArr == null)
            {
                subArr = parent.AddSubArrangement(name);
            }
            return(subArr);
        }