private void Map_MouseClick(object sender, MouseEventArgs e)
        {
            var point = _map.ScreenToGeographic(e.Location);

            var selectedStore = FindShop(point, _selectedLayer);

            if (selectedStore != null)
            {
                _selectedLayer.Items.Remove(selectedStore);
                _layer.Items.Add(selectedStore);
                SelectedChanged?.Invoke(this, e);
            }
            else
            {
                var store = FindShop(point, _layer);
                if (store != null)
                {
                    _layer.Items.Remove(store);
                    _selectedLayer.Items.Add(store);
                    SelectedChanged?.Invoke(this, e);
                }
            }
        }
Exemplo n.º 2
0
        public TabView(IList <TabViewChildren> Children)
        {
            InitUI();

            Views          = new List <ContentView>();
            RadioBehaviors = new List <RadioBehavior>();

            for (int i = 0; i < Children.Count; ++i)
            {
                grid.ColumnDefinitions.Add(new ColumnDefinition());
                RadioBehavior radioBehavior = new RadioBehavior()
                {
                    IsChecked = i == 0
                };
                TabViewChildren children = Children[i];
                Views.Add(children.View);
                RadioBehaviors.Add(radioBehavior);

                var tabbedView = new TabbedImageLabelView(children, radioBehavior)
                {
                    Margin = new Thickness(0, 3, 0, 0),
                };

                tabbedView.IndexSelectedChanged += (sendor, e) =>
                {
                    var view  = sendor as TabbedImageLabelView;
                    int index = RadioBehaviors.IndexOf(view.RadioBehavior);
                    SelectedChanged?.Invoke(this,
                                            new TabViewChangedEventArgs(index, Children[index].View));
                };

                grid.Children.Add(tabbedView);
                viewGroup.Children.Add(children.View);
                SetColumn(tabbedView, i);
            }
        }
Exemplo n.º 3
0
 private void CB_CheckedChanged(object sender, EventArgs e) => SelectedChanged?.Invoke(this, e);
Exemplo n.º 4
0
 public void FireSelected()
 {
     SelectedChanged.Invoke(this);
 }
Exemplo n.º 5
0
 public void SetSelected(bool selected)
 {
     Selected  = selected;
     BackColor = Selected ? Color.LightGreen : Color.White;
     SelectedChanged?.Invoke(this, Selected);
 }
Exemplo n.º 6
0
 protected virtual void OnSelectedChanged() => SelectedChanged?.Invoke(this, Selected);
 protected void OnSelectedChanged()
 {
     SelectedChanged?.Invoke(this, new EventArgs());
 }
Exemplo n.º 8
0
 //	protecteds
 /// <summary>
 /// Вызов OnPropertyChanged("Current") и соответствующего события
 /// </summary>
 /// <param name="value">Выбор для передачи в событие</param>
 protected virtual void OnSelectedChanged(T value)
 {
     SelectedChanged?.Invoke(this, new EventArgs <T>(value));
 }
Exemplo n.º 9
0
        public async Task CreateFolder(Guid parentFolderKey, string folderName)
        {
            await FileSystemRepository.CreateFolder(parentFolderKey, folderName);

            SelectedChanged?.Invoke();
        }
Exemplo n.º 10
0
        public async Task RenameFileSystemItem(Guid itemKey, string name)
        {
            await FileSystemRepository.RenameFileSystemItem(itemKey, name);

            SelectedChanged?.Invoke();
        }
Exemplo n.º 11
0
        public async Task DeleteFavoriteItem(Guid key)
        {
            await FavoriteRepository.DeleteFavorite(key);

            SelectedChanged?.Invoke();
        }
