Exemple #1
0
        public MenuOptionRow AddNewMenuOption( )
        {
            MenuOptionRow optn = new MenuOptionRow( );

            Add(optn);
            return(optn);
        }
Exemple #2
0
 // convert from string to MenuOptionRow
 public override object ConvertFrom(
     ITypeDescriptorContext context,
     CultureInfo culture,
     object InValue)
 {
     if (InValue is string)
     {
         return(MenuOptionRow.FromString((string)InValue));
     }
     return(base.ConvertFrom(context, culture, InValue));
 }
Exemple #3
0
 // Overrides the ConvertTo method of TypeConverter.
 public override object ConvertTo(
     ITypeDescriptorContext context,
     CultureInfo culture,
     object InValue,
     Type destinationType)
 {
     if (destinationType == typeof(string))
     {
         MenuOptionRow row = (MenuOptionRow)InValue;
         return(row.ToString( ));
     }
     return(base.ConvertTo(context, culture, InValue, destinationType));
 }
Exemple #4
0
        // ------------------------ FromString --------------------------
        // create a MenuOptionList object from a comma delimeted string.
        public static MenuOptionList FromString(string InValue)
        {
            MenuOptionList menuOl        = new MenuOptionList();
            CsvString      csvOptionList = new CsvString();

            csvOptionList.AddString(InValue);
            string[] lines = csvOptionList.ToStringArray();
            foreach (string line in lines)
            {
                MenuOptionRow row = MenuOptionRow.FromString(line);
                menuOl.Add(row);
            }
            return(menuOl);
        }
Exemple #5
0
        public MenuOptionRow FindMenuOption(string InOptionName)
        {
            MenuOptionRow optn = null;
            IEnumerator   it   = GetEnumerator( );

            while (it.MoveNext( ) == true)
            {
                optn = (MenuOptionRow)it.Current;
                if (optn.OptionName == InOptionName)
                {
                    return(optn);
                }
            }
            return(null);
        }
Exemple #6
0
        // ------------------------ FromString --------------------------
        // create a MenuOptionRow object from a comma delimeted string.
        public static MenuOptionRow FromString(string InValue)
        {
            MenuOptionRow row = new MenuOptionRow( );
            ArrayList     v   = SmartSplit(InValue);

//			string[] v = ((string)value).Split(new char[] {','}) ;
            row.SetMenuName((string)v[0])
            .SetOptionNumber(int.Parse((string)v[1]))
            .SetOptionCategory((string)v[2])
            .SetOptionText((string)v[3])
            .SetOptionName((string)v[4])
            .SetDocumentFileName((string)v[5])
            .SetUrl((string)v[6]);
            return(row);
        }