Ejemplo n.º 1
0
        private void formRenamer_Load(object sender, EventArgs e)
        {
            columnError.IsVisible = false;
            SendMessage(textBoxFilter.Handle, 0x1501, 1, "Rename Filter Ex. {name} {titleid} (Click Info for details -->)");
            SendMessage(textBoxSearch.Handle, 0x1501, 1, "Search List..");

            columnPath.AspectToStringConverter = delegate(object row)
            {
                string path = (string)row;

                return(ProcessPathAspect(path));
            };

            columnRenamed.AspectToStringConverter = delegate(object row)
            {
                string path = (string)row;

                return(ProcessPathAspect(path));
            };

            columnError.AspectGetter = delegate(object row)
            {
                RenameItem item = (RenameItem)row;

                if (item.renameException == null)
                {
                    return("");
                }

                return(item.renameException.Message);
            };
            olvRenameList.RebuildColumns();
        }
Ejemplo n.º 2
0
 private bool TryRename(RenameItem item)
 {
     try
     {
         File.Move(item.filePath, item.renamePath);
         item.xci.uniqueId = XciHelper.GetXciIdentifier(item.renamePath);
         //TODO verify file was moved
         return(true);
     } catch (Exception ex)
     {
         item.renameException = ex;
         return(false);
     }
 }