|
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.Text; |
|
19 using System.IO; |
|
20 using System.Collections.Generic; |
|
21 using System.Reflection; |
|
22 using SymbianUtils.PluginManager; |
|
23 using SymbianDebugLib.Engine; |
|
24 using CrashItemLib.Crash; |
|
25 using CrashItemLib.Crash.Container; |
|
26 using CrashItemLib.Engine; |
|
27 |
|
28 namespace CrashItemLib.Sink |
|
29 { |
|
30 public class CISinkManager : IEnumerable<CISink> |
|
31 { |
|
32 #region Constructors |
|
33 internal CISinkManager( CIEngine aEngine ) |
|
34 { |
|
35 iEngine = aEngine; |
|
36 LoadSinks(); |
|
37 } |
|
38 #endregion |
|
39 |
|
40 #region API |
|
41 #endregion |
|
42 |
|
43 #region Properties |
|
44 public int Count |
|
45 { |
|
46 get { return iSinks.Count; } |
|
47 } |
|
48 |
|
49 public CISink this[ int aIndex ] |
|
50 { |
|
51 get { return iSinks[ aIndex ]; } |
|
52 } |
|
53 #endregion |
|
54 |
|
55 #region Internal methods |
|
56 private void LoadSinks() |
|
57 { |
|
58 object[] parameters = new object[ 1 ]; |
|
59 parameters[ 0 ] = this; |
|
60 // |
|
61 try |
|
62 { |
|
63 iSinks.Load( parameters ); |
|
64 } |
|
65 catch ( Exception assemblyLoadException ) |
|
66 { |
|
67 iEngine.Trace( "SINK CREATION EXCEPTION: " + assemblyLoadException.Message ); |
|
68 iEngine.Trace( " " + assemblyLoadException.StackTrace ); |
|
69 } |
|
70 } |
|
71 #endregion |
|
72 |
|
73 #region From System.Object |
|
74 #endregion |
|
75 |
|
76 #region From IEnumerable<CISink> |
|
77 public IEnumerator<CISink> GetEnumerator() |
|
78 { |
|
79 return iSinks.GetEnumerator(); |
|
80 } |
|
81 |
|
82 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() |
|
83 { |
|
84 return iSinks.GetEnumerator(); |
|
85 } |
|
86 #endregion |
|
87 |
|
88 #region Data members |
|
89 private readonly CIEngine iEngine; |
|
90 private PluginManager<CISink> iSinks = new PluginManager<CISink>(); |
|
91 #endregion |
|
92 } |
|
93 } |