Exemplo n.º 12
0
        private void Dialogs_MouseDown(object sender, MouseEventArgs e)
        {
            if (!ChooseConstraint && !ChooseConstraintLost && !ChooseByAlign && SelectedChanged != null)
            {
                int phindexx = dlginstance.GetSelectedPhrase(e.Location, ScaleZoom, Translate);
                if (phindexx == -1)
                {
                    phindexx = dlginstance.GetSelectedTimeLine(e.Location, ScaleZoom, Translate);
                    if (phindexx > -1)
                    {
                        if (FocusedEditPhrase != -1)
                        {
                            SelectedChanging(dlginstance.Phrase(FocusedEditPhrase));
                        }
                        if (FocusedEditTimeline != -1)
                        {
                            SelectedChangingTL(dlginstance.Timeline(FocusedEditTimeline));
                        }
                        FocusedEditTimeline = phindexx;

                        FocusedEditPhrase   = -1;
                        FocusedEditTimeline = phindexx;
                        this.Refresh();
                        TimeLine t = dlginstance.Timeline(phindexx);
                        SelectedChangedTL.Invoke(t);

                        //return;
                        goto next;
                    }
                    //else
                    //TranslateFocus = true;
                    //movestart = e.Location;
                    //return;
                }
                else
                {
                    Phrase p = dlginstance.Phrase(phindexx);
                    if (FocusedEditPhrase != -1)
                    {
                        SelectedChanging(dlginstance.Phrase(FocusedEditPhrase));
                    }
                    if (FocusedEditTimeline != -1)
                    {
                        SelectedChangingTL(dlginstance.Timeline(FocusedEditTimeline));
                    }
                    if (FocusedEditPhrase != phindexx)
                    {
                        FocusedEditPhrase   = phindexx;
                        FocusedEditTimeline = -1;
                        this.Refresh();
                        SelectedChanged.Invoke(p);
                    }
                }
            }
next:
            int phindex = dlginstance.GetSelectedPhrase(e.Location, ScaleZoom, Translate);

            if (phindex == -1)
            {
                if (ChooseConstraint || ChooseConstraintLost || ChooseByAlign)
                {
                    if (Program.HitTest(e.X, e.Y, 0, 0, this.Width, 40))
                    {
                        ChooseConstraint = ChooseConstraintLost = ChooseByAlign = false;
                    }
                    this.Refresh();
                    return;
                }
                phindex = dlginstance.GetSelectedTimeLine(e.Location, ScaleZoom, Translate);

                if (phindex == -1)
                {
                    TranslateFocus = true;
                    movestart      = e.Location;
                    return;
                }

                FocusedTimeline = phindex;
                movestart       = e.Location;
                return;
            }
            if (ChooseConstraintLost)
            {
                if (dlginstance.Phrase(FocusedEditPhrase).PhraseConnectReferences.Contains(phindex))
                {
                    dlginstance.RemoveConnection(FocusedEditPhrase, phindex);
                    ChooseConstraintLost = false;
                    this.Refresh();
                    Changed = true;
                }
                else if (dlginstance.Phrase(phindex).PhraseConnectReferences.Contains(FocusedEditPhrase))
                {
                    dlginstance.RemoveConnection(phindex, FocusedEditPhrase);
                    ChooseConstraintLost = false;
                    this.Refresh();
                    Changed = true;
                }
                return;
            }
            if (ChooseConstraint)
            {
                if (phindex != FocusedEditPhrase &&
                    !dlginstance.Phrase(FocusedEditPhrase).PhraseConnectReferences.Contains(phindex) &&
                    !dlginstance.Phrase(phindex).PhraseConnectReferences.Contains(FocusedEditPhrase))
                {
                    //dlginstance.Phrase(FocusedEditPhrase).PhraseConnectReferences.Add(phindex);
                    dlginstance.Connect(FocusedEditPhrase, phindex);
                    ChooseConstraint = false;
                    this.Refresh();
                    Changed = true;
                }
                return;
            }
            if (ChooseByAlign)
            {
                if (phindex != FocusedEditPhrase)
                {
                    //dlginstance.phrases[FocusedEditPhrase].PhraseConnectReferences.Add(phindex);
                    Point newpos = dlginstance.Phrase(FocusedEditPhrase).position;
                    switch (orientation)
                    {
                    case AlignOrientation.horisontal:
                        newpos.Y = dlginstance.Phrase(phindex).position.Y;
                        dlginstance.Phrase(FocusedEditPhrase).position = newpos;
                        break;

                    case AlignOrientation.vertical:
                        newpos.X = dlginstance.Phrase(phindex).position.X;
                        dlginstance.Phrase(FocusedEditPhrase).position = newpos;
                        break;
                    }
                    ChooseByAlign = false;
                    this.Refresh();
                    Changed = true;
                }
                return;
            }
            FocusedPhrase = phindex;
            movestart     = e.Location;
        }
Exemplo n.º 13
0
        /// <summary>
        /// On mouse up event
        /// </summary>
        protected override void OnMouseUp(MouseEventArgs e)
        {
            // Base call
            base.OnClick(e);

            // User pressed left button
            if (e.Button == MouseButtons.Left)
            {
                // Update Selected property
                Selected = !Selected;

                // Trigger SelectedItem changed event
                SelectedChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedItemChanged"));

                // Uncheck (unselect) all other color-boxes if check-box behavior is on
                if (!MultipleTicks)
                {
                    // Iterate over all parent controls
                    foreach (Control control in Parent.Controls)
                    {
                        // Is control MColorBox?
                        if (control is MColorBox)
                        {
                            // If control is this control, return
                            if (control == this)
                            {
                                continue;
                            }

                            // Cast control to MColorBox
                            MColorBox colorBox = control as MColorBox;

                            // Unselect color-box
                            colorBox.Selected = false;
                        }
                    }
                }

                // State
                _frame = 0;

                // Are we in design time? Updates look of check-box
                // in design time.
                if (DesignMode)
                {
                    // Is check-box checked?
                    if (Selected)
                    {
                        // Make check-box checked
                        _a     = 10;
                        _frame = _checkmark.Length;
                    }
                    else
                    {
                        // Make check-box unchecked
                        _a     = 0;
                        _frame = 0;
                    }
                }

                // Calls OnPaint method
                Invalidate();
            }

            // Update whole control
            Component.Outdated = true;
        }
Exemplo n.º 14
0
 protected void OnSelectedChanged()
 {
     SelectedChanged?.Invoke(this, EventArgs.Empty);
 }
 private void RadioButton_CheckedChanged(object sender, EventArgs e)
 {
     SelectedChanged?.Invoke(this, e);
 }
Exemplo n.º 16
0
 protected virtual void OnSelectedChanged(SelectButton selection)
 {
     SelectedChanged?.Invoke(this, new EventArgs());
 }
Exemplo n.º 17
0
 protected void OnSelectedChanged(SelectEventArgs e)
 {
     SelectedChanged?.Invoke(this, e);
 }
Exemplo n.º 18
0
 private void MultiSelect_SelectionChanged(object sender, EventArgs e) => SelectedChanged?.Invoke(this, e);
 void OnIsSelectedChanged()
 => SelectedChanged?.Invoke(this);