Esempio n. 1
0
 public virtual void InvokeEditedEvent(BackupObject obj)
 {
     if (Edited != null)
     {
         Edited.Invoke(obj);
     }
 }
Esempio n. 2
0
 private void tryDelete(DrawableTile tile)
 {
     confirmation.Push("Are you sure you want to delete action for this tile?", () =>
     {
         Edited?.Invoke(tile, null);
     });
 }
 private void ViewModel_Deleted(object sender, EventArgs e)
 {
     if (sender is KeyBindingViewModel keyBinding)
     {
         _keyBindings.Remove(keyBinding.Model);
         KeyBindings.Remove(keyBinding);
         Edited?.Invoke(Command, _keyBindings);
     }
 }
Esempio n. 4
0
 public void Redo()
 {
     if (stackRedo.Any())
     {
         var op = stackRedo.Pop();
         op.Invoke();
         stackUndo.Push(op);
     }
     StatusChanged?.Invoke(stackUndo.Any(), stackRedo.Any());
     Edited.Invoke();
 }
Esempio n. 5
0
 public void AddOperation(Operation operation)
 {
     if (!IsOperationValid(operation))
     {
         return;
     }
     stackUndo.Push(operation);
     stackRedo.Clear();
     StatusChanged?.Invoke(stackUndo.Any(), stackRedo.Any());
     Edited.Invoke();
 }
Esempio n. 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Value"></param>
        protected virtual void OnEdited(bool Value)
        {
            IsEditable = Value;

            if (Value)
            {
                Focus();
            }
            else
            {
                Edited?.Invoke(this, new EventArgs <string>(Text));
            }
        }
        public async Task Add()
        {
            var newKeyBinding = new KeyBindingViewModel(new KeyBinding {
                Command = Command
            }, _dialogService);

            if (await newKeyBinding.Edit().ConfigureAwait(true))
            {
                newKeyBinding.Deleted += ViewModel_Deleted;
                newKeyBinding.Edited  += ViewModel_Edited;
                KeyBindings.Add(newKeyBinding);
                _keyBindings.Add(newKeyBinding.Model);
                Edited?.Invoke(Command, _keyBindings);
            }
        }
Esempio n. 8
0
 /// <summary>
 ///     Raises the <see cref="Edited" /> event.
 /// </summary>
 /// <param name="e">An <see cref="EditGlobalObjectEventArgs" /> that contains the event data. </param>
 public virtual void OnEdited(EditGlobalObjectEventArgs e)
 {
     Edited?.Invoke(this, e);
 }
        async void Save_Clicked(object sender, EventArgs e)
        {
            if (IsBusy || input.IsVisible)
            {
                return;
            }
            IsBusy = true;

            var result = await DataBase.Manager.EditTextAsync(Name, Text);

            if (result != DataBase.ReturnCode.Success)
            {
                IsBusy = false;
                await DisplayAlert(Resource.Error, Resource.SaveFileError + " " + result.GetDescription(), Resource.Ok);

                return;
            }

            string description;

            if (string.IsNullOrWhiteSpace(Text))
            {
                description = Resource.EmptyFile;
            }
            else if (Settings.Storage.UseKeyWords)
            {
                try
                {
                    var words = await CognitiveServices.TextAnalytics.KeyPhrasesAsync(new[] { Text });

                    if (words[0].Length > 0)
                    {
                        description = string.Join("; ", words[0]);
                    }
                    else
                    {
                        description = Resource.NoKeyWords;
                    }
                }
                catch (Exception ex)
                {
                    await DisplayAlert(Resource.Error, Resource.GetKeyWordsError + " " + ex.Message, Resource.Ok);

                    description = Text;
                }
            }
            else
            {
                description = Text.Trim();
            }

            if (description.Length > 200)
            {
                description = description.Substring(0, 200);
            }

            result = await DataBase.Manager.EditDescriptionAsync(Name, description);

            if (result != DataBase.ReturnCode.Success)
            {
                IsBusy = false;
                await DisplayAlert(Resource.Error, Resource.UpdatingDescriptionError + " " + result.GetDescription(), Resource.Ok);

                return;
            }

            Edited?.Invoke(this, new EditEventArgs(Name, description, Text));

            IsBusy = false;
        }
Esempio n. 10
0
 public virtual void OnEdited(PlayerEditEventArgs e)
 {
     AssertNotDisposed();
     Edited?.Invoke(this, e);
 }
Esempio n. 11
0
 /// <summary>
 /// Notifing the list which containing this item to edit it
 /// </summary>
 private void Edit()
 {
     // Notify all lists which contains this item to edit it
     Edited?.Invoke(this);
 }
Esempio n. 12
0
 /// <summary>
 ///     Raises the <see cref="Edited" /> event.
 /// </summary>
 /// <param name="e">An <see cref="EditPlayerObjectEventArgs" /> that contains the event data. </param>
 public virtual void OnEdited(EditPlayerObjectEventArgs e)
 {
     Edited?.Invoke(this, e);
 }
