private bool ModelBuilderActivated() { bool activated = false; try { string value = RegistryUtil.GetRegistryKey("ModelBuilderActivated"); if (!string.IsNullOrEmpty(value)) { activated = Convert.ToBoolean(value); } } catch (Exception ex) { MessageBox.Show("Failed to find an activation key for the Model Builder.\n" + ex.Message, "Model Builder Activation Failed", MessageBoxButton.OK, MessageBoxImage.Warning); } return(activated); }
public ModelInfo(Document doc) { m_doc = doc; docTitle = doc.Title; prefixes.Add("E-CAD", "E-CAD"); prefixes.Add("E-BIM", "E-BIM"); prefixes.Add("REVIT", "REVIT"); docCentralPath = GetCentralPath(); GetProjectInfo(); GetFileLocation(); GetUserLocation(); if (string.IsNullOrEmpty(fileLocation) && userLocation == "UNKNOWN") { hokStandard = false; string regValue = RegistryUtil.GetRegistryKey("CompanyName"); if (!string.IsNullOrEmpty(regValue)) { companyName = regValue; } } else { hokStandard = true; } ProjectReplicatorSettings settings = DataStorageUtil.ReadSettings(doc); revitDocumentId = settings.RevitDocumentId; if (string.IsNullOrEmpty(revitDocumentId)) { revitDocumentId = Guid.NewGuid().ToString(); settings.RevitDocumentId = revitDocumentId; DataStorageUtil.UpdateSettings(doc, settings); } }