/// <inheritdoc /> public void Initialize(IServerModule module) { if (!AvailableModules.Contains(module)) { return; // Module not executable } module.Initialize(); }
/// <summary> /// Removes all invalid modules based on the neighbors /// </summary> /// <param name="wfcSpace">The space this cell is in</param> /// <returns>true if any modules were removed</returns> public bool RemoveInvalidModules(WfcSpace <TModule, TPosition> wfcSpace) { if (WasSelected) { return(false); } var numberOfRemovedModules = AvailableModules.RemoveAll(module => !module.CanModuleBePlaced(this, wfcSpace)); return(numberOfRemovedModules > 0); }
public void SetModules(IEnumerable <IModule> availableModules, IEnumerable <IModule> selectedModules, List <IDependent> ordering = null) { AvailableModules.Clear(); foreach (var module in availableModules) { AvailableModules.Add(module); } SelectedModules.Clear(); foreach (var module in selectedModules) { SelectedModules.Add(module); } Ordering = ordering; RaisePropertyChanged(nameof(Ordering)); }
/// <summary> /// Add the standard modules to the list view. /// </summary> private void AddStandardModules() { AvailableModules allModules = RestAPIWrapper.GetModules(); foreach (string moduleKey in this.standardModules.OrderBy(x => x)) { var module = allModules.items.FirstOrDefault(x => x.module_key == moduleKey); if (module != null) { this.lstViewSearchModules.Items.Add(new ListViewItem { Tag = module.module_key, Text = module.module_label }); } else { Log.Warn($"Standard modules '{moduleKey}' was not found on the CRM system"); } } }
void UpdateBreadCrumbList(Uri targetUri) { var currentModules = new List <IOfficeModule>(); if (targetUri != null) { var activeModule = AvailableModules.FirstOrDefault(m => m.TargetUri == targetUri); while (activeModule != null) { currentModules.Add(activeModule); var parentType = activeModule.ParentType; if (parentType == null) { break; } activeModule = AvailableModules.FirstOrDefault(m => m.GetType() == parentType); } } currentModules.Add(_homePage); currentModules.Reverse(); CurrentModules = currentModules.Select(x => new ModuleViewModel(x, _regionManager)); }
/// <summary> /// Get the list of modules installed in the connected CRM instance, with their /// associated access control lists. /// </summary> /// <remarks>This data changes only rarely, and is consequently cached for the session. /// </remarks> /// <returns>the list of modules installed in the connected CRM instance.</returns> public static AvailableModules GetModules() { if (modulesCache == null) { EnsureLoggedIn(); object data = new { @session = SuiteCRMUserSession.id }; try { Log.Debug("Calling get_available_modules..."); modulesCache = SuiteCRMUserSession.RestServer.GetCrmResponse <AvailableModules>("get_available_modules", data); Log.Debug("Successfully called get_available_modules."); } catch (Exception any) { Log.Error($"Call to get_available_modules failed: {any.Message}"); throw; } } return(modulesCache); }
public Library(string path) { if (string.Equals("$(Default)", path, StringComparison.OrdinalIgnoreCase)) { path = LibraryManager.DefaultX64; } if (string.IsNullOrWhiteSpace(path)) { Error = $"Argument is null or empty: {nameof(path)}"; return; } if (!Directory.Exists(path)) { Error = $"Directory is not exists: {path}"; return; } LibraryPath = path; AvailableLibraries = LibraryUtilities.FindAvailableFiles(path, LibrariesSubFolders, "*.lib"); if (!AvailableLibraries.Any()) { Error = "Libraries are not found"; return; } VersionShort = FindVersion(AvailableLibraries); AvailableLibraries = LibraryUtilities.FindAvailableFiles(path, LibrariesSubFolders, $"*{VersionShort}.lib"); if (!AvailableLibraries.Any()) { Error = "Libraries are not found"; return; } LibrariesPath = Path.GetDirectoryName(AvailableLibraries.First()); Version = ToFullVersion(VersionShort); AvailableModules = AvailableLibraries.Select(GetName).ToList(); if (!AvailableModules.Any()) { Error = "Modules are not found"; return; } AvailableDlls = LibraryUtilities.FindAvailableFiles(path, DllSubFolders, $"*{VersionShort}.dll"); if (!AvailableDlls.Any()) { Error = "Dlls are not found"; return; } Is64Bit = FindIs64Bit(AvailableDlls); DllsPath = Path.GetDirectoryName(AvailableDlls.First()); AvailableHeaders = LibraryUtilities.FindAvailableFiles(path, IncludeSubFolders, "*.hpp"); if (!AvailableHeaders.Any()) { Error = "Headers are not found"; return; } HeadersPath = Path.GetDirectoryName(Path.GetDirectoryName(AvailableHeaders.First())); IsAvailable = true; AvailableExes = LibraryUtilities.FindAvailableFiles(path, DllSubFolders, "*.exe"); if (!AvailableExes.Any()) { return; } ExesPath = Path.GetDirectoryName(AvailableExes.First()); }