-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
181 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Test.Services.Console | ||
{ | ||
internal class Console | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,51 @@ | ||
namespace Test.Services.GLUpdater | ||
using System; | ||
using System.IO; | ||
using System.Net; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
using Test.Services.Message; | ||
using Version = Test.Models.Version; | ||
|
||
namespace Test.Services.GLUpdater | ||
{ | ||
/* | ||
* Модуль обновления приложения | ||
* | ||
*/ | ||
internal class GLUpdater | ||
internal class GLUpdater : CLMessage | ||
{ | ||
|
||
private static GLUpdater _model; | ||
|
||
public static GLUpdater Model => _model ??= new GLUpdater(); | ||
|
||
public string New_version { get; set; } | ||
|
||
|
||
public bool IsUpdate() | ||
{ | ||
if (Version.Model.GetVersion(false) == New_version) | ||
{ | ||
return false; | ||
} | ||
return true; | ||
} | ||
public void Checker() | ||
{ | ||
Task.Run(RequestAsync); | ||
} | ||
|
||
private async Task RequestAsync() | ||
{ | ||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://raw.githubusercontent.com/Sereoj/DesktopSort/Design/Updates/xml/update.xml"); | ||
HttpWebResponse response = (HttpWebResponse)await request.GetResponseAsync(); | ||
using (Stream stream = response.GetResponseStream()) | ||
{ | ||
using (StreamReader reader = new StreamReader(stream)) | ||
{ | ||
New_version = reader.ReadToEnd(); | ||
} | ||
} | ||
response.Close(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Test.ViewModels.Base; | ||
|
||
namespace Test.Services.Message | ||
{ | ||
|
||
/* | ||
* Модуль вывода сообщений на экран | ||
* | ||
*/ | ||
|
||
internal class CLMessage : ViewModel | ||
{ | ||
public string GetMessage { get; private set; } | ||
|
||
public void SetMessage(string message) | ||
{ | ||
if (message.Length > 0) | ||
{ | ||
GetMessage = message; | ||
OnPropertyChanged("MessageChange"); | ||
} | ||
else | ||
{ | ||
GetMessage = "..."; | ||
OnPropertyChanged("MessageChange"); | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters