Click here to Skip to main content
15,885,365 members
Articles / Desktop Programming / Windows Forms

ResxWriter: Generating .resx files from an Excel spreadsheet

Rate me:
Please Sign up or sign in to vote.
4.94/5 (22 votes)
17 Nov 20062 min read 130.5K   3.5K   65  
Generate .resx files from an Excel spreadsheet; fully customizable.
/*
 * Patrick Bounaix
 * www.L0g1c4L.com
 * 
 * See AssemblyInfo.cs 
 * for License Information
 * */

#region using
using System;
using System.Collections;
using System.Xml.Serialization;
#endregion

namespace L0g1c4L.ResxWriter.UI
{
	/// <summary>
	/// Strongly-typed collection 
	/// of Language objects.
	/// </summary>
	[Serializable] 
	[XmlInclude(typeof(ClsLanguage))] 
	public class ClsLanguageCollection : System.Collections.CollectionBase 
	{ 
		#region Public...
		#region Constructors
		/// <summary>
		/// Default Constructor.
		/// </summary>
		public ClsLanguageCollection() {} 

		/// <summary>
		/// Adds a Language object 
		/// to the current collection.
		/// </summary>
		/// <param name="lang">ClsLanguage</param>		
		public void Add(ClsLanguage lang) 
		{ 
			List.Add(lang); 
		} 
		#endregion
		
		#region Methods
		#region ClsLanguage this[int index] 
		/// <summary>
		/// Indexer for current ClsLanguage object.
		/// </summary>
		public virtual ClsLanguage this[int index] 
		{ 
			get 
			{ 
				return (ClsLanguage) this.List[index]; 
			} 
			set 
			{
				((IList)this)[index] =  value;
			}
		} 
		#endregion
		
		#region Contains
		/// <summary>
		/// Determines if ClsLanguage object 
		/// is in current collection.
		/// (ColumnName and Culture must be unique)
		/// </summary>
		/// <param name="val">ClsLanguage</param>
		/// <returns>bool</returns>
		public bool Contains(ClsLanguage val) 
		{
			foreach (ClsLanguage c in List)
			{
				if ((c.LanguageColumnName == val.LanguageColumnName)
					|| (c.LanguageCulture == val.LanguageCulture))
				{
					return true;
				}
			}

			return false;
		}
		#endregion

		#region Insert
		/// <summary>
		/// Inserts ClsLanguage 
		/// at specified index 
		/// into current collection.
		/// </summary>
		/// <param name="index">int</param>
		/// <param name="value">ClsLanguage</param>
		public void Insert(int index, ClsLanguage value) 
		{
			((IList)this).Insert(index, (object) value);
		}
		#endregion

		#region Remove
		/// <summary>
		/// Removes ClsLanguage object from collection.
		/// </summary>
		/// <param name="value">ClsLanguage</param>
		public void Remove(ClsLanguage value) 
		{
			((IList)this).Remove((object) value);
		}
		#endregion

		#region IndexOf
		/// <summary>
		/// Returns the index of specified ClsLanguage object.
		/// </summary>
		/// <param name="value">ClsLanguage</param>
		/// <returns>int</returns>
		public int IndexOf(ClsLanguage value) 
		{
			return ((IList)this).IndexOf((object) value);
		}
		#endregion

		#region CopyTo
		/// <summary>
		/// Copies the ClsLanguage collection to the specified collection.
		/// </summary>
		/// <param name="array">ClsLanguage[]</param>
		/// <param name="index">int</param>
		public void CopyTo(ClsLanguage[] array, int index)
		{
			((ICollection)this).CopyTo(array, index);
		}
		#endregion
		#endregion
		#endregion
	} 
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
- philosophy
- french
- computer science

Comments and Discussions