/// ------------------------------------------------------------------------------------ public ClassesDlg(PaProject project) : this() { Project = project; ClassListView.Load(); HandleClassesListViewSelectedIndexChanged(null, null); ClassListView.Font = FontHelper.UIFont; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Make a copy of the currently selected class. /// </summary> /// ------------------------------------------------------------------------------------ private void HandleCopyButtonClick(object sender, EventArgs e) { if (ClassListView.SelectedItems.Count <= 0) { return; } var item = ClassListView.SelectedItems[0] as ClassListViewItem; if (item == null) { return; } var fmt = LocalizationManager.GetString("DialogBoxes.ClassesDlg.CopyClassPrefix", "Copy of {0}", "Prefix for names of copied items"); string baseName = string.Format(fmt, item.Text); string newName = baseName; fmt = LocalizationManager.GetString("DialogBoxes.ClassesDlg.CopyClassNameFormat", "{0} ({1:D2})", "Format for name of copied class. First parameter is the copied class name and second is a two digit number to make the name unique."); int i = 1; while (ClassListView.DoesClassNameExist(newName, null, false)) { newName = string.Format(fmt, baseName, i++); } item = CopyAndInsertItem(item, newName); ClassListView.LabelEdit = true; item.BeginEdit(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Modify the currently selected class. /// </summary> /// ------------------------------------------------------------------------------------ private void HandleModifyButtonClick(object sender, EventArgs e) { if (ClassListView.SelectedItems.Count == 0) { return; } var item = ClassListView.SelectedItems[0] as ClassListViewItem; if (item == null) { return; } using (var dlg = GetDefineClassDialogForItem(item.ClassType, item)) { //dlg.TxtClassName.Enabled = false; var result = dlg.ShowDialog(this); if (result == DialogResult.Yes || result == DialogResult.OK) { item.Copy(dlg.ClassInfo); item.IsDirty = true; ClassListView.Focus(); } } }
private void GotoClassroom() { GlobalData.Instance.CurrentHomeMenu = MainMenuNames.Classrooms; var view = new ClassListView(); view.Show(); _mainView.Close(); }
/// ------------------------------------------------------------------------------------ protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!App.DesignMode) { ClassListView.LoadSettings(Name); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Delete the currently selected class. /// </summary> /// ------------------------------------------------------------------------------------ private void HandleDeleteButtonClick(object sender, EventArgs e) { if (ClassListView.SelectedItems.Count > 0) { ClassListView.DeleteItem(ClassListView.SelectedItems[0] as ClassListViewItem); } ClassListView.Focus(); }
public ClassListViewModel(ClassListView view) { _listView = view; ClassroomList = new ObservableCollection <ClassroomModel>(); LoadCommand = DelegateCommand.FromAsyncHandler(LoadingAsync); SearchCommand = DelegateCommand.FromAsyncHandler(SearchAsync); GridDownKeyPressCommand = new DelegateCommand(GridDownKeyPress); GridUpKeyPressCommand = new DelegateCommand(GridUpKeyPress); GridLeftOrRightKeyPressCommand = new DelegateCommand(GridLeftOrRightKeyPress); GoBackCommand = new DelegateCommand(GoBack); }
public virtual void RefreshScreen() { ErrorView = null; STClient.ResetData(); Top.Clear(); HostPane.Clear(); ClassListView.Clear(); LeftPane.Clear(); SettingsPane.Clear(); Setup(); Application.Refresh(); }
/// ------------------------------------------------------------------------------------ private void AddClass(SearchClassType type) { using (var dlg = GetDefineClassDialogForItem(type, null)) { var result = dlg.ShowDialog(this); if (result == DialogResult.Yes || result == DialogResult.OK) { var item = dlg.ClassInfo; item.SubItems.Add(new ListViewItem.ListViewSubItem()); item.SubItems.Add(new ListViewItem.ListViewSubItem()); CopyAndInsertItem(item, null); ClassListView.Focus(); } } }
private void ToggleCapability() { if (SelectedItem != null) { if (_componentFrame != null) { HostPane.Remove(_componentFrame); HostPane.Remove(_componentList); HostPane.Remove(_capabilityPresentationJsonView); _componentFrame = null; _componentList = null; _capabilityPresentationJsonView = null; ClassListView.SetFocus(); } else { CapabilitySummary selectedCapability = (CapabilitySummary)SelectedItem; ConfigureCapabilityPane(selectedCapability); } } }
private void ToggleComponentStatus() { if (SelectedItem != null) { if (_componentFrame != null) { HostPane.Remove(_componentFrame); HostPane.Remove(_componentList); HostPane.Remove(_capabilitiesStatusJsonView); _componentFrame = null; _componentList = null; _capabilitiesStatusJsonView = null; ClassListView.SetFocus(); } else { Device selectedDevice = (Device)SelectedItem; ConfigureComponentsStatusPane(selectedDevice); } } }