1: /*
2: Copyright (c) 2010 <a href="http://www.gutgames.com">James Craig</a>
3:
4: Permission is hereby granted, free of charge, to any person obtaining a copy
5: of this software and associated documentation files (the "Software"), to deal
6: in the Software without restriction, including without limitation the rights
7: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8: copies of the Software, and to permit persons to whom the Software is
9: furnished to do so, subject to the following conditions:
10:
11: The above copyright notice and this permission notice shall be included in
12: all copies or substantial portions of the Software.
13:
14: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20: THE SOFTWARE.*/
21:
22: #region Usings
23: using System;
24: using System.Collections.Generic;
25: using System.Linq;
26: using System.Text;
27: using Utilities.Cisco.Interfaces;
28: #endregion
29:
30: namespace Utilities.Cisco
31: {
32: /// <summary>
33: /// Image class
34: /// </summary>
35: public class Image:IDisplay
36: {
37: #region Constructor
38:
39: /// <summary>
40: /// Constructor
41: /// </summary>
42: public Image()
43: {
44: SoftKeys = new List<SoftKeyItem>();
45: }
46:
47: #endregion
48:
49: #region Properties
50:
51: /// <summary>
52: /// Title
53: /// </summary>
54: public string Title { get; set; }
55:
56: /// <summary>
57: /// Prompt
58: /// </summary>
59: public string Prompt { get; set; }
60:
61: /// <summary>
62: /// X location
63: /// </summary>
64: public int X { get; set; }
65:
66: /// <summary>
67: /// Y location
68: /// </summary>
69: public int Y { get; set; }
70:
71: /// <summary>
72: /// URL to the image
73: /// </summary>
74: public string URL { get; set; }
75:
76: /// <summary>
77: /// Softkeys list
78: /// </summary>
79: public List<SoftKeyItem> SoftKeys { get; set; }
80:
81: #endregion
82:
83: #region Overridden Functions
84:
85: public override string ToString()
86: {
87: StringBuilder Builder = new StringBuilder();
88: Builder.Append("<CiscoIPPhoneImageFile><Title>").Append(Title).Append("</Title><Prompt>").Append(Prompt).Append("</Prompt><LocationX>")
89: .Append(X.ToString()).Append("</LocationX><LocationY>").Append(Y.ToString()).Append("</LocationY><URL>")
90: .Append(URL).Append("</URL>");
91: foreach (SoftKeyItem Item in SoftKeys)
92: {
93: Builder.Append(Item.ToString());
94: }
95: Builder.Append("</CiscoIPPhoneImageFile>");
96: return Builder.ToString();
97: }
98:
99: #endregion
100: }
101: }