public DBPVariable GetVariable(DebugVariableLinkCollection collection, IDebugVariable debugVariable)
        {
            // Return null if there is no value.
            if (debugVariable.Value == null)
            {
                return(null);
            }

            // Create the variable.
            DBPVariable variable = GetProtocolVariable(debugVariable);

            // Add the clipboard value copy.
            variable.evaluateName = collection.AddClipboardKey(debugVariable.Name, debugVariable.Value.AsOSTWExpression());

            // If the value is an array, assign a reference.
            if (debugVariable.Value is CsvArray array)
            {
                variable.indexedVariables   = array.Values.Length;
                variable.variablesReference = IDebugVariable.ApplyReference(collection, debugVariable);
            }
            // If the value is a vector, assign a reference.
            else if (debugVariable.Value is CsvVector vector)
            {
                variable.namedVariables     = 3; // X, Y, and Z.
                variable.variablesReference = IDebugVariable.ApplyReference(collection, debugVariable);
            }

            return(variable);
        }
        public DBPVariable GetVariable(DebugVariableLinkCollection collection, IDebugVariable debugVariable)
        {
            // Return null if there is no value.
            if (debugVariable.Value == null)
            {
                return(null);
            }

            // Create the variable.
            DBPVariable variable = new DBPVariable(debugVariable, Class.Name);

            variable.namedVariables     = Class.ObjectVariables.Count;
            variable.variablesReference = IDebugVariable.ApplyReference(collection, debugVariable);

            return(variable);
        }