ApiParser.UnityApiEventFunction.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
        public override string ToString()
        {
            var parameters = string.Join(", ", myParameters.Select(p => p.ToString()));
            return $"{myReturnType} {Name}({parameters})";
        }
    }

Usage Example

Esempio n. 1
0
        public void MergeEventFunction(UnityApiEventFunction newFunction, Version apiVersion)
        {
            UpdateSupportedVersion(apiVersion);

            var newFunctionSig = newFunction.ToString();

            foreach (var eventFunction in myEventFunctions)
            {
                if (eventFunction.ToString() == newFunctionSig)
                {
                    // Prefer an existing documented function that covers this version, than an undocumented one. This
                    // means we will automatically replace our undocumented functions with documented versions without
                    // having to explicitly add an end version
                    if (newFunction.IsUndocumented && !eventFunction.IsUndocumented &&
                        eventFunction.MinimumVersion <= apiVersion && eventFunction.MaximumVersion >= apiVersion)
                    {
                        return;
                    }

                    // If the documented state of both functions is the same, update the function
                    if (newFunction.IsUndocumented == eventFunction.IsUndocumented)
                    {
                        eventFunction.Update(newFunction, apiVersion);
                        return;
                    }
                }
            }

            // Not a match. We either haven't found this function before,
            // or a parameter or return type is different
            myEventFunctions.Add(newFunction);
        }
All Usage Examples Of ApiParser.UnityApiEventFunction::ToString