Esempio n. 13
0
 private void Edit()
 {
     Edited?.Invoke(this, new EventArgs());
 }
Esempio n. 14
0
 /// <summary>
 /// Raised when a value is edited on the tile.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ValuesEdited(object sender, EventArgs e)
 {
     Edited?.Invoke(this.Index, e);
 }
Esempio n. 15
0
        public HairChartView(HairAppBl.Interfaces.IHairBl hairbl, HairChartController controller)
        {
            mModel                     = new PlotModel();
            mController                = controller;
            mPictContainer             = new StackLayout();
            mPictContainer.Orientation = StackOrientation.Horizontal;

            mEditButton          = Common.GetButton("edit.png", hairbl);
            mEditButton.Clicked += (sender, e) =>
            {
                Edited?.Invoke(this, new EditEventArgs(mCurrentHairLength));
            };

            var allPoints = new List <DataPoint>();

            foreach (var l in mController.GetCharts())
            {
                allPoints.AddRange(l.Points);
            }

            if (allPoints.Any())
            {
                //Y Axis
                var maxY = allPoints.Max(p => p.Y) + 5;
                var minY = allPoints.Min(p => p.Y) - 5;

                var yAxis = new LinearAxis()
                {
                    Position = AxisPosition.Right, Minimum = minY, Maximum = maxY, StringFormat = "00cm"
                };

                //X Axis
                var minX  = allPoints.Min(p => p.X) - 3;
                var maxX  = allPoints.Max(p => p.X) + 3;
                var xAxis = new DateTimeAxis()
                {
                    Position = AxisPosition.Bottom, Minimum = minX, Maximum = maxX, StringFormat = "dd.MM.yy"
                };

                mModel.Axes.Add(yAxis);
                mModel.Axes.Add(xAxis);
            }

            foreach (var l in mController.GetCharts())
            {
                var ls = new LineSeries();
                ls.TrackerFormatString   = "{4}cm";
                ls.MarkerType            = MarkerType.Circle;
                ls.MarkerStrokeThickness = 3;
                ls.TouchStarted         += Ls_TouchStarted;
                ls.Title           = l.Name;
                ls.SelectionMode   = OxyPlot.SelectionMode.Single;
                ls.StrokeThickness = 4;
                ls.Points.AddRange(l.Points);
                ls.Color = l.Color;

                mModel.Series.Add(ls);
            }
            mModel.IsLegendVisible = false;

            var lengths = mController.GetLengths().OrderBy(x => x.Day);

            foreach (var hl in lengths)
            {
                var image = new HairLengthImage(hairbl, hl)
                {
                    Source = hl.Picture,
                };
                image.Clicked += Image_Clicked;
                mPictContainer.Children.Add(image);
            }

            mScrollContainer = new ScrollView
            {
                Orientation   = ScrollOrientation.Horizontal,
                Content       = mPictContainer,
                HeightRequest = 100,
            };

            if (lengths.Any())
            {
                FillData(lengths.Last());
                SelectImage((HairLengthImage)mPictContainer.Children.Last());
                SelectAllPoints(lengths.Last());
            }


            Padding         = new Thickness(0, 0, 0, 0);
            VerticalOptions = LayoutOptions.FillAndExpand;
            BackgroundColor = Color.Transparent;
            this.Content    = new StackLayout
            {
                BackgroundColor = Color.Transparent,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children        =
                {
                    new Frame
                    {
                        VerticalOptions = LayoutOptions.FillAndExpand,
                        CornerRadius    = 4,
                        Content         = new StackLayout
                        {
                            VerticalOptions = LayoutOptions.FillAndExpand,
                            Children        =
                            {
                                new PlotView
                                {
                                    Model             = mModel,
                                    VerticalOptions   = LayoutOptions.FillAndExpand,
                                    HorizontalOptions = LayoutOptions.Fill,
                                },
                                mScrollContainer
                            }
                        }
                    },
                    new Frame
                    {
                        CornerRadius = 4,
                        Content      = GetDataFields()
                    }
                }
            };
        }
Esempio n. 16
0
 /// <summary>
 /// Called when curve gets edited.
 /// </summary>
 public void OnEdited()
 {
     Edited?.Invoke();
 }
Esempio n. 17
0
 public void handleEdit()
 {
     Edited?.Invoke(this, Base);
 }
 private void ViewModel_Edited(object sender, EventArgs e)
 {
     Edited?.Invoke(Command, _keyBindings);
 }
Esempio n. 19
0
 public void OnEdited(IRibbonControl control, string text)
 => Edited?.Invoke(control, text);
Esempio n. 20
0
 protected virtual void OnEdited(EditedEventArgs eventArgs)
 {
     Edited?.Invoke(this, eventArgs);
 }
Esempio n. 21
0
 public void InvokeEdited()
 {
     Edited?.Invoke(this, EventArgs.Empty);
     Dismiss();
 }
Esempio n. 22
0
 private void ViewModel_Edited(object sender, EventArgs e)
 {
     Edited?.Invoke(this, EventArgs.Empty);
 }