GlueViewOfficialPlugins.Scripting.ScriptParsingPlugin.GetTypeFromReflection C# (CSharp) Method

GetTypeFromReflection() private method

private GetTypeFromReflection ( string leftSideRaw, Type &runtimeType, Type containerType ) : void
leftSideRaw string
runtimeType System.Type
containerType System.Type
return void
        private void GetTypeFromReflection(string leftSideRaw, out Type runtimeType, Type containerType)
        {
            string leftBeforeDot = leftSideRaw;
            string leftSideAfterDot = leftSideRaw;
            bool hasDot = leftSideRaw.Contains('.');
            if (hasDot)
            {
                leftBeforeDot = leftSideRaw.Substring(0, leftSideRaw.IndexOf('.'));
                leftSideAfterDot = leftSideRaw.Substring(leftSideRaw.IndexOf('.') + 1);
            }

            if(hasDot)
            {
                GetTypeFromReflection(leftBeforeDot, out containerType, containerType);
                GetTypeFromReflection(leftSideAfterDot, out runtimeType, containerType);
            }
            else
            {
                if (containerType == null)
                {
                    runtimeType = TypeManager.GetTypeFromString(leftSideRaw);
                }
                else
                {
                    runtimeType = null;

                    FieldInfo fieldInfo = containerType.GetField(leftSideRaw);
                    if (fieldInfo != null)
                    {
                        runtimeType = fieldInfo.FieldType;
                    }
                    else
                    {
                        PropertyInfo propertyInfo = containerType.GetProperty(leftSideRaw);
                        if (propertyInfo != null)
                        {
                            runtimeType = propertyInfo.PropertyType;
                        }
                    }
                }
            }


        }