コード例 #1
0
 private void LoadItems(bool isReference)
 {
     using (var shellKey = RegistryEx.GetRegistryKey(ShellPath))
     {
         foreach (string itemName in shellKey.GetSubKeyNames())
         {
             if (Filter != null && !Filter(itemName))
             {
                 continue;
             }
             string         regPath = $@"{ShellPath}\{itemName}";
             StoreShellItem item    = new StoreShellItem(regPath, isReference);
             item.SelectedChanged += () =>
             {
                 foreach (StoreShellItem shellItem in list.Controls)
                 {
                     if (!shellItem.IsSelected)
                     {
                         chkSelectAll.Checked = false;
                         return;
                     }
                 }
                 chkSelectAll.Checked = true;
             };
             list.AddItem(item);
         }
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: ulivegenov/SoftUni
    static void Main(string[] args)
    {
        string[] input          = Console.ReadLine().Split(' ');
        int      countOfRemoves = int.Parse(Console.ReadLine());


        AddCollection       addCollection       = new AddCollection();
        AddRemoveCollection addRemoveCollection = new AddRemoveCollection();
        MyList myList = new MyList();

        foreach (var item in input)
        {
            addCollection.AddItem(item);
            addRemoveCollection.AddItem(item);
            myList.AddItem(item);
        }

        for (int i = 0; i < countOfRemoves; i++)
        {
            addRemoveCollection.RemoveItem();
            myList.RemoveItem();
        }

        Console.WriteLine(string.Join(" ", addCollection.CollectionAdds));
        Console.WriteLine(string.Join(" ", addRemoveCollection.CollectionAdds));
        Console.WriteLine(string.Join(" ", myList.CollectionAdds));
        Console.WriteLine(string.Join(" ", addRemoveCollection.CollectionRemovedItems));
        Console.WriteLine(string.Join(" ", myList.CollectionRemovedItems));
    }
コード例 #3
0
        private void AddItems(string[] wordsToAdd)
        {
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < 3; i++)
            {
                if (i == 0)
                {
                    foreach (var word in wordsToAdd)
                    {
                        sb.Append(addCollection.AddItem(word) + " ");
                    }
                }
                else if (i == 1)
                {
                    foreach (var word in wordsToAdd)
                    {
                        sb.Append(addRemoveCollection.AddItem(word) + " ");
                    }
                }
                else
                {
                    foreach (var word in wordsToAdd)
                    {
                        sb.Append(myList.AddItem(word) + " ");
                    }
                }

                Console.WriteLine(sb.ToString().TrimEnd());
                sb.Clear();
            }
        }
コード例 #4
0
 private void LoadItems()
 {
     using (var shellKey = RegistryEx.GetRegistryKey(ShellPath))
     {
         Array.ForEach(Array.FindAll(shellKey.GetSubKeyNames(), itemName =>
                                     !IgnoredKeyNames.Contains(itemName, StringComparer.OrdinalIgnoreCase)), itemName =>
         {
             string regPath = $@"{ShellPath}\{itemName}";
             list.AddItem(new StoreShellItem(regPath, IsPublic));
         });
     }
 }
コード例 #5
0
 private void LoadItems(bool isReference)
 {
     using (var shellKey = RegistryEx.GetRegistryKey(ShellPath))
     {
         foreach (string itemName in shellKey.GetSubKeyNames())
         {
             if (Filter != null && !Filter(itemName))
             {
                 continue;
             }
             string regPath = $@"{ShellPath}\{itemName}";
             list.AddItem(new StoreShellItem(regPath, isReference));
         }
     }
 }