Skip to content

Commit

Permalink
refactor app
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Nov 18, 2019
1 parent f133df1 commit 4050b7b
Show file tree
Hide file tree
Showing 23 changed files with 947 additions and 908 deletions.
71 changes: 1 addition & 70 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,76 +5,7 @@
A simple program to shorten links

![](https://file.soft98.ir/uploads/mahdi72/2018/10/26_10-zxc.png)
![](https://file.soft98.ir/uploads/mahdi72/2018/11/28_11-Untitled.png)


## If you know the other shortening service that supports API, let us know!

Any contributions will be accepted

# Linux and Mac Version
CrossPlatform version Written by DotNet Core<br>
you can access Linux and Mac version via two way!<br>
1.Precompiled Binary [Download it from [here](https://github.com/ghost1372/UrlShortener/releases))]<br>
2.Compile Project on Linux or Mac

## How to Run downloaded binary on linux or mac?
unzip binary and go to directoy then execute following command:
```
./UrlShortenerCrossPlatform.dll
```
#### Simple usage
-s is optional argument that is a integer for selecting service (you can find services in help menu)<br>
-l is required argument that is long url you want to shot it.
```
chmod 777 ./UrlShortenerCrossPlatform
./UrlShortenerCrossPlatform -s 3 -l https://github.com/ghost1372
```
## Compile Project on Linux or Mac
First Step: you must install prerequisites library<br>
Second Step: clone project
```
git clone https://github.com/ghost1372/UrlShortener.git
cd UrlShortener
cd UrlShortenerCrossPlatform
```
Third Step: Compile it
```
dotnet build -c release
```


### Prerequisites for .NET Core on Linux
#### Ubuntu
Ubuntu distributions require the following libraries installed:<br>

liblttng-ust0<br>
libcurl3<br>
libssl1.0.0<br>
libkrb5-3<br>
zlib1g<br>
libicu52 (for 14.x)<br>
libicu55 (for 16.x)<br>
libicu57 (for 17.x)<br>
libicu60 (for 18.x)<br>
libunwind8<br>
libuuid1<br>

#### CentOS and Fedora
CentOS distributions require the following libraries installed:<br>

lttng-ust<br>
libcurl<br>
openssl-libs<br>
krb5-libs<br>
libicu<br>
zlib<br>
libunwind<br>
libuuid<br>

Fedora users: If your openssl's version >= 1.1, you'll need to install compat-openssl10.

### Prerequisites for .NET Core on Mac
Download and install the .NET Core SDK from [.NET Downloads](https://www.microsoft.com/net/download/core)).


Any contributions will be accepted
8 changes: 0 additions & 8 deletions UrlShortener.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.28917.182
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UrlShortener", "UrlShortener\UrlShortener.csproj", "{967892AE-2BEB-44C9-927F-804E75EFC55D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UrlShortenerCrossPlatform", "UrlShortenerCrossPlatform\UrlShortenerCrossPlatform.csproj", "{FB441283-8B83-4E4E-9438-6500B6DBBC47}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -20,12 +18,6 @@ Global
{967892AE-2BEB-44C9-927F-804E75EFC55D}.Debug-Net45|Any CPU.Build.0 = Debug|Any CPU
{967892AE-2BEB-44C9-927F-804E75EFC55D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{967892AE-2BEB-44C9-927F-804E75EFC55D}.Release|Any CPU.Build.0 = Release|Any CPU
{FB441283-8B83-4E4E-9438-6500B6DBBC47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB441283-8B83-4E4E-9438-6500B6DBBC47}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB441283-8B83-4E4E-9438-6500B6DBBC47}.Debug-Net45|Any CPU.ActiveCfg = Debug|Any CPU
{FB441283-8B83-4E4E-9438-6500B6DBBC47}.Debug-Net45|Any CPU.Build.0 = Debug|Any CPU
{FB441283-8B83-4E4E-9438-6500B6DBBC47}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB441283-8B83-4E4E-9438-6500B6DBBC47}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
25 changes: 20 additions & 5 deletions UrlShortener/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using HandyControl.Data;
using HandyControl.Controls;
using HandyControl.Data;
using HandyControl.Tools;
using System;
using System.Windows;
Expand All @@ -12,18 +13,32 @@ public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
GlobalData.Init();

if (GlobalData.Config.Skin != SkinType.Default)
if (checkSkinType(InIHelper.ReadValue("Skin")) != SkinType.Default)
{
UpdateSkin(GlobalData.Config.Skin);
UpdateSkin(checkSkinType(InIHelper.ReadValue("Skin")));
}

var lang = InIHelper.ReadValue("Lang");
if (string.IsNullOrEmpty(lang))
ConfigHelper.Instance.SetLang("fa");
else
ConfigHelper.Instance.SetLang(lang);

ConfigHelper.Instance.SetSystemVersionInfo(CommonHelper.GetSystemVersionInfo());

base.OnStartup(e);
}

internal SkinType checkSkinType(string input)
{
if (input.Equals("Default"))
return SkinType.Default;
else if (input.Equals("Violet"))
return SkinType.Violet;
else
return SkinType.Dark;
}

internal void UpdateSkin(SkinType skin)
{
Resources.MergedDictionaries.Clear();
Expand Down
49 changes: 0 additions & 49 deletions UrlShortener/GlobalData.cs

This file was deleted.

Loading

0 comments on commit 4050b7b

Please sign in to comment.