<# /*============================================================================= Description: This script will include a file that exists in the file system in the current Mist Project. This script uses an Invoke since the operation occurs on a separate thread. This is a useful pattern to combine with auto-generated Biml. =============================================================================== History: 20131028 david.darden Initial Version =============================================================================*/ #> <#@ template language="C#" hostspecific="True"#> <#@ assembly name="C:\Program Files\Varigence\Mist\3.4\Mist.exe" #> <#@ assembly name="C:\Program Files\Varigence\Mist\3.4\WpfControls.dll" #> <#@ assembly name="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\PresentationFramework.dll" #> <#@ assembly name="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xaml.dll" #> <#@ import namespace="Varigence.Mist.Managers" #> <Biml xmlns="http://schemas.varigence.com/biml.xsd"> </Biml> <# WriteLine("<!--"); // Display the project context; this might be useful to find the relative location of a file. var model = ProjectManager.GetInstance().CurrentProjectViewModel; WriteLine("Project Directory: {0}", model.DirectoryPath); WriteLine("Project File Path: {0}", model.FilePath); // Add a file that exists in the File System to the current Mist project. System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { ProjectManager.GetInstance().Project.AddNewPathToModel(@"C:\SVN\edw\edw3\trunk\Jobs\MyAwesomeJob\MyFile.txt", Varigence.Utility.Files.ExplorerItemType.File); })); WriteLine("-->"); #>
This script will include a file that exists in the file system in the current Mist Project. This script uses an Invoke since the operation occurs on a separate thread.
This is a useful pattern to combine with auto-generated Biml.
Comments
There are no comments yet.