Пример #1
0
 public DeleteStartItemCommand(StartItem startItem, StartManager startMenu)
 {
     this.startItem     = startItem;
     this.startMenu     = startMenu;
     this.startItemName = startItem.Name;
     this.name          = "Delete '" + startItem.Name + "'";
 }
Пример #2
0
	   public MoveFileCommand(string source, string target, StartItem startItem, string oldName, string newName, bool mayFail) {
		  this.source = source;
		  this.target = target;
		  this.startItem = startItem;
		  this.oldName = oldName;
		  this.newName = newName;
		  this.mayFail = mayFail;
		  this.name = "Move '" + this.source + "' to '" + this.target + "'";
	   }
Пример #3
0
 public DeleteFileCommand(string source, string target, StartItem startItem, string oldName, string newName)
 {
     base.source    = source;
     base.target    = target;
     base.startItem = startItem;
     base.oldName   = oldName;
     base.newName   = newName;
     this.name      = "Delete '" + this.source + "'";
 }
Пример #4
0
	   public RenameFileCommand(string source, string target, StartItem startItem, string oldName, string newName, bool mayfail) {
		  base.source = source;
		  base.target = target;
		  base.startItem = startItem;
		  base.oldName = oldName;
		  base.newName = newName;
		  base.mayFail = mayFail;
		  this.name = "Rename '" + this.source + "' to '" + this.target + "'";
	   }
Пример #5
0
 public RenameFileCommand(string source, string target, StartItem startItem, string oldName, string newName, bool mayfail)
 {
     base.source    = source;
     base.target    = target;
     base.startItem = startItem;
     base.oldName   = oldName;
     base.newName   = newName;
     base.mayFail   = mayFail;
     this.name      = "Rename '" + this.source + "' to '" + this.target + "'";
 }
Пример #6
0
 public MoveFileCommand(string source, string target, StartItem startItem, string oldName, string newName, bool mayFail)
 {
     this.source    = source;
     this.target    = target;
     this.startItem = startItem;
     this.oldName   = oldName;
     this.newName   = newName;
     this.mayFail   = mayFail;
     this.name      = "Move '" + this.source + "' to '" + this.target + "'";
 }
Пример #7
0
	   public MoveStartItemCommand(StartItem startItem, string newCategory) {
		  this.startItem = startItem;

		  this.oldCategory = startItem.Category;
		  this.newCategory = newCategory;

		  this.oldName = startItem.Name;
		  this.newName = Path.Combine(newCategory, Path.GetFileName(startItem.Name));

		  this.name = "Move '" + Path.GetFileName(startItem.Name) + "'";

		  //Console.WriteLine("-***'{0}'***-", this.Name);
		  //Console.WriteLine("'{0}' to '{1}'", this.oldCategory, this.newCategory);
		  //Console.WriteLine("'{0}' to '{1}'", this.oldName, this.newName);
		  //Console.WriteLine("-******-");
	   }
Пример #8
0
        public MoveStartItemCommand(StartItem startItem, string newCategory)
        {
            this.startItem = startItem;

            this.oldCategory = startItem.Category;
            this.newCategory = newCategory;

            this.oldName = startItem.Name;
            this.newName = Path.Combine(newCategory, Path.GetFileName(startItem.Name));

            this.name = "Move '" + Path.GetFileName(startItem.Name) + "'";

            //Console.WriteLine("-***'{0}'***-", this.Name);
            //Console.WriteLine("'{0}' to '{1}'", this.oldCategory, this.newCategory);
            //Console.WriteLine("'{0}' to '{1}'", this.oldName, this.newName);
            //Console.WriteLine("-******-");
        }
Пример #9
0
	   public RenameStartItemCommand(StartItem startItem, string newName) {

		  this.startItem = startItem;

		  this.oldCategory = startItem.Category;
		  this.newCategory = startItem.Category;

		  this.oldName = startItem.Name;
		  this.newName = Path.Combine(Path.GetDirectoryName(startItem.Name), newName);

		  this.name = "Rename '" + Path.GetFileName(startItem.Name) + "'";

		  Console.WriteLine("-***'{0}'***-", this.Name);
		  Console.WriteLine("'{0}' to '{1}'", this.oldCategory, this.newCategory);
		  Console.WriteLine("'{0}' to '{1}'", this.oldName, this.newName);
		  Console.WriteLine("-******-");
	   }
