public static async Task <string> Execute(string exec, string value, string type) { Timer t = new Timer(); if (exec == "Embed") { if (type == "Message") { t.Run(true, String.Empty); //TIMER START } PopupDialog.Loading pl = new PopupDialog.Loading(); if (value.Length > 1000) { pl.Show(true, Data.Misc.PleaseWait, Data.Misc.PleaseWaitDetail); } Picker_Property.Reset_Picker(Data.Misc.Text); var x = Task.Run(() => Encrypt(value, type)); var result = await x; if (x.IsCompleted == true) { pl.Show(false, String.Empty, String.Empty); } if (type == "Message") { t.Run(false, Data.Misc.T_Encrypt); //TIMER STOP } return(result); } else { if (type == "Message") { t.Run(true, String.Empty); //TIMER START } var result = await Task.Run(() => Decrypt(value)); if (type == "Message") { t.Run(false, Data.Misc.T_Decrypt); //TIMER STOP } return(result); } }
public static async Task Message(StorageFile file) { Picker_Property.Reset_Picker("Text"); GetData.Picker.Add(Data.Misc.Text, await FileIO.ReadTextAsync(file)); }
public static async Task <bool> Execute(string[] extension, string type) { FileOpenPicker picker = new FileOpenPicker(); PopupDialog.Loading pl = new PopupDialog.Loading(); foreach (string ext in extension) { picker.FileTypeFilter.Add(ext); } StorageFile file = await picker.PickSingleFileAsync(); if (file != null) { switch (type) { case "Image": if (await Picker_Property.GetPicker(file, type) == true) { await Conversion.Image(file, "Cover"); return(true); } else { return(false); } case "File": if (await Picker_Property.GetPicker(file, type) == true) { Task x = Task.Run(() => Conversion.File(file)); pl.Show(true, Data.Misc.PleaseWait, Data.Misc.PleaseWaitDetail); await x; if (x.IsCompleted == true) { pl.Show(false, String.Empty, String.Empty); } return(true); } else { return(false); } case "Message": if (await Picker_Property.GetPicker(file, type)) { await Conversion.Message(file); return(true); } else { return(false); } case "Stego": if (await Picker_Property.GetPicker(file, type)) { await Conversion.Image(file, type); await Validate.SecretData(file); return(true); } else { return(false); } default: return(false); } } else { return(false); } }