コード例 #1
0
        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));
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
ファイル: BaseGraph.cs プロジェクト: xiaoxiongnpu/dotnetrdf
 /// <summary>
 /// Helper method for raising the <see cref="Cleared">Cleared</see> event.
 /// </summary>
 protected void RaiseCleared()
 {
     Cleared?.Invoke(this, new GraphEventArgs(this));
 }
コード例 #5
0
        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();
        }
コード例 #6
0
 public Task NotifyCleared()
 {
     return(Cleared.InvokeAsync());
 }
コード例 #7
0
 /// <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);
 }
コード例 #8
0
 /// <summary>Fires the 'Cleared' event</summary>
 protected virtual void OnCleared()
 {
     Cleared?.Invoke(this, EventArgs.Empty);
 }
コード例 #9
0
 /// <summary>
 /// Removes all items from this <see cref="BaseCollection{T}"/>.
 /// </summary>
 public virtual void Clear()
 {
     InternalList.Clear();
     Cleared?.Invoke(this);
 }
コード例 #10
0
 public void Clear()
 {
     this.topNodes.Clear();
     Cleared?.Invoke(this, EventArgs.Empty);
 }
コード例 #11
0
 private void OnSignatureCleared()
 {
     UpdateUi();
     Cleared?.Invoke(this, EventArgs.Empty);
 }
コード例 #12
0
 public void Clear()
 {
     root  = null;
     Count = 0;
     Cleared?.Invoke(this, new BinaryTreeClearedEventArgs());
 }
コード例 #13
0
 public void Clear()
 {
     Log = Copyright;
     Cleared?.Invoke(this, new EventArgs());
 }
コード例 #14
0
        private async Task OnCleared()
        {
            await ValueChanged.InvokeAsync(string.Empty).ConfigureAwait(true);

            await Cleared.InvokeAsync(null).ConfigureAwait(true);
        }
コード例 #15
0
        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();
        }
コード例 #16
0
 internal void OnCleared()
 {
     Cleared?.Invoke(this, EventArgs.Empty);
 }
コード例 #17
0
        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();
        }
コード例 #18
0
 public static void Clear()
 {
     log = Copyright;
     Cleared?.Invoke();
 }
コード例 #19
0
 private void ClearSecurities()
 {
     _trie.Clear();
     Cleared.SafeInvoke();
 }
コード例 #20
0
        //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);
        }
コード例 #21
0
ファイル: SignaturePad.cs プロジェクト: delort/SignaturePad
        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();
        }
コード例 #22
0
        public async Task ClearAsync()
        {
            await OnClearAsync();

            Cleared?.Invoke();
        }
コード例 #23
0
        /// <summary>
        /// Clears settings data file or storage.
        /// </summary>
        public void ClearSettings()
        {
            OnClearSettings();

            Cleared?.Invoke();
        }
コード例 #24
0
 public void Clear()
 {
     Has = false;
     Cleared?.Invoke();
 }
コード例 #25
0
        public void Clear()
        {
            OnClear();

            Cleared?.Invoke();
        }
コード例 #26
0
 public void ClearAnnonces()
 {
     Annonces.Clear();
     TotalAnnonces = 0;
     Cleared?.Invoke(this, new EventArgs());
 }
コード例 #27
0
 /// <summary>
 /// Sends a cache cleared message.
 /// </summary>
 protected internal void TriggerCleared()
 {
     Cleared?.Invoke(this, new EventArgs());
 }
コード例 #28
0
ファイル: Series.cs プロジェクト: dzolotaryov/lab2
 public void Clear()
 {
     NumberList.Clear();
     Cleared?.Invoke(this, "Cleared series");
 }
コード例 #29
0
 public void Clear()
 {
     elements.Clear();
     objects.Clear();
     Cleared?.Invoke(this, EventArgs.Empty);
 }
コード例 #30
0
        private void ViewChannels_Cleared(object sender, EventArgs e)
        {
            m_BindingSource.ResetBindings(false);

            Cleared?.Invoke(this, e);
        }