protected override void OnDisappearing() { _timerStarted = null; NotesCell.Tapped -= NotesCell_Tapped; EditItem?.Dispose(); CleanupAttachmentCells(); }
public void Parse_DeleteItem_CreatesDefaultDelete() { // Arrange Parser sut = new Parser(); const string Item = "TestItem"; string[] items = { $"-{Item}" }; // Act IEnumerable <EditItem> enumerable = sut.Parse(items); var actual = enumerable.First(); // Assert // The defaults returned from the parser are not necessarily the // default values of the EditItem. Here are the defaults we // expect from the Parser: const EditItem.Location DefaultLocation = EditItem.Location.Beginning; const Hive DefaultHive = Hive.User; var expected = new EditItem(Item, EditItem.Action.Delete, DefaultHive, DefaultLocation); Assert.That(actual, Is.EqualTo(expected)); }
private void SaveEditItem(EditItem editItem) { if (_statusIsErrorMessage) { // After an edit, clear the error message ClearStatusMessage(render: true); } if (IsLastEditItemReplaceable) { int lastEditIndex = _edits.Count - 1; if (editItem.Replaceable) { if (_edits[lastEditIndex] is GroupedEdit groupedEdit) { var groupedEdits = groupedEdit._groupedEditItems; groupedEdits[groupedEdits.Count - 1] = editItem; } else { _edits[lastEditIndex] = editItem; } return; } _edits[lastEditIndex].Replaceable = false; } _edits.Add(editItem); _undoEditIndex = _edits.Count; }
protected override void OnDisappearing() { _pageDisappeared = true; NotesCell.Tapped -= NotesCell_Tapped; EditItem?.Dispose(); CleanupAttachmentCells(); }
/// <summary> /// Invert the case of the current character and move to the next one. /// </summary> public static void InvertCase(ConsoleKeyInfo?key = null, object arg = null) { if (_singleton._current >= _singleton._buffer.Length) { Ding(); return; } int qty = (arg is int) ? (int)arg : 1; for (; qty > 0 && _singleton._current < _singleton._buffer.Length; qty--) { char c = _singleton._buffer[_singleton._current]; if (Char.IsLetter(c)) { char newChar = Char.IsUpper(c) ? Char.ToLower(c) : char.ToUpper(c); EditItem delEditItem = EditItemDelete.Create(c.ToString(), _singleton._current); EditItem insEditItem = EditItemInsertChar.Create(newChar, _singleton._current); _singleton.SaveEditItem(GroupedEdit.Create(new List <EditItem> { delEditItem, insEditItem }, InvertCase, arg )); _singleton._buffer[_singleton._current] = newChar; } _singleton._current = Math.Min(_singleton._current + 1, _singleton._buffer.Length); _singleton.PlaceCursor(); } _singleton.Render(); }
private void InitItemsCount() { // 清空当前显示 for (int i = 0; i < _itemList.Count; i++) { _itemList[i].valueText.text = ""; } string attrValueStr = _nodeAttr.GetValueString(); // 获取掉落道具的列表 List <string> paraList; if (attrValueStr == "") { paraList = new List <string>(); } else { paraList = new List <string>(attrValueStr.Split(',')); } for (int i = 0; i < paraList.Count; i += 2) { eDropItemType curType = (eDropItemType)int.Parse(paraList[i]); EditItem editItem = GetEditItemByType(curType); editItem.valueText.text = paraList[i + 1]; } }
public void Execute_AddToBothHives_BothHivesGetNew() { // Arrange editor = new FakeRegistryEditor(); editor.SetSysStrings(SysOrig); editor.SetUseStrings(UseOrig); sut = new Script(editor); EditItem ed1 = new EditItem(TestPath, EditItem.Action.Add, Hive.System, EditItem.Location.Beginning); EditItem ed2 = new EditItem(TestPath, EditItem.Action.Add, Hive.User, EditItem.Location.Beginning); EditItem[] items = { ed1, ed2 }; // Act sut.Execute(items); // Assert var expectedSys = new List <string> { TestPath }; expectedSys.AddRange(SysOrig); var expectedUser = new List <string> { TestPath }; expectedUser.AddRange(UseOrig); var actualSys = editor.ReceivedSystem; var actualUser = editor.ReceivedUser; CollectionAssert.AreEqual(expectedSys, actualSys); CollectionAssert.AreEqual(expectedUser, actualUser); }
public void UpdateItem(int posx, int posy, int posn, int id) { EditList list = listDic[GridModel.Instance.brushType]; EditItem item = list.GetItemByPos(posx, posy, posn); if (GridModel.Instance.brushType == FightLayerType.cell) { config_cell_item config_cell = (config_cell_item)GridMain.resourceMgr.config_cell.GetItem(id); item.icon = config_cell.icon; item.zrotate = config_cell.rotate * FightConst.ROTATE_BASE; } else if (GridModel.Instance.brushType == FightLayerType.monster) { config_monster_item config_monster = (config_monster_item)GridMain.resourceMgr.config_monster.GetItem(id); item.icon = config_monster.icon; item.zrotate = config_monster.rotate * FightConst.ROTATE_BASE; } else if (GridModel.Instance.brushType == FightLayerType.cover) { config_cover_item config_cover = (config_cover_item)GridMain.resourceMgr.config_cover.GetItem(id); item.icon = config_cover.icon; } else { item.icon = id; } }
public SelectCostObjective(MainWindow mainWindow, EditItem itemWindow) : this() { this.editItemWindow = itemWindow; this.mainWindow = mainWindow; Scenario = CostObjectiveScenarios.EditItem; async = new AsyncWork(mainWindow); async2 = new AsyncWork(mainWindow); async3 = new AsyncWork(mainWindow); }
private void EhEditItem(object sender, RoutedEventArgs e) { var node = ((FrameworkElement)sender).Tag as NGTreeNode; if (node != null) { EditItem?.Invoke(node.Tag as IFitFunctionInformation); } }
private void Edit_Click(object sender, RoutedEventArgs e) { var button = (Button)sender; var model = button.DataContext as ItemModel; var row = dgItems.SelectedItem as ItemModel; EditItem dialog = new EditItem(mainWindow, model, this); dialog.ShowDialog(); }
private EditItem GetEditItem() { var newEdit = new EditItem() { Id = IdSelected, Domeniu = tbNume.Text, }; return(newEdit); }
/// <summary> /// Context Menu [Edit] click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuItemEdit_Click(object sender, RoutedEventArgs e) { var dialog = new EditItem(this._owner, this._model); if (true != dialog.ShowDialog()) { return; } this.ItemUpdated?.Invoke(this, new ItemEventArgs(dialog.Model)); }
void изменитьToolStripMenuItem_Click(object sender, EventArgs e) { if (EditItem != null) { if (IsSelectedCellGrid()) { EditItem.Invoke(dataGridView_db.SelectedRows[0].Cells[0].Value); } } }
public EditItemViewModel(EditItem editItemOpen, vwProduct warehouseItemEdit) { editItem = editItemOpen; WarehouseItem = warehouseItemEdit; WarehouseItemList = dataBaseService.GetAllWarehouseItems().ToList(); ProductNameBeforeEdit = warehouseItem.ProductName; ProductNumberBeforeEdit = warehouseItem.ProductNumber; AmountBeforeEdit = warehouseItem.Amount; PriceBeforeEdit = warehouseItem.Price; actionEventObject = new ActionEvent(); actionEventObject.ActionPerformed += ActionPerformed; }
private void SaveEditItem(EditItem editItem) { // If there is some sort of edit after an undo, forget // any edit items that were undone. int removeCount = _edits.Count - _undoEditIndex; if (removeCount > 0) { _edits.RemoveRange(_undoEditIndex, removeCount); } _edits.Add(editItem); _undoEditIndex = _edits.Count; }
public void Execute_DeleteNullItem_DeletesNothing() { // Verify that a command to delete a null entry in a hive deletes nothing. // Arrange EditItem sut = new EditItem(path: null, EditItem.Action.Delete); // Act sut.Execute(Hive.System, pathList); // Assert CollectionAssert.AreEqual(Original, pathList); }
private void SaveEditItem(EditItem editItem) { // If there is some sort of edit after an undo, forget // the int removeCount = _edits.Count - _undoEditIndex; if (removeCount > 0) { _edits.RemoveRange(_undoEditIndex, removeCount); } _edits.Add(editItem); _undoEditIndex = _edits.Count; _editGroupCount++; }
private EditItem <T> GetOptions <T>() where T : BaseEntity { var repository = _unitOfWork.GetRepository <T>(); var items = Mapper.MapLists(repository.GetAll()); var editItem = new EditItem <T>() { Items = items, ItemType = typeof(T).Name }; return(editItem); }
private EditItem <T> GetArtworkOptions <T>() where T : ArtworkEntity { var repository = _unitOfWork.GetRepository <T>(); var items = Mapper.MapLists(repository.GetAll()).Where(a => a.BasePrice.Type.Contains(typeof(T).Name)); var editItem = new EditItem <T>() { Items = items, ItemType = typeof(T).Name }; return(editItem); }
/// <summary> /// Repeat the last text modification. /// </summary> public static void RepeatLastCommand(ConsoleKeyInfo?key = null, object arg = null) { if (_singleton._undoEditIndex > 0) { EditItem editItem = _singleton._edits[_singleton._undoEditIndex - 1]; if (editItem._instigator != null) { editItem._instigator(key, editItem._instigatorArg); return; } } Ding(); }
private void SaveEditItem(EditItem editItem) { if (_statusIsErrorMessage) { // After an edit, clear the error message ClearStatusMessage(render: true); } RemoveEditsAfterUndo(); _edits.Add(editItem); _undoEditIndex = _edits.Count; }
private EditItem GetEditItem() { var newEdit = new EditItem() { Id = IdSelected, Nume = tbNume.Text, Varsta = tbVarsta.Value, Sex = cmbSex.Text, Email = tbEmail.Text }; return(newEdit); }
void EditDialog() { EditItem editItem = new EditItem(); EditItemViewModel editItemViewModel = new EditItemViewModel(_Items, _SelectedItem, editItem); editItem.DataContext = editItemViewModel; bool?result = editItem.ShowDialog(); if (result.HasValue) { var tempItems = _Items; Items = new ObservableCollection <Item>(tempItems); } }
public EditItem GetItemByPos(int posx, int posy, int posn) { for (int i = 0; i < list.items.Count; i++) { GameObject item = list.items[i]; EditItem itemCtr = item.GetComponent <EditItem>(); if (itemCtr.gridPos.x == posx && itemCtr.gridPos.y == posy && itemCtr.gridPos.z == posn) { return(itemCtr); } } return(null); }
private EditItem GetEditItem() { var newEdit = new EditItem() { Id = IdSelected, Nume = tbNume.Text, CUI = tbCUI.Text, Sold = tbSold.Value, Email = tbEmail.Text, Telefon = tbTelefon.Text }; return(newEdit); }
protected virtual void CreateCoverItem(int posX, int posY, int id) { GameObject item = list.NewItem(); item.name = posX + "_" + posY; EditItem itemCtr = item.GetComponent <EditItem>(); itemCtr.type = type; itemCtr.gridPos = new Vector3(posX, posY, 0); itemCtr.icon = id; PosMgr.SetCellPos(item.transform, posX, posY, 0.4f); EventTriggerListener.Get(item).onClick = itemCtr.OnCellClick; }
public void Execute_DeleteNullPath_DeletesNothing() { // Verify that a null entry in a hive is not deleted. // Arrange EditItem sut = new EditItem(Existing, EditItem.Action.Delete); // Act pathList[1] = null; sut.Execute(Hive.System, pathList); // Assert string[] expected = { Original[0], null, Original[2], Original[3] }; CollectionAssert.AreEqual(expected, pathList); }
private EditItem GetEditItem() { var selectedFurnizor = (dynamic)cmbFurnizor.SelectedItem; var newEdit = new EditItem() { Id = IdPlataSelected, Furnizor = (int)selectedFurnizor.IdFurnizor, Suma = (double)tbSuma.Value, Data = dtData.Value, SerieDocument = tbSerie.Text, NrDocument = (int)tbNrDoc.Value }; return(newEdit); }
public void Execute_Delete_DeletesFromSystem() { // Verify that the SUT deletes the requested item from somewhere // in the middle of the System hive. // Arrange EditItem sut = new EditItem(Existing, EditItem.Action.Delete); // Act sut.Execute(Hive.System, pathList); // Assert string[] expected = { Original[0], Original[2], Original[3] }; CollectionAssert.AreEqual(expected, pathList); }
public void Execute_AddUserEndAlready_DoesNotAdd() { // Verify that the SUT does not add a string to the end of // the user hive if it is already in the hive. // Arrange EditItem sut = new EditItem(Existing, EditItem.Action.Add, Hive.User, EditItem.Location.End); // Act sut.Execute(Hive.User, pathList); // Assert CollectionAssert.AreEqual(Original, pathList); }
public void Execute_AddSystemEnd_NoAddToUser() { // Verify that the SUT does not molest the hive it is supposed to // leave alone. // Arrange EditItem sut = new EditItem(TestPath, EditItem.Action.Add, Hive.System, EditItem.Location.End); // Act sut.Execute(Hive.User, pathList); // Assert CollectionAssert.AreEqual(Original, pathList); }
public void Execute_AddSystemBeginAlready_DoesNotAdd() { // Verify that the SUT does not add a string to the beginning of // system the hive if it is already in the hive. // Arrange EditItem sut = new EditItem(Existing, EditItem.Action.Add, Hive.System, EditItem.Location.Beginning); // Act sut.Execute(Hive.System, pathList); // Assert CollectionAssert.AreEqual(Original, pathList); }
private void SaveEditItem(EditItem editItem) { // If there is some sort of edit after an undo, forget // any edit items that were undone. int removeCount = _edits.Count - _undoEditIndex; if (removeCount > 0) { _edits.RemoveRange(_undoEditIndex, removeCount); if (_editGroupStart >= 0) { // Adjust the edit group start if we are started a group. _editGroupStart -= removeCount; } } _edits.Add(editItem); _undoEditIndex = _edits.Count; }
/// <summary> /// Constructor /// Creates a InnerHasEditItems link in the same Partition as the given Inner /// </summary> /// <param name="source">Inner to use as the source of the relationship.</param> /// <param name="target">EditItem to use as the target of the relationship.</param> public InnerHasEditItems(Inner source, EditItem target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(InnerHasEditItems.InnerDomainRoleId, source), new DslModeling::RoleAssignment(InnerHasEditItems.EditItemDomainRoleId, target)}, null) { }
public static Inner GetInner(EditItem element) { return DslModeling::DomainRoleInfo.GetLinkedElement(element, EditItemDomainRoleId) as Inner; }
public static void SetInner(EditItem element, Inner newInner) { DslModeling::DomainRoleInfo.SetLinkedElement(element, EditItemDomainRoleId, newInner); }