개정판 f87dfb18
Issue #200114 CTRL+방향키로 페이지의 Center 이동
- 뱡향키 사용시 컨트롤의 포커스가 변경되는 경우가 발생
CTRL+마우스 휠 페이지번호 변경
Change-Id: I7804b9fdf9a0720393a682a8183d9192ef43c8a3
ConvertService/ServiceBase/ServiceTestApp/MainWindow.xaml.cs | ||
---|---|---|
706 | 706 |
{ |
707 | 707 |
if (!string.IsNullOrWhiteSpace(txtEncodeDownloadFile.Text)) |
708 | 708 |
{ |
709 |
txtDecodeDownloadFile.Text = HttpUtility.UrlDecode(txtEncodeDownloadFile.Text); |
|
709 |
txtDecodeDownloadFile.Text = HttpUtility.UrlDecode(txtEncodeDownloadFile.Text,Encoding.UTF8);
|
|
710 | 710 |
} |
711 | 711 |
|
712 | 712 |
if(!string.IsNullOrWhiteSpace(txtDecodeDownloadFile.Text)) |
713 | 713 |
{ |
714 |
txtEncodeDownloadFile.Text = HttpUtility.UrlEncode(txtDecodeDownloadFile.Text); |
|
714 |
txtEncodeDownloadFile.Text = HttpUtility.UrlEncode(txtDecodeDownloadFile.Text,Encoding.UTF8);
|
|
715 | 715 |
} |
716 | 716 |
|
717 |
string File = txtEncodeDownloadFile.Text; |
|
717 |
string File = txtDecodeDownloadFile.Text; |
|
718 |
|
|
719 |
DownloadCurrent(File); |
|
720 |
|
|
718 | 721 |
string Savepath = txtSavePath.Text; |
719 | 722 |
|
720 |
if (!System.IO.Directory.Exists(Savepath)) |
|
721 |
{ |
|
722 |
System.IO.Directory.CreateDirectory(Savepath); |
|
723 |
} |
|
723 |
//if (!System.IO.Directory.Exists(Savepath))
|
|
724 |
//{
|
|
725 |
// System.IO.Directory.CreateDirectory(Savepath);
|
|
726 |
//}
|
|
724 | 727 |
|
725 |
Markus.Service.Convert.ConvertService convertService = new Markus.Service.Convert.ConvertService(); |
|
728 |
//Markus.Service.Convert.ConvertService convertService = new Markus.Service.Convert.ConvertService();
|
|
726 | 729 |
|
727 |
var result = await convertService.DownloadFileAsync(new Markus.Message.SaveItem { PdfFilePath = File, SavePath = Savepath }); |
|
730 |
//var result = await convertService.DownloadFileAsync(new Markus.Message.SaveItem { PdfFilePath = File, SavePath = Savepath });
|
|
728 | 731 |
|
729 |
System.Windows.MessageBox.Show(result.ToString()); |
|
732 |
// System.Windows.MessageBox.Show(result.ToString());
|
|
730 | 733 |
} |
731 | 734 |
catch (Exception ex) |
732 | 735 |
{ |
733 | 736 |
System.Windows.MessageBox.Show(ex.ToString()); |
734 | 737 |
} |
735 | 738 |
} |
739 |
|
|
740 |
private void DownloadCurrent(string fileUri) |
|
741 |
{ |
|
742 |
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(fileUri); |
|
743 |
webRequest.Method = "GET"; |
|
744 |
webRequest.Timeout = 3000; |
|
745 |
webRequest.Credentials = CredentialCache.DefaultCredentials; |
|
746 |
webRequest.BeginGetResponse(new AsyncCallback(PlayResponeAsync), webRequest); |
|
747 |
} |
|
748 |
|
|
749 |
private void PlayResponeAsync(IAsyncResult asyncResult) |
|
750 |
{ |
|
751 |
long total = 0; |
|
752 |
long received = 0; |
|
753 |
HttpWebRequest webRequest = (HttpWebRequest)asyncResult.AsyncState; |
|
754 |
|
|
755 |
try |
|
756 |
{ |
|
757 |
using (HttpWebResponse webResponse = (HttpWebResponse)webRequest.EndGetResponse(asyncResult)) |
|
758 |
{ |
|
759 |
byte[] buffer = new byte[1024]; |
|
760 |
|
|
761 |
FileStream fileStream = File.OpenWrite(@"D:\Case\test.pdf"); |
|
762 |
using (Stream input = webResponse.GetResponseStream()) |
|
763 |
{ |
|
764 |
total = input.Length; |
|
765 |
|
|
766 |
int size = input.Read(buffer, 0, buffer.Length); |
|
767 |
while (size > 0) |
|
768 |
{ |
|
769 |
fileStream.Write(buffer, 0, size); |
|
770 |
received += size; |
|
771 |
|
|
772 |
size = input.Read(buffer, 0, buffer.Length); |
|
773 |
} |
|
774 |
} |
|
775 |
|
|
776 |
fileStream.Flush(); |
|
777 |
fileStream.Close(); |
|
778 |
} |
|
779 |
} |
|
780 |
catch (Exception ex) |
|
781 |
{ |
|
782 |
} |
|
783 |
} |
|
784 |
|
|
785 |
private string ToHexString(char chr) |
|
786 |
{ |
|
787 |
UTF8Encoding utf8 = new UTF8Encoding(); |
|
788 |
byte[] encodedBytes = utf8.GetBytes(chr.ToString()); |
|
789 |
StringBuilder builder = new StringBuilder(); |
|
790 |
for (int index = 0; index < encodedBytes.Length; index++) |
|
791 |
{ |
|
792 |
builder.AppendFormat("%{0}", Convert.ToString(encodedBytes[index], 16)); |
|
793 |
} |
|
794 |
|
|
795 |
return builder.ToString(); |
|
796 |
} |
|
736 | 797 |
} |
737 | 798 |
|
799 |
|
|
738 | 800 |
class IntegratedServiceInstaller |
739 | 801 |
{ |
740 | 802 |
public void Install(String ServiceName, String DisplayName, String Description, |
내보내기 Unified diff