示例#1
0
 /// <summary>
 /// Responds to a <see cref="T:System.Windows.Controls.ComboBox"/> selection change by raising a <see cref="E:System.Windows.Controls.Primitives.Selector.SelectionChanged"/> event.
 /// </summary>
 /// <param name="e">Provides data for <see cref="T:System.Windows.Controls.SelectionChangedEventArgs"/>.</param>
 protected override void OnSelectionChanged(SelectionChangedEventArgs e)
 {
     base.OnSelectionChanged(e);
     // TODO: unsafe code!
     if (e.AddedItems.Count > 0)
         PropertyValue.Value = e.AddedItems[0];
 }
示例#2
0
 private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (e.AddedItems != null && e.AddedItems.Count > 0)
     {
         ViewModel.SelectedChanged(e.AddedItems[0]);
     }
 }
示例#3
0
        private void StatusComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var selectedRouteTask = VM.Routes.SelectedRouteTask;

            if(selectedRouteTask == null)
                return;

            var source = e.OriginalSource as RadComboBox;

            if(source == null || !source.IsDropDownOpen)
                return;

            var status = selectedRouteTask.TaskStatus;

            //This will also remove the task from its RouteDestination 
            if (status != null && status.RemoveFromRoute && e.RemovedItems.Count > 0)
            {
                //and delete the Destination if there are no other tasks for that Destination
                DragDropTools.RemoveFromRoute(selectedRouteTask);

                ((ObservableCollection<RouteTask>)VM.TaskBoard.CollectionView.SourceCollection).Add(selectedRouteTask);

                VM.Routes.DispatcherSave();
            }
        }
 private void ExpandDirectionChanged(object sender, SelectionChangedEventArgs e)
 {
     acc.ExpandDirection = (ExpandDirection)Enum.Parse(
         typeof(ExpandDirection),
         ((ComboBoxItem)cbExpandDirection.SelectedItem).Content.ToString(),
         true);
 }
 void workspaceTree_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (e.SelectedNodes.Count() != 0)
     {
         GisApp.ActiveApp.SelectNode = e.SelectedNodes[0] as WorkspaceTreeNodeBase;
     }
 }
示例#6
0
        private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {          
            #if UNITY_EDITOR
            //Do something on selection changed (just syncronized with editor's hierarchy for demo purposes)
            UnityEditor.Selection.objects = e.NewItems.OfType<GameObject>().ToArray();
            #endif

        }
 /// <summary>
 /// Handles the SelectionChanged event of the owner control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Windows.Controls.SelectionChangedEventArgs"/> 
 /// instance containing the event data.</param>
 private void EditorSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     // serialize with name.
     object DataContext = _owner.DataContext;
     DataContext
         .GetType()
         .GetProperty("Value", BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty)
         .SetValue(DataContext, ((CultureInfo)_owner.SelectedItem).Name, new object[] { });
 }
        private void OnSizeMetricSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count > 0)
            {
                ComboBoxItem item = e.AddedItems[0] as ComboBoxItem;
                treeMapControl.ItemDefinition.ValueBinding = new Binding(item.Tag as string);

                RefreshDataSource();
            }
        }
        private void OnColorMetricSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count > 0)
            {
                ComboBoxItem item = e.AddedItems[0] as ComboBoxItem;
                treeMapControl.Interpolators[0].DataRangeBinding = new Binding(item.Tag as string);

                RefreshDataSource();
            }
        }
        private void OnCultureChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItem selected = CultureOptions.SelectedItem as ComboBoxItem;
            if (selected == null)
            {
                return;
            }

            CultureInfo culture = new CultureInfo(selected.Tag as string);
            CulturedCalendar.CalendarInfo = new CultureCalendarInfo(culture);
        }
示例#11
0
        private void OnSelectionChanged(object sender, SelectionChangedEventArgs e) {
            //#if UNITY_EDITOR
            //            //Do something on selection changed (just syncronized with editor's hierarchy for demo purposes)
            //            UnityEditor.Selection.objects = e.NewItems.OfType<GameObject>().ToArray();
            //#endif
            //foreach (TreeData td in e.NewItems.OfType<TreeData>().ToArray()) {
            //    Debug.Log(td.name);
            //}
            //if( TreeView.SelectedIndex != -1) {
            //    Debug.Log(((TreeData)TreeView.SelectedItem).name);
            //}

        }
