コード例 #1
0
        private void LoadingProcess()
        {
            progress                  = new LoadingProgress(3);
            progress.OnUpdate        += new LoadingProgress.ProgressUpdateHandler(progress_OnUpdate);
            progress.OnProcessUpdate += new LoadingProgress.ProcessUpdateHandler(progress_OnProcessUpdate);
            loadedChemFile            = MoleculeLoader.LoadFromFile(filename, progress);

            // close dlg
            this.Invoke(closeDelegate);
        }
コード例 #2
0
        public void LoadFile(string file)
        {
            MoleculeLoadingResults results = null;

            try
            {
                renderSource = new ChemRenderingSource3D(MoleculeLoader.LoadFromFile(file, settings, MoleculeLoader.FileUsage.ThreeD, null, out results));
                if (renderContext != null)
                {
                    renderContext.ChemRenderSource = renderSource;
                    renderContext.OnResize(Width, Height);
                    renderContext.Render(null);
                }
            }
            catch (UserLevelException ule)
            {
                // post to user
                MessageBox.Show(ule.Message, "Loading File", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            UleDlg dlg = new UleDlg(results, null);

            dlg.ShowDialog();
            dlg.Dispose();
        }