~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesignerDisplayBinding.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using ICSharpCode.SharpDevelop;
 
6
using ICSharpCode.SharpDevelop.Editor;
 
7
using ICSharpCode.SharpDevelop.Gui;
 
8
 
 
9
namespace ICSharpCode.WixBinding
 
10
{
 
11
        public class WixDialogDesignerDisplayBinding : ISecondaryDisplayBinding
 
12
        {
 
13
                public WixDialogDesignerDisplayBinding()
 
14
                {
 
15
                }
 
16
                
 
17
                public bool ReattachWhenParserServiceIsReady {
 
18
                        get { return false; }
 
19
                }
 
20
                
 
21
                /// <summary>
 
22
                /// Wix dialog designer can attach to Wix source files (.wxs) and 
 
23
                /// Wix include files (.wxi).
 
24
                /// </summary>
 
25
                public bool CanAttachTo(IViewContent view)
 
26
                {
 
27
                        if (IsViewTextEditorProvider(view)) {
 
28
                                return WixFileName.IsWixFileName(view.PrimaryFileName);
 
29
                        }
 
30
                        return false;
 
31
                }
 
32
                
 
33
                public IViewContent[] CreateSecondaryViewContent(IViewContent view)
 
34
                {
 
35
                        return new IViewContent[] {new WixDialogDesigner(view)};
 
36
                }
 
37
                
 
38
                bool IsViewTextEditorProvider(IViewContent view)
 
39
                {
 
40
                        ITextEditorProvider textEditorProvider = view as ITextEditorProvider;
 
41
                        return textEditorProvider != null;
 
42
                }
 
43
        }
 
44
}