public static IEAVolatileElement Wrap(EventProperties info) { var volatileElement = new EAVolatileElement { Type = info.Get(EAEventPropertyKeys.Type).Value, Stereotype = info.Get(EAEventPropertyKeys.Stereotype).Value }; if (volatileElement.Type.Equals(EAConstants.EventPropertyTypeElement)) { dynamic parentElementID = EAUtilities.ParseToInt32(info.Get(EAEventPropertyKeys.ParentId).Value, -1); if (parentElementID > 0) { volatileElement.ParentElement = EARepository.Instance.GetElementByID(parentElementID); } } dynamic diagramID = EAUtilities.ParseToInt32(info.Get(EAEventPropertyKeys.DiagramId).Value, -1); if (diagramID > 0) { volatileElement.Diagram = EARepository.Instance.GetDiagramByID(diagramID); } return(volatileElement); }
private IEnumerator SetEventPropertiesAndLogEvent(string eventType, Dictionary <string, string> vals) { if (disabled) { yield break; } yield return(new WaitUntil(PerfManager.Instance.AvailableForLowPri)); PerfManager.Instance.LockLowPriActions(2); float start = Time.unscaledTime; while (userId == NULL_USER_ID && connected) { yield return(new WaitForSeconds(1)); if (start + ConnectionRetryPeriodInS < Time.unscaledTime) { connected = false; Debug.LogWarning("No Network connection, not logging stats."); break; } } if (connected) { EventProperties.Get().ToList().ForEach(e => vals.Add(e.Key, e.Value)); send(eventType, vals); } }
public static IEAElement Wrap(EventProperties properties) { dynamic elementId = EAUtilities.ParseToInt32(properties.Get(EAEventPropertyKeys.ElementId).Value, -1); EAElement element = null; if (elementId > 0) { element = EARepository.Instance.GetElementByID(elementId); } return(element); }
public static IEAVolatileDiagram Wrap(EventProperties info) { var volatileDiagram = new EAVolatileDiagram(); dynamic diagramID = EAUtilities.ParseToInt32(info.Get(EAEventPropertyKeys.DiagramId).Value, -1); if (diagramID > 0) { volatileDiagram.DiagramID = diagramID; } return(volatileDiagram); }
public static IEAVolatileConnector Wrap(EventProperties properties) { var volatileConnector = new EAVolatileConnector { Type = properties.Get(EAEventPropertyKeys.Type).Value, Subtype = properties.Get(EAEventPropertyKeys.Subtype).Value, Stereotype = properties.Get(EAEventPropertyKeys.Stereotype).Value }; dynamic supplierId = EAUtilities.ParseToInt32(properties.Get(EAEventPropertyKeys.SupplierId).Value, -1); if (supplierId > 0) { volatileConnector.Supplier = EARepository.Instance.GetElementByID(supplierId); } dynamic clientId = EAUtilities.ParseToInt32(properties.Get(EAEventPropertyKeys.ClientId).Value, -1); if (clientId > 0) { volatileConnector.Client = EARepository.Instance.GetElementByID(clientId); } dynamic diagramId = EAUtilities.ParseToInt32(properties.Get(EAEventPropertyKeys.DiagramId).Value, -1); if (diagramId > 0) { volatileConnector.Diagram = EARepository.Instance.GetDiagramByID(diagramId); } return(volatileConnector); }
public override bool EA_OnPreDeleteConnector(Repository repository, EventProperties properties) { EAMain.UpdateRepository(repository); int connectorID; if (Int32.TryParse(properties.Get(EAEventPropertyKeys.ConnectorID).Value, out connectorID)) { IEAConnector connector = EAMain.Repository.GetConnectorByID(connectorID); foreach (IRepositoryListener l in _listeners) { if (!l.OnPreDeleteConnector(connector)) { return(false); } } } return(true); }
public override bool EA_OnPreDeletePackage(Repository Repository, EventProperties Info) { EventProperty packageID = Info.Get("PackageID"); if (changesAllowed) { contextWrapper.handlePackageDeletion(Repository, Convert.ToInt32(packageID.Value.ToString())); } return base.EA_OnPreDeletePackage(Repository, Info); }
public override bool EA_OnPreDeleteElement(Repository Repository, EventProperties Info) { try { EventProperty elementID = Info.Get("ElementID"); if (changesAllowed) { contextWrapper.handleElementDeletion(Repository, Convert.ToInt32(elementID.Value.ToString())); } } catch (Exception) { } return base.EA_OnPreDeleteElement(Repository, Info); }
public override bool EA_OnPostNewPackage(Repository Repository, EventProperties Info) { try { EventProperty packageID = Info.Get("PackageID"); if (changesAllowed) { contextWrapper.handlePackageCreation(Repository, Convert.ToInt32(packageID.Value.ToString())); } } catch (Exception) { } return base.EA_OnPostNewPackage(Repository, Info); }
public override bool EA_OnPostNewDiagramObject(Repository Repository, EventProperties Info) { try { EventProperty elementID = Info.Get("ID"); EventProperty diagramID = Info.Get("DiagramID"); EventProperty duID = Info.Get("DUID"); if (changesAllowed) { contextWrapper.handleDiagramObjectCreation(Repository, Convert.ToInt32(elementID.Value.ToString()), Convert.ToInt32(diagramID.Value.ToString()), duID.ToString()); } } catch (Exception) { } return base.EA_OnPostNewDiagramObject(Repository, Info); }
public override bool EA_OnPostNewConnector(Repository Repository, EventProperties Info) { try { EventProperty connectorID = Info.Get("ConnectorID"); contextWrapper.handleConnectorCreation(Repository, Convert.ToInt32(connectorID.Value.ToString())); } catch (Exception) { } return base.EA_OnPostNewConnector(Repository, Info); }