private void PaintBordersAndRamps(Color c) { Transform borders = transform.Find("EnvironmentCommon/Borders"); foreach (Transform t in borders.GetComponentsInChildren <Transform>()) { SpriteRenderer sr = t.GetComponent <SpriteRenderer> (); if (sr != null) { sr.color = c; } } Transform specificEmploi = transform.Find("EnvironmentSpecificEmploi"); if (specificEmploi != null) { foreach (Transform t in specificEmploi.GetComponentsInChildren <Transform>()) { SpriteRenderer sr = t.GetComponent <SpriteRenderer> (); FlipControl p = t.parent.GetComponent <FlipControl> (); if (sr != null && p == null) { sr.color = c; } } } }
/// <summary> /// Resolves the ControlTemplate parts. /// </summary> protected override bool ApplyTemplateCore() { bool applied = base.ApplyTemplateCore(); this.layoutRoot = this.GetTemplatePartField <UIElement>("PART_LayoutRoot"); applied = applied && this.layoutRoot != null; this.flipControl = this.GetTemplatePartField <FlipControl>("PART_FlipControl"); applied = applied && this.flipControl != null; return(applied); }
/// <summary> /// Initializes the PART_Panel template part. /// </summary> protected override bool ApplyTemplateCore() { bool applied = base.ApplyTemplateCore(); this.slideControl = this.GetTemplatePartField <SlideControl>("PART_SlideControl"); applied = applied && this.slideControl != null; this.flipControl = this.GetTemplatePartField <FlipControl>("PART_FlipControl"); applied = applied && this.flipControl != null; return(applied); }
/// <summary> /// Initializes a new instance of the FlipControlAutomationPeer class. /// </summary> /// <param name="owner">The owner.</param> public FlipControlAutomationPeer(FlipControl owner) : base(owner) { }