Пример #10
0
        public RenameStartItemCommand(StartItem startItem, string newName)
        {
            this.startItem = startItem;

            this.oldCategory = startItem.Category;
            this.newCategory = startItem.Category;

            this.oldName = startItem.Name;
            this.newName = Path.Combine(Path.GetDirectoryName(startItem.Name), newName);

            this.name = "Rename '" + Path.GetFileName(startItem.Name) + "'";

            Console.WriteLine("-***'{0}'***-", this.Name);
            Console.WriteLine("'{0}' to '{1}'", this.oldCategory, this.newCategory);
            Console.WriteLine("'{0}' to '{1}'", this.oldName, this.newName);
            Console.WriteLine("-******-");
        }
Пример #11
0
    public static GameSettings CreateSettings(string _playername, StartItem _startItem)
    {
        GameSettings settings = new GameSettings();

        if (_playername == null || _playername == "")
        {
            settings.playername = "Nameless";
        }
        else
        {
            settings.playername = _playername;
        }

        settings.myItem = _startItem;

        return(settings);
    }
Пример #12
0
	   public DeleteStartItemCommand(StartItem startItem, StartManager startMenu) {
		  this.startItem = startItem;
		  this.startMenu = startMenu;
		  this.startItemName = startItem.Name;
		  this.name = "Delete '" + startItem.Name + "'";
	   }
Пример #13
0
 private void ConvertToCategory(StartItem startItem)
 {
     KnownCategories.Instance.Add(startItem.Name);
     startManager.RemoveItem(startItem);
     foreach (string str in AddCategoryToTree(startItem.Name))
     {
         // This ensures that nodes that are not explicitly listed as categories are scanned
         AddToManager(str);
     }
     startManager.LoadAssociationList(Utility.ASSOCIATION_LIST_FILE_PATH);
     _categoryTree.SelectedNode = _categoryTree.Nodes.Find(startItem.Name, true)[0];
 }
Пример #14
0
	   public ConvertToCategoryCommand(StartItem startItem, ArrayRemoveDelegate removeDelegate) {
		  this.startItem = startItem;
		  this.removeDelegate = removeDelegate;
	   }
Пример #15
0
	   public StartItemSelector(StartItem[] source, StartItemFields field, object query) {
		  this.source = source;
		  this.field = field;
		  this.query = query;
	   }
Пример #16
0
 private ListViewItem FindItem(StartItem tag)
 {
     for (int i = 0; i < _itemList.Items.Count; i++)
     {
         if (_itemList.Items[i].Tag == tag)
         {
             return _itemList.Items[i];
         }
     }
     return null;
 }
Пример #17
0
        private ListViewItem StartItemToListItem(StartItem startItem, bool setIcon)
        {
            ListViewItem listItem;

            string[] validPaths = startItem.GetValidPaths();
            string path = (validPaths.Length >= 1) ? validPaths[0] : "";

            if (startItem.Type == StartItemType.File)
            {
                listItem = new ListViewItem(new string[] { Path.GetFileNameWithoutExtension(startItem.Name), startItem.Location.ToString(), startItem.Application });
            }
            else
            {
                listItem = new ListViewItem(new string[] { Path.GetFileNameWithoutExtension(startItem.Name), startItem.Location.ToString(), startItem.Application });
            }

            listItem.SubItems[1].ForeColor = SystemColors.GrayText;
            listItem.SubItems[2].ForeColor = SystemColors.GrayText;

            listItem.Tag = startItem;
            listItem.Name = startItem.Name;

            if (setIcon)
            {
                listItem.ImageIndex = largeListIconList.IconIndex(path, true, ShellIconStateConstants.ShellIconStateNormal);
            }
            else
            {
                lock (iconInfoLock)
                {
                    iconInfo.Add(listItem, path);
                }
            }

            return listItem;
        }
Пример #18
0
 private void LocateOnDisk(StartItem item)
 {
     string[] validPaths = item.GetValidPaths();
     for (int i = 0; i < validPaths.Length; i++)
     {
         LocateOnDisk(validPaths[i]);
     }
 }
Пример #19
0
        private void RemoveCategory(TreeNode parent)
        {
            // remove the item and all children
            RecursiveRemoveCategory(parent);
            // add it back to parent category
            string grandParent = Path.GetDirectoryName(parent.Name);

            StartItem item = new StartItem(parent.Name, StartItemType.Directory, grandParent);
            if (item.HasLocal || item.HasUser)
            {
                startManager.AddItem(item);
                UpdateItemList(grandParent);
                _itemList.Items[parent.Name].Focused = true;
                _itemList.Focus();
            }
            _categoryTree.SelectedNode = _categoryTree.Nodes.Find(grandParent, true)[0];
        }
Пример #20
0
 public ConvertToCategoryCommand(StartItem startItem, ArrayRemoveDelegate removeDelegate)
 {
     this.startItem      = startItem;
     this.removeDelegate = removeDelegate;
 }