Beispiel #1
0
        public void Add(RuntimicSystemModel model, UnifiedAssemblyNode assemblyNode, UnifiedModuleNode node)
        {
            //if (!model.Unified.Modules.Sets.TryGetValue(node.Name, out UnifiedModuleNodeSet set))
            //{
            //	set = new UnifiedModuleNodeSet()
            //	{
            //		Name = node.Name
            //	};

            //	model.Unified.Modules.Sets.Add(node.Name, set);
            //}

            //if (set.First == null)
            //{
            //	set.First = node;
            //	set.Last = node;
            //}
            //else
            //{
            //	set.Last.Next = node;
            //	set.Last = node;
            //}

            //assemblyNode.ModuleNodes.Add(node);
        }
Beispiel #2
0
        public UnifiedTypeNode Extend(RuntimicSystemModel model, UnifiedAssemblyNode assemblyNode, UnifiedModuleNode moduleNode, TypeReference typeReference)
        {
            var node = Create(model, assemblyNode, moduleNode, typeReference);

            Add(model, node);

            return(node);
        }
Beispiel #3
0
        public UnifiedModuleNode Extend(RuntimicSystemModel model, UnifiedAssemblyNode assemblyNode, ModuleDefinition moduleDefinition)
        {
            var node = Create(model, assemblyNode, moduleDefinition);

            Add(model, assemblyNode, node);

            return(node);
        }
Beispiel #4
0
        public void Extend(RuntimicSystemModel model, UnifiedAssemblyNode assemblyNode, UnifiedModuleNode moduleNode, List <UnifiedTypeNode> types)
        {
            var moduleDefinition = moduleNode.ModuleDefinition;

            foreach (var typeDefinition in moduleDefinition.Types)
            {
                var node = Extend(model, assemblyNode, moduleNode, typeDefinition, types);
            }
        }
Beispiel #5
0
        public void Extend(RuntimicSystemModel model, UnifiedAssemblyNode assemblyNode, List <UnifiedTypeNode> types)
        {
            var assemblyDefinition = assemblyNode.SourceAssemblyDefinition;

            foreach (var moduleDefinition in assemblyDefinition.Modules)
            {
                var moduleNode = Unified.Modules.Extend(model, assemblyNode, moduleDefinition);

                Types.Extending.Extend(model, assemblyNode, moduleNode, types);
            }
        }
Beispiel #6
0
        public UnifiedModuleNode Create(RuntimicSystemModel model, UnifiedAssemblyNode assemblyNode, ModuleDefinition moduleDefinition)
        {
            var resolutionName = GetResolutionName(moduleDefinition);

            return(new UnifiedModuleNode()
            {
                Name = resolutionName,
                AssemblyNode = assemblyNode,
                ModuleDefinition = moduleDefinition
            });
        }
Beispiel #7
0
        private bool IsPresent(CecilTypeReferenceSet result, UnifiedAssemblyNode assemblyNode)
        {
            for (int i = 0; i < result.Assemblies.Count; i++)
            {
                if (ReferenceEquals(result.Assemblies[i], assemblyNode))
                {
                    return(true);
                }
            }

            return(false);
        }
Beispiel #8
0
        public UnifiedTypeNode Create(RuntimicSystemModel model, UnifiedAssemblyNode assemblyNode, UnifiedModuleNode moduleNode, TypeReference typeReference)
        {
            var resolutionName = GetResolutionName(typeReference);

            //return new UnifiedTypeNode()
            //{
            //	ResolutionName = resolutionName,
            //	AssemblyNode = assemblyNode,
            //	ModuleNode= moduleNode,
            //	SourceTypeReference = typeReference
            //};

            throw new System.NotImplementedException();
        }
Beispiel #9
0
        public UnifiedTypeNode Extend(RuntimicSystemModel model, UnifiedAssemblyNode assemblyNode, UnifiedModuleNode moduleNode, TypeReference typeReference, List <UnifiedTypeNode> types)
        {
            var unifiedTypeNode = Unified.Types.Extend(model, assemblyNode, moduleNode, typeReference);

            types?.Add(unifiedTypeNode);

            if (!(typeReference is TypeDefinition typeDefinition))
            {
                return(unifiedTypeNode);
            }

            if (!typeDefinition.HasNestedTypes)
            {
                return(unifiedTypeNode);
            }

            foreach (var nestedType in typeDefinition.NestedTypes)
            {
                Extend(model, assemblyNode, moduleNode, nestedType, types);
            }

            return(unifiedTypeNode);
        }
Beispiel #10
0
        /// <summary>
        /// Creates a bound or converted assembly depending if isonvered is set to true.
        /// </summary>
        /// <param name="conversion"></param>
        /// <param name="assemblyNode"></param>
        /// <returns></returns>
        public SemanticAssemblyMask_I Ensure(ILConversion conversion, UnifiedAssemblyNode assemblyNode)
        {
            if (assemblyNode.Semantic != null)
            {
                return(assemblyNode.Semantic);
            }

            var assemblyDefinition = assemblyNode.SourceAssemblyDefinition;

            var name = Assemblies.Naming.GetAssemblyName(conversion, assemblyDefinition.Name.FullName);

            if (!Assemblies.Query.IsConverted(conversion, name))
            {
                return(Bound.Metadata.Assemblies.Ensuring.Ensure(conversion.RuntimicSystem, assemblyDefinition));
            }

            //var convertedAssembly = Assemblies.Creation.CreateConvertedAssembly(conversion, name, assemblyDefinition);

            // Ensure all the module entries are added.
            //Modules.Ensuring.EnsureModuleEntries(convertedAssembly);
            throw new Exception("Debug");

            //return convertedAssembly;
        }
Beispiel #11
0
        public void Add(RuntimicSystemModel model, UnifiedAssemblyNode node, string name)
        {
            throw new System.Exception("Debug");
            //  if (!model.Unified.Assemblies.Definitions.TryGetValue(name, out UnifiedAssemblyNodeSet set))
            //  {
            //   set = new UnifiedAssemblyNodeSet()
            //   {
            //    Name = name
            //};

            //   model.Unified.Assemblies.Definitions.Add(name, set);
            //  }

            //  if (set.First == null)
            //  {
            //   set.First = node;
            //   set.Last = node;
            //  }
            //  else
            //  {
            //   set.Last.Next = node;
            //   set.Last = node;
            //  }
        }
Beispiel #12
0
 public void AddCrossReference(RuntimicSystemModel model, UnifiedAssemblyNode node, string crossReferenceKey)
 {
     Add(model, node, crossReferenceKey);
 }
Beispiel #13
0
 public void Add(RuntimicSystemModel model, UnifiedAssemblyNode node)
 {
     Add(model, node, node.Name);
 }
Beispiel #14
0
 public void Extend(RuntimicSystemModel model, UnifiedAssemblyNode assemblyNode)
 {
     Extend(model, assemblyNode, null);
 }