Beispiel #1
0
        /// <summary>
        /// Assumptions:
        ///     assembly that methodInfo is in has been loaded
        ///     the class the methodinfo is in has a parameterless constructor
        /// </summary>
        /// <param name="methodInfo"></param>
        public MethodCall(MethodInfo methodInfo, string identifier)
        {
            m_identifier = identifier;
            m_methodInfo = methodInfo;
            m_object     = Activator.CreateInstance(m_methodInfo.DeclaringType);

            ClassXsdGenerator generator = new ClassXsdGenerator();

            generator.NameGenerator += new NameGeneratorDelegate(generator_NameGenerator);
            m_baseName = "input";

            List <ParameterInfo> inputParameters = MethodCallTools.GetInputParameters(m_methodInfo);

            m_inputType    = MethodCallTools.CreateTypeFromParameters(inputParameters, m_methodInfo);
            m_inputSchemas = generator.GenerateSchema(m_inputType);
            m_inputSchema  = m_inputSchemas[0];

            generator = new ClassXsdGenerator();
            generator.NameGenerator += new NameGeneratorDelegate(generator_NameGenerator);
            m_baseName = "output";

            List <ParameterInfo> outputParameters = MethodCallTools.GetOutputParameters(m_methodInfo);

            m_outputType    = MethodCallTools.CreateTypeFromParameters(outputParameters, m_methodInfo);
            m_outputSchemas = generator.GenerateSchema(m_outputType);
            m_outputSchema  = m_outputSchemas[0];
        }
        void myAssemblyTreeView_TypeSelected(object sender, Type type)
        {
            if (type == null)
                return;

            try
            {
                ClassXsdGenerator generator = new ClassXsdGenerator();
                IList<XmlSchema> schemas = generator.GenerateSchema(type);
                AddSchemas(schemas);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #3
0
        void myAssemblyTreeView_TypeSelected(object sender, Type type)
        {
            if (type == null)
            {
                return;
            }

            try
            {
                ClassXsdGenerator generator = new ClassXsdGenerator();
                IList <XmlSchema> schemas   = generator.GenerateSchema(type);
                AddSchemas(schemas);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }