Skip to content

Commit

Permalink
2002-03-26 Gaurav Vaish <gvaish@iitk.ac.in>
Browse files Browse the repository at this point in the history
* Web/*.cs  -- Added attribute definitions.
* Web/ChangeLog -- Notification

* Web.UI.WebControls/*.cs -- Patches, to make build get going..

svn path=/trunk/mcs/; revision=3367
  • Loading branch information
Gaurav Vaish committed Mar 26, 2002
1 parent bcfb2d5 commit 50378fc
Show file tree
Hide file tree
Showing 19 changed files with 151 additions and 45 deletions.
1 change: 1 addition & 0 deletions mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Web;
using System.Web.UI;
using System.Drawing;
using System.ComponentModel;

namespace System.Web.UI.WebControls
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System;
using System.Web;
using System.Web.UI;
using System.ComponentModel;

namespace System.Web.UI.WebControls
{
Expand Down
5 changes: 5 additions & 0 deletions mcs/class/System.Web/System.Web.UI.WebControls/HyperLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
* (C) Gaurav Vaish (2001)
*/

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

namespace System.Web.UI.WebControls
{
[DefaultProperty("Text")]
Expand Down
1 change: 1 addition & 0 deletions mcs/class/System.Web/System.Web.UI.WebControls/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System;
using System.Web;
using System.Web.UI;
using System.ComponentModel;

namespace System.Web.UI.WebControls
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using System.Collections.Specialized;
using System.Web;
using System.Web.UI;
using System.ComponentModel;

namespace System.Web.UI.WebControls
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System;
using System.Web;
using System.Web.UI;
using System.ComponentModel;

namespace System.Web.UI.WebControls
{
Expand Down
3 changes: 2 additions & 1 deletion mcs/class/System.Web/System.Web.UI.WebControls/ListItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
using System.Collections;
using System.Web;
using System.Web.UI;
using System.ComponentModel;

namespace System.Web.UI.WebControls
{
[TypeConverter(typeof(ExpandableObjectConverter))]
[ContolBuilder(typeof(ListItemControlBuilder))]
[ControlBuilder(typeof(ListItemControlBuilder))]
public sealed class ListItem : IStateManager, IParserAccessor, IAttributeAccessor
{
private static int MARKED = (0x01 << 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@

namespace System.Web.UI.WebControls
{
[DefaultMember("Item")]
//[DefaultMember("Item")] I need the this[...] thing...
//[Editor("??", typeof(Design.WebControls.ListItemCollectionEditor))]
public class ListItemCollection : IList, ICollection, IEnumerable, IStateManager
{
private ArrayList items;
private bool saveAll;
private bool marked;

public ListItemCollection()
{
items = new ArrayList();
saveAll = false;
marked = false;
}

public int Capacity
{
get
Expand All @@ -46,31 +46,31 @@ public int Capacity
items.Capacity = value;
}
}

public int Count
{
get
{
return items.Count;
}
}

public bool IsReadOnly
{
get
{
return items.IsReadOnly;
}
}

public bool IsSynchronized
{
get
{
return items.IsSynchronized;
}
}

public ListItem this[int index]
{
get
Expand All @@ -85,15 +85,15 @@ public ListItem this[int index]
items[index] = value;
}
}

public object SyncRoot
{
get
{
return this;
}
}

public void Add(ListItem item)
{
items.Add(item);
Expand All @@ -114,24 +114,24 @@ public void AddRange(ListItem[] items)
Add(item);
}
}

public void Clear()
{
items.Clear();
if(marked)
saveAll = true;
}

public bool Contains(ListItem item)
{
return items.Contains(item);
}

public void CopyTo(Array array, int index)
{
items.CopyTo(array, index);
}

public ListItem FindByText(string text)
{
int i=-1;
Expand All @@ -143,7 +143,7 @@ public ListItem FindByText(string text)
}
return (i==-1 ? null : (ListItem)items[i]);
}

public ListItem FindByValue(string value)
{
foreach(ListItem current in items)
Expand All @@ -155,7 +155,7 @@ public ListItem FindByValue(string value)
}
return null;
}

internal int FindByValueInternal(string value)
{
int i = -1;
Expand All @@ -169,29 +169,29 @@ internal int FindByValueInternal(string value)
}
return -1;
}

public IEnumerator GetEnumerator()
{
return items.GetEnumerator();
}

public int IndexOf(ListItem item)
{
return items.IndexOf(item);
}

public void Insert(int index, ListItem item)
{
items.Insert(index, item);
if(marked)
saveAll = true;
}

public void Insert(int index, string item)
{
Insert(index, new ListItem(item));
}

public void RemoveAt(int index)
{
if(index < 0 || index >= items.Count)
Expand All @@ -200,17 +200,17 @@ public void RemoveAt(int index)
if(marked)
saveAll = true;
}

public void Remove(ListItem item)
{
RemoveAt(IndexOf(item));
}

public void Remove(string item)
{
RemoveAt(IndexOf(ListItem.FromString(item)));
}

internal object SaveViewState()
{
if(saveAll)
Expand Down Expand Up @@ -240,7 +240,7 @@ internal object SaveViewState()
return new Pair(indices, states);
return null;
}

internal void LoadViewState(object savedState)
{
if(savedState!=null)
Expand Down Expand Up @@ -273,14 +273,14 @@ internal void LoadViewState(object savedState)
}
}
}

