C \ # WPF 도구 HTML 회전 JS

2332 단어
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication1
{
    /// <summary>
    /// MainWindow.xaml      
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
        static int flag = 0;
        private void button_Click(object sender, RoutedEventArgs e)
        {
            string s = this.inputJs.Text;
            string v = s.Trim().Replace("'","\\'").Replace("\"", "\\'").Replace("\r
"," "); this.outputJs.Text = "\""+v+ "\""; } private void inputJs_GotFocus(object sender, RoutedEventArgs e) { flag++; if (flag == 1) { this.inputJs.Text = ""; } } private void button1_Click(object sender, RoutedEventArgs e) { string s = this.outputJs.Text; if (!s.Trim().Equals("")) { Clipboard.Clear(); Clipboard.SetData(DataFormats.Text,s); } } private void button2_Click(object sender, RoutedEventArgs e) { this.inputJs.Text = ""; } private void button3_Click(object sender, RoutedEventArgs e) { IDataObject iData = Clipboard.GetDataObject(); if (iData.GetDataPresent(DataFormats.Text)) { this.inputJs.Text = (string)iData.GetData(DataFormats.Text); } } } }

좋은 웹페이지 즐겨찾기