コード例 #1
0
        internal bool EA_OnPostNewAttribute(EA.Repository Repository, EA.EventProperties Info)
        {
            if (!initialConnectionAvailable)
            {
                return(true);
            }

            EA.Attribute        attribute = Repository.GetAttributeByID(int.Parse((string)Info.Get(0).Value));
            CreateElementChange change    = new CreateElementChange();

            change.elementType = ElementType.PACKAGE;
            change.internalID  = attribute.AttributeGUID;
            change.name        = attribute.Name;
            return(sendObject(change));
            //return sendEvent(Repository, Info);
        }
コード例 #2
0
ファイル: EAUtil.cs プロジェクト: SvenPeldszus/emoflon-tool
        public static Object sqlEAObjectToOriginalObject(SQLRepository sqlRepository, Object sqlEAObject)
        {
            EA.Repository repository = sqlRepository.GetOriginalRepository();
            Object        realObject = sqlEAObject;

            if (sqlEAObject is SQLElement)
            {
                realObject = repository.GetElementByGuid((sqlEAObject as SQLElement).ElementGUID);
                if (realObject == null)
                {
                    throw new COMException("Can't find matching ID");
                }
                else
                {
                    realObject = repository.GetElementByID((sqlEAObject as SQLElement).ElementID);
                }
            }
            else if (sqlEAObject is SQLConnector)
            {
                realObject = repository.GetConnectorByID((sqlEAObject as SQLConnector).ConnectorID);
            }
            else if (sqlEAObject is SQLMethod)
            {
                realObject = repository.GetMethodByID((sqlEAObject as SQLMethod).MethodID);
            }
            else if (sqlEAObject is SQLAttribute)
            {
                realObject = repository.GetAttributeByID((sqlEAObject as SQLAttribute).AttributeID);
            }
            else if (sqlEAObject is SQLPackage)
            {
                realObject = repository.GetPackageByID((sqlEAObject as SQLPackage).PackageID);
            }
            else if (sqlEAObject is SQLDiagram)
            {
                realObject = repository.GetDiagramByID((sqlEAObject as SQLDiagram).DiagramID);
            }
            return(realObject);
        }