You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2005/11/15 23:08:46 UTC

svn commit: r344455 - in /struts/sandbox/trunk/overdrive/PhoneBook: Core/Commands/EntryInitial.cs Test/Commands/FilterLists.cs Web/Controls/InitialFilter.ascx.cs Web/Controls/Lister2.ascx.cs Web/Web.csproj

Author: husted
Date: Tue Nov 15 14:08:37 2005
New Revision: 344455

URL: http://svn.apache.org/viewcvs?rev=344455&view=rev
Log:
OVR-22
* Reformat code only; no changes.

Modified:
    struts/sandbox/trunk/overdrive/PhoneBook/Core/Commands/EntryInitial.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/InitialFilter.ascx.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/Commands/EntryInitial.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Core/Commands/EntryInitial.cs?rev=344455&r1=344454&r2=344455&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/Commands/EntryInitial.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/Commands/EntryInitial.cs Tue Nov 15 14:08:37 2005
@@ -1,6 +1,5 @@
 using System.Collections;
 using Nexus.Core;
-using PhoneBook.Core.Commands;
 
 namespace PhoneBook.Core.Commands
 {
@@ -9,7 +8,6 @@
 	/// </summary>
 	public class EntryInitial : BaseMapper
 	{
-
 		/// <summary>
 		/// Document token representing match all entries.
 		/// </summary>
@@ -23,10 +21,12 @@
 		public override bool RequestExecute(IRequestContext context)
 		{
 			const string ZERO = "0";
-			
-			string[] input = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
-								 "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
-								 "U", "V", "W", "X", "Y", "Z"};
+
+			string[] input = {
+				"A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
+				"K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
+				"U", "V", "W", "X", "Y", "Z"
+			};
 
 			IList output = new ArrayList(26);
 
@@ -37,11 +37,10 @@
 				if (ZERO.Equals(result)) continue;
 				output.Add(letter);
 			}
-		
+
 			output.Add(ALL);
 			context.Outcome = output;
 			return CONTINUE;
 		}
 	}
-}
-
+}
\ No newline at end of file

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs?rev=344455&r1=344454&r2=344455&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs Tue Nov 15 14:08:37 2005
@@ -122,15 +122,15 @@
 			IViewHelper helper = catalog.GetHelperFor(App.ENTRY_LIST);
 			helper.Criteria["initial"] = "C%";
 			helper.Execute();
-			Assert.IsTrue(helper.IsNominal,helper.AlertsText);
+			Assert.IsTrue(helper.IsNominal, helper.AlertsText);
 			IList list = helper.Outcome;
-			Assert.IsTrue(list.Count>0,"Expected one or more entries");
-			foreach (AppEntry entry in list) 
+			Assert.IsTrue(list.Count > 0, "Expected one or more entries");
+			foreach (AppEntry entry in list)
 			{
-				Assert.IsTrue("C".Equals(entry.last_name.Substring(0,1)),"Expected all to be C*");
+				Assert.IsTrue("C".Equals(entry.last_name.Substring(0, 1)), "Expected all to be C*");
 			}
 			int count = Convert.ToInt32(helper.Criteria["item_count"]);
-			Assert.IsTrue(count==list.Count,"Expected counts to match");
+			Assert.IsTrue(count == list.Count, "Expected counts to match");
 		}
 
 		[Test]
