~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet/AspNetAppProject.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
                public override bool SupportsFramework (TargetFramework framework)
132
132
                {
133
133
                        //only support 1.1, 2.0, 3.5, 4.0 etc, not monotouch, moonlight and so on
134
 
                        return framework.IsCompatibleWithFramework ("1.1") && base.SupportsFramework (framework);
 
134
                        return framework.Id.Identifier == TargetFrameworkMoniker.ID_NET_FRAMEWORK && base.SupportsFramework (framework);
135
135
                }
136
136
                
137
137
                #endregion
397
397
                {
398
398
                        if (virtualPath == null || virtualPath.Length == 0 || virtualPath[0] == '/'
399
399
                                || virtualPath.IndexOf (':') > -1)
400
 
                                return null;
401
 
 
 
400
                                return null;
 
401
 
402
402
                        FilePath relativeToDir;
403
403
                        if (virtualPath.Length > 1 && virtualPath[0] == '~') {
404
404
                                if (virtualPath[1] == '/')
408
408
                                relativeToDir = this.BaseDirectory;
409
409
                        } else {
410
410
                                relativeToDir = String.IsNullOrEmpty (relativeToFile)
411
 
                                        ? BaseDirectory
 
411
                                        ? BaseDirectory
412
412
                                        : (FilePath) Path.GetDirectoryName (relativeToFile);
413
413
                        }
414
414
                        
478
478
                        if (webConfig == null || !File.Exists (webConfig.FilePath))
479
479
                                return;
480
480
                        
481
 
                        var textFile = DesignerSupport.OpenDocumentFileProvider.Instance.GetEditableTextFile (webConfig.FilePath);
 
481
                        var textFile = MonoDevelop.Ide.TextFileProvider.Instance.GetEditableTextFile (webConfig.FilePath);
482
482
                        //use textfile API because it's write safe (writes out to another file then moves)
483
483
                        if (textFile == null)
484
484
                                textFile = MonoDevelop.Projects.Text.TextFile.ReadFile (webConfig.FilePath);
624
624
                                base.OnFileAddedToProject (e);
625
625
                                return;
626
626
                        }
627
 
                        
628
 
                        IEnumerable<string> filesToAdd = MonoDevelop.DesignerSupport.CodeBehind.GuessDependencies
629
 
                                (this, e.ProjectFile, groupedExtensions);
630
 
                        
631
 
                        if (IsWebConfig (e.ProjectFile.FilePath))
 
627
 
 
628
                        bool webConfigChange = false;
 
629
                        List<string> filesToAdd = new List<string> ();
 
630
                        
 
631
                        foreach (ProjectFileEventInfo fargs in e) {
 
632
                                IEnumerable<string> files = MonoDevelop.DesignerSupport.CodeBehind.GuessDependencies
 
633
                                        (this, fargs.ProjectFile, groupedExtensions);
 
634
                                if (files != null)
 
635
                                        filesToAdd.AddRange (files);
 
636
                                if (IsWebConfig (fargs.ProjectFile.FilePath))
 
637
                                        webConfigChange = true;
 
638
                        }
 
639
                        
 
640
                        if (webConfigChange)
632
641
                                UpdateWebConfigRefs ();
633
642
                        
634
643
                        //let the base fire the event before we add files
636
645
                        base.OnFileAddedToProject (e);
637
646
                        
638
647
                        //make sure that the parent and child files are in the project
639
 
                        if (filesToAdd != null) {
640
 
                                foreach (string file in filesToAdd) {
641
 
                                        //NOTE: this only adds files if they are not already in the project
642
 
                                        AddFile (file);
643
 
                                }
 
648
                        foreach (string file in filesToAdd) {
 
649
                                //NOTE: this only adds files if they are not already in the project
 
650
                                AddFile (file);
644
651
                        }
645
652
                }
646
653
                
710
717
                        protected override string GenerateInfo (string filename)
711
718
                        {
712
719
                                try {
713
 
                                        var doc = ProjectDomService.Parse (Project, filename, null) as AspNetParsedDocument;
 
720
                                        var doc = ProjectDomService.Parse (Project, filename) as AspNetParsedDocument;
714
721
                                        if (doc != null && !string.IsNullOrEmpty (doc.Info.InheritedClass))
715
722
                                                return doc.Info.InheritedClass;
716
723
                                } catch (Exception ex) {