Example #1
0
        Control FileTypeComboBox()
        {
            var combo = new DropDown();

            fileTypes.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.CurrentCulture));
            combo.Items.AddRange(fileTypes.Cast <IListItem>());

            combo.SelectedKey           = Convert.ToString(Sauce.ByteFileType);
            combo.SelectedIndexChanged += delegate
            {
                var fileType = (SauceFileTypeInfo)combo.SelectedValue;
                Sauce.ByteFileType = fileType.Type;
                FileType           = fileType;
                OnFileTypeChanged(EventArgs.Empty);
            };

            return(combo);
        }
Example #2
0
 public Admin(T dataType)
 {
     DataType  = dataType;
     fileTypes = DataType.FileTypes.ToList();
     FileType  = fileTypes.FirstOrDefault(r => r.Type == Sauce.ByteFileType);
 }