Example #1
0
 public Interpreter(InterpreterManager manager, string id, string name, IRInterpreterInfo rInterpreterInfo)
 {
     Manager          = manager;
     Id               = id;
     Name             = name;
     Path             = rInterpreterInfo.InstallPath;
     BinPath          = rInterpreterInfo.BinPath;
     Version          = rInterpreterInfo.Version;
     RInterpreterInfo = rInterpreterInfo;
 }
Example #2
0
        private IConnection PickBestLocalRConnection(ICollection <IConnection> connections, ICollection <IRInterpreterInfo> localEngines)
        {
            // Get highest version engine
            IRInterpreterInfo rInfo = null;

            if (localEngines.Any())
            {
                var highest = localEngines.Max(e => e.Version);
                rInfo = localEngines.First(e => e.Version == highest);
            }

            if (rInfo != null)
            {
                // Find connection matching the highest version
                var c = connections.FirstOrDefault(e => e.Path.PathEquals(rInfo.InstallPath));
                if (c != null)
                {
                    return(c);
                }
            }

            // Nothing found or incompatible. Try first user connection in the list, if any
            return(connections.FirstOrDefault());
        }
Example #3
0
 public Interpreter(string id, string name, IRInterpreterInfo rInterpreterInfo)
 {
     Id               = id;
     Name             = name;
     RInterpreterInfo = rInterpreterInfo;
 }
Example #4
0
 public Interpreter(string id, IRInterpreterInfo rInterpreterInfo) :
     this(id, rInterpreterInfo.Name, rInterpreterInfo)
 {
 }