protected override void ClearItems() { T[] items = new T[Count]; for (int i = 0; i < Count; i++) { if (items[i] is INotifyPropertyChanged notify) { notify.PropertyChanged -= Item_PropertyChanged; } items[i] = this[i]; } base.ClearItems(); Cleared?.Invoke(this, new CollectionClearEventArgs <T>(items)); for (int i = 0; i < items.Length; i++) { RemovedAny?.Invoke(this, new SingleChangeEventArgs <T>(i, items[i], SingleChangeType.Removed)); } }
private void RemoteTargetCallStackClear() { // Fire clearing event Clearing.Raise(this, EventArgs.Empty); // Reset CurrentStackLevel = 0; // Clear call stack window m_callStackEditor.View = null; // Remote items from the collection if (m_callStackCollection != null) { m_callStackCollection.CallStack.Clear(); } // Rebind with a context m_callStackEditor.View = m_callStackCollection; // Fire cleared event Cleared.Raise(this, EventArgs.Empty); }
/// <inheritdoc /> public void DeleteBy(SecurityLookupMessage criteria) { if (criteria.IsLookupAll()) { _inner.Clear(); Cleared?.Invoke(); return; } Security[] toDelete; lock (_inner.SyncRoot) { toDelete = _inner.Values.Filter(criteria).ToArray(); foreach (var security in toDelete) { _inner.Remove(security.ToSecurityId()); } } Removed?.Invoke(toDelete); }
/// <summary> /// Helper method for raising the <see cref="Cleared">Cleared</see> event. /// </summary> protected void RaiseCleared() { Cleared?.Invoke(this, new GraphEventArgs(this)); }
private void Initialize(bool baseProperties = true) { // add the background view { BackgroundImageView = new UIImageView(); AddSubview(BackgroundImageView); } // add the main signature view { SignaturePadCanvas = new SignaturePadCanvasView(); SignaturePadCanvas.StrokeCompleted += (sender, e) => { UpdateUi(); StrokeCompleted?.Invoke(this, EventArgs.Empty); }; SignaturePadCanvas.Cleared += (sender, e) => Cleared?.Invoke(this, EventArgs.Empty); AddSubview(SignaturePadCanvas); } // add the caption { Caption = new UILabel() { Text = "Sign here.", Font = UIFont.BoldSystemFontOfSize(11f), BackgroundColor = UIColor.Clear, TextColor = UIColor.Gray, TextAlignment = UITextAlignment.Center }; AddSubview(Caption); } // add the signature line { SignatureLine = new UIView() { BackgroundColor = UIColor.Gray }; AddSubview(SignatureLine); } // add the prompt { SignaturePrompt = new UILabel() { Text = "X", Font = UIFont.BoldSystemFontOfSize(20f), BackgroundColor = UIColor.Clear, TextColor = UIColor.Gray }; AddSubview(SignaturePrompt); } // add the clear label { ClearLabel = UIButton.FromType(UIButtonType.Custom); ClearLabel.SetTitle("Clear", UIControlState.Normal); ClearLabel.Font = UIFont.BoldSystemFontOfSize(11f); ClearLabel.BackgroundColor = UIColor.Clear; ClearLabel.SetTitleColor(UIColor.Gray, UIControlState.Normal); AddSubview(ClearLabel); // attach the "clear" command ClearLabel.TouchUpInside += (sender, e) => Clear(); } // clear / initialize the view Clear(); }
public Task NotifyCleared() { return(Cleared.InvokeAsync()); }
/// <summary> /// Raises the Cleared event. /// </summary> /// <param name="e">An EventArgs instance containing event data.</param> protected virtual void OnCleared(EventArgs e) { Cleared?.Invoke(this, e); }
/// <summary>Fires the 'Cleared' event</summary> protected virtual void OnCleared() { Cleared?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Removes all items from this <see cref="BaseCollection{T}"/>. /// </summary> public virtual void Clear() { InternalList.Clear(); Cleared?.Invoke(this); }
public void Clear() { this.topNodes.Clear(); Cleared?.Invoke(this, EventArgs.Empty); }
private void OnSignatureCleared() { UpdateUi(); Cleared?.Invoke(this, EventArgs.Empty); }
public void Clear() { root = null; Count = 0; Cleared?.Invoke(this, new BinaryTreeClearedEventArgs()); }
public void Clear() { Log = Copyright; Cleared?.Invoke(this, new EventArgs()); }
private async Task OnCleared() { await ValueChanged.InvokeAsync(string.Empty).ConfigureAwait(true); await Cleared.InvokeAsync(null).ConfigureAwait(true); }
private void Initialize() { // add the background view { BackgroundImageView = new ImageView(Context) { Id = GenerateId(this), LayoutParameters = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent) }; AddView(BackgroundImageView); } // add the main signature view { SignaturePadCanvas = new SignaturePadCanvasView(Context) { Id = GenerateId(this), LayoutParameters = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent) }; SignaturePadCanvas.StrokeCompleted += (sender, e) => { UpdateUi(); StrokeCompleted?.Invoke(this, EventArgs.Empty); }; SignaturePadCanvas.Cleared += (sender, e) => Cleared?.Invoke(this, EventArgs.Empty); AddView(SignaturePadCanvas); } // add the caption { Caption = new TextView(Context) { Id = GenerateId(this), Text = "Sign Here" }; var layout = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.WrapContent) { AlignWithParent = true, BottomMargin = 6 }; layout.AddRule(LayoutRules.AlignBottom); layout.AddRule(LayoutRules.CenterHorizontal); Caption.LayoutParameters = layout; Caption.SetIncludeFontPadding(true); Caption.SetPadding(0, 0, 0, 6); AddView(Caption); } // add the signature line { SignatureLine = new View(Context) { Id = GenerateId(this) }; SignatureLine.SetBackgroundColor(Color.Gray); var layout = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, 1); layout.SetMargins(10, 0, 10, 5); layout.AddRule(LayoutRules.Above, Caption.Id); SignatureLine.LayoutParameters = layout; AddView(SignatureLine); } // add the prompt { SignaturePrompt = new TextView(Context) { Id = GenerateId(this), Text = "X" }; SignaturePrompt.SetTypeface(null, TypefaceStyle.Bold); var layout = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.WrapContent) { LeftMargin = 11 }; layout.AddRule(LayoutRules.Above, SignatureLine.Id); SignaturePrompt.LayoutParameters = layout; AddView(SignaturePrompt); } // add the clear label { ClearLabel = new TextView(Context) { Id = GenerateId(this), Text = "Clear", Visibility = ViewStates.Invisible }; var layout = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.WrapContent) { AlignWithParent = true }; layout.SetMargins(0, 10, 22, 0); layout.AddRule(LayoutRules.AlignRight); layout.AddRule(LayoutRules.AlignTop); ClearLabel.LayoutParameters = layout; AddView(ClearLabel); // attach the "clear" command ClearLabel.Click += (sender, e) => Clear(); } // clear / initialize the view Clear(); }
internal void OnCleared() { Cleared?.Invoke(this, EventArgs.Empty); }
private void Initialize() { const int ThinPad = 3; const int ThickPad = 12; const int LineHeight = 2; RowSpacing = 0; ColumnSpacing = 0; // create the chrome layout var chromeStack = new StackLayout(); chromeStack.Spacing = 0; chromeStack.Padding = 0; chromeStack.Margin = 0; Children.Add(chromeStack); // add the background view { BackgroundImageView = new Image(); BackgroundImageView.SetValue(View.VerticalOptionsProperty, LayoutOptions.FillAndExpand); chromeStack.Children.Add(BackgroundImageView); } // add the prompt { SignaturePrompt = new Label { Text = "X", FontSize = 20, FontAttributes = FontAttributes.Bold, Margin = new Thickness(ThickPad, 0, 0, 0) }; chromeStack.Children.Add(SignaturePrompt); } // add the signature line { SignatureLine = new BoxView { BackgroundColor = Color.Gray, HeightRequest = LineHeight, Margin = new Thickness(ThickPad, 0, ThickPad, 0) }; chromeStack.Children.Add(SignatureLine); } // add the caption { CaptionLabel = new Label { Text = "Sign here.", FontSize = 11, TextColor = Color.Gray, HorizontalTextAlignment = TextAlignment.Center, Margin = new Thickness(ThinPad) }; chromeStack.Children.Add(CaptionLabel); } // add the main signature view { SignaturePadCanvas = new SignaturePadCanvasView(); SignaturePadCanvas.SetValue(View.HorizontalOptionsProperty, LayoutOptions.Fill); SignaturePadCanvas.SetValue(View.VerticalOptionsProperty, LayoutOptions.Fill); SignaturePadCanvas.StrokeCompleted += (sender, e) => { UpdateUi(); StrokeCompleted?.Invoke(this, EventArgs.Empty); }; SignaturePadCanvas.Cleared += (sender, e) => Cleared?.Invoke(this, EventArgs.Empty); Children.Add(SignaturePadCanvas); } // add the clear label { ClearLabel = new Label { Text = "Clear", FontSize = 11, FontAttributes = FontAttributes.Bold, IsVisible = false, TextColor = Color.Gray, Margin = new Thickness(0, ThickPad, ThickPad, 0) }; ClearLabel.SetValue(View.HorizontalOptionsProperty, LayoutOptions.End); ClearLabel.SetValue(View.VerticalOptionsProperty, LayoutOptions.Start); Children.Add(ClearLabel); // attach the "clear" command ClearLabel.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => Clear()) }); } // clear / initialize the view Clear(); }
public static void Clear() { log = Copyright; Cleared?.Invoke(); }
private void ClearSecurities() { _trie.Clear(); Cleared.SafeInvoke(); }
//public void LoadStrokes (NativePoint[][] loadedStrokes) //{ // // clear any existing paths or points. // Clear (); // // there is nothing // if (loadedStrokes == null || loadedStrokes.Length == 0) // { // return; // } // inkPresenter.AddStrokes (loadedStrokes, StrokeColor, (float)StrokeWidth); // if (!IsBlank) // { // OnStrokeCompleted (); // } //} ///// <summary> ///// Allow the user to import an array of points to be used to draw a signature in the view, with new ///// lines indicated by a { 0, 0 } point in the array. ///// <param name="loadedPoints"></param> //public void LoadPoints (NativePoint[] loadedPoints) //{ // // clear any existing paths or points. // Clear (); // // there is nothing // if (loadedPoints == null || loadedPoints.Length == 0) // { // return; // } // var startIndex = 0; // var emptyIndex = Array.IndexOf (loadedPoints, new NativePoint (0, 0)); // if (emptyIndex == -1) // { // emptyIndex = loadedPoints.Length; // } // var strokes = new List<NativePoint[]> (); // do // { // // add a stroke to the ink presenter // var currentStroke = new NativePoint[emptyIndex - startIndex]; // strokes.Add (currentStroke); // Array.Copy (loadedPoints, startIndex, currentStroke, 0, currentStroke.Length); // // obtain the indices for the next line to be drawn. // startIndex = emptyIndex + 1; // if (startIndex < loadedPoints.Length - 1) // { // emptyIndex = Array.IndexOf (loadedPoints, new NativePoint (0, 0), startIndex); // if (emptyIndex == -1) // { // emptyIndex = loadedPoints.Length; // } // } // else // { // emptyIndex = startIndex; // } // } // while (startIndex < emptyIndex); // inkPresenter.AddStrokes (strokes, StrokeColor, (float)StrokeWidth); // if (!IsBlank) // { // OnStrokeCompleted (); // } //} private void OnCleared() { Cleared?.Invoke(this, EventArgs.Empty); }
private void Initialize() { const int ThinPad = 3; const int ThickPad = 20; const int LineHeight = 2; RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); // add the background view { BackgroundImageView = new Image(); BackgroundImageView.SetValue(Grid.HorizontalAlignmentProperty, HorizontalAlignment.Stretch); BackgroundImageView.SetValue(Grid.VerticalAlignmentProperty, VerticalAlignment.Stretch); BackgroundImageView.SetValue(Grid.RowProperty, 0); Children.Add(BackgroundImageView); } // add the main signature view { SignaturePadCanvas = new SignaturePadCanvasView(); SignaturePadCanvas.SetValue(Grid.HorizontalAlignmentProperty, HorizontalAlignment.Stretch); SignaturePadCanvas.SetValue(Grid.VerticalAlignmentProperty, VerticalAlignment.Stretch); SignaturePadCanvas.SetValue(Grid.RowProperty, 0); SignaturePadCanvas.StrokeCompleted += (sender, e) => { UpdateUi(); StrokeCompleted?.Invoke(this, EventArgs.Empty); }; SignaturePadCanvas.Cleared += (sender, e) => Cleared?.Invoke(this, EventArgs.Empty); Children.Add(SignaturePadCanvas); } // add the caption { Caption = new TextBlock() { Text = "Sign here.", FontSize = 11, Foreground = new SolidColorBrush(Colors.Gray), TextAlignment = TextAlignment.Center, Margin = new Thickness(ThinPad) }; Caption.SetValue(Grid.HorizontalAlignmentProperty, HorizontalAlignment.Stretch); Caption.SetValue(Grid.VerticalAlignmentProperty, VerticalAlignment.Bottom); Caption.SetValue(Grid.RowProperty, 1); Children.Add(Caption); } // add the signature line { SignatureLine = new Border() { Background = new SolidColorBrush(Colors.Gray), Height = LineHeight, Margin = new Thickness(ThickPad, 0, ThickPad, 0) }; SignatureLine.SetValue(Grid.HorizontalAlignmentProperty, HorizontalAlignment.Stretch); SignatureLine.SetValue(Grid.VerticalAlignmentProperty, VerticalAlignment.Bottom); Children.Add(SignatureLine); } // add the prompt { SignaturePrompt = new TextBlock() { Text = "X", FontSize = 20, FontWeight = FontWeights.Bold, Margin = new Thickness(ThickPad, 0, 0, ThinPad) }; SignaturePrompt.SetValue(Grid.HorizontalAlignmentProperty, HorizontalAlignment.Left); SignaturePrompt.SetValue(Grid.VerticalAlignmentProperty, VerticalAlignment.Bottom); Children.Add(SignaturePrompt); } // add the clear label { ClearLabel = new TextBlock() { Text = "Clear", FontSize = 11, FontWeight = FontWeights.Bold, Visibility = Visibility.Collapsed, Foreground = new SolidColorBrush(Colors.Gray), Margin = new Thickness(0, ThickPad, ThickPad, 0) }; ClearLabel.SetValue(Grid.HorizontalAlignmentProperty, HorizontalAlignment.Right); ClearLabel.SetValue(Grid.VerticalAlignmentProperty, VerticalAlignment.Top); Children.Add(ClearLabel); // attach the "clear" command ClearLabel.MouseLeftButtonUp += (sender, e) => Clear(); } // clear / initialize the view Clear(); }
public async Task ClearAsync() { await OnClearAsync(); Cleared?.Invoke(); }
/// <summary> /// Clears settings data file or storage. /// </summary> public void ClearSettings() { OnClearSettings(); Cleared?.Invoke(); }
public void Clear() { Has = false; Cleared?.Invoke(); }
public void Clear() { OnClear(); Cleared?.Invoke(); }
public void ClearAnnonces() { Annonces.Clear(); TotalAnnonces = 0; Cleared?.Invoke(this, new EventArgs()); }
/// <summary> /// Sends a cache cleared message. /// </summary> protected internal void TriggerCleared() { Cleared?.Invoke(this, new EventArgs()); }
public void Clear() { NumberList.Clear(); Cleared?.Invoke(this, "Cleared series"); }
public void Clear() { elements.Clear(); objects.Clear(); Cleared?.Invoke(this, EventArgs.Empty); }
private void ViewChannels_Cleared(object sender, EventArgs e) { m_BindingSource.ResetBindings(false); Cleared?.Invoke(this, e); }