상속: Microsoft.VisualStudio.Project.ProjectNode
예제 #1
0
        protected override ProjectNode CreateProject()
        {
            var project = new ProjectionsProjectNode(_package);

            var serviceProvider = (IServiceProvider) _package;

            project.SetSite((IOleServiceProvider)serviceProvider.GetService(typeof (IOleServiceProvider)));
            return project;
        }
예제 #2
0
        private static void AddProjectionFileIntoProject(ProjectionsProjectNode project, ProjectionConfig config, ProjectionStatistics stats)
        {
            var name = config.Name;
            var query = config.Query;

            //create file and node
            var projectionNode = (ProjectionFileNode)project.CreateFileNode(name + ".js");
            File.WriteAllText(projectionNode.Url, query);

            //set node properties
            var nodeProps = (ProjectionFileNodeProperties) projectionNode.NodeProperties;
            nodeProps.Enabled = stats.IsEnabled;
            nodeProps.EmitEnabled = config.IsEmitEnabled;
            nodeProps.CheckpointEnabled = "continuous".Equals(stats.Mode, StringComparison.InvariantCultureIgnoreCase);

            //finally add the node into the project
            project.AddChild(projectionNode);
        }
예제 #3
0
        private static async Task ImportProjectionsAsync(ProjectionsProjectNode project, IProjectionsManager projectionsManager, IList<ProjectionStatistics> projections)
        {
            foreach (var projection in projections)
            {
                var configResponse = await projectionsManager.GetConfigAsync(projection.Name);

                if (!configResponse.IsSuccessful)
                {
                    Output.Pane.OutputStringThreadSafe(
                        string.Format("Unable to fetch projection {0}, server returned {1}", projection.Name,
                                      configResponse.Status));
                    continue;
                }


                AddProjectionFileIntoProject(project, configResponse.Result, projection);
            }
        }
예제 #4
0
 public ProjectionFileNode(ProjectionsProjectNode project, ProjectElement element)
     : base(project, element)
 {
     _project = project;
 }
 public ProjectionsConfigProvider(ProjectionsProjectNode project)
     : base(project)
 {
     this._project = project;
 }
 public ProjectionsProjectConfig(ProjectionsProjectNode project, string configuration)
     : base(project, configuration)
 {
 }