private protected virtual bool GetFirstCommentFrame(IFrameFrame root, out IFrameCommentFrame frame) { bool Found = false; frame = null; if (root is IFrameCommentFrame AsCommentFrame) { frame = AsCommentFrame; Found = true; } if (!Found && root is IFramePanelFrame AsPanelFrame) { foreach (IFrameFrame Item in AsPanelFrame.Items) { if (GetFirstCommentFrame(Item, out frame)) { Found = true; break; } } } return(Found); }
/// <summary> /// Gets the frame that creates cells associated to a comment in a state. /// </summary> /// <param name="state">The state.</param> public virtual IFrameCommentFrame GetCommentFrame(IFrameNodeState state) { // Call overloads of this method if they exist. ControllerTools.AssertNoOverride(this, typeof(FrameTemplateSet)); Type OwnerType = state.Node.GetType(); Type InterfaceType = NodeTreeHelper.NodeTypeToInterfaceType(OwnerType); IFrameNodeTemplate Template = NodeTypeToTemplate(InterfaceType); IFrameCommentFrame Frame = Template.GetCommentFrame(); return(Frame); }