GetData() public static method

public static GetData ( string format ) : Object
format string
return Object
示例#1
0
        private void bt__Click(object sender, RoutedEventArgs e)
        {
            DataGrid dg = dgDocuments;

            dg.SelectAllCells();
            dg.ClipboardCopyMode = DataGridClipboardCopyMode.IncludeHeader;
            ApplicationCommands.Copy.Execute(null, dg);
            dg.UnselectAllCells();

            String result = (string)Clipboard.GetData(DataFormats.Text);

            string a, b;

            b = "@";

            a = (DBConnection.FolderZ.ToString());

            StreamWriter sw = new StreamWriter(a);

            sw.WriteLine(result);
            sw.Close();



            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.ShowDialog();
            File.WriteAllText(saveFileDialog.FileName, result);
        }
示例#2
0
 public void DumpWFClipboardTest()
 {
     TestContext.WriteLine($"ContainsAudio: {WFClipboard.ContainsAudio()}");
     TestContext.WriteLine($"ContainsData: {WFClipboard.ContainsData(DataFormats.StringFormat)}");
     TestContext.WriteLine($"ContainsFileDropList: {WFClipboard.ContainsFileDropList()}");
     TestContext.WriteLine($"ContainsImage: {WFClipboard.ContainsImage()}");
     TestContext.WriteLine($"ContainsText: {WFClipboard.ContainsText()}");
     TestContext.WriteLine($"GetAudioStream: {WFClipboard.GetAudioStream()}");
     TestContext.WriteLine($"GetData: {WFClipboard.GetData(DataFormats.StringFormat)}");
     TestContext.WriteLine($"GetDataObject: {WFClipboard.GetDataObject()}");
     TestContext.WriteLine($"GetFileDropList: {string.Join("\n", WFClipboard.GetFileDropList().Cast<string>())}");
     TestContext.WriteLine($"GetImage: {WFClipboard.GetImage()}");
     TestContext.WriteLine($"GetText: {WFClipboard.GetText()}");
 }
示例#3
0
        public override object GetData(TransferDataType type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            if (!IsTypeAvailable(type))
            {
                return(null);
            }

            return(WindowsClipboard.GetData(type.ToSwf()));
        }
示例#4
0
        //Экспортв MS Word
        private void bt_Eport_Word_Click(object sender, RoutedEventArgs e)
        {
            DataGrid dg = dgClient;

            dg.SelectAllCells();
            dg.ClipboardCopyMode = DataGridClipboardCopyMode.IncludeHeader;
            ApplicationCommands.Copy.Execute(null, dg);
            dg.UnselectAllCells();
            String result = (string)Clipboard.GetData(DataFormats.Text);

            try
            {
                StreamWriter sw = new StreamWriter("export.doc");
                sw.WriteLine(result);
                sw.Close();
                Process.Start("export.doc");
            }
            catch (Exception ex) { }
        }
示例#5
0
 public static object GetData(string format)
 {
     return(ClipboardProxy.GetData(format));
 }