Пример #1
0
        public static string GetMessageType(JupyterMessageContent source)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            return(GetMessageType(source.GetType()));
        }
Пример #2
0
Файл: Message.cs Проект: vdt/try
        private static string GetMessageType(JupyterMessageContent source)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            var attribute = source.GetType().GetCustomAttribute <JupyterMessageTypeAttribute>() ?? throw new InvalidOperationException("source is not annotated with JupyterMessageTypeAttribute");

            return(attribute.Type);
        }