示例#12
0
 private void listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     //     WebBrowserTask blogViewer = new WebBrowserTask();
     //   blogViewer.URL = books[listBox1.SelectedIndex].Url;
     //   blogViewer.Show();
     try
     {
         NavigationService.Navigate(new Uri("/Detail.xaml?id=" + books[listBox1.SelectedIndex].Url, UriKind.Relative));
     }
     catch (Exception ex)
     {
     }
 }
 /// <summary>
 /// Update the API system.
 /// </summary>
 /// <param name="sender">The source object.</param>
 /// <param name="e">The selection changed event data.</param>
 private void OnPickerChanged(object sender, SelectionChangedEventArgs e)
 {
     if (ControlPicker.SelectedItem == null)
     {
         ControlApi.ItemsSource = null;
         ControlApi.Text = null;
         IntelliSenseIcon.Content = null;
         ControlApi.IsEnabled = false;
     }
     else
     {
         KeyValuePair<string, Type> pair = (KeyValuePair<string, Type>)ControlPicker.SelectedItem;
         ControlApi.ItemsSource = MemberInfoData.GetSetForType(pair.Value);
         ControlApi.IsEnabled = true;
     }
 }
 private void MyListView_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     OkButton.IsEnabled = MyListView.SelectedItem != null;
 }
示例#15
0
        /// <summary>
        /// Ce produit lorsqu'il y a une sélection
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dg_variableList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            IList list = dg_variableList.SelectedItems;

            vo.setSelectedItems(dg_variableList.SelectedItems);
        }
示例#16
0
        private void ComboboxArenaImportingBehaviour_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!_initialized)
            {
                return;
            }
            var selected = ComboboxArenaImportingBehaviour.SelectedItem as ArenaImportingBehaviour?;

            if (selected != null)
            {
                Config.Instance.SelectedArenaImportingBehaviour = selected;
                Config.Save();
            }
        }
 private void hmacHashTypeCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     vm.HashType = (Hash)((ComboBox)e.OriginalSource).SelectedIndex;
 }
 private void aesPaddingCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     vm.AesPadding = (PaddingMode)(((ComboBox)e.OriginalSource).SelectedIndex + 1);
 }
        /// <summary>
        /// Called when the <see cref="SelectedItems"/> CollectionChanged event is raised.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event args.</param>
        private void SelectedItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            var generator = ItemContainerGenerator;
            IList added = null;
            IList removed = null;

            switch (e.Action)
            {
                case NotifyCollectionChangedAction.Add:
                    SelectedItemsAdded(e.NewItems.Cast<object>().ToList());

                    if (AutoScrollToSelectedItem)
                    {
                        ScrollIntoView(e.NewItems[0]);
                    }

                    added = e.NewItems;
                    break;

                case NotifyCollectionChangedAction.Remove:
                    if (SelectedItems.Count == 0)
                    {
                        if (!_syncingSelectedItems)
                        {
                            SelectedIndex = -1;
                        }
                    }
                    else
                    {
                        foreach (var item in e.OldItems)
                        {
                            MarkItemSelected(item, false);
                        }
                    }

                    removed = e.OldItems;
                    break;

                case NotifyCollectionChangedAction.Reset:
                    if (generator != null)
                    {
                        removed = new List<object>();

                        foreach (var item in generator.Containers)
                        {
                            if (item?.ContainerControl != null)
                            {
                                if (MarkContainerSelected(item.ContainerControl, false))
                                {
                                    removed.Add(item.Item);
                                }
                            }
                        }
                    }

                    if (SelectedItems.Count > 0)
                    {
                        _selectedItem = null;
                        SelectedItemsAdded(SelectedItems);
                        added = SelectedItems;
                    }
                    else if (!_syncingSelectedItems)
                    {
                        SelectedIndex = -1;
                    }

                    break;

                case NotifyCollectionChangedAction.Replace:
                    foreach (var item in e.OldItems)
                    {
                        MarkItemSelected(item, false);
                    }

                    foreach (var item in e.NewItems)
                    {
                        MarkItemSelected(item, true);
                    }

                    if (SelectedItem != SelectedItems[0] && !_syncingSelectedItems)
                    {
                        var oldItem = SelectedItem;
                        var oldIndex = SelectedIndex;
                        var item = SelectedItems[0];
                        var index = IndexOf(Items, item);
                        _selectedIndex = index;
                        _selectedItem = item;
                        RaisePropertyChanged(SelectedIndexProperty, oldIndex, index, BindingPriority.LocalValue);
                        RaisePropertyChanged(SelectedItemProperty, oldItem, item, BindingPriority.LocalValue);
                    }

                    added = e.OldItems;
                    removed = e.NewItems;
                    break;
            }

            if (added?.Count > 0 || removed?.Count > 0)
            {
                var changed = new SelectionChangedEventArgs(
                    SelectionChangedEvent,
                    added ?? Empty,
                    removed ?? Empty);
                RaiseEvent(changed);
            }
        }
