protected override HtmlElement CreateDOMElementForDisplayMode(string displayMode) { switch (displayMode) { case "Small": _elmImage = new Image(); _elmImage.Style.Cursor = "default"; _elmImageCont = Utility.CreateClusteredImageContainerNew( ImgContainerSize.Size2by16, Properties.Image, Properties.ImageClass, _elmImage, true, false, Properties.ImageTop, Properties.ImageLeft ); _elmSmall = new Span(); _elmSmall.ClassName = "ms-cui-ctl ms-cui-ctl-small ms-cui-separator"; _elmSmall.AppendChild(_elmImageCont); return _elmSmall; default: EnsureValidDisplayMode(displayMode); break; } return null; }
public override void Dispose() { base.Dispose(); _elmImage = null; _elmImageCont = null; _elmSmall = null; }
public override void Dispose() { base.Dispose(); _elmLarge = null; _elmLargeImgCont = null; _elmLargeButton = null; _elmLargeMenuButton = null; _elmLargeArrowImg = null; _elmMedium = null; _elmMediumImgCont = null; _elmMediumButton = null; _elmMediumMenuButton = null; _elmMediumArrowImg = null; _elmSmall = null; _elmSmallImgCont = null; _elmSmallButton = null; _elmSmallMenuButton = null; _elmSmallArrowImg = null; }
internal override void AttachDOMElementsForDisplayMode(string displayMode) { Span elm = (Span)Browser.Document.GetById(Id + "-" + displayMode); StoreElementForDisplayMode(elm, displayMode); currentDisplayMode = displayMode; switch (displayMode) { case "Large": { if (!CUIUtility.IsNullOrUndefined(elm)) _elmLarge = elm; _elmLargeButton = (Anchor)_elmLarge.ChildNodes[0]; _elmLargeImgCont = (Span)_elmLargeButton.ChildNodes[0].ChildNodes[0]; _elmLargeMenuButton = (Anchor)_elmLarge.ChildNodes[1]; HtmlElement elmLargeLabel = (HtmlElement)_elmLargeMenuButton.ChildNodes[0]; _elmLargeArrowImg = null; // We might have a <br> and/or text nodes in here, so we have to search for the element we want HtmlElementCollection candidates = elmLargeLabel.GetElementsByTagName("span"); foreach (HtmlElement elt in candidates) { string tag = elt.TagName; if (CUIUtility.SafeString(tag) == "span") { _elmLargeArrowImg = (Image)elt.ChildNodes[0]; break; } } break; } case "Medium": if (!CUIUtility.IsNullOrUndefined(elm)) _elmMedium = elm; _elmMediumButton = (Anchor)_elmMedium.ChildNodes[0]; _elmMediumImgCont = (Span)_elmMediumButton.ChildNodes[0].ChildNodes[0]; _elmMediumMenuButton = (Anchor)_elmMedium.ChildNodes[1]; _elmMediumArrowImg = (Image)_elmMediumMenuButton.ChildNodes[1].ChildNodes[0]; break; case "Small": if (!CUIUtility.IsNullOrUndefined(elm)) _elmSmall = elm; _elmSmallButton = (Anchor)_elmSmall.ChildNodes[0]; _elmSmallImgCont = (Span)_elmSmallButton.ChildNodes[0].ChildNodes[0]; _elmSmallMenuButton = (Anchor)_elmSmall.ChildNodes[1]; _elmSmallArrowImg = (Image)_elmSmallMenuButton.ChildNodes[1].ChildNodes[0]; break; } }