Exemplo n.º 1
0
        private void setInstanceLabel()
        {
            if (lbInstance != null)
            {
                string s = "";
                if (inst != null)
                {
                    List <string> labels = null;
                    if (useFlagNames && dataOwner == 0x07 && flagsFor != null)
                    {
                        labels = BhavWiz.flagNames(flagsFor.DataOwner, flagsFor.Value);
                        if (labels != null)
                        {
                            labels = new List <string>(labels);
                            labels.Insert(0, "[0: " + pjse.Localization.GetString("invalid") + "]");
                        }
                    }
                    else if (dataOwner == 0x00 || dataOwner == 0x01)
                    {
                        labels = inst.GetAttrNames(Scope.Private);
                    }
                    else if (dataOwner == 0x02 || dataOwner == 0x05)
                    {
                        labels = inst.GetAttrNames(Scope.SemiGlobal);
                    }
                    else if (dataOwner == 0x09 || dataOwner == 0x16 || dataOwner == 0x32) // Param
                    {
                        labels = inst.GetTPRPnames(false);
                    }
                    else if (dataOwner == 0x19) // Local
                    {
                        labels = inst.GetTPRPnames(true);
                    }
                    else if (dataOwner >= 0x29 && dataOwner <= 0x2F)
                    {
                        labels = inst.GetArrayNames();
                    }
                    else if (BhavWiz.doidGStr[dataOwner] != null)
                    {
                        labels = BhavWiz.readStr((GS.BhavStr)BhavWiz.doidGStr[dataOwner]);
                    }

                    if (labels != null)
                    {
                        if (instance < labels.Count)
                        {
                            s = cbDataOwner.Text + ": " + labels[instance];
                        }
                    }
                    else if (dataOwner == 0x1a)
                    {
                        ushort[] bcon = BhavWiz.ExpandBCON(instance, false);
                        s = ((BhavWiz)inst).readBcon(bcon[0], bcon[1], false, true);
                    }
                }
                lbInstance.Text = s;
            }
        }