2022-10-13 13:05:43 +02:00
|
|
|
|
// Copyright (c) Microsoft Corporation
|
|
|
|
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2024-09-16 16:09:43 -04:00
|
|
|
|
|
2024-04-26 19:41:44 +02:00
|
|
|
|
using HostsUILib.Models;
|
2022-10-13 13:05:43 +02:00
|
|
|
|
|
2024-04-26 19:41:44 +02:00
|
|
|
|
namespace HostsUILib.Helpers
|
2022-10-13 13:05:43 +02:00
|
|
|
|
{
|
2024-06-03 11:26:05 +02:00
|
|
|
|
public interface IHostsService
|
2022-10-13 13:05:43 +02:00
|
|
|
|
{
|
|
|
|
|
|
string HostsFilePath { get; }
|
|
|
|
|
|
|
|
|
|
|
|
event EventHandler FileChanged;
|
|
|
|
|
|
|
2023-06-23 21:54:45 +02:00
|
|
|
|
Task<HostsData> ReadAsync();
|
2022-10-13 13:05:43 +02:00
|
|
|
|
|
2023-09-08 17:25:36 +02:00
|
|
|
|
Task WriteAsync(string additionalLines, IEnumerable<Entry> entries);
|
2022-10-13 13:05:43 +02:00
|
|
|
|
|
|
|
|
|
|
Task<bool> PingAsync(string address);
|
|
|
|
|
|
|
2022-10-24 20:09:00 +02:00
|
|
|
|
void OpenHostsFile();
|
2023-11-03 17:10:26 +01:00
|
|
|
|
|
2024-08-16 20:36:26 +02:00
|
|
|
|
void RemoveReadOnlyAttribute();
|
2022-10-13 13:05:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|