示例#1
0
 public ListViewChangeCommentUndoUnit(ListViewKeyItem item, string oldComment, string newComment, string key)
 {
     this.Key        = key;
     this.OldComment = oldComment;
     this.NewComment = newComment;
     this.Item       = item;
 }
        /// <summary>
        /// Returns image for the list view item based on its type
        /// </summary>
        private object GetImageFor(ListViewKeyItem item)
        {
            ListView ListView = item.ListView;

            if (ListView is ResXSoundsList)
            {
                return(Editor.play);
            }
            else if (ListView is ResXFilesList)
            {
                return(Editor.doc);
            }
            else if (ListView is ResXImagesList)
            {
                return(item.DataNode.GetValue <Bitmap>());
            }
            else
            {
                return(item.DataNode.GetValue <Icon>());
            }
        }
示例#3
0
        public ListViewNewItemCreateUndoUnit(ResXEditorControl control, ListViewKeyItem item, KeyValueIdentifierConflictResolver conflictResolver)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (conflictResolver == null)
            {
                throw new ArgumentNullException("conflictResolver");
            }

            this.Item = item;

            RemoveUnit = new ListViewRemoveItemsUndoUnit(control, new List <ListViewKeyItem>()
            {
                item
            }, conflictResolver);
        }
        public ListViewRenameKeyUndoUnit(ResXEditorControl control, AbstractListView listView, ListViewKeyItem item, string oldKey, string newKey)
            : base(oldKey, newKey)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }
            if (listView == null)
            {
                throw new ArgumentNullException("listView");
            }
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            this.Item     = item;
            this.ListView = listView;
            this.Control  = control;
        }