Subversion Repositories SoapBoxCore

Rev

Rev 8 | Rev 13 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
8 scott 1
#region "SoapBox.Demo License"
2
/// <header module="SoapBox.Demo"> 
3
/// Copyright (C) 2009 SoapBox Automation Inc., All Rights Reserved.
4
/// Contact: SoapBox Automation Licencing (license@soapboxautomation.com)
5
/// 
6
/// This file is part of SoapBox Demo.
7
/// 
8
/// GNU Lesser General Public License Usage
9
/// SoapBox Demo is free software: you can redistribute it and/or modify 
10
/// it under the terms of the GNU Lesser General Public License
11
/// as published by the Free Software Foundation, either version 3 of the
12
/// License, or (at your option) any later version.
13
/// 
14
/// SoapBox Demo is distributed in the hope that it will be useful, 
15
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
/// GNU Lesser General Public License for more details.
18
/// 
19
/// You should have received a copy of the GNU Lesser General Public License 
20
/// along with SoapBox Demo. If not, see <http://www.gnu.org/licenses/>.
21
/// </header>
22
#endregion
23
 
24
using System;
25
using System.Collections.Generic;
26
using System.Linq;
27
using System.Text;
28
using System.ComponentModel.Composition;
29
using SoapBox.Core;
30
using System.Collections.ObjectModel;
31
 
32
namespace SoapBox.Demo.PinBall
33
{
12 scott 34
    [Export(SoapBox.Core.ExtensionPoints.Workbench.StatusBar, typeof(IStatusBarItem))]
35
    [Export(CompositionPoints.Workbench.StatusBar.BallsScoreSeparator, typeof(BallsScoreSeparator))]
8 scott 36
    public class BallsScoreSeparator : AbstractStatusBarSeparator
37
    {
38
        public BallsScoreSeparator()
39
        {
40
            ID = "BallsScoreSeparator";
41
            InsertRelativeToID = "BallCounterText";
42
            BeforeOrAfter = RelativeDirection.After;
43
        }
44
    }
45
 
12 scott 46
    [Export(SoapBox.Core.ExtensionPoints.Workbench.StatusBar, typeof(IStatusBarItem))]
47
    [Export(CompositionPoints.Workbench.StatusBar.ScoreDisplayHeading, typeof(ScoreDisplayHeading))]
8 scott 48
    public class ScoreDisplayHeading : AbstractStatusBarLabel
49
    {
50
        public ScoreDisplayHeading()
51
        {
52
            ID = "ScoreDisplayHeading";
53
            Text = Resources.Strings.Workbench_StatusBar_ScoreDisplay_Score;
54
            InsertRelativeToID = "BallsScoreSeparator";
55
            BeforeOrAfter = RelativeDirection.After;
56
        }
57
    }
58
 
12 scott 59
    [Export(SoapBox.Core.ExtensionPoints.Workbench.StatusBar, typeof(IStatusBarItem))]
60
    [Export(CompositionPoints.Workbench.StatusBar.ScoreDisplayText, typeof(ScoreDisplayText))]
8 scott 61
    public class ScoreDisplayText : AbstractStatusBarLabel
62
    {
63
        public ScoreDisplayText()
64
        {
65
            ID = "ScoreDisplayText";
66
            Text = "";
67
            InsertRelativeToID = "ScoreDisplayHeading";
68
            BeforeOrAfter = RelativeDirection.After;
69
        }
70
 
71
        public void SetScore(int score)
72
        {
73
            Text = score.ToString();
74
        }
75
    }
76
}