Example #1
0
        /// <summary>
        /// Initializes data model before UI's shown.
        /// </summary>
        /// <param name="argument">Optional argument.</param>
        public override void OnInitialize(object argument)
        {
            _log.LogMessage(this.Feature, "Initializing...");

            if (!(argument is CodeModelFilterFlags))
            {
                throw new ArgumentException("Invalid initialization argument", nameof(argument));
            }

            this.FileName = _optionsService.GetStringOption(this.Feature, "File", this.FileName);
            _search       = _optionsService.GetStringOption(this.Feature, "Search", _search);
            this.Filter   = (CodeModelFilterFlags)argument;
            var filter = (CodeModelFilterFlags)_optionsService.GetIntOption(this.Feature, "Filter", (int)this.Filter);

            if (filter != this.Filter)
            {
                _search = string.Empty;
            }

            ApplyMembers();

            using (_members.DeferRefresh())             // defers filter evaluation until end of using
            {
                _members.Filter += OnFilter;

                OnSearch();
            }

            _log.LogMessage(this.Feature, "Initialized");
        }
Example #2
0
        /// <summary>
        /// Initializes data model before UI's shown.
        /// </summary>
        /// <param name="argument">Optional argument.</param>
        public override void OnInitialize(object argument)
        {
            _log.LogMessage(this.Feature, "Initializing...");

            var model        = _solutionProcessor.GetProjects(ProcessorFlags.IncludeFiles | ProcessorFlags.GroupLinkedFiles);
            var files        = model.Files;
            var solutionName = model.SolutionName;

            files = ApplyOptions(files);

            this.SolutionName = _optionsService.GetStringOption(this.Feature, "Solution", this.SolutionName);
            _search           = _optionsService.GetStringOption(this.Feature, "Search", _search);
            _allFiles         = _optionsService.GetBoolOption(this.Feature, "AllFiles", _allFiles);

            // Reset search on new solution
            if (!string.IsNullOrEmpty(this.SolutionName) && !string.IsNullOrEmpty(solutionName) && !solutionName.Equals(this.SolutionName, StringComparison.OrdinalIgnoreCase))
            {
                _search = string.Empty;
            }
            this.SolutionName = solutionName;

            _sourceFiles.Clear();
            _sourceFiles.AddRange(files);             // causes filter to be evaluated

            using (_files.DeferRefresh())             // defers filter evaluation until end of using
            {
                _files.Filter += OnFilter;

                OnSearch();
            }

            _log.LogMessage(this.Feature, "Initialized");
        }
Example #3
0
        /// <summary>
        /// Initializes data model before UI's shown.
        /// </summary>
        /// <param name="argument">Optional argument.</param>
        public override void OnInitialize(object argument)
        {
            _log.LogMessage(this.Feature, "Initializing...");

            var files = _solutionProcessor.GetProjects(ProcessorFlags.IncludeFiles | ProcessorFlags.GroupLinkedFiles).Files;

            files = ApplyOptions(files);

            _search   = _optionsService.GetStringOption(this.Feature, "Search", _search);
            _allFiles = _optionsService.GetBoolOption(this.Feature, "AllFiles", _allFiles);

            _sourceFiles.Clear();
            _sourceFiles.AddRange(files);             // causes filter to be evaluated

            using (_files.DeferRefresh())             // defers filter evaluation until end of using
            {
                _files.Filter += OnFilter;

                OnSearch();
            }

            _log.LogMessage(this.Feature, "Initialized");
        }