Exemplo n.º 1
0
        public static INodeOut CreateNodeOutput(this IPluginHost host, OutputAttribute attribute, Type type)
        {
            INodeOut result = null;

            host.CreateNodeOutput(attribute.Name, (TSliceMode)attribute.SliceMode, (TPinVisibility)attribute.Visibility, out result);

            // Register all implemented interfaces and inherited classes of T
            // to support the assignment of ISpread<Apple> output to ISpread<Fruit> input.
            var guids = new List <Guid>();
            var typeT = type;

            foreach (var interf in typeT.GetInterfaces())
            {
                guids.Add(interf.GUID);
            }

            while (typeT != null)
            {
                guids.Add(typeT.GUID);
                typeT = typeT.BaseType;
            }

            result.SetSubType2(type, guids.ToArray(), type.GetCSharpName());
            result.Order = attribute.Order;
            return(result);
        }
Exemplo n.º 2
0
        public ColladaSkeletonNode(IPluginHost host)
        {
            FSkeleton = new Skeleton();

            System.Guid[] guids = new System.Guid[1];
            guids[0] = new Guid("AB312E34-8025-40F2-8241-1958793F3D39");

            host.CreateNodeOutput("Skeleton", TSliceMode.Single, TPinVisibility.True, out FSkeletonOutput);
            FSkeletonOutput.SetSubType2(typeof(ISkeleton), guids, "Skeleton");
        }
Exemplo n.º 3
0
        public static INodeOut CreateNodeOutput(this IPluginHost host, OutputAttribute attribute, Type type)
        {
            INodeOut result = null;

            host.CreateNodeOutput(attribute.Name, (TSliceMode)attribute.SliceMode, (TPinVisibility)attribute.Visibility, out result);

            if (type != null)
            {
                // Register all implemented interfaces and inherited classes of T
                // to support the assignment of ISpread<Apple> output to ISpread<Fruit> input.
                var guids = new List <Guid>();

                RegisterID(host, guids, type);

                foreach (var interf in type.GetInterfaces())
                {
                    RegisterID(host, guids, interf);
                }

                var t = type.BaseType;
                while (t != null)
                {
                    RegisterID(host, guids, t);
                    t = t.BaseType;
                }

                result.SetSubType2(type, guids.ToArray(), type.GetCSharpName());
            }
            else
            {
                result.SetSubType(new Guid[] { }, "Variant");
            }

            SetOutputProperties(result, attribute);
            return(result);
        }