Пример #1
0
		public AssemblyReferencesModel(IAssemblyModel parentAssemblyModel)
		{
			if (parentAssemblyModel == null)
				throw new ArgumentNullException("parentAssemblyModel");
			
			assemblyNames = new NullSafeSimpleModelCollection<IAssemblyReferenceModel>();
			this.parentAssemblyModel = parentAssemblyModel;
		}
Пример #2
0
 public NamespaceModel(IProject parentProject, NamespaceModel parent, string name)
 {
     this.parentProject = parentProject;
     this.parent = parent;
     this.name = name;
     this.typeDefinitions = new NullSafeSimpleModelCollection<ITypeDefinitionModel>();
     this.childNamespaces = new NullSafeSimpleModelCollection<NamespaceModel>();
 }
 public SolutionAssemblyList(ISolution solution)
 {
     this.solution = solution;
     if (solution != null) {
         Name = solution.Name;
         Assemblies = new NullSafeSimpleModelCollection<IAssemblyModel>();
         Assemblies.AddRange(solution.Projects.Select(p => p.AssemblyModel));
     }
 }
Пример #4
0
		public SDProjectService()
		{
			allSolutions = new NullSafeSimpleModelCollection<ISolution>();
			allProjects = allSolutions.SelectMany(s => s.Projects);
			
			SD.GetFutureService<IWorkbench>().ContinueWith(t => t.Result.ActiveViewContentChanged += ActiveViewContentChanged);
			
			var applicationStateInfoService = SD.GetService<ApplicationStateInfoService>();
			if (applicationStateInfoService != null) {
				applicationStateInfoService.RegisterStateGetter("ProjectService.CurrentSolution", delegate { return CurrentSolution; });
				applicationStateInfoService.RegisterStateGetter("ProjectService.CurrentProject", delegate { return CurrentProject; });
			}
			
			SD.Services.AddService(typeof(IProjectServiceRaiseEvents), this);
		}
Пример #5
0
		public SDProjectService()
		{
			allSolutions = new NullSafeSimpleModelCollection<ISolution>();
			allProjects = allSolutions.SelectMany(s => s.Projects);
			projectBindings = SD.AddInTree.BuildItems<ProjectBindingDescriptor>("/SharpDevelop/Workbench/ProjectBindings", null);
			targetFrameworks = SD.AddInTree.BuildItems<TargetFramework>("/SharpDevelop/TargetFrameworks", null);
			
			SD.GetFutureService<IWorkbench>().ContinueWith(t => t.Result.ActiveViewContentChanged += ActiveViewContentChanged).FireAndForget();
			
			var applicationStateInfoService = SD.GetService<ApplicationStateInfoService>();
			if (applicationStateInfoService != null) {
				applicationStateInfoService.RegisterStateGetter("ProjectService.CurrentSolution", delegate { return CurrentSolution; });
				applicationStateInfoService.RegisterStateGetter("ProjectService.CurrentProject", delegate { return CurrentProject; });
			}
			
			SD.Services.AddService(typeof(IProjectServiceRaiseEvents), this);
		}
Пример #6
0
        public SDProjectService()
        {
            allSolutions     = new NullSafeSimpleModelCollection <ISolution>();
            allProjects      = allSolutions.SelectMany(s => s.Projects);
            projectBindings  = SD.AddInTree.BuildItems <ProjectBindingDescriptor>("/SharpDevelop/Workbench/ProjectBindings", null);
            targetFrameworks = SD.AddInTree.BuildItems <TargetFramework>("/SharpDevelop/TargetFrameworks", null);

            SD.GetFutureService <IWorkbench>().ContinueWith(t => t.Result.ActiveViewContentChanged += ActiveViewContentChanged).FireAndForget();

            var applicationStateInfoService = SD.GetService <ApplicationStateInfoService>();

            if (applicationStateInfoService != null)
            {
                applicationStateInfoService.RegisterStateGetter("ProjectService.CurrentSolution", delegate { return(CurrentSolution); });
                applicationStateInfoService.RegisterStateGetter("ProjectService.CurrentProject", delegate { return(CurrentProject); });
            }

            SD.Services.AddService(typeof(IProjectServiceRaiseEvents), this);
        }
Пример #7
0
        SD.ISolution CreateSharpDevelopSolution(string fileName = @"d:\projects\MyProject\MyProject.sln")
        {
            var solution         = MockRepository.GenerateStub <ISolution>();
            var solutionFileName = new FileName(fileName);

            solution.Stub(s => s.FileName).Return(solutionFileName);
            solution.Stub(s => s.Directory).Return(solutionFileName.GetParentDirectory());

            var sections = new SimpleModelCollection <SolutionSection>(new SolutionSection[0]);

            solution.Stub(s => s.GlobalSections).Return(sections);

            solution.Stub(s => s.MSBuildProjectCollection).Return(new ProjectCollection());

            var projects = new SimpleModelCollection <IProject>();

            solution.Stub(s => s.Projects).Return(projects);

            var items = new NullSafeSimpleModelCollection <ISolutionItem>();

            solution.Stub(s => s.Items).Return(items);

            return(solution);
        }
Пример #8
0
 public AssemblyList()
 {
     Name = "<default>";
     Assemblies = new NullSafeSimpleModelCollection<IAssemblyModel>();
 }
Пример #9
0
        SD.ISolution CreateSharpDevelopSolution(string fileName = @"d:\projects\MyProject\MyProject.sln")
        {
            var solution = MockRepository.GenerateStub<ISolution>();
            var solutionFileName = new FileName(fileName);
            solution.Stub(s => s.FileName).Return(solutionFileName);
            solution.Stub(s => s.Directory).Return(solutionFileName.GetParentDirectory());

            var sections = new SimpleModelCollection<SolutionSection>(new SolutionSection[0]);
            solution.Stub(s => s.GlobalSections).Return(sections);

            solution.Stub(s => s.MSBuildProjectCollection).Return(new ProjectCollection());

            var projects = new SimpleModelCollection<IProject>();
            solution.Stub(s => s.Projects).Return(projects);

            var items = new NullSafeSimpleModelCollection<ISolutionItem>();
            solution.Stub(s => s.Items).Return(items);

            return solution;
        }