コード例 #1
0
ファイル: VaultViewCipherPage.cs プロジェクト: pee/mobile
 protected override void OnDisappearing()
 {
     _timerStarted     = null;
     NotesCell.Tapped -= NotesCell_Tapped;
     EditItem?.Dispose();
     CleanupAttachmentCells();
 }
コード例 #2
0
ファイル: TestParser.cs プロジェクト: weblum/PathEdit
        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));
        }
コード例 #3
0
ファイル: UndoRedo.cs プロジェクト: sdwheeler/PSReadLine
        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;
        }
コード例 #4
0
 protected override void OnDisappearing()
 {
     _pageDisappeared  = true;
     NotesCell.Tapped -= NotesCell_Tapped;
     EditItem?.Dispose();
     CleanupAttachmentCells();
 }
コード例 #5
0
        /// <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();
        }
コード例 #6
0
        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];
            }
        }
コード例 #7
0
ファイル: TestScript.cs プロジェクト: weblum/PathEdit
        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);
        }
コード例 #8
0
    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;
        }
    }
コード例 #9
0
 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);
 }
コード例 #10
0
        private void EhEditItem(object sender, RoutedEventArgs e)
        {
            var node = ((FrameworkElement)sender).Tag as NGTreeNode;

            if (node != null)
            {
                EditItem?.Invoke(node.Tag as IFitFunctionInformation);
            }
        }
コード例 #11
0
        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();
        }
コード例 #12
0
        private EditItem GetEditItem()
        {
            var newEdit = new EditItem()
            {
                Id      = IdSelected,
                Domeniu = tbNume.Text,
            };

            return(newEdit);
        }
コード例 #13
0
        /// <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));
        }
コード例 #14
0
ファイル: MSQGrid.cs プロジェクト: victorsalekseev/NetcodeLib
 void изменитьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (EditItem != null)
     {
         if (IsSelectedCellGrid())
         {
             EditItem.Invoke(dataGridView_db.SelectedRows[0].Cells[0].Value);
         }
     }
 }
コード例 #15
0
 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;
 }
コード例 #16
0
ファイル: UndoRedo.cs プロジェクト: TyrelBaux/PSReadLine
 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;
 }
コード例 #17
0
ファイル: TestEditItem.cs プロジェクト: weblum/PathEdit
        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);
        }
コード例 #18
0
ファイル: UndoRedo.cs プロジェクト: powercode/PSReadLine
 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++;
 }
コード例 #19
0
ファイル: AdminService.cs プロジェクト: Bohdan20/Bike-Store
        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);
        }
コード例 #20
0
ファイル: AdminService.cs プロジェクト: Bohdan20/Bike-Store
        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);
        }
コード例 #21
0
 /// <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();
 }
コード例 #22
0
ファイル: UndoRedo.cs プロジェクト: sethvs/PSReadLine
        private void SaveEditItem(EditItem editItem)
        {
            if (_statusIsErrorMessage)
            {
                // After an edit, clear the error message
                ClearStatusMessage(render: true);
            }

            RemoveEditsAfterUndo();

            _edits.Add(editItem);
            _undoEditIndex = _edits.Count;
        }
コード例 #23
0
        private EditItem GetEditItem()
        {
            var newEdit = new EditItem()
            {
                Id     = IdSelected,
                Nume   = tbNume.Text,
                Varsta = tbVarsta.Value,
                Sex    = cmbSex.Text,
                Email  = tbEmail.Text
            };

            return(newEdit);
        }
コード例 #24
0
        private void SaveEditItem(EditItem editItem)
        {
            if (_statusIsErrorMessage)
            {
                // After an edit, clear the error message
                ClearStatusMessage(render: true);
            }

            RemoveEditsAfterUndo();

            _edits.Add(editItem);
            _undoEditIndex = _edits.Count;
        }
コード例 #25
0
        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);
            }
        }
コード例 #26
0
        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++;
        }
コード例 #27
0
    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);
    }
コード例 #28
0
ファイル: Furnizor.cs プロジェクト: MateiCh/Librarie
        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);
        }
コード例 #29
0
    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;
    }
コード例 #30
0
ファイル: TestEditItem.cs プロジェクト: weblum/PathEdit
        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);
        }
コード例 #31
0
ファイル: Plati.cs プロジェクト: MateiCh/Librarie
        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);
        }
コード例 #32
0
ファイル: TestEditItem.cs プロジェクト: weblum/PathEdit
        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);
        }
コード例 #33
0
ファイル: TestEditItem.cs プロジェクト: weblum/PathEdit
        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);
        }
コード例 #34
0
ファイル: TestEditItem.cs プロジェクト: weblum/PathEdit
        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);
        }
コード例 #35
0
ファイル: TestEditItem.cs プロジェクト: weblum/PathEdit
        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);
        }
コード例 #36
0
ファイル: UndoRedo.cs プロジェクト: joonro/PSReadLine
 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;
 }
コード例 #37
0
		/// <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)
		{
		}
コード例 #38
0
		public static Inner GetInner(EditItem element)
		{
			return DslModeling::DomainRoleInfo.GetLinkedElement(element, EditItemDomainRoleId) as Inner;
		}
コード例 #39
0
		public static void SetInner(EditItem element, Inner newInner)
		{
			DslModeling::DomainRoleInfo.SetLinkedElement(element, EditItemDomainRoleId, newInner);
		}