|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 using System; |
|
18 using System.Collections.Generic; |
|
19 using System.Text; |
|
20 |
|
21 namespace SymbianUtils.FileTypes |
|
22 { |
|
23 public class SymFileType |
|
24 { |
|
25 #region Constructors |
|
26 public SymFileType( string aExtension, string aDescription ) |
|
27 { |
|
28 iExtension = aExtension; |
|
29 iDescription = aDescription; |
|
30 } |
|
31 #endregion |
|
32 |
|
33 #region API |
|
34 #endregion |
|
35 |
|
36 #region Properties |
|
37 public string Extension |
|
38 { |
|
39 get { return iExtension; } |
|
40 } |
|
41 |
|
42 public string Description |
|
43 { |
|
44 get { return iDescription; } |
|
45 } |
|
46 #endregion |
|
47 |
|
48 #region From System.Object |
|
49 public override bool Equals( object aObject ) |
|
50 { |
|
51 if ( aObject != null ) |
|
52 { |
|
53 if ( aObject is SymFileType ) |
|
54 { |
|
55 SymFileType type = (SymFileType) aObject; |
|
56 return string.Compare( Extension, type.Extension, StringComparison.CurrentCultureIgnoreCase ) == 0; |
|
57 } |
|
58 } |
|
59 // |
|
60 return base.Equals( aObject ); |
|
61 } |
|
62 |
|
63 public override int GetHashCode() |
|
64 { |
|
65 return Extension.GetHashCode(); |
|
66 } |
|
67 |
|
68 public override string ToString() |
|
69 { |
|
70 StringBuilder ret = new StringBuilder(); |
|
71 // |
|
72 ret.AppendFormat( "{0} ({1})|{2}", Description, Extension, Extension ); |
|
73 // |
|
74 return ret.ToString(); |
|
75 } |
|
76 #endregion |
|
77 |
|
78 #region Data members |
|
79 private readonly string iExtension; |
|
80 private readonly string iDescription; |
|
81 #endregion |
|
82 } |
|
83 } |