Ejemplo n.º 1
0
 public void Add(IProjectItem projectItem)
 {
     if (!ProjectItems.Contains(projectItem))
     {
         ProjectItems.Add(projectItem);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Imports a project item from a source file to this project.
        /// </summary>
        public ProjectItem Import(string fileName, IImporter importer)
        {
            var result = new ProjectItem(this, fileName, importer);

            ProjectItems.Add(result);
            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new project item with the specified object model inside the target project.
        /// </summary>
        public ProjectItem Create(object objectModel)
        {
            var result = new ProjectItem(this, objectModel);

            ProjectItems.Add(result);
            return(result);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a new project item from a factory.
        /// </summary>
        public ProjectItem Create(IFactory factory)
        {
            Verify.IsNotNull(factory, "factory");

            var result = new ProjectItem(this, factory.Create(this, null));

            ProjectItems.Add(result);
            return(result);
        }
Ejemplo n.º 5
0
        public async Task LoadMoreAsync()
        {
            IsLoading = true;
            var projectPreviews = await _projectsService.GetProjects(ProjectItems.Count, ProjectsPageSize);

            var newProjects = projectPreviews.Where(preview => ProjectItems.All(item => item.ProjectId != preview.ProjectId));
            var newItems    = newProjects.Select(ToViewModel).ToArray();

            foreach (var viewModel in newItems)
            {
                ProjectItems.Add(viewModel);
            }
            IsLoading = false;
        }
        private void RefreshProject()
        {
            _projectIsDirty = false;
            ProjectItems.Clear();
            ProjectItems.Add(CurrentProjectInfo.ProjectItem);

            foreach (var fileInfo in CurrentProjectInfo.Files)
            {
                var parent = GenerateAndGetFolder(fileInfo);
                if (parent == null)
                {
                    continue;
                }

                var fileName = Path.GetFileName(fileInfo.RealPath);
                parent.AddChild(new ProjectItem <FileProjectItemDefinition>
                {
                    Text = fileName,
                    Tag  = fileInfo.RealPath
                });
            }
        }
 void AddButton_Click(object sender, RoutedEventArgs e)
 {
     ProjectItems.Add(SelectedNameSpace);
     IsDirty = true;
 }