예제 #1
0
 protected override void Initialize()
 {
     base.Initialize();
     GoToDefinitionCommand.Initialize(this);
     FindAllReferencesCommand.Initialize(this);
     RenameCommand.Initialize(this);
     FindRefsWindowCommand.Initialize(this);
     Reformat.ReformatCommand.Initialize(this);
 }
예제 #2
0
        protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            await base.InitializeAsync(cancellationToken, progress);

            // Attach to solution events
            solution = GetService(typeof(SVsSolution)) as IVsSolution;
            var re = solution.AdviseSolutionEvents(new SolutionEventListener(), out solutionEventsCookie);

            FindAllReferencesCommand.Initialize(this);
            FindRefsWindowCommand.Initialize(this);
            GoToDefinitionCommand.Initialize(this);
            GoToVisitorCommand.Initialize(this);
            NextSymCommand.Initialize(this);
            OptionsCommand.Initialize(this);
            ReformatCommand.Initialize(this);
            RenameCommand.Initialize(this);
            AboutCommand.Initialize(this);
        }
예제 #3
0
        /// <summary>
        /// Generate the list of commands to rename the files
        /// </summary>
        /// <returns>A list of RenameCommands</returns>
        public List <RenameCommand> GenerateRenameCommands()
        {
            //GenerateNewFileNames();

            if (Clashes)
            {
                throw (new RenameClashException());
            }

            List <RenameCommand> commands = new List <RenameCommand>(_fileMetaData.Count);

            // The IOMove object is used to perform IO actions with the filesystem
            var mover = IOMove.Create();

            for (int i = 0; i < _fileMetaData.Count; i++)
            {
                var rename = new RenameCommand(mover);
                rename.Initialize(_fileMetaData[i].Directory, _fileMetaData[i].Name, Files[i].NewFileName);
                commands.Add(rename);
            }

            return(commands);
        }