Example #1
0
 public DropHandlerLogic(ILogger logger, IVisualStudioAbstraction vs, IFileSystemAbstraction fileSystem = null, Profile profileOverride = null)
 {
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
     this.vs = vs ?? throw new ArgumentNullException(nameof(vs));
     this.fileSystem = fileSystem ?? new WindowsFileSystem();
     this.profileOverride = profileOverride;
 }
Example #2
0
 public CreateViewCommandLogic(Profile profile, ILogger logger, IVisualStudioAbstraction vs, IFileSystemAbstraction fileSystem = null)
 {
     this.profile    = profile ?? throw new ArgumentNullException(nameof(profile));
     this.logger     = logger ?? throw new ArgumentNullException(nameof(logger));
     this.vs         = vs ?? throw new ArgumentNullException(nameof(vs));
     this.fileSystem = fileSystem ?? new WindowsFileSystem();
 }
Example #3
0
 public RapidXamlDropHandler(ILogger logger, IWpfTextView view, ITextBufferUndoManager undoManager, IVisualStudioAbstraction vs, IFileSystemAbstraction fileSystem = null)
 {
     this.logger      = logger ?? throw new ArgumentNullException(nameof(logger));
     this.view        = view;
     this.undoManager = undoManager;
     this.vs          = vs ?? throw new ArgumentNullException(nameof(vs));
     this.fileSystem  = fileSystem ?? new WindowsFileSystem();
 }
Example #4
0
 public static void Initialize(AsyncPackage rxPackage, ILogger logger)
 {
     package = rxPackage;
     vsa     = new VisualStudioAbstraction(logger, rxPackage, ProjectHelpers.Dte);
 }
Example #5
0
 public InsertGridRowDefinitionCommandLogic(ILogger logger, IVisualStudioAbstraction visualStudioAbstraction)
 {
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
     this.vs     = visualStudioAbstraction ?? throw new ArgumentNullException(nameof(visualStudioAbstraction));
 }
Example #6
0
        public static string GetSubElementAtPosition(ProjectType projectType, string fileName, ITextSnapshot snapshot, string xaml, int position, ILogger logger, string projectFile, IVisualStudioAbstraction vsAbstraction)
        {
            var startPos = xaml.LastIndexOf('<', position, position);

            var elementName = GetElementName(xaml.AsSpan(), startPos);

            string result = null;

            var processor = new SubElementProcessor(new ProcessorEssentials(projectType, logger, projectFile, vsAbstraction));

            processor.SubElementFound += (s, e) => { result = e.SubElement; };

            XamlElementExtractor.Parse(projectType, fileName, snapshot, xaml.Substring(startPos), new List <(string element, XamlElementProcessor processor)> {
                (elementName, processor),
            }, new TagList(), vsAbstraction, skipEveryElementProcessor: true);

#if DEBUG
            if (result == null)
            {
                // If get here it's because there's a subelement that can't be identified correctly by XamlElementExtractor
                // but was detected elsewhere. (Probably by something extending XamlElementProcessor.)
                System.Diagnostics.Debugger.Break();
            }
#endif

            return(result);
        }
 public ProcessorEssentials(ProjectType projectType, ILogger logger, string projectFilePath, IVisualStudioAbstraction vsa)
 {
     this.ProjectType     = projectType;
     this.Logger          = logger;
     this.ProjectFilePath = projectFilePath;
     this.Vsa             = vsa;
 }
 public CustomProcessorWrapper(RapidXaml.ICustomAnalyzer customProcessor, ProjectType projType, string projectPath, ILogger logger, IVisualStudioAbstraction vsa)
     : base(new ProcessorEssentials(projType, logger, projectPath, vsa))
 {
     this.customProcessor = customProcessor;
 }