ME3Explorer.PackageEditor.Preview C# (CSharp) Method

Preview() public method

public Preview ( bool isRefresh = false ) : void
isRefresh bool
return void
        public void Preview(bool isRefresh = false)
        {
            int n;
            if (!GetSelected(out n))
            {
                return;
            }
            if (CurrentView == View.Imports || CurrentView == View.Exports || CurrentView == View.Tree)
            {
                tabControl1_SelectedIndexChanged(null, null);
                PreviewInfo(n);
                RefreshMetaData();
                //export
                if (n >= 0)
                {
                    PreviewProps(n);
                    if (!tabControl1.TabPages.ContainsKey(nameof(propertiesTab)))
                    {
                        tabControl1.TabPages.Insert(0, propertiesTab);
                    }
                    if (!tabControl1.TabPages.ContainsKey(nameof(interpreterTab)))
                    {
                        tabControl1.TabPages.Insert(1, interpreterTab);
                    }

                    IExportEntry exportEntry = pcc.getExport(n);
                    if (exportEntry.ClassName == "Function" && pcc.Game != MEGame.ME2)
                    {
                        if (!tabControl1.TabPages.ContainsKey(nameof(scriptTab)))
                        {
                            tabControl1.TabPages.Add(scriptTab);
                        }
                        if (pcc.Game == MEGame.ME3)
                        {
                            Function func = new Function(exportEntry.Data, pcc as ME3Package);
                            rtb1.Text = func.ToRawText();
                        }
                        else
                        {
                            ME1Explorer.Unreal.Classes.Function func = new ME1Explorer.Unreal.Classes.Function(exportEntry.Data, pcc as ME1Package);
                            rtb1.Text = func.ToRawText();
                        }
                    }
                    else if (tabControl1.TabPages.ContainsKey(nameof(scriptTab)))
                    {
                        tabControl1.TabPages.Remove(scriptTab);
                    }
                    hb2.ByteProvider = new DynamicByteProvider(exportEntry.header);
                    if (!isRefresh)
                    {
                        interpreterControl.export = exportEntry;
                        interpreterControl.InitInterpreter();
                    }
                    UpdateStatusEx(n);
                }
                //import
                else
                {
                    n = -n - 1;
                    hb2.ByteProvider = new DynamicByteProvider(pcc.getImport(n).header);
                    UpdateStatusIm(n);
                    if (tabControl1.TabPages.ContainsKey(nameof(interpreterTab)))
                    {
                        tabControl1.TabPages.Remove(interpreterTab);
                    }
                    if (tabControl1.TabPages.ContainsKey(nameof(propertiesTab)))
                    {
                        tabControl1.TabPages.Remove(propertiesTab);
                    }
                    if (tabControl1.TabPages.ContainsKey(nameof(scriptTab)))
                    {
                        tabControl1.TabPages.Remove(scriptTab);
                    }
                }
            }
        }
PackageEditor