diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-03 16:36:54 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-03 16:36:54 +0300 |
| commit | 856773f7eafb9d04500ede0cfae9c0e75231418b (patch) | |
| tree | d1b4f9577b5a47dd10fa7243823fd1016de1418e /Software/Visual_Studio/Tango.Stubs/Examples/WriteToFile.cs | |
| parent | 94e4072838c235be4d48a4635e47204a39cdd78b (diff) | |
| download | Tango-856773f7eafb9d04500ede0cfae9c0e75231418b.tar.gz Tango-856773f7eafb9d04500ede0cfae9c0e75231418b.zip | |
Implemented StubsView & VM !!!
Diffstat (limited to 'Software/Visual_Studio/Tango.Stubs/Examples/WriteToFile.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Stubs/Examples/WriteToFile.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Stubs/Examples/WriteToFile.cs b/Software/Visual_Studio/Tango.Stubs/Examples/WriteToFile.cs new file mode 100644 index 000000000..73d8dde6f --- /dev/null +++ b/Software/Visual_Studio/Tango.Stubs/Examples/WriteToFile.cs @@ -0,0 +1,29 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +private const string FILE_PATH = "D:\\logFile.txt"; + +public void OnExecute(StubManager stubManager) +{ + //This will overwrite existing file. + stubManager.WriteToFile(FILE_PATH, "Writing to file..."); + + for (int i = 0; i < 10; i++) + { + //This will append the contents to the end of the file. + stubManager.AppendToFile(FILE_PATH, i.ToString() + " Some text..."); + } + + stubManager.AppendToFile(FILE_PATH, "Done"); + + stubManager.WriteLine("Done writing to the file."); +}
\ No newline at end of file |
