/// <summary> /// Handles <see cref="Attached"/> event /// </summary> protected override void OnAttached(ElementEventArgs e) { // Scope will free all allocated child elements using (var scope = ElementScope.Create()) { var ctl = e.Element; var children = ctl.Children; var got_one = false; for (int i = children.Count - 1; i >= 0; --i) { var t = children[i]; if (!String.IsNullOrEmpty(t.Attributes["default"]) && !got_one) { t.SetState(ElementState.Current | ElementState.Expanded); got_one = true; } else { t.SetState(ElementState.Collapsed); } } } base.OnAttached(e); }
public override void OnEntry(MethodExecutionEventArgs eventArgs) { InputDialog dlg = new InputDialog(); if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; ElementEventArgs ea = new ElementEventArgs(); ea.Element = dlg.Input; Controller.InvokeSomethingCreated(this, ea); }
void HandleChildAdded(object sender, ElementEventArgs e) { var view = e.Element as VisualElement; if (view == null) return; IVisualElementRenderer renderer; Platform.SetRenderer(view, renderer = Platform.CreateRenderer(view)); _panel.Children.Add(renderer.ContainerElement); EnsureZIndex(); }
void HandleChildRemoved(object sender, ElementEventArgs e) { var view = e.Element as VisualElement; if (view == null) return; var renderer = Platform.GetRenderer(view) as UIElement; if (renderer != null) _panel.Children.Remove(renderer); EnsureZIndex(); }
private void Adsoyad_ChildAdded(object sender, ElementEventArgs e) { throw new NotImplementedException(); }
private void Button_DescendantAdded(object sender, ElementEventArgs e) { }
private void Model_ElementInvalid(object sender, ElementEventArgs e) { this.propertyEditor1.PropertyGrid.Refresh(); }
private void OnTabRemoved(object sender, ElementEventArgs e) { e.Element.PropertyChanged -= OnTabbedPagePropertyChanged; BadgeViews.Remove(e.Element); }
private void OnTabRemoved(object sender, ElementEventArgs e) { e.Element.PropertyChanged -= OnTabbedPagePropertyChanged; this.UpdateCurrentPage(); this.UpdateItemBounds(); }
private void Marquee_ChildAdded(object sender, ElementEventArgs e) { this.InitChildView((Xamarin.Forms.View)e.Element); this.Begin(); }
void OnChildRemoved(object sender, ElementEventArgs e) { var view = e.Element as VisualElement; if (view == null) return; IVisualElementRenderer childRenderer = Platform.GetRenderer(view); if (childRenderer != null) { if (_row > 0) childRenderer.ContainerElement.ClearValue(Windows.UI.Xaml.Controls.Grid.RowProperty); if (_rowSpan > 0) childRenderer.ContainerElement.ClearValue(Windows.UI.Xaml.Controls.Grid.RowSpanProperty); if (_column > 0) childRenderer.ContainerElement.ClearValue(Windows.UI.Xaml.Controls.Grid.ColumnProperty); if (_columnSpan > 0) childRenderer.ContainerElement.ClearValue(Windows.UI.Xaml.Controls.Grid.ColumnSpanProperty); _panel.Children.Remove(childRenderer.ContainerElement); view.Cleanup(); } }
protected void OnElementRemoved(object sender, ElementEventArgs e) { e.Element.LayoutChanged -= OnLayoutChanged; if (e.Element is Symbol) { Component component = ((Symbol)e.Element).Component; circuit.Components.Remove(component); if (component is NamedWire) RebuildNodes(((NamedWire)component).ConnectedTo, true); } else if (e.Element is Wire) { // If the removed element is a wire, we might have to split the node it was a part of. RebuildNodes(((Wire)e.Element).Node, true); } foreach (Terminal j in e.Element.Terminals) { Node n = j.ConnectedTo; j.ConnectTo(null); // If the node that this terminal was connected to has no more connections, remove it from the circuit. if (n != null && n.Connected.Empty()) { Log.WriteLine(MessageType.Verbose, "Removed node '" + n.ToString() + "'"); circuit.Nodes.Remove(n); } } Log.WriteLine(MessageType.Verbose, "Removed '" + e.Element.ToString() + "'"); }
protected void OnElementAdded(object sender, ElementEventArgs e) { if (e.Element is Symbol) { circuit.Components.Add(((Symbol)e.Element).Component); if (((Symbol)e.Element).Component is NamedWire) RebuildNodes(null, true); } OnLayoutChanged(e.Element, null); e.Element.LayoutChanged += OnLayoutChanged; Log.WriteLine(MessageType.Verbose, "Added '" + e.Element.ToString() + "'"); }
private void ErrorDisplayChangedEvent(object sender, ElementEventArgs e) { SetFlag(PrivateFlags.ErrorDisplayModified, true); }
void OnChildRemoved(object sender, ElementEventArgs eventArgs) { var page = eventArgs.Element as Page; if (page == null) return; UnregisterChildPage(page); }
private bool IsSystemEvent(ElementEventArgs args) { return(IsSystemEvent(args.Subject, args.OldValue, args.NewValue)); }
static void Layout_ChildAdded(object sender, ElementEventArgs e) { AddInputTransparentToElement(e.Element); }
void OnChildAdded(object sender, ElementEventArgs e) { var view = e.Element as VisualElement; if (view == null) return; IVisualElementRenderer childRenderer = Platform.CreateRenderer(view); Platform.SetRenderer(view, childRenderer); if (_row > 0) Windows.UI.Xaml.Controls.Grid.SetRow(childRenderer.ContainerElement, _row); if (_rowSpan > 0) Windows.UI.Xaml.Controls.Grid.SetRowSpan(childRenderer.ContainerElement, _rowSpan); if (_column > 0) Windows.UI.Xaml.Controls.Grid.SetColumn(childRenderer.ContainerElement, _column); if (_columnSpan > 0) Windows.UI.Xaml.Controls.Grid.SetColumnSpan(childRenderer.ContainerElement, _columnSpan); _panel.Children.Add(childRenderer.ContainerElement); EnsureZIndex(); }
private static void OnChildAdded(object sender, ElementEventArgs args) { var nativeView = GetNativeViewHandler?.Invoke(args.Element); nativeView?.SetBindingMemberValue(AttachedMembersBase.Object.Parent, args.Element); }
/// <summary> /// Callback called when Element Online state changes (signaled by the T2G Client). /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="args">Event information to send to registered event handlers.</param> public static void OnElementInfoChanged(object sender, ElementEventArgs args) { // Signal the event to start handling the request. _transmitEvent.Set(); }
static void HandleChildRemoved(object sender, ElementEventArgs e) { var view = e.Element; view?.DisposeModalAndChildRenderers(); }
void OnChildRemoved(object sender, ElementEventArgs e) { var view = e.Element as VisualElement; if (view != null) OnChildRemoved(view); }
void OnChildAdded(object sender, ElementEventArgs e) { var view = e.Element as VisualElement; if (view != null) AddChild(view); if (_renderer.Element.LogicalChildren[_renderer.Element.LogicalChildren.Count - 1] != view) EnsureChildOrder(); }
private void Element_OnChildAdded(object sender, ElementEventArgs e) { _scrollView = ((ScrollView)sender); }
private static void OnElementAdded(object sender, ElementEventArgs e) { // Cet évenement est appelé lorsqu'un élément est ajouté au plan Console.Write("Added: "); OnElement(e); }
void OnElementDeleted(object sender, ElementEventArgs args) { FlightElement deleted = args.Element as FlightElement; NSIndexPath path = deleted.IndexPath; int n = GetElementOffsetFromPath (path); if (LogBook.Delete (deleted.Flight)) { deleted.Changed -= OnFlightElementChanged; Root[path.Section].Remove (path.Row); if (Root[path.Section].Count == 0) Root.RemoveAt (path.Section, UITableViewRowAnimation.Fade); SelectOrAdd (n); } }
private static void OnElementUpdated(object sender, ElementEventArgs e) { if (!planRecu) return; // Cet évenement est appelé lorsqu'un élément est ajouté ou mis à jour sur le plan string elementID = e.ID; object element = e.Element; switch (e.ElementName) { case "fb": fb capteur = (fb)element; foreach (CLoco loco in res.listeLoco) { if (loco.ZA != null) { // La loco rentre dans la zone aval if (capteur.state && (loco.ZA.capteurID == capteur.ID)) { loco.blockid = loco.ZA.blockID; loco.ZOccupees.Add(loco.ZA); loco.LongueurZone = loco.ZA.longueur; loco.distanceZonePrec = 0; loco.distanceZoneSuiv = 0; loco.blockEnterSide = loco.ProchainBES; CLocalisation.determinerZA(loco); } // La loco quitte une zone else if (!capteur.state && loco.ZOccupees.ElementAt(0).capteurID == capteur.ID) { loco.ZoneAmont = loco.ZOccupees.ElementAt(0).blockID; loco.ZOccupees.RemoveAt(0); } } } break; case "bk": bk block = (bk)element; break; case "sw": sw aiguillage = (sw)element; // On met à jour la liste d'aiguillages foreach (CAiguillage aig in res.listeAiguillages) { if (elementID == aig.ID) { aig.cmd = aiguillage.state; break; } } // On met à jour la ZA des locos for (int k = 0; k < res.listeLoco.Count; k++) CLocalisation.determinerZA(res.listeLoco.ElementAt(k)); break; case "st": st route = (st)element; foreach (CItineraire iti in res.listeItineraire) { if (elementID == iti.ID) { iti.bka = route.bka; iti.bkaside = route.bkaside; iti.bkb = route.bkb; iti.bkbside = route.bkbside; iti.listeAiguillage.Clear(); foreach (swcmd s in route.swcmdlist) iti.listeAiguillage.Add(new CAiguillage(s)); break; } } break; case "lc": lc locoUpdate = (lc)element; foreach (CLoco loc in res.listeLoco) { if (loc.ID == locoUpdate.ID) { //loc.blockEnterSide = locoUpdate.blockenterside; //loc.blockid = locoUpdate.blockid; // Changement de sens if (loc.direction != locoUpdate.dir) { if (locoUpdate.V != 0) { loc.ZoneAmont = (loc.ZoneAval != "Pas d'itinéraire" && loc.ZoneAval != "Erreur aiguillage") ? loc.ZoneAval : loc.blockid; /*bool troisiemeVerre = loc.PrecedentBES; loc.ProchainBES = !loc.PrecedentBES; loc.PrecedentBES = !troisiemeVerre;*/ } loc.ZOccupees.Reverse(); loc.direction = locoUpdate.dir; } loc.longueur = locoUpdate.len; loc.masse = locoUpdate.mass; loc.nrcars = locoUpdate.nrcars; loc.number = locoUpdate.number; loc.vitesseMoy = locoUpdate.V_mid; loc.vitesse = locoUpdate.V; CLocalisation.determinerZA(loc); break; } } break; case "car": car wagon = (car)element; foreach (CWagon wag in res.listeWagon) { if (wag.ID == wagon.ID) { wag.location = wagon.location; wag.longueur = wagon.len; wag.poidsAvide = wagon.weight_empty; wag.poidsRempli = wagon.weight_loaded; break; } } break; } }
protected virtual void OnLinkRemoved(ElementEventArgs e) { if (LinkRemoved != null) LinkRemoved(this, e); }
private void SelectionTab_ChildAdded(object sender, ElementEventArgs e) { this.Refresh(); }
private void Element_OnChildAdded(object sender, ElementEventArgs e) { ls.ScrollTo(sender, ScrollToPosition.End, true); }
private void QueueOverflow(object sender, ElementEventArgs args) { _stopReadEvent.WaitOne(); _concurentQueue.Enqueue(args.StopElement); }
private void QueueOverflow(object sender, ElementEventArgs args) { Debug.WriteLine("Stop read from file"); _stopReadEvent.WaitOne(); _concurentQueue.Enqueue(args.StopElement); }
private static void OnLayoutChildAdded(object sender, ElementEventArgs e) => AddInputTransparentToElement(e.Element);
void OnPageAdded(object sender, ElementEventArgs e) { InsertPage(e.Element as Page, Page.Children.IndexOf(e.Element)); }
private static void RootElement_DescendantRemoved(object sender, ElementEventArgs e) { ElementRemoved(e.Element); }
void OnPageRemoved(object sender, ElementEventArgs e) { RemovePage(e.Element as Page); }
void HandleChildRemoved(object sender, ElementEventArgs e) { var view = e.Element; DisposeModelAndChildrenRenderers(view); }
protected override void OnMouseUp(MouseEventArgs e) { var selectionRectangle = _selectionArea.GetUnsignedRectangle(); if ((_moveAction != null) && (_moveAction.IsMoving)) { var eventClickArg = new ElementEventArgs(SelectedElement, PreviousSelectedElement); OnElementClick(eventClickArg); _moveAction.End(); _moveAction = null; var eventMouseUpArg = new ElementMouseEventArgs(SelectedElement, e.X, e.Y); OnElementMouseUp(eventMouseUpArg); if (Changed) { AddUndo(); } CheckControlClick(); } // Select if (_isMultiSelection) { EndSelectElements(selectionRectangle); } // Add element else if (_isAddSelection) { EndAddElement(selectionRectangle); } // Add link else if (_isAddLink) { EndAddLink(); AddUndo(); } // Resize if (_resizeAction != null) { if (_resizeAction.IsResizing) { var mousePoint = Gsc2Goc(new Point(e.X, e.Y)); _resizeAction.End(mousePoint); AddUndo(); } _resizeAction.UpdateResizeCorner(); } RestartInitValues(); base.Invalidate(); Invalidate(); base.OnMouseUp(e); }
private void UserList_ChildRemoved(object sender, ElementEventArgs e) { currentUser.Id = users.Max(x => x.Id) + 1; users.Add(currentUser); }
private void DocumentLinkRemoved(object sender, ElementEventArgs e) { OnLinkRemoved(e); }
private void lv_programmes_ChildAdded(object sender, ElementEventArgs e) { }
static void Element_ChildAdded(object sender, ElementEventArgs e) { ScaleResizer.scaleChild(e.Element); }
void HandleChildRemoved(object sender, ElementEventArgs e) { var view = e.Element; view = null; }
void Element_Selected(object sender, ElementEventArgs args) { Redraw(); }
/// <summary> /// Survey event handler for changes to a <see cref="ModelElement">ModelElement</see>'s error state /// </summary> private static void ModelElementErrorStateChangedEvent(object sender, ElementEventArgs e) { INotifySurveyElementChanged eventNotify; ModelElement element; if (null != (eventNotify = ((element = e.ModelElement).Store as IORMToolServices).NotifySurveyElementChanged)) { NotifyErrorStateChanged(eventNotify, element as IModelErrorOwnerPath); } }
private void Resize(object sender, ElementEventArgs e) { throw new NotImplementedException(); }
void OnChildRemoved(object sender, ElementEventArgs e) { Performance.Start(); var view = e.Element as VisualElement; if (view != null) RemoveChild(view); Performance.Stop(); }
private static void ChildAddedHandler(object sender, ElementEventArgs e) { AttachChildInternal(e.Element); }
private static void OnElement(ElementEventArgs e) { // Cet évenement est appelé lorsqu'un élément est ajouté ou mis à jour sur le plan string _elementID = e.ID; string _nomElement = e.ElementName; object _element = e.Element; Console.Write("Nom:" + _nomElement + " ID:" + _elementID); switch (_nomElement) { case "auto": auto aut = (auto)_element; Console.Write(" cmd:" + aut.cmd); break; case "clock": clock horloge = (clock)_element; Console.Write(" cmd:" + horloge.cmd); break; case "state": state etat = (state)_element; break; case "exception": exception exepti = (exception)_element; Console.Write(" niveau:" + exepti.level + " " + exepti.text); break; case "sw": sw aiguillage = (sw)_element; Console.Write(" blockid:" + aiguillage.blockid + " state:" + aiguillage.state); break; case "st": st route = (st)_element; Console.Write(" bka:" + route.bka + " bkb:" + route.bkb + " bkaside:" + route.bkaside + " bkbside:" + route.bkbside); break; case "lc": lc loco = (lc)_element; Console.Write(" blockid:" + loco.blockid + " vitesse:" + loco.V + " blockenterside:" + loco.blockenterside + " dir:" + loco.dir); break; case "bk": bk canton = (bk)_element; Console.Write(" speed:" + canton.speed); break; case "fb": fb capteur = (fb)_element; Console.Write(" state:" + capteur.state); break; } Console.WriteLine(""); }
private static void ChildRemovedHandler(object sender, ElementEventArgs e) { RemoveChildInternal(e.Element); }
private static void OnElementUpdated(object sender, ElementEventArgs e) { // Cet évenement est appelé lorsqu'un élément est modifié sur le plan Console.Write("Updated: "); OnElement(e); }
/// <summary> /// Callback called when Element Online state changes (signaled by the T2G Client). /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="args">Event information to send to registered event handlers.</param> public static void OnElementInfoChanged(object sender, ElementEventArgs args) { if (args != null && args.SystemInformation != null && args.SystemInformation.IsOnline == true && args.SystemInformation.PisMission != null && args.SystemInformation.PisMission.MissionState == MissionStateEnum.MI) { // Will be called multiple times for the same train. // Some sort of debouncing will be welcome in a future revision // to prevent multiple notifications to the console(s) if (string.IsNullOrEmpty(args.SystemInformation.SystemId) == false) { TargetAddressType target = new TargetAddressType(); target.Type = AddressTypeEnum.Element; target.Id = args.SystemInformation.SystemId; string automaticModeUrl; if (GetAutomaticMode(out automaticModeUrl) == true) { LogManager.WriteLog( TraceType.INFO, "Automatically starting streaming on newly detected train: " + args.SystemInformation.SystemId, "PIS.Ground.LiveVideoControl.LiveVideoControlService.OnElementInfoChanged", null, EventIdEnum.LiveVideoControl); LiveVideoControlResult result = SendStartStreamingCommand(Guid.Empty, target, automaticModeUrl); if (result.ResultCode != LiveVideoControlErrorEnum.RequestAccepted) { LogManager.WriteLog(TraceType.ERROR, "Problem sending a start command with url " + automaticModeUrl + " to train " + target.Id + ". Error: " + result.ResultCode.ToString(), "PIS.Ground.LiveVideoControl.LiveVideoControlService.OnElementInfoChanged", null, EventIdEnum.LiveVideoControl); } } else { // Manual Mode, resend the latest Start command if available ServiceInfo lastSentService; if (_dicVideoHistory.ContainsKey(target) && _dicVideoHistorySentService.TryGetValue(target, out lastSentService)) { ServiceInfo foundService = (args.SystemInformation.ServiceList != null) ? args.SystemInformation.ServiceList.FirstOrDefault(s => s.ServiceId == (ushort)eServiceID.eSrvSIF_LiveVideoControlServer && s.IsAvailable): null; bool lServiceLiveVideoControlServerAvailable = foundService != null; // If service is not available, force the sent status to value false. if (!lServiceLiveVideoControlServerAvailable && lastSentService != null) { _dicVideoHistorySentService[target] = null; } // Avoiding sending multiple start notifications. // The LiveVideoService have to be online if (lServiceLiveVideoControlServerAvailable == true && (lastSentService == null || !foundService.Equals(lastSentService))) { LogManager.WriteLog( TraceType.INFO, "Re-starting streaming on newly detected train: " + args.SystemInformation.SystemId, "PIS.Ground.LiveVideoControl.LiveVideoControlService.OnElementInfoChanged", null, EventIdEnum.LiveVideoControl); LiveVideoControlResult result = SendStartStreamingCommand(Guid.Empty, target, _dicVideoHistory[target]); // Setting the flag that the start command was already sent _dicVideoHistorySentService[target] = foundService; if (result.ResultCode != LiveVideoControlErrorEnum.RequestAccepted) { LogManager.WriteLog(TraceType.ERROR, "Problem sending a start command with url " + _dicVideoHistory[target] + " to train " + target.Id + ". Error: " + result.ResultCode.ToString(), "PIS.Ground.LiveVideoControl.LiveVideoControlService.OnElementInfoChanged", null, EventIdEnum.LiveVideoControl); } } } } } } }
public void Subscribed(object sender, ElementEventArgs e) { Console.WriteLine("Элемент в позиции {0}-{1} был изменен. User {2} уведомлен",e.i,e.j, Name); }
void OnElementDeleted(object sender, ElementEventArgs args) { AircraftElement deleted = args.Element as AircraftElement; NSIndexPath path = deleted.IndexPath; if (LogBook.Delete (deleted.Aircraft)) { deleted.Changed -= OnElementChanged; Root[0].Remove (path.Row); SelectOrAdd (path.Row); } }