private static double GetProfileParameter(string aProfileName, int aNo) { CatalogHandler catalogHandler = new CatalogHandler(); double result = -1.0; if (catalogHandler.GetConnectionStatus()) { try { LibraryProfileItem libraryProfile = new LibraryProfileItem(); libraryProfile.Select(aProfileName); ArrayList Parameters = libraryProfile.aProfileItemParameters; ProfileItemParameter parameter = (ProfileItemParameter)Parameters[aNo]; result = parameter.Value; } catch { try { ParametricProfileItem parametricProfile = new ParametricProfileItem(); parametricProfile.Select(aProfileName); ArrayList Parameters = parametricProfile.aProfileItemParameters; ProfileItemParameter parameter = (ProfileItemParameter)Parameters[aNo]; result = parameter.Value; } catch { } } } return(result); }
private bool isExisting(BaseComponent component) { CatalogHandler catalogHandler = new CatalogHandler(); if (catalogHandler.GetConnectionStatus()) { ComponentItemEnumerator componentItemEnumerator = catalogHandler.GetComponentItems(); ComponentItem componentItem; while (componentItemEnumerator.MoveNext()) { componentItem = componentItemEnumerator.Current; if (component.Name == componentItem.Name) { return(true); } } return(false); } MessageBox.Show("Nie można połączyć z modelem"); throw new Exception("Nie można połączyć z modelem"); }