Ejemplo n.º 1
0
        private static IEnumerable <IUnitOption> GetContextualOptions(GraphReference reference)
        {
            foreach (var variableKind in Enum.GetValues(typeof(VariableKind)).Cast <VariableKind>())
            {
                foreach (var graphVariableName in EditorVariablesUtility.GetVariableNameSuggestions(variableKind, reference))
                {
                    yield return(new GetVariableOption(variableKind, graphVariableName));

                    yield return(new SetVariableOption(variableKind, graphVariableName));

                    yield return(new IsVariableDefinedOption(variableKind, graphVariableName));
                }
            }

            // Extensions

            foreach (var contextualUnitsExtension in contextualUnitsExtensions)
            {
                foreach (var extensionContextualUnitOption in contextualUnitsExtension(reference))
                {
                    yield return(extensionContextualUnitOption);
                }
            }
        }
Ejemplo n.º 2
0
 private IEnumerable <string> GetNameSuggestions()
 {
     return(EditorVariablesUtility.GetVariableNameSuggestions(unit.kind, reference));
 }