public void Setup() { _client = MockRepository.GenerateMock<IClient>(); _fs = MockRepository.GenerateMock<IFS>(); _locator = new EngineLocator(_fs); _locator.ClientFactory = () => { return _client; }; }
public void Setup() { _client = MockRepository.GenerateMock <IClient>(); _fs = MockRepository.GenerateMock <IFS>(); _locator = new EngineLocator(_fs); _locator.ClientFactory = () => { return(_client); }; }
public Traversal(Graph graph) { this.graph = graph; fs = new T(); fs.Init(graph); statuses = new HandleStatus[graph.GetVerticesCount()]; }
public void Setup() { var user = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Replace(Path.DirectorySeparatorChar.ToString(), "-"); _filepattern = string.Format("*.EditorEngine.{0}.pid", user); _client = MockRepository.GenerateMock<IClient>(); _fs = MockRepository.GenerateMock<IFS>(); _locator = new EngineLocator(_fs); _locator.ClientFactory = () => { return _client; }; }
public void Setup() { var user = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Replace(Path.DirectorySeparatorChar.ToString(), "-"); _filepattern = string.Format("*.EditorEngine.{0}.pid", user); _client = MockRepository.GenerateMock <IClient>(); _fs = MockRepository.GenerateMock <IFS>(); _locator = new EngineLocator(_fs); _locator.ClientFactory = () => { return(_client); }; }
public VSFileAppender(IFS fs) { _fs = fs; Func <XmlNamespaceManager> getNSManager = () => { return(_nsManager); }; _appenders.AddRange( new IVSFileAppender[] { new CompileFileAppender(getNSManager, nsPrefix), new NoneFileAppender(getNSManager, nsPrefix) }); }
public CodeEngineDispatcher(IFS fs) { _fs = fs; ClientFactory = () => { return new EditorEngineIntegration.Client(); }; }
public DefaultRemover(IFS fs) { _fs = fs; }
public EngineLocator(IFS fs) { _fs = fs; ClientFactory = () => { return(new Client()); }; }
public AssemblyReferencer(IFS fs) { _fs = fs; }
/// <summary> /// Main user interface - switch-case type /// </summary> /// <param name="fileSystem">Object "FS" with file system</param> static void commands(IFS fileSystem) { string x = null; x = Console.ReadLine(); x = x.Trim(); int i; int j; string[] commands = null; commands = x.Split(' '); switch (commands[0].ToLower()) { case "ls": case "dir": if (commands.Length == 1) { Console.WriteLine(fileSystem.main.Show(0)); } else if (Int32.TryParse(commands[1], out i)) { IComponent temp = fileSystem.main.FindComponent(i); if (temp == null) { Console.WriteLine("Object doesn't exist!"); Program.commands(fileSystem); } Console.WriteLine(temp.Show(0)); } else { Console.WriteLine("Wrong command, enter \"help\" for more info."); } break; case "copy": case "cp": if (Int32.TryParse(commands[1], out i) && Int32.TryParse(commands[2], out j)) { if (commands.Length == 4) { fileSystem.CopyComponent(i, j, commands[3]); } else { fileSystem.CopyComponent(i, j); } } else { Console.WriteLine("Wrong command, enter \"help\" for more info."); } break; case "move": case "mv": if (Int32.TryParse(commands[1], out i) && Int32.TryParse(commands[2], out j)) { fileSystem.MoveComponent(i, j); } else { Console.WriteLine("Wrong command, enter \"help\" for more info."); } break; case "rm": if (Int32.TryParse(commands[1], out i)) { fileSystem.RemoveComponent(i); } else { Console.WriteLine("Wrong command, enter \"help\" for more info."); } break; case "rid": if (Int32.TryParse(commands[1], out i)) { Console.WriteLine(fileSystem.ShowReverse(i)); } else { Console.WriteLine("Wrong command, enter \"help\" for more info."); } break; case "mkdir": if (Int32.TryParse(commands[1], out i)) { fileSystem.CreateComponentOnFS(i, commands[2], true); } else { Console.WriteLine("Wrong command, enter \"help\" for more info."); } break; case "touch": if (Int32.TryParse(commands[1], out i)) { fileSystem.CreateComponentOnFS(i, commands[2], false); } else { Console.WriteLine("Wrong command, enter \"help\" for more info."); } break; case "help": case "pomoc": StringBuilder help = new StringBuilder(); help.AppendLine("DIR [from where]"); help.AppendLine("CP what where [name]"); help.AppendLine("MV what where [name]"); help.AppendLine("RM what"); help.AppendLine("RID what"); help.AppendLine("MKDIR where name"); help.AppendLine("TOUCH where name"); help.AppendLine("OPEN what"); Console.WriteLine(help.ToString()); break; case "open": case "otvori": if (Int32.TryParse(commands[1], out i)) { fileSystem.Open(i); } else { Console.WriteLine("Wrong command, enter \"help\" for more info."); } break; case "quit": System.Environment.Exit(0); break; default: Console.WriteLine("Wrong command, enter \"help\" for more info."); break; } Console.WriteLine(); Program.commands(fileSystem); }
/// <summary> /// Main user interface - switch-case type /// </summary> /// <param name="fileSystem">Object "FS" with file system</param> static void commands(IFS fileSystem) { string x = null; x = Console.ReadLine(); x = x.Trim(); int i; int j; string[] commands = null; commands = x.Split(' '); switch (commands[0].ToLower()) { case "ls": case "dir": if (commands.Length == 1) Console.WriteLine(fileSystem.main.Show(0)); else if (Int32.TryParse(commands[1], out i)) { IComponent temp = fileSystem.main.FindComponent(i); if (temp == null) { Console.WriteLine("Object doesn't exist!"); Program.commands(fileSystem); } Console.WriteLine(temp.Show(0)); } else Console.WriteLine("Wrong command, enter \"help\" for more info."); break; case "copy": case "cp": if (Int32.TryParse(commands[1], out i) && Int32.TryParse(commands[2], out j)) if (commands.Length == 4) fileSystem.CopyComponent(i, j, commands[3]); else fileSystem.CopyComponent(i, j); else Console.WriteLine("Wrong command, enter \"help\" for more info."); break; case "move": case "mv": if (Int32.TryParse(commands[1], out i) && Int32.TryParse(commands[2], out j)) fileSystem.MoveComponent(i, j); else Console.WriteLine("Wrong command, enter \"help\" for more info."); break; case "rm": if (Int32.TryParse(commands[1], out i)) fileSystem.RemoveComponent(i); else Console.WriteLine("Wrong command, enter \"help\" for more info."); break; case "rid": if (Int32.TryParse(commands[1], out i)) Console.WriteLine(fileSystem.ShowReverse(i)); else Console.WriteLine("Wrong command, enter \"help\" for more info."); break; case "mkdir": if (Int32.TryParse(commands[1], out i)) fileSystem.CreateComponentOnFS(i, commands[2], true); else Console.WriteLine("Wrong command, enter \"help\" for more info."); break; case "touch": if (Int32.TryParse(commands[1], out i)) fileSystem.CreateComponentOnFS(i, commands[2], false); else Console.WriteLine("Wrong command, enter \"help\" for more info."); break; case "help": case "pomoc": StringBuilder help = new StringBuilder(); help.AppendLine("DIR [from where]"); help.AppendLine("CP what where [name]"); help.AppendLine("MV what where [name]"); help.AppendLine("RM what"); help.AppendLine("RID what"); help.AppendLine("MKDIR where name"); help.AppendLine("TOUCH where name"); help.AppendLine("OPEN what"); Console.WriteLine(help.ToString()); break; case "open": case "otvori": if (Int32.TryParse(commands[1], out i)) fileSystem.Open(i); else Console.WriteLine("Wrong command, enter \"help\" for more info."); break; case "quit": System.Environment.Exit(0); break; default: Console.WriteLine("Wrong command, enter \"help\" for more info."); break; } Console.WriteLine(); Program.commands(fileSystem); }
public CodeEngineDispatcher(IFS fs) { _fs = fs; ClientFactory = () => { return(new EditorEngineIntegration.Client()); }; }
public EngineLocator(IFS fs) { _fs = fs; ClientFactory = () => { return new Client(); }; }
public ProjectReferencer(IFS fs, Func <string, ProviderSettings> getTypesProviderByProject) { _fs = fs; _getTypesProviderByProject = getTypesProviderByProject; }
public DefaultReader(IFS fs) { _fs = fs; }