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

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebReferenceItem.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-18 08:40:51 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090218084051-gh8m6ukvokbwj7cf
Tags: 1.9.2+dfsg-1ubuntu1
* Merge from Debian Experimental (LP: #330519), remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24
    - Add libmono-cairo1.0-cil to build-deps to fool pkg-config check

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
                public void Update()
75
75
                {
76
76
                        // Read the map file into the discovery client protocol and setup the code generator
77
 
                        DiscoveryProtocol protocol = new DiscoveryProtocol();
 
77
                        DiscoveryProtocol protocol = new DiscoveryProtocol(),
 
78
                        remoteProtocol = null;
78
79
                        protocol.ReadAllUseBasePath(MapFile.FilePath);
 
80
 
 
81
                        // Refresh the disco and wsdl from the server
 
82
                        foreach (object doc in protocol.References.Values) { 
 
83
                                if (doc is DiscoveryDocumentReference) {
 
84
                                        remoteProtocol = new DiscoveryProtocol();
 
85
                                        try {
 
86
                                                remoteProtocol.DiscoverAny(((DiscoveryDocumentReference)doc).Url);
 
87
                                                break;
 
88
                                        } catch (WebException) {
 
89
                                                remoteProtocol = null;
 
90
                                        }
 
91
                                }
 
92
                        }
 
93
 
 
94
                        if(null != remoteProtocol){ protocol = remoteProtocol; }
 
95
                        
79
96
                        protocol.ResolveAll();
80
97
                        
81
98
                        // Re-generate the proxy and map files
82
99
                        string basePath = new FileInfo(MapFile.FilePath).Directory.FullName;
83
100
                        CodeGenerator codeGen = new CodeGenerator(ProxyFile.Project, (DiscoveryClientProtocol)protocol);
84
101
                        codeGen.CreateProxyFile(basePath, MapFile.Project.Name + "." + Name, "Reference");
85
 
                        codeGen.CreateMapFile(basePath, "Reference.map");
 
102
                        protocol.WriteAll(basePath, "Reference.map");
86
103
                        protocol.Dispose();
87
104
                }
88
105
                
90
107
                public void Delete()
91
108
                {
92
109
                        Project project = proxyFile.Project;
93
 
                        project.ProjectFiles.Remove(proxyFile);
94
 
                        project.ProjectFiles.Remove(mapFile);
 
110
                        project.Files.Remove(proxyFile);
 
111
                        project.Files.Remove(mapFile);
95
112
                        Directory.Delete(Path.Combine(Library.GetWebReferencePath(project), Name), true);
96
113
                }
97
114
        }