public static void SetSelectedAdapter(int index) { if (index >= adapters.Length && index < 0 && selectedAdapterIndex == index) { return; } selectedAdapterIndex = index; selectedAdapter = adapters[index]; }
private static void InitializeSelectedAdapter() { selectedAdapter = adapters.FirstOrDefault(a => Exists(a) && GetAdapterName(a) == GitManager.Settings.ExternalProgram) ?? adapters.FirstOrDefault(a => Exists(a)); if (selectedAdapter != null) { selectedAdapterIndex = Array.IndexOf(adapters, selectedAdapter); } initiazlitedSelected = true; }
private static bool Exists(IExternalAdapter adapterInfo) { ExternalAdapterAttribute attribute = adapterInfo.GetType().GetCustomAttributes(typeof(ExternalAdapterAttribute), false).FirstOrDefault() as ExternalAdapterAttribute; if (attribute == null) { return(false); } return(attribute.ProcessNames.All(p => ExistsOnPath(p))); }
private static string GetAdapterName(IExternalAdapter adapter) { ExternalAdapterAttribute attribute = adapter.GetType().GetCustomAttributes(typeof(ExternalAdapterAttribute), false).FirstOrDefault() as ExternalAdapterAttribute; if (attribute == null) { return(null); } return(attribute.FriendlyName); }
private static int GetAdapterPriority(IExternalAdapter adapter) { ExternalAdapterAttribute attribute = GetAdapterAttribute(adapter); if (attribute == null) { return(0); } return(attribute.Priority); }
private static string GetAdapterName(IExternalAdapter adapter) { ExternalAdapterAttribute attribute = GetAdapterAttribute(adapter); if (attribute == null) { return(null); } return(attribute.FriendlyName); }
private static bool Exists(IExternalAdapter adapterInfo) { ExternalAdapterAttribute attribute = GetAdapterAttribute(adapterInfo); if (attribute == null) { return(false); } return(attribute.ProcessNames.All(p => ExistsOnPath(p))); }
private static ExternalAdapterAttribute GetAdapterAttribute(IExternalAdapter adapter) { return(adapter.GetType().GetCustomAttributes(typeof(ExternalAdapterAttribute), false).FirstOrDefault() as ExternalAdapterAttribute); }