示例#20
0
 private void lvStationBoard_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     e.Handled = true;
 }
示例#21
0
 private void lvConnectionPoints_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     e.Handled = true;
 }
示例#22
0
 private void pivot_learn_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
 }
示例#23
0
 private void UserThemesList_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     userThemeId = (sender as ComboBox).SelectedIndex;
     (((sender as ComboBox)?.SelectedItem as ComboBoxItem)?.Tag as Theme)?.Apply();
 }
示例#24
0
 private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     themeId = (sender as ComboBox).SelectedIndex;
     GetTheme((sender as ComboBox).SelectedIndex).Apply();
 }
示例#25
0
 private void UsersDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
 }
示例#26
0
 private void AuthorsItemSet_RowsPerPageChanged(object sender, SelectionChangedEventArgs e)
 {
     ClearRows();
     DisplayData();
 }
 void control_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     this._counter++;
     this._selectionChangedEventArgs = e;
 }
示例#28
0
 private void CB1_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     Button1.Visibility = Visibility.Visible;
 }
示例#29
0
 internal void OnSelectedDatesCollectionChanged(SelectionChangedEventArgs e) {
     if (!IsSelectionChanged(e))
         return;
     if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementSelected) || AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementAddedToSelection) || AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection)) {
         //CalendarAutomationPeer calendarAutomationPeer = UIElementAutomationPeer.FromElement((UIElement)this) as CalendarAutomationPeer;
         //if (calendarAutomationPeer != null)
         //    calendarAutomationPeer.RaiseSelectionEvents(e);
     }
     CoerceFromSelection();
     OnSelectedDatesChanged(e);
 }
 private void randomUABrowserCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     vm.UserAgentBrowser = (UserAgent.Browser)((ComboBox)e.OriginalSource).SelectedIndex;
 }
示例#31
0
 private void txtEstado_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
 }
示例#32
0
 // Click по Предметам
 private void L_DropAllItems_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (L_DropAllItems.SelectedIndex != -1)
     {
         T_DropALL_ID_Item.Text = ((DropAll.Items)L_DropAllItems.SelectedItem).idx.ToString();
         T_DropAll_Percent.Text = ((DropAll.Items)L_DropAllItems.SelectedItem).percent.ToString();
     }
 }
 private void aesModeCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     vm.AesMode = (CipherMode)(((ComboBox)e.OriginalSource).SelectedIndex + 1);
 }
示例#34
0
 public void SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     UpdateSelectionStatus();
 }
示例#35
0
        private void LoopingListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            foreach (ToolHeader item in e.AddedItems)
            {
                string selectedToolName = item.RelatedControlName;
                System.Diagnostics.Debug.WriteLine("LoopingListBox_SelectionChanged: " + selectedToolName);


                //if (selectedToolName.Equals("CutMode") == false && this._pathGenerator.IsCollecting == true)
                //{
                //    this.Cursor = Cursors.Arrow;
                //    this.llbTools.SelectedIndex = 1;
                //    this._pathGenerator.EndCollect();
                //    this.SearchWindow.Hide();
                //}
                if (this.radioTools != null && selectedToolName.Equals("llbTools") == true)
                {
                    this.radioTools.IsChecked = true;
                    this.SearchWindow.Hide();
                }
                else if (this.radioColors != null && selectedToolName.Equals("llbColors") == true)
                {
                    this.radioColors.IsChecked = true;
                    this.SearchWindow.Hide();
                }
                else if (this.radioStrokes != null && selectedToolName.Equals("llbStroke") == true)
                {
                    this.radioStrokes.IsChecked = true;
                    this.SearchWindow.Hide();
                }
                else if (this.radioStrokes != null && selectedToolName.Equals("ctl_Search") == true)
                {
                    //검색창 띄움
                    this.SearchWindow.Show();
                }
                else if (selectedToolName.Equals("CutMode") == true)
                {
                    //if (this._pathGenerator.IsCollecting == false)
                    {
                        this.Cursor = Cursors.Pen; //가위로 바꿔야 함
                        this.llbTools.SelectedIndex = 3;

                        //this._pathGenerator.BeginCollect();
                    }
                    this.SearchWindow.Hide();
                }
                else if (selectedToolName.Equals("LinerMode") == true)
                {
                    this._recognier.IsRuler           = true;
                    _liner.Visibility                 = Visibility.Visible;
                    _liner.Opacity                    = 1;
                    this.llbToolHeaders.SelectedIndex = 0;      // line ruler
                    this.SelectedIndex(0);
                }
                else
                {
                    this.radioTools.IsChecked   = false;
                    this.radioColors.IsChecked  = false;
                    this.radioStrokes.IsChecked = false;
                    this.SearchWindow.Hide();
                }
            }
        }
