示例#1
0
        public static HostsFile Load(string path)
        {
            var file = new HostsFile();

            file.ReloadFrom(path);
            return(file);
        }
示例#2
0
        public static HostsFile Load(TextReader reader)
        {
            var file = new HostsFile();

            file.ReloadFrom(reader);
            return(file);
        }
示例#3
0
文件: Program.cs 项目: mouhong/XHost
        static void Run(string commandLine)
        {
            var cmdLine = CommandLine.Parse(commandLine);
            var command = CommandFactory.Find(cmdLine.CommandName);

            if (command == null)
            {
                throw new InvalidOperationException("Unknown command: " + cmdLine.CommandName);
            }

            var context = new CommandExecutionContext(HostsFile.Load());

            command.Execute(cmdLine, context);
        }
示例#4
0
 public static HostsFile Load(TextReader reader)
 {
     var file = new HostsFile();
     file.ReloadFrom(reader);
     return file;
 }
示例#5
0
 public static HostsFile Load(string path)
 {
     var file = new HostsFile();
     file.ReloadFrom(path);
     return file;
 }