• R/O
  • SSH
  • HTTPS

nlgp1: Commit


Commit MetaInfo

Revision605 (tree)
Time2010-11-20 18:09:25
Authorbiikame

Log Message

識別子を一部修正

Change Summary

Incremental Difference

--- trunk/Nlgp1/Nlgp1.StageEditor/Controls/Events/LayerControlEvent.cs (revision 604)
+++ trunk/Nlgp1/Nlgp1.StageEditor/Controls/Events/LayerControlEvent.cs (nonexistent)
@@ -1,58 +0,0 @@
1-using System;
2-using System.Collections.Generic;
3-using System.Linq;
4-using System.Text;
5-using Nlgp1.StageEditor.Controls;
6-using Nlgp1.StageEditor.Notifies;
7-using System.Windows.Forms;
8-using Nlgp1.StageEditor.Instances;
9-
10-namespace Nlgp1.StageEditor.Controls.Events
11-{
12- public static class LayerControlEvent
13- {
14- public static void Initialize(LayerTabPage layerTabPage, LayerNotify layer, LayerSettingNotify viewerSetting)
15- {
16- var CommanTable = new Dictionary<string, Action>();
17- CommanTable["MoveUp"] = () => LayerInstance.MoveUp(layer);
18- CommanTable["MoveDown"] = () => LayerInstance.MoveDown(layer);
19- CommanTable["Delete"] = () =>
20- {
21- var result = ShowDeleteMessage(layer.Name);
22- if (result != DialogResult.OK) return;
23-
24- LayerInstance.Remove(layer);
25- };
26- CommanTable["Clear"] = () => {
27- for( int i = 0 ; i < layer.Map.GetLength( 0 ) ; i++ ) {
28- for( int j = 0 ; j < layer.Map.GetLength( 1 ) ; j++ ) {
29- layer.Map[ i , j ] = layer.ChipTable[ 0 ];
30- }
31- }
32- layer.OnPropertyChanged( "SetGridData" );
33- };
34-
35- layerTabPage.LayerControl.Command += (sender, e) =>
36- CommanTable[e.Command]();
37-
38- layerTabPage.LayerControl.LayerProipertyChanged += (sender, e) =>
39- layer.SetProperty(e.Name);
40-
41- layerTabPage.LayerControl.ViewSettingChanged += (sender, e) =>
42- viewerSetting.SetLayerSetting(e.ViewSetting);
43-
44- layer.PropertyChanged += layerTabPage.ChipGridData_PropertyChanged;
45- viewerSetting.PropertyChanged += layerTabPage.ViewSettingData_PropertyChanged;
46- }
47-
48- private static DialogResult ShowDeleteMessage(string name)
49- {
50- var message = string.Format("{0}レイヤーを削除します", name);
51- var result = MessageBox.Show(message, name,
52- MessageBoxButtons.OKCancel, MessageBoxIcon.None,
53- MessageBoxDefaultButton.Button2);
54-
55- return result;
56- }
57- }
58-}
\ No newline at end of file
--- trunk/Nlgp1/Nlgp1.StageEditor/Controls/Events/LayerTabPagelEvent.cs (nonexistent)
+++ trunk/Nlgp1/Nlgp1.StageEditor/Controls/Events/LayerTabPagelEvent.cs (revision 605)
@@ -0,0 +1,58 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Text;
5+using Nlgp1.StageEditor.Controls;
6+using Nlgp1.StageEditor.Notifies;
7+using System.Windows.Forms;
8+using Nlgp1.StageEditor.Instances;
9+
10+namespace Nlgp1.StageEditor.Controls.Events
11+{
12+ public static class LayerTabPageEvent
13+ {
14+ public static void Initialize(LayerTabPage layerTabPage, LayerNotify layer, LayerSettingNotify viewerSetting)
15+ {
16+ var CommanTable = new Dictionary<string, Action>();
17+ CommanTable["MoveUp"] = () => LayerInstance.MoveUp(layer);
18+ CommanTable["MoveDown"] = () => LayerInstance.MoveDown(layer);
19+ CommanTable["Delete"] = () =>
20+ {
21+ var result = ShowDeleteMessage(layer.Name);
22+ if (result != DialogResult.OK) return;
23+
24+ LayerInstance.Remove(layer);
25+ };
26+ CommanTable["Clear"] = () => {
27+ for( int i = 0 ; i < layer.Map.GetLength( 0 ) ; i++ ) {
28+ for( int j = 0 ; j < layer.Map.GetLength( 1 ) ; j++ ) {
29+ layer.Map[ i , j ] = layer.ChipTable[ 0 ];
30+ }
31+ }
32+ layer.OnPropertyChanged( "SetGridData" );
33+ };
34+
35+ layerTabPage.LayerControl.Command += (sender, e) =>
36+ CommanTable[e.Command]();
37+
38+ layerTabPage.LayerControl.LayerProipertyChanged += (sender, e) =>
39+ layer.SetProperty(e.Name);
40+
41+ layerTabPage.LayerControl.ViewSettingChanged += (sender, e) =>
42+ viewerSetting.SetLayerSetting(e.ViewSetting);
43+
44+ layer.PropertyChanged += layerTabPage.ChipGridData_PropertyChanged;
45+ viewerSetting.PropertyChanged += layerTabPage.ViewSettingData_PropertyChanged;
46+ }
47+
48+ private static DialogResult ShowDeleteMessage(string name)
49+ {
50+ var message = string.Format("{0}レイヤーを削除します", name);
51+ var result = MessageBox.Show(message, name,
52+ MessageBoxButtons.OKCancel, MessageBoxIcon.None,
53+ MessageBoxDefaultButton.Button2);
54+
55+ return result;
56+ }
57+ }
58+}
\ No newline at end of file
--- trunk/Nlgp1/Nlgp1.StageEditor/Instances/LayerInstance.cs (revision 604)
+++ trunk/Nlgp1/Nlgp1.StageEditor/Instances/LayerInstance.cs (revision 605)
@@ -41,7 +41,7 @@
4141 var layer = stage.CreateLayer(name);
4242 var viewerSetting = editor.CreateLayerSetting();
4343 var layerTabPage = stageEditor.LayersetControl.CreateLayer(name);
44- LayerControlEvent.Initialize(layerTabPage, layer, viewerSetting);
44+ LayerTabPageEvent.Initialize(layerTabPage, layer, viewerSetting);
4545
4646 stageEditor.LayersetControl.AddLayer(layerTabPage);
4747 stage.AddLayer(layer);
Show on old repository browser