/// <summary> /// Performs the business logic for adding the Parent relationship between the person and the parents. /// </summary> public static void AddParent(PeopleCollection family, Person person, ParentSet parentSet) { // First add child to parents. family.AddChild(parentSet.FirstParent, person, ParentChildModifier.Natural); family.AddChild(parentSet.SecondParent, person, ParentChildModifier.Natural); // Next update the siblings. Get the list of full siblings for the person. // A full sibling is a sibling that has both parents in common. List<Person> siblings = GetChildren(parentSet); foreach (Person sibling in siblings) { if (sibling != person) family.AddSibling(person, sibling); } }
public ScriptContainer() { InitializeComponent(); AutoSize = true; parentStatus = ParentSet.None; status = new Label(); status.Text = "Waiting for video"; panel = new Panel(); panel.Controls.Add(status); Controls.Add(panel); windowMon = new Timer(); windowMon.Interval = 10; windowMon.Tick += CheckPythonWindows; windowMon.Start(); Disposed += containerClosing; }
public ScriptContainer() { InitializeComponent(); AutoSize = true; parentStatus = ParentSet.None; status = new Label(); status.Text = "Waiting for video"; panel = new Panel(); panel.Controls.Add(status); Controls.Add(panel); windowMon = new Timer(); windowMon.Interval = 10; windowMon.Tick += CheckPythonWindows; windowMon.Start(); Disposed += containerClosing; }
private void CheckPythonWindows(object sender, EventArgs e) { foreach (Process proc in Process.GetProcessesByName("python")) { switch (proc.MainWindowTitle) { case "video": if (parentStatus != ParentSet.Video) { EmbedWindow(proc); } parentStatus = ParentSet.Video; status.Text = "Waiting for adjustment window"; break; case "Adjustment": if (parentStatus != ParentSet.Adjustment) { EmbedWindow(proc); } parentStatus = ParentSet.Adjustment; status.Text = "Waiting for outputs"; break; case "Outputs": if (parentStatus != ParentSet.Outputs) { EmbedWindow(proc); } parentStatus = ParentSet.Outputs; status.Text = "Waiting for video"; break; } } }
protected virtual void OnParentSet() { ParentSet?.Invoke(this, EventArgs.Empty); }
protected virtual void OnParentSet() { ParentSet?.Invoke(this, EventArgs.Empty); // ApplyStyleSheetsOnParentSet(); }
/// <summary> /// Return a list of children for the parent set. /// </summary> private static List<Person> GetChildren(ParentSet parentSet) { // Get list of both parents. List<Person> firstParentChildren = new List<Person>(parentSet.FirstParent.Children); List<Person> secondParentChildren = new List<Person>(parentSet.SecondParent.Children); // Combined children list that is returned. List<Person> children = new List<Person>(); // Go through and add the children that have both parents. foreach (Person child in firstParentChildren) { if (secondParentChildren.Contains(child)) children.Add(child); } return children; }
/// <summary> /// Performs the business logic for changing the person parents /// </summary> public static void ChangeParents(PeopleCollection family, Person person, ParentSet newParentSet) { // Don't do anything if there is nothing to change or if the parents are the same if (person.ParentSet == null || newParentSet == null || person.ParentSet.Equals(newParentSet)) return; // store the current parent set which will be removed ParentSet formerParentSet = person.ParentSet; // Remove the first parent RemoveParentChildRelationship(person, formerParentSet.FirstParent); // Remove the person as a child of the second parent RemoveParentChildRelationship(person, formerParentSet.SecondParent); // Remove the sibling relationships RemoveSiblingRelationships(person); // Add the new parents AddParent(family, person, newParentSet); }
public override void UpdateTransform() { ParentSet.UpdateModularSet(); // update modular set }
public override void Destroy() { ParentSet.RemoveModularPiece(this); base.Destroy(); }
protected virtual void OnParentSet() { ParentSet?.Invoke(this, EventArgs.Empty); ApplyStyleSheetsOnParentSet(); (this as IPropertyPropagationController)?.PropagatePropertyChanged(null); }
private void CheckPythonWindows(object sender, EventArgs e) { foreach(Process proc in Process.GetProcessesByName("python")) { switch(proc.MainWindowTitle) { case "video": if (parentStatus != ParentSet.Video) EmbedWindow(proc); parentStatus = ParentSet.Video; status.Text = "Waiting for adjustment window"; break; case "Adjustment": if (parentStatus != ParentSet.Adjustment) EmbedWindow(proc); parentStatus = ParentSet.Adjustment; status.Text = "Waiting for outputs"; break; case "Outputs": if (parentStatus != ParentSet.Outputs) EmbedWindow(proc); parentStatus = ParentSet.Outputs; status.Text = "Waiting for video"; break; } } }