private static void CopyIProjectItemModelMembers(IProjectItemModel target, IProjectItemModel source)
 {
     target.ProjectId = source.ProjectId;
     target.Id = source.Id;
     target.Name = source.Name;
     target.LastModified = source.LastModified;
 }
 public void AddProjectItem(IProjectItemModel item)
 {
     projectItems.Add(item);
 }
        private void _foldersBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            _activeWebFolder = _foldersBindingSource.Current as IProjectItemModel;
            if (WebFolderChanged != null)
                WebFolderChanged(sender, CreateValidationEventArgs());

            this.ValidateChildren();

            Wizard.OnValidationStateChanged(this);
            RefreshSolutionPreview();
        }
        public void GetAddViewWebsitePreview(string viewName, string viewFileExtension, IProjectItemModel webFolder, IProjectModel webProject)
        {
            if ((webProject != null)
                && (webFolder != null))
            {

                assembliesTreeView.BeginUpdate();
                assembliesTreeView.Nodes.Clear();

                string website=string.Empty;
                if (webProject != null)
                {
                    website = webProject.Name;
                }
                TreeNode websiteNode = assembliesTreeView.Nodes.Add(website);
                websiteNode.ImageKey = webProjectIcon;
                websiteNode.SelectedImageKey = webProjectIcon;

                TreeNode viewContainerNode;
                if (webFolder.Name == "Root")
                {
                    viewContainerNode = websiteNode;
                }
                else
                {
                    TreeNode parentNode = websiteNode;
                    string folderPath = webFolder.ItemPath;
                    string webSitePath = webProject.ProjectPath;

                    if (folderPath.StartsWith(webSitePath))
                    {
                        folderPath = folderPath.Replace(webSitePath, String.Empty);
                        folderPath = System.IO.Path.GetDirectoryName(folderPath);

                        string[] folders = folderPath.Split(new string[] { "\\" }, StringSplitOptions.RemoveEmptyEntries);
                        foreach (string innerFolder in folders)
                        {
                            parentNode = parentNode.Nodes.Add(innerFolder);
                            parentNode.ImageKey = solutionFolderIcon;
                            parentNode.SelectedImageKey = solutionFolderIcon;
                        }
                    }

                    string folder = webFolder.Name;
                    viewContainerNode = parentNode.Nodes.Add(folder);
                    viewContainerNode.ImageKey = solutionFolderIcon;
                    viewContainerNode.SelectedImageKey = solutionFolderIcon;
                }

                TreeNode genericNode1 = viewContainerNode.Nodes.Add(String.Format(CultureInfo.InvariantCulture,ellipsis));
                genericNode1.ImageKey = webFormIcon;
                genericNode1.SelectedImageKey = webFormIcon;

                TreeNode viewNode = viewContainerNode.Nodes.Add(string.Format(CultureInfo.InvariantCulture, "{0}.{1}", viewName ,viewFileExtension));
                if (viewFileExtension == "ascx")
                {
                    viewNode.ImageKey = webUserControlIcon;
                    viewNode.SelectedImageKey = webUserControlIcon;
                }
                else if (viewFileExtension == "master")
                {
                    viewNode.ImageKey = masterPageIcon;
                    viewNode.SelectedImageKey = masterPageIcon;
                }
                else
                {
                    viewNode.ImageKey = webFormIcon;
                    viewNode.SelectedImageKey = webFormIcon;
                }

                TreeNode viewCodebehindNode = viewNode.Nodes.Add(string.Format(CultureInfo.InvariantCulture, "{0}.{1}.{2}", viewName,viewFileExtension, extension));
                viewCodebehindNode.ImageKey = itemIcon;
                viewCodebehindNode.SelectedImageKey = itemIcon;

                TreeNode genericNode2 = viewContainerNode.Nodes.Add(String.Format(CultureInfo.InvariantCulture, ellipsis));
                genericNode2.ImageKey = webFormIcon;
                genericNode2.SelectedImageKey = webFormIcon;

                assembliesTreeView.ExpandAll();
                assembliesTreeView.EndUpdate();
            }
        }
 public void ShowWebFolders(IList<IProjectItemModel> folders, IProjectItemModel selected)
 {
     _foldersBindingSource.DataSource = folders;
     int index = selected == null ? 0 : FindFolder(selected);
     _foldersBindingSource.Position = index;
 }
 private int FindFolder(IProjectItemModel selected)
 {
     int index = 0;
     if (selected != null)
     {
         List<IProjectItemModel> folders = _foldersBindingSource.DataSource as List<IProjectItemModel>;
         if (folders != null)
         {
             index = folders.FindIndex(delegate(IProjectItemModel match)
             {
                 if (match != null)
                 {
                     return match.ProjectItem.Equals(selected.ProjectItem);
                 }
                 else
                 {
                     return false;
                 }
             });
         }
     }
     return index;
 }
 public void SelectWebFolder(IProjectItemModel moduleFolder)
 {
     int index = FindFolder(moduleFolder);
     _foldersBindingSource.Position = index;
     if (ViewNameChanged != null)
         ViewNameChanged(_viewNameTextBox, CreateValidationEventArgs());
 }
 internal void FireWebFolderSelected(IProjectItemModel folder)
 {
     WebFolderSelected = folder;
     if ( WebFolderChanged != null )
         WebFolderChanged(this, new EventArgs());
 }
 public void ShowWebFolders(IList<IProjectItemModel> folders, IProjectItemModel selected)
 {
     WebFoldersDisplayed = folders;
     WebFolderSelected = selected;
 }
 public void SelectWebFolder(IProjectItemModel moduleFolder)
 {
     WebFolderSelected = moduleFolder;
     if (WebFolderChanged != null)
         WebFolderChanged(this, new EventArgs());
 }
 public void AddFolder(IProjectItemModel item)
 {
     _folders.Add(item);
 }