Ejemplo n.º 1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (base.ProjectPane != null)
         {
             base.Services.ViewService().ViewOpened -= new ViewEventHandler(this.ViewService_ViewOpened);
             base.Services.ViewService().ViewClosed -= new ViewEventHandler(this.ViewService_ViewClosed);
             base.ProjectPane = null;
         }
         if (this.projectItem != null)
         {
             this.projectItem.IsDirtyChanged         -= new EventHandler(this.ProjectItem_IsDirtyChanged);
             this.projectItem.IsCutChanged           -= new EventHandler(this.ProjectItem_IsCutChanged);
             this.projectItem.ParentChanged          -= new EventHandler(this.ProjectItem_ParentChanged);
             this.projectItem.FileInformationChanged -= new FileSystemEventHandler(this.ProjectItem_FileInformationChanged);
             this.projectItem = null;
         }
         if (this.knownProjectNode != null)
         {
             ((IProject)this.knownProjectNode.Project).StartupItemChanged -= new EventHandler <ProjectItemChangedEventArgs>(this.Project_StartupSceneChanged);
         }
         this.projectNode      = null;
         this.knownProjectNode = null;
         ProjectItemNode projectItemNode = this;
         base.IsExpandedChanged -= new EventHandler(projectItemNode.ProjectItemNode_IsExpandedChanged);
         base.Dispose(disposing);
     }
 }
Ejemplo n.º 2
0
        private static ProjectItemNode FindItemNodeRecursive(IProjectItem item, VirtualizingTreeItemCollection <HierarchicalNode> collection)
        {
            ProjectItemNode projectItemNode;

            using (IEnumerator <ProjectItemNode> enumerator = collection.OfType <ProjectItemNode>().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ProjectItemNode current = enumerator.Current;
                    if (current.ProjectItem != item)
                    {
                        ProjectItemNode projectItemNode1 = ProjectNode.FindItemNodeRecursive(item, current.Children);
                        if (projectItemNode1 == null)
                        {
                            continue;
                        }
                        projectItemNode = projectItemNode1;
                        return(projectItemNode);
                    }
                    else
                    {
                        projectItemNode = current;
                        return(projectItemNode);
                    }
                }
                return(null);
            }
            return(projectItemNode);
        }
Ejemplo n.º 3
0
        private void Project_ItemRenamed(object sender, ProjectItemRenamedEventArgs e)
        {
            ProjectItemNode projectItemNode = base.FindItemNode(e.ProjectItem);

            if (projectItemNode != null)
            {
                projectItemNode.OnRenamed();
            }
        }
Ejemplo n.º 4
0
 internal override void AddItemNode(IProjectItem item)
 {
     if (!(item is AssemblyReferenceProjectItem) || this.referencesFolder == null)
     {
         base.AddItemNode(item);
         return;
     }
     this.referencesFolder.AddChild(ProjectItemNode.Create(item, base.ProjectPane, this));
 }
Ejemplo n.º 5
0
        public override void Execute()
        {
            ProjectItemNode activeProjectItemNode = this.ActiveProjectItemNode;

            if (this.IsEnabled)
            {
                activeProjectItemNode.BeginRename();
            }
        }
Ejemplo n.º 6
0
        internal static ProjectItemNode Create(IProjectItem projectItem, Microsoft.Expression.Project.UserInterface.ProjectPane projectPane, Microsoft.Expression.Project.UserInterface.ProjectNode projectNode)
        {
            ProjectItemNode   projectItemNode   = null;
            FolderProjectItem folderProjectItem = projectItem as FolderProjectItem;

            if (folderProjectItem == null)
            {
                projectItemNode = new ProjectItemNode(projectItem, projectPane, projectNode);
            }
            else
            {
                projectItemNode = new FolderNode(folderProjectItem, projectPane, projectNode);
            }
            return(projectItemNode);
        }
Ejemplo n.º 7
0
 private void ToggleNode(HierarchicalNode node, bool isExpanded)
 {
     if (!this.blockExpansionRecording)
     {
         this.expansionStates[node] = isExpanded;
         ProjectItemNode projectItemNode = node as ProjectItemNode;
         if (projectItemNode != null)
         {
             if (projectItemNode.Parent != null)
             {
                 this.ToggleNode(projectItemNode.Parent, true);
                 return;
             }
             this.ToggleNode(projectItemNode.ProjectNode, true);
         }
     }
 }