示例#36
0
        /// <summary> 
        /// Raise the SelectionChanged event.
        /// </summary> 
        private void InvokeSelectionChanged(List<object> unselectedItems, List<object> selectedItems) 
        {
            SelectionChangedEventArgs selectionChanged = new SelectionChangedEventArgs(unselectedItems, selectedItems); 

            selectionChanged.Source=this;

            OnSelectionChanged(selectionChanged); 
        }
		private void lbxCustomer_SelectionChanged(object sender, SelectionChangedEventArgs e)
		{
			Customer customer = this.lbxCustomer.SelectedItem as Customer;
			this.gbxBookedTours.DataContext = customer;
		}
 private void kdfAlgorithmCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     vm.KdfAlgorithm = (Hash)((ComboBox)e.OriginalSource).SelectedIndex;
 }
示例#39
0
 private void DocListbox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     _selectedFile = docListbox.SelectedItem as FileInfo;
 }
        private void functionTypeCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            vm.FunctionType = (BlockFunction.Function)((ComboBox)e.OriginalSource).SelectedIndex;
            try { functionInfoTextblock.Text = infoDic[vm.FunctionType.ToString()]; } catch { functionInfoTextblock.Text = "No additional information available for this function"; }

            switch (vm.FunctionType)
            {
                default:
                    functionTabControl.SelectedIndex = 0;
                    break;

                case BlockFunction.Function.Hash:
                    functionTabControl.SelectedIndex = 1;
                    break;

                case BlockFunction.Function.HMAC:
                    functionTabControl.SelectedIndex = 2;
                    break;

                case BlockFunction.Function.Translate:
                    functionTabControl.SelectedIndex = 3;
                    break;

                case BlockFunction.Function.DateToUnixTime:
                case BlockFunction.Function.UnixTimeToDate:
                    functionTabControl.SelectedIndex = 4;
                    break;

                case BlockFunction.Function.Replace:
                    functionTabControl.SelectedIndex = 5;
                    break;

                case BlockFunction.Function.RegexMatch:
                    functionTabControl.SelectedIndex = 6;
                    break;

                case BlockFunction.Function.RandomNum:
                    functionTabControl.SelectedIndex = 7;
                    break;

                case BlockFunction.Function.CountOccurrences:
                    functionTabControl.SelectedIndex = 8;
                    break;

                case BlockFunction.Function.RSAEncrypt:
                    functionTabControl.SelectedIndex = 9;
                    break;

                /*
            case BlockFunction.Function.RSADecrypt:
                functionTabControl.SelectedIndex = 10;
                break;
                */

                case BlockFunction.Function.RSAPKCS1PAD2:
                    functionTabControl.SelectedIndex = 11;
                    break;

                case BlockFunction.Function.CharAt:
                    functionTabControl.SelectedIndex = 12;
                    break;

                case BlockFunction.Function.Substring:
                    functionTabControl.SelectedIndex = 13;
                    break;

                case BlockFunction.Function.GetRandomUA:
                    functionTabControl.SelectedIndex = 14;
                    break;

                case BlockFunction.Function.AESEncrypt:
                case BlockFunction.Function.AESDecrypt:
                    functionTabControl.SelectedIndex = 15;
                    break;

                case BlockFunction.Function.PBKDF2PKCS5:
                    functionTabControl.SelectedIndex = 16;
                    break;

                case BlockFunction.Function.Remove:
                    functionTabControl.SelectedIndex = 17;
                    break;

                case BlockFunction.Function.Split:
                    functionTabControl.SelectedIndex = 18;
                    break;

                case BlockFunction.Function.Encoding:
                    functionTabControl.SelectedIndex = 19;
                    break;

                case BlockFunction.Function.SCrypt:
                    functionTabControl.SelectedIndex = 20;
                    break;

                case BlockFunction.Function.BCrypt:
                    functionTabControl.SelectedIndex = 21;
                    break;

            }
        }
 void grid_SelectionChanged(object sender, SelectionChangedEventArgs args)
 {
     try
     {
         SetButtonEnabled();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + "\r\n\r\n" + ex.StackTrace);
     }
 }