@@ -138,12 +138,12 @@
 		{
 			IViewHelper helper = catalog.GetHelperFor(App.ENTRY_INITIAL);
 			helper.Execute();
-			Assert.IsTrue(helper.IsNominal,helper.AlertsText);
+			Assert.IsTrue(helper.IsNominal, helper.AlertsText);
 			IList list = helper.Outcome;
-			Assert.IsTrue(list.Count>0,"Expected one or more entries");
+			Assert.IsTrue(list.Count > 0, "Expected one or more entries");
 			string a = list[0] as string;
-			Assert.IsNotNull(a,"Expected letter");
-			Assert.IsTrue("C".Equals(a),"Expected C");			
+			Assert.IsNotNull(a, "Expected letter");
+			Assert.IsTrue("C".Equals(a), "Expected C");
 		}
 
 	}

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/InitialFilter.ascx.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/InitialFilter.ascx.cs?rev=344455&r1=344454&r2=344455&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/InitialFilter.ascx.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/InitialFilter.ascx.cs Tue Nov 15 14:08:37 2005
@@ -4,6 +4,5 @@
 {
 	public class InitialFilter : LetterFilter
 	{
-
 	}
-}
+}
\ No newline at end of file

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs?rev=344455&r1=344454&r2=344455&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs Tue Nov 15 14:08:37 2005
@@ -14,7 +14,6 @@
 	/// </summary>
 	public class Lister2 : AppGridControl
 	{
-		
 		/// <summary>
 		/// Provide instance of DataGrid control
 		/// </summary>
@@ -29,23 +28,22 @@
 
 		protected override IViewHelper Save(string key, ControlCollection controls)
 		{
-			IViewHelper h = base.Save(key,controls,false);
+			IViewHelper h = base.Save(key, controls, false);
 			if (h.IsNominal)
 			{
-				bool needEditorValue = (null==h.Criteria[App.EDITOR]); 
+				bool needEditorValue = (null == h.Criteria[App.EDITOR]);
 				// FIXME: [OVR-24] - Template columns not passed by DataGridCommandEventArgs
 				if (needEditorValue)
 				{
 					h.Criteria[App.EDITOR] = FindControlValue(App.EDITOR);
 				}
-				h.Execute();				
+				h.Execute();
 			}
 			return h;
 		}
 
 		public override ControlCollection GetControls(DataGridCommandEventArgs e)
 		{
-
 			DataGrid grid = Grid;
 			ControlCollection controls = new ControlCollection(grid);
 			foreach (TableCell cell in e.Item.Cells)
@@ -53,7 +51,7 @@
 				for (int i = 0; i < cell.Controls.Count; i++)
 					controls.Add(cell.Controls[i]);
 			}
-						
+
 			/*
 			// What the scripts usually do, but our EDITOR_CELL is null.
 			const int EDITOR_CELL = 8;
@@ -87,18 +85,19 @@
 
 
 		private IKeyValueList _EditorKeys = null;
+
 		private IKeyValueList EditorKeys
 		{
 			get
 			{
-				if (_EditorKeys==null)
+				if (_EditorKeys == null)
 				{
 					IKeyValueList data = new KeyValueList();
 					// FIXME: Obtain from Spring?
-					data.Add(new KeyValue(" ","--v--"));
-					data.Add(new KeyValue("0","NO"));
-					data.Add(new KeyValue("1","YES"));
-					_EditorKeys = data;					
+					data.Add(new KeyValue(" ", "--v--"));
+					data.Add(new KeyValue("0", "NO"));
+					data.Add(new KeyValue("1", "YES"));
+					_EditorKeys = data;
 				}
 				return _EditorKeys;
 			}
@@ -113,7 +112,7 @@
 		private IGridConfig GetConfig(string dataField)
 		{
 			string headerText = GetMessage(dataField + LABEL);
-			IGridConfig config = new GridConfig(dataField,headerText);
+			IGridConfig config = new GridConfig(dataField, headerText);
 			return config;
 		}
 
@@ -141,8 +140,8 @@
 			list.Add(GetConfig(App.HIRED));
 			list.Add(GetConfig(App.HOURS));
 			IGridConfig c = GetConfig(App.EDITOR);
-			c.ItemTemplate = new KeyValueTemplate(App.EDITOR,EditorKeys);
-			c.EditItemTemplate = new DropDownListTemplate(App.EDITOR,EditorKeys);
+			c.ItemTemplate = new KeyValueTemplate(App.EDITOR, EditorKeys);
+			c.EditItemTemplate = new DropDownListTemplate(App.EDITOR, EditorKeys);
 			list.Add(c);
 			Configs = list;
 		}
@@ -215,10 +214,7 @@
 		}
 
 		#endregion
-
 	}
 
-
-	
 
 }

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj?rev=344455&r1=344454&r2=344455&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj Tue Nov 15 14:08:37 2005
@@ -234,7 +234,7 @@
                 <File
                     RelPath = "Controls\InitialFilter.ascx.cs"
                     DependentUpon = "InitialFilter.ascx"
-                    SubType = "Code"
+                    SubType = "ASPXCodeBehind"
                     BuildAction = "Compile"
                 />
                 <File



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org