Ejemplo n.º 8
0
        private void Project_ItemRemoved(object sender, ProjectItemEventArgs e)
        {
            if (base.Services.ProjectManager().ItemSelectionSet.IsSelected(e.ProjectItem))
            {
                base.Services.ProjectManager().ItemSelectionSet.RemoveSelection(e.ProjectItem);
            }
            ProjectItemNode projectItemNode = base.FindItemNode(e.ProjectItem);

            if (projectItemNode != null)
            {
                if (projectItemNode.Parent != null)
                {
                    projectItemNode.Parent.RemoveChild(projectItemNode);
                }
                projectItemNode.Dispose();
            }
        }
Ejemplo n.º 9
0
        private void ResetVisibility(bool resetAll)
        {
            if (this.previousFilterString == null)
            {
                this.previousFilterString = string.Empty;
            }
            bool flag  = (resetAll ? true : this.previousFilterString.ToUpperInvariant().Contains(this.FilterString.ToUpperInvariant()));
            bool flag1 = (resetAll ? true : this.FilterString.ToUpperInvariant().Contains(this.previousFilterString.ToUpperInvariant()));

            foreach (HierarchicalNode hierarchicalNode in this.HierarchicalNodes)
            {
                ProjectItemNode projectItemNode = hierarchicalNode as ProjectItemNode;
                if (projectItemNode == null)
                {
                    continue;
                }
                projectItemNode.ResetVisibilityFilter(flag, flag1);
            }
        }
Ejemplo n.º 10
0
 internal KnownProjectNode(IProject project, Microsoft.Expression.Project.UserInterface.ProjectPane projectPane) : base(project, projectPane)
 {
     this.project                  = project;
     this.project.ItemAdded       += new EventHandler <ProjectItemEventArgs>(this.Project_ItemAdded);
     this.project.ItemRemoved     += new EventHandler <ProjectItemEventArgs>(this.Project_ItemRemoved);
     this.project.ItemRenamed     += new EventHandler <ProjectItemRenamedEventArgs>(this.Project_ItemRenamed);
     this.project.ItemChanged     += new EventHandler <ProjectItemEventArgs>(this.Project_ItemChanged);
     this.project.ItemDeleted     += new EventHandler <ProjectItemEventArgs>(this.Project_ItemDeleted);
     this.project.PropertyChanged += new PropertyChangedEventHandler(this.Project_PropertyChanged);
     if (this.project.GetCapability <bool>("CanAddAssemblyReference") || this.project.GetCapability <bool>("CanAddProjectReference"))
     {
         this.referencesFolder = ProjectItemNode.Create(new FolderStandIn(this.project, StringTable.ProjectNodeReferencesFolderName, base.Services), projectPane, this);
         base.AddSortedItemNode(this.referencesFolder);
         this.referencesFolder.IsExpanded = false;
     }
     this.AddAllProjectItems();
     this.IsExpanded = true;
     ((ProjectManager)base.Services.ProjectManager()).StartupProjectChanged += new EventHandler(this.ProjectManager_StartupProjectChanged);
 }
Ejemplo n.º 11
0
        internal virtual void AddItemNode(IProjectItem item)
        {
            ProjectItemNode  projectItemNode  = ProjectItemNode.Create(item, base.ProjectPane, this);
            HierarchicalNode hierarchicalNode = this;

            if (item.Parent != null)
            {
                IProjectItem parent = item.Parent;
                if (parent != null)
                {
                    ProjectItemNode projectItemNode1 = this.FindItemNode(parent);
                    if (projectItemNode1 != null)
                    {
                        hierarchicalNode = projectItemNode1;
                    }
                }
            }
            hierarchicalNode.AddChild(projectItemNode);
        }
Ejemplo n.º 12
0
        public override int CompareTo(HierarchicalNode treeItem)
        {
            ProjectItemNode projectItemNode = treeItem as ProjectItemNode;

            if (projectItemNode == null)
            {
                return(-1);
            }
            if (this.ProjectItem is FolderStandIn)
            {
                return(-1);
            }
            if (projectItemNode.ProjectItem is FolderStandIn)
            {
                return(1);
            }
            IDocumentType item = base.Services.DocumentTypeManager().DocumentTypes[DocumentTypeNamesHelper.Folder];

            if (this.ProjectItem.DocumentType == item)
            {
                if (projectItemNode.ProjectItem.DocumentType != item)
                {
                    return(-1);
                }
                return(AlphabeticThenNumericComparer.Compare(this.DisplayName, projectItemNode.DisplayName, CultureInfo.CurrentCulture));
            }
            if (projectItemNode.ProjectItem.DocumentType == item)
            {
                return(1);
            }
            try
            {
                if (Microsoft.Expression.Framework.Documents.PathHelper.GetSafeExtension(this.FullPath) == Microsoft.Expression.Framework.Documents.PathHelper.GetSafeExtension(projectItemNode.FullPath))
                {
                    int num = AlphabeticThenNumericComparer.Compare(Path.GetFileNameWithoutExtension(this.FullPath), Path.GetFileNameWithoutExtension(projectItemNode.FullPath), CultureInfo.CurrentCulture);
                    return(num);
                }
            }
            catch (ArgumentException argumentException)
            {
            }
            return(ProjectPathHelper.CompareForDisplay(this.DisplayName, projectItemNode.DisplayName, CultureInfo.CurrentCulture));
        }