示例#42
0
 private void list_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     PreviewTheme?.Invoke(selected);
 }
示例#43
0
 // Click по NPC
 private void L_DropAll_NPC_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (L_DropAll_NPC.SelectedIndex != -1)
     {
         Items = new ObservableCollection<DropAll.Items>(((DropAll)L_DropAll_NPC.SelectedItem).Item);
         L_DropAllItems.ItemsSource = Items;
         T_DropAll_ID_NPC.Text = ((DropAll)L_DropAll_NPC.SelectedItem).NpcID.ToString();
     }
 }
 void OnCollectionViewSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     UpdateSelectionData(e.PreviousSelection, e.CurrentSelection);
 }
 /// <summary>
 /// Update the visible content.
 /// </summary>
 /// <param name="sender">The source object.</param>
 /// <param name="e">The selection changed event data.</param>
 private void OnApiChanged(object sender, SelectionChangedEventArgs e)
 {
     MemberInfoData mim = ControlApi.SelectedItem as MemberInfoData;
     IntelliSenseIcon.Content = ControlApi.SelectedItem == null ? null : mim.Icon;
     SelectedInformation.Text = mim == null ? string.Empty : mim.MemberInfo.Name;
 }
 private void Language_SelectionChanged(object sender, SelectionChangedEventArgs e)
 => SonicNextModManager.Language.UpdateCultureResources();
示例#47
0
        private void DualityEditorApp_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.SameObjects) return;
            if (!e.AffectedCategories.HasFlag(ObjectSelection.Category.GameObjCmp))
                return;

            // Tilemap selection changed
            Tilemap newSelection = TilemapsEditorSelectionParser.QuerySelectedTilemap();
            if (this.selectedTilemap != newSelection)
            {
                this.selectedTilemap = newSelection;
                if (this.Mouseover)
                    this.OnMouseMove();
                this.Invalidate();
                this.UpdateActionToolButtons();
            }
        }
示例#48
0
 private void moviesList_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
 }
示例#49
0
 public void Pn_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     var pnReg = e.AddedItems[0] as PnRegDTO;
     if (pnReg == null) return;
     EngineMaterial.Pn = pnReg.Pn;
     EngineMaterial.Description = pnReg.Description;
 }
 private void exerciseListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     this.viewDetailButton.IsEnabled   =
         this.deleteButton.IsEnabled   =
             this.editButton.IsEnabled = (this.exerciseListView.SelectedItem != null);
 }
示例#51
0
        private void AuthorsItemSet_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (addingRows == true) return;
            if (dgv.Rows.Count == 0) return;
            int index = e.SelectedIndex;
            int selectedAuthorID = -1;
            try
            {
                selectedAuthorID = int.Parse(dgv.Rows[index].Cells[0].Value.ToString());
            }
            catch (Exception) { }

            if (selectedAuthorID != -1)
            {
                selectedAuthor = Authors.Where(x => x.id == selectedAuthorID).Single();
            }
        }
 /// <summary>
 /// 起始时间选择后控制终止时间的可选范围
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void from_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
 {
     DPToDate.DisplayDateStart = DPFromDate.SelectedDate;
 }
 /// <summary>
 /// Handle the SelectedDatesChanged event.
 /// </summary>
 /// <param name="sender">The calendar.</param>
 /// <param name="e">Event arguments.</param>
 private void OnSelectedDatesChanged(object sender, SelectionChangedEventArgs e)
 {
     _selectedDatesChangedAddedDays = e.AddedItems;
     _selectedDateChangedRemovedDays = e.RemovedItems;
     _selectedDatesChangedCount++;
 }
 private void cmbOrigenes_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
 }
        /// <summary>
        /// Handles the SelectionChanged event of the ItemContainer class.
        /// </summary>
        /// <param name="sender">Event source.</param>
        /// <param name="e">Event arguments.</param>
        private void ItemContainerSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataItem[] removedDataItems = e.RemovedItems.CastWrapper<DataItem>().ToArray();
            DataItem[] addedDataItems = e.AddedItems.CastWrapper<DataItem>().ToArray();

            if (!_synchronizingSelectedItems)
            {
                try
                {
                    _synchronizingSelectedItems = true;

                    // Synchronize the SelectedItems collection
                    foreach (object obj in removedDataItems.Select(di => di.Value))
                    {
                        _selectedItems.Remove(obj);
                    }
                    foreach (object obj in addedDataItems.Select(di => di.Value))
                    {
                        _selectedItems.Add(obj);
                    }
                }
                finally
                {
                    _synchronizingSelectedItems = false;
                }
            }

            // Pass the SelectionChanged event on to any listeners
            IList removedItems = removedDataItems.Select(di => di.Value).ToArray();
            IList addedItems = addedDataItems.Select(di => di.Value).ToArray();
