root/platform/silverlight/DoSchebe/trunk/src/DoSchebe/UI/AddScheduleView.xaml.cs @ 12967

Revision 12967, 3.4 kB (checked in by coma2n, 5 years ago)

platform/silverlight/DoSchebe/trunk: initial import

Line 
1#region license
2/*
3Copyright (c) 2008, Kouji Yamaguchi
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11
12* Neither the name of coma2n nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13
14THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
15INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
17OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
18OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20*/
21#endregion
22
23#region namespaces
24
25using System;
26using System.Windows;
27using System.Windows.Controls;
28using System.Diagnostics;
29
30#endregion
31
32namespace DoSchebe.UI {
33    /// <summary>
34    /// スケジュールを追加する画面
35    /// </summary>
36    public partial class AddScheduleView : UserControl {
37
38        #region event
39
40        /// <summary>
41        ///
42        /// </summary>
43        public event RoutedEventHandler DialogClosed;
44        /// <summary>
45        /// DialogClosedイベントを呼び出します。
46        /// </summary>
47        /// <param name="e">イベント引数</param>
48        protected virtual void OnDialogClosed(RoutedEventArgs e) {
49            if(DialogClosed != null) DialogClosed(this, e);
50        }
51
52        #endregion
53
54        #region constructors
55
56        /// <summary>
57        /// 標準的なコンストラクタ
58        /// </summary>
59        public AddScheduleView() {
60            InitializeComponent();
61        }
62
63        #endregion
64
65        #region methods
66
67        /// <summary>
68        /// 指定したタイトルを付けて画面を表示します。
69        /// </summary>
70        /// <param name="title">タイトル</param>
71        public void Show(string title) {
72            this.titleLabel.Text = title;
73            this.Visibility = Visibility.Visible;
74            this.stimeInput.Focus();
75
76            this.stimeInput.Text = "9:00";
77            this.etimeInput.Text = "11:00";
78        }
79
80        #endregion
81
82        private void okButton_Click(object sender, RoutedEventArgs e) {
83            this.Visibility = Visibility.Collapsed;
84
85            OnDialogClosed(new RoutedEventArgs {
86                Source = this
87            });
88        }
89
90        private void cancelButton_Click(object sender, RoutedEventArgs e) {
91            this.Visibility = Visibility.Collapsed;
92        }
93
94    }
95}
Note: See TracBrowser for help on using the browser.