public bool IsDataTypeComlex(Guid GUID)
        {
            //BaseDataType baseDatatype = BaseDataTypes.FindObject(GUID);
            //if (baseDatatype != null)
            //{
            //    return false;
            //}

            //SimpleDataType simpleDataType = SimpleDataTypes.FindObject(GUID);
            //if (simpleDataType != null)
            //{
            //    return false;
            //}

            ComplexDataType complexDataType = ComplexDataTypes.FindObject(GUID);

            if (complexDataType != null)
            {
                return(true);
            }

            //EnumDataType enumDataType = Enums.FindObject(GUID);
            //if (enumDataType != null)
            //{
            //    return false;
            //}

            return(false);
        }
        public bool LoadFromFile(string filename)
        {
            if (File.Exists(filename))
            {
                Clear();
                XElement xroot  = XElement.Load(filename);
                XElement xmlApp = xroot.Element("AUTOSARTAPP");
                BaseDataTypes.Clear();

                LoadProperties(xroot);
                Enums.LoadFromXML(xroot);
                systemErrors.LoadFromXML(xroot);
                BaseDataTypes.LoadFromXML(xroot);
                SimpleDataTypes.LoadFromXML(xroot);
                ComplexDataTypes.LoadFromXML(xroot);
                SenderReceiverInterfaces.LoadFromXML(xroot);
                ClientServerInterfaces.LoadFromXML(xroot);
                ComponentDefenitionsList.LoadFromXML(xroot);
                Compositions.LoadFromXML(xroot);
                OsTasks.LoadFromXML(xroot);
                arrayDataTypes.LoadFromXML(xroot);
                BaseDataTypes.CheckBaseDataTypes();
                SyncronizeRunnables(null, true);
                UpdateConnections();

                FileName = filename;
                return(true);
            }
            else
            {
                return(false);
            }
        }
 public bool Delete(ComplexDataType complexDataType)
 {
     if (isComplexDataTypeUsed(complexDataType) == false)
     {
         ComplexDataTypes.Remove(complexDataType);
         return(true);
     }
     else
     {
         /* datatype is used and we cannot delete it */
         return(false);
     }
 }
 public void Clear()
 {
     SimpleDataTypes.Clear();
     ComplexDataTypes.Clear();
     ClientServerInterfaces.Clear();
     SenderReceiverInterfaces.Clear();
     Compositions.ClearCompositions();
     ComponentDefenitionsList.Clear();
     Enums.Clear();
     systemErrors.Clear();
     BaseDataTypes.Clear();
     OsTasks.Clear();
     arrayDataTypes.Clear();
     FileName = "";
     CleanProperties();
 }
        public String GetDataTypeName(Guid GUID)
        {
            ArrayDataType arrayDatatype = ArrayDataTypes.FindObject(GUID);

            if (arrayDatatype != null)
            {
                return(arrayDatatype.Name);
            }

            BaseDataType baseDatatype = BaseDataTypes.FindObject(GUID);

            if (baseDatatype != null)
            {
                return(baseDatatype.Name);
            }

            SimpleDataType simpleDataType = SimpleDataTypes.FindObject(GUID);

            if (simpleDataType != null)
            {
                return(simpleDataType.Name);
            }

            ComplexDataType complexDataType = ComplexDataTypes.FindObject(GUID);

            if (complexDataType != null)
            {
                return(complexDataType.Name);
            }

            EnumDataType enumDataType = Enums.FindObject(GUID);

            if (enumDataType != null)
            {
                return(enumDataType.Name);
            }

            return(ErrorDataType);
        }
        public IGUID GetDataType(Guid GUID)
        {
            BaseDataType baseDatatype = BaseDataTypes.FindObject(GUID);

            if (baseDatatype != null)
            {
                return(baseDatatype);
            }

            SimpleDataType simpleDataType = SimpleDataTypes.FindObject(GUID);

            if (simpleDataType != null)
            {
                return(simpleDataType);
            }

            ComplexDataType complexDataType = ComplexDataTypes.FindObject(GUID);

            if (complexDataType != null)
            {
                return(complexDataType);
            }

            EnumDataType enumDataType = Enums.FindObject(GUID);

            if (enumDataType != null)
            {
                return(enumDataType);
            }

            ArrayDataType arrayDataType = ArrayDataTypes.FindObject(GUID);

            if (arrayDataType != null)
            {
                return(arrayDataType);
            }

            return(null);
        }
        public bool SaveToFile(string filename)
        {
            XDocument xdoc = new XDocument();
            XElement  root = new XElement("AUTOSARTAPP");

            xdoc.Add(root);
            SaveProperties(root);
            BaseDataTypes.WriteToXML(root);
            SimpleDataTypes.WriteToXML(root);
            arrayDataTypes.WriteToXML(root);
            ComplexDataTypes.WriteToXML(root);
            SenderReceiverInterfaces.WriteToXML(root);
            ClientServerInterfaces.WriteToXML(root);
            ComponentDefenitionsList.WriteToXML(root);
            Enums.WriteToXML(root);
            systemErrors.WriteToXML(root);
            OsTasks.WriteToXML(root);
            Compositions.WriteToXML(root);

            xdoc.Save(filename);
            return(true);
        }