-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- update ios workflow
- Loading branch information
Showing
9 changed files
with
119 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
v1.1.2 | ||
- change profile file's syntax | ||
- update ios workflow | ||
|
||
v1.1.1 | ||
- fix bug | ||
|
||
|
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
| ||
using System; | ||
using System.Web.Script.Serialization; | ||
|
||
namespace SyncClipboard | ||
{ | ||
class Profile | ||
{ | ||
public enum ClipboardType { | ||
Text, | ||
Image | ||
}; | ||
|
||
private class JsonProfile | ||
{ | ||
public String File { get; set; } | ||
public String Clipboard { get; set; } | ||
public String Type { get; set; } | ||
} | ||
|
||
public String FileName { get; set; } | ||
public String Text { get; set; } | ||
public ClipboardType Type { get; set; } | ||
|
||
public Profile() | ||
{ | ||
FileName = ""; | ||
Text = ""; | ||
Type = ClipboardType.Text; | ||
} | ||
|
||
public Profile(String jsonStr) | ||
{ | ||
JsonProfile jsonProfile = null; | ||
try | ||
{ | ||
JavaScriptSerializer serializer = new JavaScriptSerializer(); | ||
jsonProfile = serializer.Deserialize<JsonProfile>(jsonStr); | ||
FileName = jsonProfile.File; | ||
Text = jsonProfile.Clipboard; | ||
Type = StringToClipBoardType(jsonProfile.Type); | ||
} | ||
catch (ArgumentException) | ||
{ | ||
Console.WriteLine("Exited profile file's format is wrong"); | ||
FileName = ""; | ||
Text = ""; | ||
Type = ClipboardType.Text; | ||
} | ||
} | ||
|
||
public String ToJsonString() | ||
{ | ||
JsonProfile jsonProfile = new JsonProfile(); | ||
jsonProfile.File = FileName; | ||
jsonProfile.Clipboard = Text; | ||
jsonProfile.Type = ClipBoardTypeToString(Type); | ||
|
||
JavaScriptSerializer serializer = new JavaScriptSerializer(); | ||
return serializer.Serialize(jsonProfile); | ||
} | ||
|
||
static private ClipboardType StringToClipBoardType(String stringType) | ||
{ | ||
ClipboardType type = ClipboardType.Text; | ||
try | ||
{ | ||
type = (ClipboardType)Enum.Parse(typeof(ClipboardType), stringType); | ||
} | ||
catch | ||
{ | ||
Console.WriteLine("Profile Type is Wrong"); | ||
throw new ArgumentException("Profile Type is Wrong"); | ||
} | ||
|
||
return type; | ||
} | ||
|
||
static private String ClipBoardTypeToString(ClipboardType type) | ||
{ | ||
return Enum.GetName(typeof(ClipboardType), type); | ||
} | ||
} | ||
} |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## feature | ||
- [ ] 添加处于上传/下载过程的图标变化 | ||
- [x] win上传图片 | ||
- [ ] win下载图片 | ||
|
||
## clean code | ||
- 资源回收排查 | ||
- 重构 |