updates color picker datatype so it supports updates to key value prevalue editor

[TFS Changeset #80615]
This commit is contained in:
starfighter83
2010-11-25 09:59:42 +00:00
parent abb97482fe
commit 0cd73c3273
2 changed files with 22 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ namespace umbraco.editorControls.colorpicker
{
if (_Editor == null)
{
_Editor = new colorPicker(Data,((KeyValuePrevalueEditor)PrevalueEditor).Prevalues);
_Editor = new colorPicker(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList);
}
return _Editor;
}

View File

@@ -4,6 +4,7 @@ using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Collections;
using umbraco.IO;
using System.Collections.Generic;
namespace umbraco.editorControls
{
@@ -23,6 +24,14 @@ namespace umbraco.editorControls
_data = Data;
_prevalues = Prevalues;
}
List<KeyValuePair<int, String>> Prevalues;
public colorPicker(interfaces.IData Data, List<KeyValuePair<int, String>> Prevalues)
{
_data = Data;
this.Prevalues = Prevalues;
}
private ArrayList _colors = new ArrayList();
public Control Editor { get { return this; } }
@@ -56,9 +65,19 @@ namespace umbraco.editorControls
try
{
foreach (string val in _prevalues.Values)
if (_prevalues != null)
{
_colors.Add(new ListItem(val));
foreach (string val in _prevalues.Values)
{
_colors.Add(new ListItem(val));
}
}
else if (Prevalues != null)
{
foreach (KeyValuePair<int, String> item in Prevalues)
{
_colors.Add(new ListItem(item.Value));
}
}
}
catch { }