Gum.DataTypes.Variables.VariableSave.GetRootName C# (CSharp) 메소드

GetRootName() 공개 메소드

public GetRootName ( ) : string
리턴 string
        public string GetRootName()
        {
            int dotIndex = Name.IndexOf('.');
            if (dotIndex == -1)
            {
                return Name;
            }
            else
            {
                return Name.Substring(1 + dotIndex);
            }
        }

Same methods

VariableSave::GetRootName ( string variableName ) : string

Usage Example

예제 #1
0
        private void AdjustEnumerationVariableValue(Gum.DataTypes.Variables.VariableSave variableSave, ElementSave element, ref string variableValue, ref string variableType)
        {
            if (variableSave.Type == "Gum.Managers.PositionUnitType" || variableSave.Type == "PositionUnitType")
            {
                string rootName = variableSave.GetRootName();

                // convert from PositionUnitType to GeneralUnitType

                GeneralUnitType convertedValue =
                    UnitConverter.ConvertToGeneralUnit((PositionUnitType)variableSave.Value);

                variableValue = convertedValue.ToString();

                variableType = "Gum.Converters.GeneralUnitType";
            }

            string prefix = variableType;



            if (mTypeToQualifiedTypes.ContainsKey(prefix))
            {
                prefix = mTypeToQualifiedTypes[prefix];
            }
            else
            {
                ModifyVariableTypeForProperty(ref prefix, variableSave, element);
            }

            variableValue = prefix + "." + variableValue;
        }
All Usage Examples Of Gum.DataTypes.Variables.VariableSave::GetRootName