Esempio n. 1
0
        /// <summary>
        /// Add the given apex file to the folder.
        /// </summary>
        /// <param name="sourceFile">The apex file to add.</param>
        public void AddApexPage(SourceFile sourceFile)
        {
            if (sourceFile == null)
            {
                throw new ArgumentNullException("file");
            }
            if (sourceFile.FileType.Name != "ApexPage")
            {
                throw new ArgumentException("file", "The file type must be ApexPage");
            }

            if (_isPagesLoaded)
            {
                int index = 0;
                for (; index < Presenter.Nodes.Count; index++)
                {
                    ApexPageNode node = Presenter.Nodes[index] as ApexPageNode;
                    if (node == null)
                    {
                        continue;
                    }

                    if (sourceFile.CompareTo(node.SourceFile) < 0)
                    {
                        break;
                    }
                }

                Presenter.Nodes.Insert(index, new ApexPageNode(Project, sourceFile));
            }
        }
Esempio n. 2
0
 /// <summary>
 /// If this node represents the given entity this method should return true.
 /// </summary>
 /// <param name="entity">The entity to check.</param>
 /// <returns>true if this node represents the given entity.</returns>
 public override bool RepresentsEntity(object entity)
 {
     return(SourceFile.CompareTo(entity) == 0);
 }