Esempio n. 1
0
        /// <summary>
        /// Search in the interface for the Namespace (equal to the package structure in java)
        /// </summary>
        /// <param name="fieldname">Method name or Parameter name</param>
        /// <returns>Packagename</returns>
        public static String CreateClassWithPackageName(String fieldname, Type type)
        {
            String result = null;

            // axis plugin
            MethodInfo method = type.GetMethod(fieldname);

            // Tests if it is a Mehtod or a Type
            if (method != null)
            {
                result = SearchSoapAttributes(method);
            }
            else
            {
                result = SearchInXMLType(fieldname, type);
            }

            String classname = HelpMethods.FirstLetterToUpper(type.FullName.Replace(type.Namespace + ".", String.Empty));

            if (classname.Contains("[]"))
            {
                return("[L" + result + "." + classname.Replace("[]", String.Empty) + ";");
            }
            else
            {
                return(result + "." + classname);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Add a OpenEngSBModel to an Object
        /// </summary>
        /// <typeparam name="ReturnTyp">The Type that gets exptendet with the OpenEngSBModel Interface</typeparam>
        /// <param name="element">The object, which gets extended</param>
        /// <param name="models">The OpenEngSBEntries</param>
        /// <returns>The object with the OpenEngSBModel</returns>
        public static ReturnTyp AddOpenEngSBModel <ReturnTyp>(this ReturnTyp element, List <openEngSBModelEntry> models)
        {
            Type            openEngSBModelType = HelpMethods.ImplementTypeDynamicly(element.GetType(), typeof(IOpenEngSBModel));
            IOpenEngSBModel tmpElement         = element.ConvertOSBType(openEngSBModelType) as IOpenEngSBModel;

            tmpElement.OpenEngSBModelTail = models;
            return((ReturnTyp)tmpElement);
        }