#if SILVERLIGHT
            SelectionChangedEventHandler handler = SelectionChanged;
            if (null != handler)
            {
                handler(this, new SelectionChangedEventArgs(removedItems, addedItems));
            }
#else
            RaiseEvent(new SelectionChangedEventArgs(SelectionChangedEvent, removedItems, addedItems));
#endif
        }
示例#56
0
 private void GamePrecisionComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
 }
示例#57
0
 /// <summary>
 /// Raises the <see cref="E:Kavand.Windows.Controls.Calendar.SelectedDatesChanged"/> routed event.
 /// </summary>
 /// <param name="e">The data for the event. </param>
 protected virtual void OnSelectedDatesChanged(SelectionChangedEventArgs e) {
     RaiseEvent(e);
 }
示例#58
0
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!isConnectted)
            {
                return;
            }

            ComboBox obj = (ComboBox)sender;
            String   tag = obj.Tag.ToString();

            if (tag == "mode")
            {
                bool isJ = ((ComboBoxItem)obj.SelectedItem).Content.ToString() == "Axis";
                isJoint = isJ ? (byte)1 : (byte)0;
                if (isJ)
                {
                    XI.Content = "Joint1+";
                    YI.Content = "Joint2+";
                    ZI.Content = "Joint3+";
                    RI.Content = "Joint4+";

                    XN.Content = "Joint1-";
                    YN.Content = "Joint2-";
                    ZN.Content = "Joint3-";
                    RN.Content = "Joint4-";
                }
                else
                {
                    XI.Content = "X+";
                    YI.Content = "Y+";
                    ZI.Content = "Z+";
                    RI.Content = "R+";

                    XN.Content = "X-";
                    YN.Content = "Y-";
                    ZN.Content = "Z-";
                    RN.Content = "R-";
                }
            }
            else if (tag == "headType")
            {
                string str = ((ComboBoxItem)obj.SelectedItem).Content.ToString();
                if (str == "SuctionCup")
                {
                    cbGrab.IsEnabled       = false;
                    cbLaser.IsEnabled      = false;
                    cbSuctionCup.IsEnabled = true;
                    EndTypeParams endType;
                    endType.xBias = 59.7f;
                    endType.yBias = 0;
                    endType.zBias = 0;
                    DobotDll.SetEndEffectorParams(ref endType);
                }
                else if (str == "Gripper")
                {
                    cbGrab.IsEnabled       = true;
                    cbLaser.IsEnabled      = false;
                    cbSuctionCup.IsEnabled = false;
                    EndTypeParams endType;
                    endType.xBias = 59.7f;
                    endType.yBias = 0;
                    endType.zBias = 0;
                    DobotDll.SetEndEffectorParams(ref endType);
                }
                else if (str == "Laser")
                {
                    cbGrab.IsEnabled       = false;
                    cbLaser.IsEnabled      = true;
                    cbSuctionCup.IsEnabled = false;
                    EndTypeParams endType;
                    endType.xBias = 70f;
                    endType.yBias = 0;
                    endType.zBias = 0;
                    DobotDll.SetEndEffectorParams(ref endType);
                }
            }
        }
示例#59
0
 private static bool IsSelectionChanged(SelectionChangedEventArgs e) {
     if (e.AddedItems.Count != e.RemovedItems.Count)
         return true;
     // ReSharper disable LoopCanBeConvertedToQuery
     foreach (DateTime dateTime in e.AddedItems) {
         // ReSharper restore LoopCanBeConvertedToQuery
         if (!e.RemovedItems.Contains(dateTime))
             return true;
     }
     return false;
 }
示例#60
0
 // -----------------------------------------    EVENTOS SELECTION CHANGED   --------------------------------------------- //
 private void cmbGenero_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
 }