Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BoundColumn.cs « System.Web.UI.WebControls « System.Web « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 13bcb75f8dbe50de6b7d5f424ee6c145b190479f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
 * Namespace: System.Web.UI.WebControls
 * Class:     BoundColumn
 * 
 * Author:  Gaurav Vaish
 * Maintainer: gvaish@iitk.ac.in
 * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
 * Implementation: yes
 * Status:  60%
 * 
 * (C) Gaurav Vaish (2001)
 */

using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;

namespace System.Web.UI.WebControls
{
	public class BoundColumn : DataGridColumn
	{
		public static readonly string thisExpr = "!";
		
		private string dataField;
		private string dataFormatString;
		private bool readOnly;
		
		private PropertyDescriptor desc;

		public BoundColumn(): base()
		{
			//TODO: The start work
			Initialize();
		}
		
		public override void Initialize()
		{
			base.Initialize();
			dataField        = String.Empty;
			dataFormatString = String.Empty;
			readOnly         = false;
			desc             = null;
		}

		[MonoTODO]
		public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
		{
			//TODO: What to do?
			InitializeCell(cell, columnIndex, itemType);
//			switch(itemType)
//			{
//				case 
//			}
			throw new NotImplementedException();
		}
		
		public virtual string DataField
		{
			get
			{
				return dataField;
			}
			set
			{
				dataField = value;
			}
		}
		
		public virtual string DataFormatString
		{
			get
			{
				return dataFormatString;
			}
			set
			{
				dataFormatString = value;
			}
		}
		
		public virtual bool ReadOnly
		{
			get
			{
				return readOnly;
			}
			set
			{
				readOnly = value;
			}
		}
		
		[MonoTODO]
		protected virtual string FormatDataValue(Object dataValue)
		{
			// TODO: How to extract the value from the object?
			// TODO: Then format the value. Here's a possible solution
			if(dataFormatString == null || dataFormatString.Equals(String.Empty))
				return dataValue.ToString();
			if(dataValue is DateTime)
				return ((DateTime)dataValue).ToString(dataFormatString);
			throw new NotImplementedException();
			// and so on for int, String, double..
			// something's wrong here. there must be some shorter method!
			//string val = dataValue.toString(dataFormatString);
		}
	}
}