Ejemplo n.º 13
0
        protected ProjectItemNode(IProjectItem projectItem, Microsoft.Expression.Project.UserInterface.ProjectPane projectPane, Microsoft.Expression.Project.UserInterface.ProjectNode projectNode) : base(projectItem, projectPane)
        {
            this.projectItem      = projectItem;
            base.ProjectPane      = projectPane;
            this.projectNode      = projectNode;
            this.knownProjectNode = this.projectNode as KnownProjectNode;
            base.Services.ViewService().ViewOpened += new ViewEventHandler(this.ViewService_ViewOpened);
            base.Services.ViewService().ViewClosed += new ViewEventHandler(this.ViewService_ViewClosed);
            this.projectItem.IsDirtyChanged         += new EventHandler(this.ProjectItem_IsDirtyChanged);
            this.projectItem.IsCutChanged           += new EventHandler(this.ProjectItem_IsCutChanged);
            this.projectItem.ParentChanged          += new EventHandler(this.ProjectItem_ParentChanged);
            this.projectItem.FileInformationChanged += new FileSystemEventHandler(this.ProjectItem_FileInformationChanged);
            ProjectItemNode projectItemNode = this;

            base.IsExpandedChanged += new EventHandler(projectItemNode.ProjectItemNode_IsExpandedChanged);
            if (this.knownProjectNode != null)
            {
                ((IProject)this.knownProjectNode.Project).StartupItemChanged += new EventHandler <ProjectItemChangedEventArgs>(this.Project_StartupSceneChanged);
            }
        }
Ejemplo n.º 14
0
        public void ExpressInterestInNode(HierarchicalNode node)
        {
            ProjectItemNode projectItemNode = node as ProjectItemNode;

            if (projectItemNode != null)
            {
                HierarchicalNode parent = projectItemNode.Parent;
                if (parent == null)
                {
                    if (!projectItemNode.ProjectItem.IsReference)
                    {
                        parent = projectItemNode.ProjectNode;
                    }
                    else
                    {
                        parent = projectItemNode.ProjectNode.ReferencesFolder;
                    }
                }
                this.ExpandNode(parent);
            }
        }
Ejemplo n.º 15
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this.referencesFolder != null)
         {
             this.referencesFolder = null;
         }
         base.Services.ProjectManager().StartupProjectChanged -= new EventHandler(this.ProjectManager_StartupProjectChanged);
         if (this.project != null)
         {
             this.project.ItemAdded       -= new EventHandler <ProjectItemEventArgs>(this.Project_ItemAdded);
             this.project.ItemRemoved     -= new EventHandler <ProjectItemEventArgs>(this.Project_ItemRemoved);
             this.project.ItemRenamed     -= new EventHandler <ProjectItemRenamedEventArgs>(this.Project_ItemRenamed);
             this.project.ItemChanged     -= new EventHandler <ProjectItemEventArgs>(this.Project_ItemChanged);
             this.project.ItemDeleted     -= new EventHandler <ProjectItemEventArgs>(this.Project_ItemDeleted);
             this.project.PropertyChanged -= new PropertyChangedEventHandler(this.Project_PropertyChanged);
         }
         base.Dispose(disposing);
     }
 }
Ejemplo n.º 16
0
        private void FilterProjectItem(ProjectItemNode node)
        {
            bool flag;
            bool isVisible = node.IsVisible;

            if (!this.VisibilityDictionary.TryGetValue(node, out flag))
            {
                this.VisibilityDictionary.Add(node, isVisible);
                node.VisibilityChanged();
            }
            else if (flag != isVisible)
            {
                this.VisibilityDictionary[node] = isVisible;
                node.VisibilityChanged();
            }
            if (isVisible)
            {
                foreach (ProjectItemNode child in node.Children)
                {
                    this.FilterProjectItem(child);
                }
            }
        }