public Vm(ILauncherMaker launcherMaker, string vmpPath, IEnumerable <KeyValuePair <string[], string> > propertys) { this.launcherMaker = launcherMaker; this.vmplayerPath = vmpPath; foreach (KeyValuePair <string[], string> property in propertys) { switch (property.Key[2]) { case "index": this.Index = property.Value; break; case "filename": this.VmxPath = property.Value; break; case "displayName": this.Name = property.Value; break; } } this.Exists = File.Exists(this.VmxPath); }
public WmpUtil(ILauncherMaker launcherMaker, string vmPlayerPath, string preferencesFilePath) { this.launcherMaker = launcherMaker; this.vmplayerPath = vmPlayerPath; this.preferencesFilePath = preferencesFilePath; this.preferences = new Preferences(File.ReadLines(preferencesFilePath)); this.Vms = this.preferences.GenerateVms(launcherMaker, vmplayerPath); }
public Vm(ILauncherMaker launcherMaker, string vmpPath, string index, string vmxPath, string name) { this.launcherMaker = launcherMaker; this.vmplayerPath = vmpPath; this.Index = index; this.VmxPath = vmxPath; this.Name = name; this.Exists = File.Exists(this.VmxPath); }
public List <Vm> GenerateVms(ILauncherMaker launcherMaker, string vmplayerPath) { List <Vm> vms = (from property in this.Propertys let key = property.Key.Split('.') where key.Length > 2 && key[1].Contains("mruVM") group new KeyValuePair <string[], string> (key, property.Value) by key[1] into rvm orderby rvm.Key select new Vm(launcherMaker, vmplayerPath, rvm)).ToList(); return(vms); }