コード例 #1
0
        public void loadPinnedTasks(ConfigFile configFile)
        {
            ConfigSection        taskbarSection       = configFile.createOrRetrieveConfigSection(TASKBAR_ALIGNMENT_SECTION);
            PinnedTaskSerializer pinnedTaskSerializer = new PinnedTaskSerializer(taskbarSection);

            String taskbarAlignmentString = taskbarSection.getValue("MainTaskbarAlignment", taskbar.Alignment.ToString());

            try
            {
                taskbar.Alignment = (TaskbarAlignment)Enum.Parse(typeof(TaskbarAlignment), taskbarAlignmentString);
            }
            catch (Exception)
            {
                Log.Warning("Could not parse the taskbar alignment {0}. Using default.", taskbarAlignmentString);
            }

            ConfigIterator configIterator = pinnedTaskSerializer.Tasks;

            while (configIterator.hasNext())
            {
                String uniqueName = configIterator.next();
                Task   item       = taskController.getTask(uniqueName);
                if (item != null)
                {
                    addPinnedTaskbarItem(item, -1);
                }
                else
                {
                    MissingTaskbarItem missingItem = new MissingTaskbarItem(uniqueName);
                    missingItem.RemoveFromTaskbar += missingItem_RemoveFromTaskbar;
                    taskbar.addItem(missingItem, -1);
                    missingTasks.Add(uniqueName, missingItem);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Scan for resources using the profile, can be null to use no profile.
        /// </summary>
        /// <param name="profileName">The name of the profile of ignore files.</param>
        public void scanResources(String profileName)
        {
            ignoreDirectories.Clear();
            ignoreFiles.Clear();
            if (profileName != null)
            {
                ConfigFile configFile = new ConfigFile(Path.Combine(solution.WorkingDirectory, profileName + ".rpr"));
                configFile.loadConfigFile();
                ConfigSection  ignoredDirectories = configFile.createOrRetrieveConfigSection("IgnoredDirectories");
                ConfigIterator dirIter            = new ConfigIterator(ignoredDirectories, "Dir");
                while (dirIter.hasNext())
                {
                    addIgnoreDirectory(dirIter.next());
                }
                ConfigSection  ignoredFiles = configFile.createOrRetrieveConfigSection("IgnoredFiles");
                ConfigIterator fileIter     = new ConfigIterator(ignoredFiles, "File");
                while (fileIter.hasNext())
                {
                    addIgnoreFile(fileIter.next());
                }
            }

            ResourceManager resourceManager = solution.getAllResources();

            files.Clear();
            recursiveDirectories.Clear();
            foreach (SubsystemResources subsystem in resourceManager.getSubsystemEnumerator())
            {
                foreach (ResourceGroup group in subsystem.getResourceGroupEnumerator())
                {
                    foreach (Resource resource in group.getResourceEnumerator())
                    {
                        processFile(resource.LocName, resource.Recursive);
                    }
                }
            }
            foreach (ExternalResource additionalResource in solution.AdditionalResources)
            {
                processFile(additionalResource.Path, true);
            }
            foreach (String directory in recursiveDirectories)
            {
                processRecursiveDirectory(directory);
            }
        }
コード例 #3
0
        public void findConfiguredPlugins(ConfigFile configFile)
        {
            String[] args = Environment.GetCommandLineArgs();
            for (int i = 0; i < args.Length; ++i)
            {
                if (args[i] == "-plugin")
                {
                    if (++i < args.Length)
                    {
                        plugins.Add(args[i]);
                    }
                }
            }
            ConfigSection  section = configFile.createOrRetrieveConfigSection("Plugins");
            ConfigIterator iter    = new ConfigIterator(section, "Plugin");

            while (iter.hasNext())
            {
                plugins.Add(iter.next());
            }
        }