Exemplo n.º 1
0
        //=========================================================
        // Viewer
        // July 2016: deplicated.
        // https://fieldofviewblog.wordpress.com/2015/05/06/google-chrome-drops-npapi-plugin-support/
        // TBD: maybe in future we will extend this portion to use Forge Viewer.
        // If we do, however, it will be an advanced lab and not as intro.
        //=========================================================
        private void buttonView_Click(object sender, EventArgs e)
        {
            InitRequestResponse();
            this.Update();

            Project   proj       = (Project)comboBoxProjects.SelectedItem;
            string    project_id = proj.project_id;
            ModelInfo model      = (ModelInfo)comboBoxModels.SelectedItem;
            string    model_id   = model.model_id;

            // The response we get here is URL that we embed in iframe.
            // Let's see what we got by showing in the response text box.
            // If you take this string and copy&paste in a simple html
            // file with an ifarme, you will see a model.
            // Note: viewer is not supported in windows control.
            // ScriptErrorsSuppressed is set to true to suppress script errors.
            // We are using it here to learn web services API.

            string url = Glue.View(m_authToken, project_id, model_id);

            textBoxRequest.Text  = url;
            textBoxResponse.Text = "displaying model...";
            this.Update();

            // a view embedded form's web browser by URL.
            webBrowser1.Url = new System.Uri(url);
        }