public Feature(FeaturePanel panel, FeatureDetail detail) { this.Children = new List <FTreeItem>(); this.Content = detail.DisplayName; this.Panel = panel; this.Detail = detail; this.TParent = null; this.m_selected = false; this.Loaded += new RoutedEventHandler(Feature_Loaded); }
public void InitializeFromModel(IModel model) { List <FTreeItem> rootFeatures = new List <FTreeItem>(); Queue <InitializationWorkItem> workItemQueue = new Queue <InitializationWorkItem>( from Profile profile in model.ProfilesRaw where profile.Parent.Parent == null select new InitializationWorkItem() { Profile = profile } ); while (workItemQueue.Count > 0) { InitializationWorkItem workItem = workItemQueue.Dequeue(); MSModel.Feature profile = workItem.Profile as MSModel.Feature; FeatureDetail fd = new FeatureDetail(profile); FTreeItem treeItem; if (profile.IsPropertyFeature) { treeItem = new Property(this, fd); } else { treeItem = new Feature(this, fd); } if (workItem.ParentTreeItem != null) { workItem.ParentTreeItem.Add(treeItem); } else { rootFeatures.Add(treeItem); } foreach (Profile childProfile in profile.Children) { workItemQueue.Enqueue(new InitializationWorkItem() { ParentTreeItem = treeItem, Profile = childProfile }); } } foreach (Feature f in rootFeatures) { StackPanel p = new StackPanel(); f.TabItem = new TabItem(); f.TabItem.Header = f.Content; f.TabItem.Content = p; f.HelpWin = this.HelpWin; this.Items.Add(f.TabItem); f.RecurseFeature("", p); f.TreeChange += OnTreeChange; this.BaseFeatures.Add(f); } this.SelectedItem = rootFeatures.First().TabItem; }
public Property(FeaturePanel panel, FeatureDetail detail) { this.Panel = panel; this.Detail = detail; this.Children = new List <FTreeItem>(); }