public void RequireType(TypeDescriptor type, DesignDescriptor design)
 {
     if (!type.HasIntrinsicTypeOverride &&
         !type.CILType.IsPrimitive)
     {
         design.TypeLib.AddType(type);
         CurComponent.AddDependency(_design.TypeLib.GetPackage(type.CILType));
     }
 }
 public DependencyBrowser(DesignDescriptor design)
 {
     _design = design;
     _curOrder = 0;
 }
 static void ResolveTypeDependencies(this IComponentDescriptor component, DesignDescriptor design)
 {
     foreach (var child in component.GetChildComponents())
     {
         ResolveTypeDependencies(child, design);
     }
     var processes = component.GetProcesses().ToArray();
     var str = new StmtTypeResolver(design, component);
     foreach (var process in processes)
     {
         ResolveTypeDependencies(process, str);
     }
     foreach (var port in component.GetPorts())
     {
         str.RequireType(port.ElementType, design);
     }
     foreach (var signal in component.GetSignals())
     {
         str.RequireType(signal.ElementType, design);
     }
     foreach (var field in component.GetFields())
     {
         str.RequireType(field.Type, design);
     }
 }
 public StmtTypeResolver(DesignDescriptor design, IComponentDescriptor component)
 {
     _design = design;
     CurComponent = component;
     _stack.Push((IPackageOrComponentDescriptor)component);
 }
 /// <summary>
 /// Constructs a type library.
 /// </summary>
 /// <param name="design">associated design</param>
 public TypeLibrary(DesignDescriptor design)
 {
     _design = design;
 }
Exemple #6
0
        /// <summary>
        /// Creates a <see cref="SummaryVolumesRequest"/> object for use with the v2 API.
        /// </summary>
        /// <returns>New instance of <see cref="SummaryVolumesRequest"/>.</returns>
        public static SummaryVolumesRequest CreateAndValidate(long projectId, Guid?projectUid, FilterResult baseFilter, FilterResult topFilter, DesignDescriptor baseDesignDescriptor, DesignDescriptor topDesignDescriptor, VolumesType volumeCalcType, bool explicitFilters = false)
        {
            var request = new SummaryVolumesRequest
            {
                ProjectId            = projectId,
                ProjectUid           = projectUid,
                BaseFilter           = baseFilter,
                TopFilter            = topFilter,
                BaseDesignDescriptor = baseDesignDescriptor,
                TopDesignDescriptor  = topDesignDescriptor,
                VolumeCalcType       = volumeCalcType,
                BaseFilterId         = -1,
                TopFilterId          = -1,
                ExplicitFilters      = explicitFilters
            };

            request.Validate();

            return(request);
        }