コード例 #1
0
        internal TypeCollection GetTypeCollection(IGenericParameterProvider genericParameterProvider)
        {
            var typeCollection = new TypeCollection();

            foreach (var genericParameter in genericParameterProvider.GenericParameters)
            {
                typeCollection.Add(GetBfType(genericParameter));
                typeCollection.AddRange(GetTypeCollection(genericParameter));
            }
            return(typeCollection);
        }
コード例 #2
0
        /// <summary>
        /// Gets property types that belongs to a NodeType and a ContentListType combination.
        /// If the <paramref name="nodeTypeId"/> is less than 1, the result is empty.
        /// The <paramref name="contentListTypeId"/> can be less than 1 if it is irrelevant.
        /// </summary>
        public TypeCollection <PropertyType> GetDynamicSignature(int nodeTypeId, int contentListTypeId)
        {
            var nodeType = NodeTypes.GetItemById(nodeTypeId);

            if (nodeType == null)
            {
                return(new TypeCollection <PropertyType>(SchemaInstance));
            }

            var nodePropertyTypes = nodeType.PropertyTypes;
            var allPropertyTypes  = new TypeCollection <PropertyType>(nodePropertyTypes);

            if (contentListTypeId > 0)
            {
                allPropertyTypes.AddRange(ContentListTypes.GetItemById(contentListTypeId).PropertyTypes);
            }

            return(allPropertyTypes);
        }
コード例 #3
0
        /// <summary>
        /// Uses the PluginProviders specified to load Plugin Types that will be used to create Plugins.
        /// </summary>
        /// <param name="pluginProviders">The collection of PluginProviders that will be used to load the Plugin Types from their various sources.</param>
        /// <returns></returns>
        public static TypeCollection LoadPluginTypes(PluginProviderCollection pluginProviders)
        {
            var pluginTypes = new TypeCollection();

            foreach (PluginProvider provider in pluginProviders)
            {
                try
                {
                    CairoLogger.Instance.Debug(string.Format("Loading Plugin Types. PluginProvider: '{0}'.", provider.Name));

                    TypeCollection types = provider.LoadPluginTypes();
                    if (types != null)
                    {
                        pluginTypes.AddRange(types);
                    }
                }
                catch (Exception ex)
                {
                    CairoLogger.Instance.Debug(ex.Message, ex);
                }
            }
            return(pluginTypes);
        }
コード例 #4
0
        /// <summary>
        /// Uses the PluginProviders specified to load Plugin Types that will be used to create Plugins.
        /// </summary>
        /// <param name="progressViewer">The callback object implementing IProgressViewer that will be used to monitor progress.</param>
        /// <param name="pluginProviders">The collection of PluginProviders that will be used to load the Plugin Types from their various sources.</param>
        /// <returns></returns>
        public static TypeCollection LoadPluginTypes(IProgressViewer progressViewer, PluginProviderCollection pluginProviders)
        {
            TypeCollection pluginTypes = new TypeCollection();

            foreach (PluginProvider provider in pluginProviders)
            {
                try
                {
                    Log.WriteLine("Loading Plugin Types. PluginProvider: '{0}'.", provider.Name);

                    TypeCollection types = provider.LoadPluginTypes(progressViewer);
                    if (types != null)
                    {
                        pluginTypes.AddRange(types);
                    }
                }
                catch (Exception ex)
                {
                    Log.WriteLine(ex);
                }
            }
            return(pluginTypes);
        }
コード例 #5
0
ファイル: NodeTypeManager.cs プロジェクト: maxpavlov/FlexNet
        public static TypeCollection<PropertyType> GetDynamicSignature(int nodeTypeId, int contentListTypeId)
        {
            System.Diagnostics.Debug.Assert(nodeTypeId > 0);

            var nodePropertyTypes = NodeTypeManager.Current.NodeTypes.GetItemById(nodeTypeId).PropertyTypes;
            var allPropertyTypes = new TypeCollection<PropertyType>(nodePropertyTypes);
            if (contentListTypeId > 0)
                allPropertyTypes.AddRange(NodeTypeManager.Current.ContentListTypes.GetItemById(contentListTypeId).PropertyTypes);

            return allPropertyTypes;
        }
コード例 #6
0
        public virtual ITypeCollection TransformTypeCollection(ITypeCollection types)
        {
            IType[] array = new IType[types.Count];
            for (int i = 0; i < types.Count; i++)
            {
                array[i] = this.TransformType(types[i]);
            }

            ITypeCollection target = new TypeCollection();
            target.AddRange(array);
            return target;
        }