void OnGUI() { defaultPath = GUILayout.TextField(defaultPath); if (GUILayout.Button("Load File")) { var dataLoader = LoaderFactory.CreateFileLoader(defaultPath); var type = CADTypeUtils.FromFileExtension(defaultPath); var model = _loader.Load(type, dataLoader); var gameObject = Builder.Create("Model", "defaultMat"); Builder.UpdateMesh(gameObject, model); dataLoader.Close(); } }
public void SetUp() { _stream = LoaderFactory.CreateFileLoader("quad.3dxml").Load(); }
static void Main(string[] args) { var parser = ThreeDXMLLoader.ParserFactory.Create(); parser.Parse(LoaderFactory.CreateFileLoader("quad.3dxml").Load()); }
static void StartInstaller(DataRow row, Hashtable args) { string applicationName = Utils.GetDbString(row["ApplicationName"]); string componentName = Utils.GetDbString(row["ComponentName"]); string componentCode = Utils.GetDbString(row["ComponentCode"]); string componentDescription = Utils.GetDbString(row["ComponentDescription"]); string component = Utils.GetDbString(row["Component"]); string version = Utils.GetDbString(row["Version"]); string fileName = row["FullFilePath"].ToString(); string installerPath = Utils.GetDbString(row["InstallerPath"]); string installerType = Utils.GetDbString(row["InstallerType"]); // Get appropriate loader to download the app distributive var loader = LoaderFactory.CreateFileLoader(fileName); // Mimic synchronous download process for the console app AutoResetEvent autoEvent = new AutoResetEvent(false); try { // loader.OperationCompleted += new EventHandler <EventArgs>((object sender, EventArgs e) => { Log.WriteInfo("Download completed!"); // string tmpFolder = FileUtils.GetTempDirectory(); string path = Path.Combine(tmpFolder, installerPath); //Update(); string method = "Install"; Log.WriteStart(string.Format("Running installer {0}.{1} from {2}", installerType, method, path)); //prepare installer args args[Global.Parameters.ComponentName] = componentName; args[Global.Parameters.ApplicationName] = applicationName; args[Global.Parameters.ComponentCode] = componentCode; args[Global.Parameters.ComponentDescription] = componentDescription; args[Global.Parameters.Version] = version; args[Global.Parameters.InstallerFolder] = tmpFolder; args[Global.Parameters.InstallerPath] = installerPath; args[Global.Parameters.InstallerType] = installerType; args[Global.Parameters.Installer] = Path.GetFileName(fileName); args[Global.Parameters.BaseDirectory] = FileUtils.GetCurrentDirectory(); args[Global.Parameters.IISVersion] = Global.IISVersion; args[Global.Parameters.ShellVersion] = AssemblyLoader.GetShellVersion(); args[Global.Parameters.ShellMode] = Global.SilentInstallerShell; args[Global.Parameters.SetupXml] = String.Empty; // Run the installer var res = AssemblyLoader.Execute(path, installerType, method, new object[] { args }); Log.WriteInfo(string.Format("Installer returned {0}", res)); Log.WriteEnd("Installer finished"); // Remove temporary directory FileUtils.DeleteTempDirectory(); // We are done autoEvent.Set(); }); // TODO: Add cleanup for events. loader.OperationFailed += new EventHandler <LoaderEventArgs <Exception> >(loader_OperationFailed); loader.ProgressChanged += new EventHandler <LoaderEventArgs <int> >(loader_ProgressChanged); loader.StatusChanged += new EventHandler <LoaderEventArgs <string> >(loader_StatusChanged); // loader.LoadAppDistributive(); // Wait until the download is complete autoEvent.WaitOne(); } catch (Exception ex) { Log.WriteError("Installer error", ex); } finally { autoEvent.Set(); } }