root/lang/powershell/PSCustomProviders/trunk/src/Dotnet.PowerShell.PSTodo/PSTodo/PSTodoItem.cs @ 7590

Revision 7590, 4.0 kB (checked in by coma2n, 5 years ago)

lang/powershell/PSCustomProviders/trunk: #71 アイテムの編集機能を追加した

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.Diagnostics;
27
28using Dotnet.Commons;
29
30#endregion
31
32namespace Dotnet.PowerShell.PSTodo {
33
34        #region PSTodoItem class
35
36        /// <summary>
37        /// Todoアイテムの情報を格納するクラス
38        /// </summary>
39        [Serializable]
40        [DebuggerStepThrough]
41        public class PSTodoItem {
42
43                #region fields
44
45                private string title;
46                private string description;
47
48                private bool isComplete;
49
50                #endregion
51
52                #region properties
53
54                /// <summary>
55                /// タイトルを取得、設定します。
56                /// </summary>
57                public string Title {
58                        get { return title; }
59                        set { title = value; }
60                }
61
62                /// <summary>
63                /// 詳細を取得、設定します。
64                /// </summary>
65                public string Description {
66                        get { return description; }
67                        set { description = value; }
68                }
69
70                /// <summary>
71                /// 完了したかどうかを取得、設定します。
72                /// </summary>
73                public bool IsComplete {
74                        get { return isComplete; }
75                        set { isComplete = value; }
76                }
77
78                #endregion
79
80                #region constructors
81
82                /// <summary>
83                /// 標準的なコンストラクタ
84                /// </summary>
85                public PSTodoItem() {
86                }
87
88                /// <summary>
89                /// タイトルを設定するコンストラクタ
90                /// </summary>
91                /// <param name="title">タイトル</param>
92                /// <exception cref="ArgumentException">引数が不正な時</exception>
93                /// <exception cref="ArgumentNullException">引数がnullの時</exception>
94                public PSTodoItem(string title) {
95                        #region ArgumentValidation
96                        ArgumentValidation.CheckForNullOrEmpty(title, "title");
97                        #endregion
98
99                        this.title = title;
100                }
101
102                /// <summary>
103                /// タイトルと詳細、完了かどうかを設定するコンストラクタ
104                /// </summary>
105                /// <param name="title">タイトル</param>
106                /// <param name="description">詳細</param>
107                /// <param name="isComplete">完了かどうか</param>
108                /// <exception cref="ArgumentException">引数が不正な時</exception>
109                /// <exception cref="ArgumentNullException">引数がnullの時</exception>
110                public PSTodoItem(string title, string description, bool isComplete)
111                        : this(title) {
112                        this.description = description;
113                        this.isComplete = isComplete;
114                }
115
116                #endregion
117
118                #region methods
119
120                /// <summary>
121                /// <see cref="object.ToString()"/>
122                /// </summary>
123                /// <returns></returns>
124                public override string ToString() {
125                        return string.Format("Title = {0}", Title);
126                }
127
128                #endregion
129
130        }
131
132        #endregion
133
134}
Note: See TracBrowser for help on using the browser.