Ejemplo n.º 1
0
        public void SaveTest()
        {
            // Window情報
            var w = new Window();

            w.Name   = "FMainWindow";
            w.Left   = 100;
            w.Top    = 110;
            w.Width  = 320;
            w.Height = 240;

            var r = Setting.MainWindowBounds;

            Assert.IsTrue(w.Left == r.Left);
            Assert.IsTrue(w.Top == r.Top);
            Assert.IsTrue(w.Width == r.Width);
            Assert.IsTrue(w.Height == r.Height);

            // DataGridColumns情報
            var c1 = new ColumnSetting()
            {
                DisplayIndex = 0, Width = -2
            };
            var c2 = new ColumnSetting()
            {
                DisplayIndex = 1, Width = 100
            };
            var c3 = new ColumnSetting()
            {
                DisplayIndex = 2, Width = 200
            };
            var c4 = new ColumnSetting()
            {
                DisplayIndex = 3, Width = -1
            };
            var c5 = new ColumnSetting()
            {
                DisplayIndex = 4, Width = 0
            };

            var cols = Setting.DataGridColumns;
            var c    = cols[0];

            Assert.IsTrue(c1.Equals(c));
            c = cols[1];
            Assert.IsTrue(c2.Equals(c));
            c = cols[2];
            Assert.IsTrue(c3.Equals(c));
            c = cols[3];
            Assert.IsTrue(c4.Equals(c));
            c = cols[4];
            Assert.IsTrue(c5.Equals(c));
        }
Ejemplo n.º 2
0
        public void DataGridColumnsTest()
        {
            var dg = new DataGrid();
            dg.Name = "FDataGrid";
            var c1 = new ColumnSetting() { DisplayIndex = 0, Width = -1 };
            var c2 = new ColumnSetting() { DisplayIndex = 1, Width = 100 };
            var c3 = new ColumnSetting() { DisplayIndex = 2, Width = 200 };
            dg.Columns.Add(new DataGridTemplateColumn() { DisplayIndex = c1.DisplayIndex, Width = c1.Width });
            dg.Columns.Add(new DataGridTemplateColumn() { DisplayIndex = c2.DisplayIndex, Width = c2.Width });
            dg.Columns.Add(new DataGridTemplateColumn() { DisplayIndex = c3.DisplayIndex, Width = c3.Width });

            Setting.SetDataGridColumns(dg);
            var cols = Setting.DataGridColumns;
            var c = cols[0];
            Assert.IsTrue(c1.Equals(c));
            c = cols[1];
            Assert.IsTrue(c2.Equals(c));
            c = cols[2];
            Assert.IsTrue(c3.Equals(c));
        }
Ejemplo n.º 3
0
        public void DataGridColumnsTest()
        {
            var dg = new DataGrid();

            dg.Name = "FDataGrid";
            var c1 = new ColumnSetting()
            {
                DisplayIndex = 0, Width = -1
            };
            var c2 = new ColumnSetting()
            {
                DisplayIndex = 1, Width = 100
            };
            var c3 = new ColumnSetting()
            {
                DisplayIndex = 2, Width = 200
            };

            dg.Columns.Add(new DataGridTemplateColumn()
            {
                DisplayIndex = c1.DisplayIndex, Width = c1.Width
            });
            dg.Columns.Add(new DataGridTemplateColumn()
            {
                DisplayIndex = c2.DisplayIndex, Width = c2.Width
            });
            dg.Columns.Add(new DataGridTemplateColumn()
            {
                DisplayIndex = c3.DisplayIndex, Width = c3.Width
            });

            Setting.SetDataGridColumns(dg);
            var cols = Setting.DataGridColumns;
            var c    = cols[0];

            Assert.IsTrue(c1.Equals(c));
            c = cols[1];
            Assert.IsTrue(c2.Equals(c));
            c = cols[2];
            Assert.IsTrue(c3.Equals(c));
        }
Ejemplo n.º 4
0
        public void SaveTest()
        {
            // Window情報
            var w = new Window();
            w.Name = "FMainWindow";
            w.Left = 100;
            w.Top = 110;
            w.Width = 320;
            w.Height = 240;

            var r = Setting.MainWindowBounds;
            Assert.IsTrue(w.Left == r.Left);
            Assert.IsTrue(w.Top == r.Top);
            Assert.IsTrue(w.Width == r.Width);
            Assert.IsTrue(w.Height == r.Height);

            // DataGridColumns情報
            var c1 = new ColumnSetting() { DisplayIndex = 0, Width = -2 };
            var c2 = new ColumnSetting() { DisplayIndex = 1, Width = 100 };
            var c3 = new ColumnSetting() { DisplayIndex = 2, Width = 200 };
            var c4 = new ColumnSetting() { DisplayIndex = 3, Width = -1 };
            var c5 = new ColumnSetting() { DisplayIndex = 4, Width = 0 };

            var cols = Setting.DataGridColumns;
            var c = cols[0];
            Assert.IsTrue(c1.Equals(c));
            c = cols[1];
            Assert.IsTrue(c2.Equals(c));
            c = cols[2];
            Assert.IsTrue(c3.Equals(c));
            c = cols[3];
            Assert.IsTrue(c4.Equals(c));
            c = cols[4];
            Assert.IsTrue(c5.Equals(c));
        }
