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

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/XmlFileAssociationNode.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:
 
1
//
 
2
// MonoDevelop XML Editor
 
3
//
 
4
// Copyright (C) 2006-2007 Matthew Ward
 
5
//
 
6
// Permission is hereby granted, free of charge, to any person obtaining a copy
 
7
// of this software and associated documentation files (the "Software"), to deal
 
8
// in the Software without restriction, including without limitation the rights
 
9
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
10
// copies of the Software, and to permit persons to whom the Software is
 
11
// furnished to do so, subject to the following conditions:
 
12
// 
 
13
// The above copyright notice and this permission notice shall be included in
 
14
// all copies or substantial portions of the Software.
 
15
// 
 
16
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
17
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
18
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
19
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
20
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
21
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
22
// THE SOFTWARE.
 
23
 
 
24
using System;
 
25
using Mono.Addins;
 
26
 
 
27
namespace MonoDevelop.XmlEditor
 
28
{
 
29
        class XmlFileAssociationNode : ExtensionNode
 
30
        {
 
31
                //ignore warning: field is never assigned
 
32
#pragma warning disable 649
 
33
                
 
34
                [NodeAttribute ("extension", true)]
 
35
                string fileExtension;
 
36
                
 
37
                [NodeAttribute ("namespacePrefix", false)]
 
38
                string namespacePrefix;
 
39
                
 
40
                [NodeAttribute ("namespaceUri", false)]
 
41
                string namespaceUri;
 
42
                
 
43
                [NodeAttribute ("schemaFile", false)]
 
44
                string schemaFile;
 
45
                
 
46
                public XmlFileAssociation GetAssociation ()
 
47
                {
 
48
                        var ns = namespaceUri;
 
49
                        if (!string.IsNullOrEmpty (schemaFile))
 
50
                                ns = new Uri (Addin.GetFilePath (schemaFile), UriKind.Absolute).ToString ();
 
51
                        return new XmlFileAssociation (fileExtension, ns, namespacePrefix);
 
52
                }
 
53
        }
 
54
}
 
 
b'\\ No newline at end of file'