public void SetViews(IEnumerable <string> viewIdentifiers) { var identifiers = viewIdentifiers as string[] ?? viewIdentifiers.ToArray(); if (identifiers.Any()) { var guid = identifiers.ElementAt(0); PrimaryView = viewManager.GetInstance(guid); PrimaryView.SetLogger(log); PrimaryTitle = viewManager.Get(guid).Name; } if (identifiers.Length >= 2) { var guid = identifiers.ElementAt(1); SecondaryView = viewManager.GetInstance(guid); SecondaryView.SetLogger(log); SecondaryTitle = viewManager.Get(guid).Name; } if (identifiers.Length == 1) { CollapseSecondaryView(); } }
void CreateHorizontalWithVertBot(PrimaryView a_top, PrimaryView a_botL, PrimaryView a_botR) { DeleteSecondaryPanels(); parentPanel.OnRightPanelResize.RemoveAllListeners(); PanelWithHorizontalSplitter l_panelHS = Instantiate(PanelWithHorizontalSplitterPrefab).GetComponent <PanelWithHorizontalSplitter>(); l_panelHS.transform.SetParent(parentPanel.rightPanel, false); parentPanel.OnRightPanelResize.AddListener(l_panelHS.OnParentPanelResize); l_panelHS.MoveSplitterToCenter(); a_top.transform.SetParent(l_panelHS.topPanel.transform, false); l_panelHS.OnTopPanelResize.AddListener(a_top.OnParentPanelResize); PanelWithVerticalSplitter l_panelVS = Instantiate(PanelWithVerticalSplitterPrefab).GetComponent <PanelWithVerticalSplitter>(); l_panelVS.transform.SetParent(l_panelHS.bottomPanel.transform, false); l_panelVS.MoveSplitterToCenter(); l_panelHS.OnBottomPanelResize.AddListener(l_panelVS.OnParentPanelResize); a_botL.transform.SetParent(l_panelVS.leftPanel.transform, false); a_botR.transform.SetParent(l_panelVS.rightPanel.transform, false); l_panelVS.OnLeftPanelResize.AddListener(a_botL.OnParentPanelResize); l_panelVS.OnRightPanelResize.AddListener(a_botR.OnParentPanelResize); parentPanel.AllignPanelsWithSplitter(); }
void OnViewButtonClick(PrimaryView a_clickedView) { bool l_onlyAvailable = false; foreach (var l_view in i_primaryPanels) { if (l_view != null) { PrimaryView l_viewC = l_view.GetComponent <PrimaryView>(); if (l_viewC == a_clickedView) { continue; } l_onlyAvailable = l_onlyAvailable || l_viewC.isActiveAndEnabled; } } if (!l_onlyAvailable) { return; } if (a_clickedView.isActiveAndEnabled) { a_clickedView.SetActiveAndSelect(false); } else { a_clickedView.SetActiveAndSelect(true); } ReArrangeLayout(firstView != null ? (firstView.isActiveAndEnabled ? firstView : null) : null, secondView != null ? (secondView.isActiveAndEnabled ? secondView : null) : null, thirdView != null ? (thirdView.isActiveAndEnabled ? thirdView : null) : null, fourthView != null ? (fourthView.isActiveAndEnabled ? fourthView : null) : null); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Class != null) { hashCode = hashCode * 59 + Class.GetHashCode(); } if (AssignedLabels != null) { hashCode = hashCode * 59 + AssignedLabels.GetHashCode(); } if (Mode != null) { hashCode = hashCode * 59 + Mode.GetHashCode(); } if (NodeDescription != null) { hashCode = hashCode * 59 + NodeDescription.GetHashCode(); } if (NodeName != null) { hashCode = hashCode * 59 + NodeName.GetHashCode(); } hashCode = hashCode * 59 + NumExecutors.GetHashCode(); if (Description != null) { hashCode = hashCode * 59 + Description.GetHashCode(); } if (Jobs != null) { hashCode = hashCode * 59 + Jobs.GetHashCode(); } if (PrimaryView != null) { hashCode = hashCode * 59 + PrimaryView.GetHashCode(); } hashCode = hashCode * 59 + QuietingDown.GetHashCode(); hashCode = hashCode * 59 + SlaveAgentPort.GetHashCode(); if (UnlabeledLoad != null) { hashCode = hashCode * 59 + UnlabeledLoad.GetHashCode(); } hashCode = hashCode * 59 + UseCrumbs.GetHashCode(); hashCode = hashCode * 59 + UseSecurity.GetHashCode(); if (Views != null) { hashCode = hashCode * 59 + Views.GetHashCode(); } return(hashCode); } }
void CreateSingleView(PrimaryView a_view) { DeleteSecondaryPanels(); a_view.transform.SetParent(parentPanel.rightPanel, false); parentPanel.OnRightPanelResize.RemoveAllListeners(); parentPanel.OnRightPanelResize.AddListener(a_view.OnParentPanelResize); parentPanel.AllignPanelsWithSplitter(); }
void CreateTwoVertical(PrimaryView a_left, PrimaryView a_right) { DeleteSecondaryPanels(); parentPanel.OnRightPanelResize.RemoveAllListeners(); PanelWithVerticalSplitter l_panelVS = Instantiate(PanelWithVerticalSplitterPrefab).GetComponent <PanelWithVerticalSplitter>(); l_panelVS.transform.SetParent(parentPanel.rightPanel, false); parentPanel.OnRightPanelResize.AddListener(l_panelVS.OnParentPanelResize); l_panelVS.MoveSplitterToCenter(); a_left.transform.SetParent(l_panelVS.leftPanel.transform, false); a_right.transform.SetParent(l_panelVS.rightPanel.transform, false); l_panelVS.OnLeftPanelResize.AddListener(a_left.OnParentPanelResize); l_panelVS.OnRightPanelResize.AddListener(a_right.OnParentPanelResize); parentPanel.AllignPanelsWithSplitter(); }
void CreateTwoHorizontal(PrimaryView a_btm, PrimaryView a_top) { DeleteSecondaryPanels(); parentPanel.OnTopPanelResize.RemoveAllListeners(); PanelWithHorizontalSplitter l_panelHS = Instantiate(PanelWithHorizontalSplitterPrefab).GetComponent <PanelWithHorizontalSplitter>(); l_panelHS.transform.SetParent(parentPanel.topPanel, false); parentPanel.OnTopPanelResize.AddListener(l_panelHS.OnParentPanelResize); l_panelHS.MoveSplitterToCenter(); a_btm.transform.SetParent(l_panelHS.bottomPanel.transform, false); a_top.transform.SetParent(l_panelHS.topPanel.transform, false); l_panelHS.OnBottomPanelResize.AddListener(a_btm.OnParentPanelResize); l_panelHS.OnTopPanelResize.AddListener(a_top.OnParentPanelResize); parentPanel.AllignPanelsWithSplitter(); }
public void SetViews(IEnumerable <string> viewIdentifiers) { if (viewIdentifiers != null && viewIdentifiers.Count() >= 1) { string guid = viewIdentifiers.ElementAt(0); PrimaryView = viewManager.GetInstance(guid); PrimaryView.SetLogger(log); PrimaryTitle = viewManager.Get(guid).Name; } if (viewIdentifiers != null && viewIdentifiers.Count() >= 2) { string guid = viewIdentifiers.ElementAt(1); SecondaryView = viewManager.GetInstance(guid); SecondaryView.SetLogger(log); SecondaryTitle = viewManager.Get(guid).Name; } if (viewIdentifiers != null && viewIdentifiers.Count() == 1) { CollapseSecondaryView(); } }
/// <summary> /// Returns true if Hudson instances are equal /// </summary> /// <param name="other">Instance of Hudson to be compared</param> /// <returns>Boolean</returns> public bool Equals(Hudson other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Class == other.Class || Class != null && Class.Equals(other.Class) ) && ( AssignedLabels == other.AssignedLabels || AssignedLabels != null && other.AssignedLabels != null && AssignedLabels.SequenceEqual(other.AssignedLabels) ) && ( Mode == other.Mode || Mode != null && Mode.Equals(other.Mode) ) && ( NodeDescription == other.NodeDescription || NodeDescription != null && NodeDescription.Equals(other.NodeDescription) ) && ( NodeName == other.NodeName || NodeName != null && NodeName.Equals(other.NodeName) ) && ( NumExecutors == other.NumExecutors || NumExecutors.Equals(other.NumExecutors) ) && ( Description == other.Description || Description != null && Description.Equals(other.Description) ) && ( Jobs == other.Jobs || Jobs != null && other.Jobs != null && Jobs.SequenceEqual(other.Jobs) ) && ( PrimaryView == other.PrimaryView || PrimaryView != null && PrimaryView.Equals(other.PrimaryView) ) && ( QuietingDown == other.QuietingDown || QuietingDown.Equals(other.QuietingDown) ) && ( SlaveAgentPort == other.SlaveAgentPort || SlaveAgentPort.Equals(other.SlaveAgentPort) ) && ( UnlabeledLoad == other.UnlabeledLoad || UnlabeledLoad != null && UnlabeledLoad.Equals(other.UnlabeledLoad) ) && ( UseCrumbs == other.UseCrumbs || UseCrumbs.Equals(other.UseCrumbs) ) && ( UseSecurity == other.UseSecurity || UseSecurity.Equals(other.UseSecurity) ) && ( Views == other.Views || Views != null && other.Views != null && Views.SequenceEqual(other.Views) )); }
void ReArrangeLayout(PrimaryView a_obj1, PrimaryView a_obj2, PrimaryView a_obj3, PrimaryView a_obj4) { if (a_obj1 != null && a_obj2 == null && a_obj3 == null && a_obj4 == null) { CreateSingleView(a_obj1); } else if (a_obj1 == null && a_obj2 != null && a_obj3 == null && a_obj4 == null) { CreateSingleView(a_obj2); } else if (a_obj1 == null && a_obj2 == null && a_obj3 != null && a_obj4 == null) { CreateSingleView(a_obj3); } else if (a_obj1 == null && a_obj2 == null && a_obj3 == null && a_obj4 != null) { CreateSingleView(a_obj4); } else if (a_obj1 != null && a_obj2 == null && a_obj3 != null && a_obj4 == null) { CreateTwoVertical(a_obj1, a_obj3); } else if (a_obj1 != null && a_obj2 != null && a_obj3 == null && a_obj4 == null) { CreateTwoVertical(a_obj1, a_obj2); } else if (a_obj1 == null && a_obj2 != null && a_obj3 == null && a_obj4 != null) { CreateTwoVertical(a_obj4, a_obj2); } else if (a_obj1 == null && a_obj2 == null && a_obj3 != null && a_obj4 != null) { CreateTwoVertical(a_obj4, a_obj3); } else if (a_obj1 != null && a_obj2 == null && a_obj3 != null && a_obj4 != null) { CreateTwoHorizontal(a_obj1, a_obj4); } else if (a_obj1 == null && a_obj2 != null && a_obj3 != null && a_obj4 == null) { CreateTwoHorizontal(a_obj2, a_obj3); } else if (a_obj1 != null && a_obj2 != null && a_obj3 != null && a_obj4 == null) { CreateHorizontalWithVertBot(a_obj3, a_obj1, a_obj2); } else if (a_obj1 != null && a_obj2 != null && a_obj3 == null && a_obj4 != null) { CreateHorizontalWithVertBot(a_obj4, a_obj1, a_obj2); } else if (a_obj1 != null && a_obj2 == null && a_obj3 != null && a_obj4 != null) { CreateHorizontalWithVertTop(a_obj1, a_obj4, a_obj3); } else if (a_obj1 == null && a_obj2 != null && a_obj3 != null && a_obj4 != null) { CreateHorizontalWithVertTop(a_obj2, a_obj4, a_obj3); } else { CreateFull(); } }