internal void TrackViewState()
{
marked = true;
foreach(ListItem current in this)
current.TrackViewState();
}

bool IList.IsFixedSize
{
get
Expand Down Expand Up @@ -311,53 +311,53 @@ int IList.Add(object item)
((ListItem)item).Dirty = true;
return index;
}

bool IList.Contains(object item)
{
if(item is ListItem)
return Contains((ListItem)item);
return false;
}

int IList.IndexOf(object item)
{
if(item is ListItem)
return IndexOf((ListItem)item);
return -1;
}

void IList.Insert(int index, object item)
{
if(item is ListItem)
Insert(index, (ListItem)item);
}

void IList.Remove(object item)
{
if(item is string)
Remove((string)item);
if(item is ListItem)
Remove((ListItem)item);
}

bool IStateManager.IsTrackingViewState
{
get
{
return marked;
}
}

void IStateManager.LoadViewState(object state)
{
LoadViewState(state);
}

object IStateManager.SaveViewState()
{
return SaveViewState();
}

void IStateManager.TrackViewState()
{
TrackViewState();
Expand Down
9 changes: 5 additions & 4 deletions mcs/class/System.Web/System.Web.UI.WebControls/Literal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System;
using System.Web;
using System.Web.UI;
using System.ComponentModel;

namespace System.Web.UI.WebControls
{
Expand All @@ -25,7 +26,7 @@ public class Literal : Control
public Literal(): base()
{
}

public string Text
{
get
Expand All @@ -40,12 +41,12 @@ public string Text
ViewState["Text"] = value;
}
}

protected override ControlCollection CreateControlCollection()
{
return new EmptyControlCollection(this);
}

protected override void AddParsedSubObject(object obj)
{
if(obj is LiteralControl)
Expand All @@ -55,7 +56,7 @@ protected override void AddParsedSubObject(object obj)
}
throw new HttpException(HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "Literal", obj.GetType().Name.ToString()));
}

protected override void Render(HtmlTextWriter writer)
{
if(Text.Length > 0)
Expand Down
1 change: 1 addition & 0 deletions mcs/class/System.Web/System.Web.UI.WebControls/Repeater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using System.Collections;
using System.Web;
using System.Web.UI;
using System.ComponentModel;

namespace System.Web.UI.WebControls
{
Expand Down
Loading

0 comments on commit 50378fc

Please sign in to comment.