// Constructor
        public IndividualBrowserDialog( MainForm mainForm, bool bMultiSelect )
        {
            m_mainForm = mainForm;

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent( bMultiSelect );

            this.m_contextmenuChooseIndi = new ContextMenu();

            //
            // Choose individual context menu
            //
            m_menuitemChooseIndiMenuDetails = new MenuItem( "&Details...", new System.EventHandler(this.chooseIndiContextMenuDetails_Click ) );
            this.m_contextmenuChooseIndi.MenuItems.Add( m_menuitemChooseIndiMenuDetails );
            this.m_contextmenuChooseIndi.Popup += new EventHandler(this.chooseIndiContextMenu_popup);

            //
            // listView1
            //
            this.m_sortableListView = new SortableListView();
            this.m_sortableListView.Location = new System.Drawing.Point(16, 32);
            this.m_sortableListView.Name = "listView1";
            this.m_sortableListView.Size = new System.Drawing.Size(this.Width-32, 192);
            this.m_sortableListView.TabIndex = 2;
            this.m_sortableListView.View = System.Windows.Forms.View.Details;
            this.m_sortableListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.m_sortableListView.ColumnClickHandler);
            this.m_sortableListView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Left )));
            this.m_sortableListView.MultiSelect = bMultiSelect;
            this.m_sortableListView.SelectedIndexChanged += new System.EventHandler(this.listView1_selectionChanged);
            this.m_sortableListView.AllowColumnReorder = true;
            this.m_sortableListView.GridLines = true;
            this.m_sortableListView.ContextMenu = m_contextmenuChooseIndi;
            this.Controls.Add(this.m_sortableListView);

            m_buttonOk.Enabled = false;
        }
Ejemplo n.º 2
0
        static void Main( string[] args )
        {
            bool bResetConfig = false;
            bool bNextArgIsFilename = false;
            string sLogFilename = "";

            // User can hold down Ctrl and Shift while app starts to enable log file creation
            // People will find this easier than altering command gedcomLine options!
            if(Control.ModifierKeys == (Keys.Shift | Keys.Control) )
            {
                LogFile.TheLogFile.SetLogLevel( LogFile.EDebugLevel.All );
                LogFile.TheLogFile.StartLogFile( "C:\\gedmill.txt" );
            }

            if( args != null )
            {
                foreach( string sArg in args )
                {
                    if( bNextArgIsFilename )
                    {
                        sLogFilename = sArg;
                        bNextArgIsFilename = false;
                    }
                    else
                    {
                        switch( sArg )
                        {
                            case "-logfile":
                            {
                                LogFile.TheLogFile.SetLogLevel( LogFile.EDebugLevel.All );
                                LogFile.TheLogFile.SetDebugAllowFilter( LogFile.DT_ALL^LogFile.DT_GEDCOM ); // Everything but gedcom
                                bNextArgIsFilename = true;
                                break;
                            }
                            case "-debug":
                            {
                                LogFile.TheLogFile.SetLogLevel( LogFile.EDebugLevel.All );
                                LogFile.TheLogFile.SetDebugAllowFilter( LogFile.DT_ALL^LogFile.DT_GEDCOM ); // Everything but gedcom
                                break;
                            }
                            case "-debug_gedcom":
                            {
                                LogFile.TheLogFile.SetLogLevel( LogFile.EDebugLevel.All );
                                LogFile.TheLogFile.SetDebugAllowFilter( LogFile.DT_ALL ); // All
                                break;
                            }
                            case "-reset":
                            {
                                bResetConfig = true;
                                break;
                            }
                        }
                    }
                }
            }
            if( sLogFilename != "" )
            {
                LogFile.TheLogFile.StartLogFile( sLogFilename );
            }
            string sStartTime = DateTime.Now.ToString();
            LogFile.TheLogFile.WriteLine( LogFile.DT_APP, LogFile.EDebugLevel.Note, MainForm.m_sSoftwareName + " started at " + sStartTime );

            m_mainForm = new MainForm( bResetConfig );

            Application.Run( m_mainForm );

            LogFile.TheLogFile.StopLogFile();
        }