void ProgramListBoxSelectedIndexChanged(object sender, EventArgs e) { DisplayBindingDescriptor binding = SelectedBinding; if (binding != null) { okButton.Enabled = true; setAsDefaultButton.Enabled = true; removeButton.Enabled = binding.GetLoadedBinding() is ExternalProcessDisplayBinding; } else { okButton.Enabled = false; setAsDefaultButton.Enabled = false; removeButton.Enabled = false; } }
public ListEntry(DisplayBindingDescriptor desc, bool isDefault) { this.desc = desc; this.IsDefault = isDefault; }
public static IDisplayBinding GetBindingPerFileName(string filename) { DisplayBindingDescriptor codon = GetCodonPerFileName(filename); return(codon == null ? null : codon.Binding); }
public ListEntry(DisplayBindingDescriptor desc, bool isDefault) { this.desc = desc; this.IsDefault = isDefault; }
public void SetDefaultCodon(string extension, DisplayBindingDescriptor bindingDescriptor) { main_thread.VerifyAccess(); if(bindingDescriptor == null) throw new ArgumentNullException("bindingDescriptor"); if(extension == null) throw new ArgumentNullException("extension"); if(!extension.StartsWith(".", StringComparison.Ordinal)) throw new ArgumentException("extension must start with '.'"); display_binding_properties.Set("Default" + extension.ToLowerInvariant(), bindingDescriptor.Id); }
static bool IsValidBindingForFileName(DisplayBindingDescriptor binding, FileName filename) { return binding.CanOpenFile(filename) && binding.Binding != null && binding.Binding.CanHandle(filename); }