Ejemplo n.º 5
0
        public void SavingDataGridStateActionTest()
        {
            var trigger = new System.Windows.Interactivity.EventTrigger("Closed");
            var trg = new SavingDataGridStateAction();
            trigger.Actions.Add(trg);

            var w = new Window();
            Interaction.GetTriggers(w).Add(trigger);

            var dg = new DataGrid();
            dg.Name = "FDataGrid";
            var c1 = new ColumnSetting() { DisplayIndex = 0, Width = -2 };
            var c2 = new ColumnSetting() { DisplayIndex = 1, Width = 100 };
            var c3 = new ColumnSetting() { DisplayIndex = 2, Width = 200 };
            var c4 = new ColumnSetting() { DisplayIndex = 3, Width = -1 };
            var c5 = new ColumnSetting() { DisplayIndex = 4, Width = 0 };
            dg.Columns.Add(new DataGridTemplateColumn() { DisplayIndex = c1.DisplayIndex, Width = c1.Width });
            dg.Columns.Add(new DataGridTemplateColumn() { DisplayIndex = c2.DisplayIndex, Width = c2.Width });
            dg.Columns.Add(new DataGridTemplateColumn() { DisplayIndex = c3.DisplayIndex, Width = c3.Width });
            dg.Columns.Add(new DataGridTemplateColumn() { DisplayIndex = c4.DisplayIndex, Width = c4.Width });
            dg.Columns.Add(new DataGridTemplateColumn() { DisplayIndex = c5.DisplayIndex, Width = c5.Width });
            trg.Parameter = dg;

            w.ShowDialog();

            var cols = Setting.DataGridColumns;
            var c = cols[0];
            Assert.IsTrue(c1.Equals(c));
            c = cols[1];
            Assert.IsTrue(c2.Equals(c));
            c = cols[2];
            Assert.IsTrue(c3.Equals(c));
            c = cols[3];
            Assert.IsTrue(c4.Equals(c));
            c = cols[4];
            Assert.IsTrue(c5.Equals(c));

            Setting.Save();
        }
Ejemplo n.º 6
0
        public void SavingDataGridStateActionTest()
        {
            var trigger = new System.Windows.Interactivity.EventTrigger("Closed");
            var trg     = new SavingDataGridStateAction();

            trigger.Actions.Add(trg);

            var w = new Window();

            Interaction.GetTriggers(w).Add(trigger);

            var dg = new DataGrid();

            dg.Name = "FDataGrid";
            var c1 = new ColumnSetting()
            {
                DisplayIndex = 0, Width = -2
            };
            var c2 = new ColumnSetting()
            {
                DisplayIndex = 1, Width = 100
            };
            var c3 = new ColumnSetting()
            {
                DisplayIndex = 2, Width = 200
            };
            var c4 = new ColumnSetting()
            {
                DisplayIndex = 3, Width = -1
            };
            var c5 = new ColumnSetting()
            {
                DisplayIndex = 4, Width = 0
            };

            dg.Columns.Add(new DataGridTemplateColumn()
            {
                DisplayIndex = c1.DisplayIndex, Width = c1.Width
            });
            dg.Columns.Add(new DataGridTemplateColumn()
            {
                DisplayIndex = c2.DisplayIndex, Width = c2.Width
            });
            dg.Columns.Add(new DataGridTemplateColumn()
            {
                DisplayIndex = c3.DisplayIndex, Width = c3.Width
            });
            dg.Columns.Add(new DataGridTemplateColumn()
            {
                DisplayIndex = c4.DisplayIndex, Width = c4.Width
            });
            dg.Columns.Add(new DataGridTemplateColumn()
            {
                DisplayIndex = c5.DisplayIndex, Width = c5.Width
            });
            trg.Parameter = dg;

            w.ShowDialog();

            var cols = Setting.DataGridColumns;
            var c    = cols[0];

            Assert.IsTrue(c1.Equals(c));
            c = cols[1];
            Assert.IsTrue(c2.Equals(c));
            c = cols[2];
            Assert.IsTrue(c3.Equals(c));
            c = cols[3];
            Assert.IsTrue(c4.Equals(c));
            c = cols[4];
            Assert.IsTrue(c5.Equals(c));

            Setting.Save();
        }