crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashContainerBase.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2004-2008 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 
       
    18 using System;
       
    19 using System.Collections.Generic;
       
    20 using System.ComponentModel;
       
    21 using System.Drawing;
       
    22 using System.Data;
       
    23 using System.Text;
       
    24 using System.Windows.Forms;
       
    25 using CrashItemLib.Crash.Container;
       
    26 using CrashItemLib.Sink;
       
    27 using CrashAnalyserEngine.Interfaces;
       
    28 using CAPCrashAnalysis.Plugin;
       
    29 
       
    30 namespace CAPluginCrashAnalysisUi.Tabs
       
    31 {
       
    32     internal partial class CATabCrashContainerBase : CATabCrashBase
       
    33     {
       
    34         #region Constructors
       
    35         protected CATabCrashContainerBase()
       
    36         {
       
    37             // For IDE designer only
       
    38             InitializeComponent();
       
    39         }
       
    40 
       
    41         protected CATabCrashContainerBase( CAPluginCrashAnalysis aSubEngine, CIContainer aContainer )
       
    42             : base( aSubEngine )
       
    43         {
       
    44             iContainer = aContainer;
       
    45             //
       
    46             InitializeComponent();
       
    47             //
       
    48             RegisterMenuItems();
       
    49         }
       
    50         #endregion
       
    51 
       
    52         #region API
       
    53         #endregion
       
    54 
       
    55         #region Properties
       
    56         [Browsable( false )]
       
    57         [DesignerSerializationVisibility( DesignerSerializationVisibility.Hidden )]
       
    58         protected CIContainer CIContainer
       
    59         {
       
    60             get { return iContainer; }
       
    61             set { iContainer = value; }
       
    62         }
       
    63         #endregion
       
    64 
       
    65         #region From CATab
       
    66         protected override void RegisterMenuItems()
       
    67         {
       
    68             base.RegisterMenuItems();
       
    69             //
       
    70             CISinkManager sinkManager = base.CrashItemEngine.SinkManager;
       
    71             foreach ( CISink sink in sinkManager )
       
    72             {
       
    73                 base.UIManager.UIManagerMenuItemAdd( CrashAnalyserEngine.Interfaces.TEngineUIMenuPane.EFileSaveAs, sink.Name, new UIMenuItemClickHandler( Menu_File_SaveAs_SinkFormat_Click ), sink, this );
       
    74             }
       
    75         }
       
    76         #endregion
       
    77 
       
    78         #region Event handlers
       
    79         private void Menu_File_SaveAs_SinkFormat_Click( object aTag, string aCaption )
       
    80         {
       
    81             if ( aTag is CISink )
       
    82             {
       
    83                 CISink sink = (CISink) aTag;
       
    84                 //
       
    85                 CISinkSerializationParameters parameters = new CISinkSerializationParameters( CIContainer, base.UIManager.UIVersion, base.UIManager.UICommandLineArguments );
       
    86                 FolderBrowserDialog dialog = new FolderBrowserDialog();
       
    87                 dialog.Description = "Save Location";
       
    88                 //
       
    89                 if ( dialog.ShowDialog() == DialogResult.OK )
       
    90                 {
       
    91                     parameters.OutputDirectory = new System.IO.DirectoryInfo( dialog.SelectedPath );
       
    92                     //
       
    93                     sink.Serialize( parameters );
       
    94                 }
       
    95             }
       
    96         }
       
    97         #endregion
       
    98 
       
    99         #region Internal methods
       
   100         #endregion
       
   101 
       
   102         #region Data members
       
   103         private CIContainer iContainer;
       
   104         #endregion
       
   105     }
       
   106 }