public void PerformLoad(TapestryNodeViewControl originator, TapestryNode nd) { TapestrySplitViewLoadCommand lc = new TapestrySplitViewLoadCommand(); if (originator == leftNodeView) { lc.LeftNode = leftNodeView.CurrentNode; lc.RightNode = nd; } else { lc.LeftNode = nd; lc.RightNode = rightNodeView.CurrentNode; } ResolveLoadCommand(lc); }
/// <summary> /// Will attempt to add the fragment as a child of this fragment /// keyed to the uri of the given fragment. If a fragment /// is already keyed to the given uri, the fragment will /// not be added and the method will return false (use SetChild(TapestryNode)) /// </summary> /// <param name="frg">the fragment to add as child to this fragment</param> /// <returns>true if Add was successful, false if not</returns> public bool AddChild(TapestryNode frg) { if (!uriToChildFragments.ContainsKey(frg.URI)) { uriToChildFragments.Add(frg.URI, frg); return true; } return false; }
/// <summary> /// Will add specified fragment as a child of this fragment /// overwriting any existing fragment keyed to the /// same URI as the given fragment /// </summary> /// <param name="frg">the fragment to add as child, overwriting URI key if necessary</param> public void SetChild(TapestryNode frg) { uriToChildFragments[frg.URI] = frg; }
public abstract bool Parallels(TapestryNode nd);
public override bool Parallels(TapestryNode nd) { throw new NotImplementedException(); }
public void LoadNode(TapestryNode nd) { ResolveContentControl(nd); currentNode = nd; }
private void ResolveContentControl(TapestryNode node) { if(node != null) { //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // IF YOU ADD A CASE HERE, // ADD IT TO IndexContentControls() ALSO! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! switch (node.NodeType) { case TapestryNodeType.Collection: if(node.Children().Count() < Configuration.NodeCollectionThreshHold()) { SetVisible(ccFragCloud); fragmentCloud.Display(node); } else { SetVisible(ccNodeList); nodeList.Display(node); } break; case TapestryNodeType.Audio: SetVisible(ccAudioNode); FileSystemNode nd = (FileSystemNode)node; audioNodeDisplay.Display(nd); break; case TapestryNodeType.Image: SetVisible(ccImageNode); FileSystemNode ind = (FileSystemNode)node; imageNodeDisplay.Display(ind); break; case TapestryNodeType.ChordProgressions: SetVisible(ccChordProgressionsNode); break; case TapestryNodeType.SynergyV5MasterList: SetVisible(ccSynergyV5MasterListNode); break; case TapestryNodeType.MediaMaster: SetVisible(ccMediaMasterNode); break; case TapestryNodeType.SynergyV5List: UI.Display.Message("SynergyV5List node awaiting implementation"); break; case TapestryNodeType.Chord: SetVisible(ccChordNode); ChordNode chordNode = (ChordNode)node; chordNodeDisplay.Display(chordNode); break; case TapestryNodeType.Cluster: SetVisible(ccClusterNode); ClusterNode clusterNode = (ClusterNode)node; clusterNodeDisplay.Display(clusterNode); break; case TapestryNodeType.NullCluster: SetVisible(ccClusterNode); clusterNodeDisplay.Display(null); break; default: SetVisible(ccFragment); nodeDisplayDefault.Display(node); break; } } else { SetVisible(null); } //if (frg.Children.Count() > 0) //{ // ccBranch.Visibility = Visibility.Visible; // ccLeaf.Visibility = Visibility.Collapsed; // fragmentCloud.Display(frg); //} //else //{ // ccBranch.Visibility = Visibility.Collapsed; // ccLeaf.Visibility = Visibility.Visible; // nodeDisplay.Display(frg); //} }