Exemple #1
0
        internal static NIType CreateNotifierSharedDataType(this NIType valueType)
        {
            NIClusterBuilder clusterBuilder = NITypes.Factory.DefineCluster();

            clusterBuilder.DefineField(WakerType, "waker");
            clusterBuilder.DefineField(valueType, "value");
            clusterBuilder.DefineField(NITypes.Int32, "state");
            return(clusterBuilder.CreateType());
        }
Exemple #2
0
        internal static NIType DefineTupleType(this IEnumerable <NIType> fieldTypes)
        {
            NIClusterBuilder clusterBuilder = NITypes.Factory.DefineCluster();
            int index = 0;

            foreach (NIType type in fieldTypes)
            {
                clusterBuilder.DefineField(type, $"_{index}");
                ++index;
            }
            return(clusterBuilder.CreateType());
        }