public DialogConfigurationNotifier( NotifierBase notifier )
        {
            InitializeComponent();

            _notifier = notifier;

            //init base
            _soundChanged = false;
            _imageChanged = false;

            GroupSound.AllowDrop = true;
            GroupImage.AllowDrop = true;

            //init from data

            IsEnabled.Checked = notifier.IsEnabled;

            PlaysSound.Checked = notifier.PlaysSound;
            SoundPath.Text = notifier.SoundPath;

            DrawsImage.Checked = notifier.DialogData.DrawsImage;
            ImagePath.Text = notifier.DialogData.ImagePath;

            ShowsDialog.Checked = notifier.ShowsDialog;
            TopMostFlag.Checked = notifier.DialogData.TopMost;
            Alignment.SelectedIndex = (int)notifier.DialogData.Alignment;
            LocationX.Value = notifier.DialogData.Location.X;
            LocationY.Value = notifier.DialogData.Location.Y;
            DrawsMessage.Checked = notifier.DialogData.DrawsMessage;
            HasFormBorder.Checked = notifier.DialogData.HasFormBorder;
            AccelInterval.Value = notifier.AccelInterval / 1000;
            ClosingInterval.Value = notifier.DialogData.ClosingInterval / 1000;
            for ( int i = 0; i < (int)NotifierDialogClickFlags.HighestBit; i++ )
                CloseList.SetItemChecked( i, ( (int)notifier.DialogData.ClickFlag & ( 1 << i ) ) != 0 );
            CloseList.SetItemChecked( (int)NotifierDialogClickFlags.HighestBit, notifier.DialogData.CloseOnMouseMove );
            ShowWithActivation.Checked = notifier.DialogData.ShowWithActivation;
            ForeColorPreview.ForeColor = notifier.DialogData.ForeColor;
            BackColorPreview.ForeColor = notifier.DialogData.BackColor;
            LevelBorder.Maximum = ExpTable.ShipMaximumLevel;

            NotifierDamage ndmg = notifier as NotifierDamage;
            if ( ndmg != null ) {
                NotifiesBefore.Checked = ndmg.NotifiesBefore;
                NotifiesNow.Checked = ndmg.NotifiesNow;
                NotifiesAfter.Checked = ndmg.NotifiesAfter;
                ContainsNotLockedShip.Checked = ndmg.ContainsNotLockedShip;
                ContainsSafeShip.Checked = ndmg.ContainsSafeShip;
                ContainsFlagship.Checked = ndmg.ContainsFlagship;
                LevelBorder.Value = ndmg.LevelBorder;
                NotifiesAtEndpoint.Checked = ndmg.NotifiesAtEndpoint;

            } else {
                GroupDamage.Visible = false;
                GroupDamage.Enabled = false;
            }
        }
        public DialogConfigurationNotifier( NotifierBase notifier )
        {
            InitializeComponent();

            _notifier = notifier;

            //init base
            _soundChanged = false;
            _imageChanged = false;

            GroupSound.AllowDrop = true;
            GroupImage.AllowDrop = true;

            //init from data

            IsEnabled.Checked = notifier.IsEnabled;

            PlaysSound.Checked = notifier.PlaysSound;
            SoundPath.Text = notifier.SoundPath;
            SoundVolume.Value = notifier.SoundVolume;
            LoopsSound.Checked = notifier.LoopsSound;

            DrawsImage.Checked = notifier.DialogData.DrawsImage;
            ImagePath.Text = notifier.DialogData.ImagePath;

            ShowsDialog.Checked = notifier.ShowsDialog;
            TopMostFlag.Checked = notifier.DialogData.TopMost;
            Alignment.SelectedIndex = (int)notifier.DialogData.Alignment;
            LocationX.Value = notifier.DialogData.Location.X;
            LocationY.Value = notifier.DialogData.Location.Y;
            DrawsMessage.Checked = notifier.DialogData.DrawsMessage;
            HasFormBorder.Checked = notifier.DialogData.HasFormBorder;
            AccelInterval.Value = notifier.AccelInterval / 1000;
            ClosingInterval.Value = notifier.DialogData.ClosingInterval / 1000;
            for ( int i = 0; i < (int)NotifierDialogClickFlags.HighestBit; i++ )
                CloseList.SetItemChecked( i, ( (int)notifier.DialogData.ClickFlag & ( 1 << i ) ) != 0 );
            CloseList.SetItemChecked( (int)NotifierDialogClickFlags.HighestBit, notifier.DialogData.CloseOnMouseMove );
            ShowWithActivation.Checked = notifier.DialogData.ShowWithActivation;
            CloseOnPort.Checked = notifier.DialogData.CloseOnPort;
            ForeColorPreview.ForeColor = notifier.DialogData.ForeColor;
            BackColorPreview.ForeColor = notifier.DialogData.BackColor;
            LevelBorder.Maximum = ExpTable.ShipMaximumLevel;

            NotifierDamage ndmg = notifier as NotifierDamage;
            if ( ndmg != null ) {
                NotifiesBefore.Checked = ndmg.NotifiesBefore;
                NotifiesNow.Checked = ndmg.NotifiesNow;
                NotifiesAfter.Checked = ndmg.NotifiesAfter;
                ContainsNotLockedShip.Checked = ndmg.ContainsNotLockedShip;
                ContainsSafeShip.Checked = ndmg.ContainsSafeShip;
                ContainsFlagship.Checked = ndmg.ContainsFlagship;
                LevelBorder.Value = ndmg.LevelBorder;
                NotifiesAtEndpoint.Checked = ndmg.NotifiesAtEndpoint;

            } else {
                GroupDamage.Visible = false;
                GroupDamage.Enabled = false;
            }

            NotifierAnchorageRepair nanc = notifier as NotifierAnchorageRepair;
            if ( nanc != null ) {
                AnchorageRepairNotificationLevel.SelectedIndex = nanc.NotificationLevel;

            } else {
                GroupAnchorageRepair.Visible = false;
                GroupAnchorageRepair.Enabled = false;
            }

            DialogOpenSound.Filter = "音楽ファイル|" + string.Join( ";", Utility.MediaPlayer.SupportedExtensions.Select( s => "*." + s ) ) + "|File|*";
        }