public TagMockData()
 {
     TagData.Add(new TagViewable(@"C:\Test\Music\testfile.wav", MusicRecord.Filename));
     TagData.Add(new TagDataBool(false, MusicRecord.RecordingType)
     {
         NewValue = true
     });
     TagData.Add(new TagDataEnum(0, MusicRecord.RecordingType, new string[] { "Test1", "Test2" })
     {
         NewInt = 1
     });
     TagData.Add(new TagDataString("Test Music File", MusicRecord.TrackTitle, ID3TagType.Title));
     TagData.Add(new TagDataString("Test Music File [Live at the Apollo]", MusicRecord.SongTitle));
     TagData.Add(new TagDataString("Classic Albu", MusicRecord.AlbumTitle, ID3TagType.Album)
     {
         NewValue = "Classic Album"
     });
     TagData.Add(new TagDataInt(1, MusicRecord.TrackNumber, ID3TagType.Track)
     {
         _newValue = 2
     });
     TagData.Add(new TagDataInt(1, MusicRecord.DiscNumber, ID3TagType.Disc));
     TagData.Add(new TagDataInt(1999, MusicRecord.AlbumYear, ID3TagType.Year));
     TagData.Add(new TagDataInt(1999, MusicRecord.AlbumYear, ID3TagType.Year));
     TagData.Add(new TagDataString("Test Artist", MusicRecord.ArtistName, ID3TagType.Performer, 0));
 }
        public void Load(Mod mod)
        {
            CoinStatDisplay = ContentTags.Get <AdaptiveItemTags>(nameof(CoinStatDisplay));
            CoinStatDisplay.Add(true, ItemID.CoinGun);

            IL.Terraria.Main.MouseText_DrawItemTooltip_GetLinesInfo += SwapCoinGun;
        }
Exemple #3
0
        private void AddOrUpdateTagData(CSLibrary.Structures.TagCallbackInfo info)
        {
            InvokeOnMainThread(() =>
            {
                bool found = false;

                int cnt;

                for (cnt = 0; cnt < EPCData.Count; cnt++)
                {
                    if (EPCData[cnt].epc.ToString() == info.epc.ToString())
                    {
                        EPCData[cnt].rssi = info.rssi;
                        TagData[cnt][1]   = info.rssi.ToString();
                        found             = true;
                        break;
                    }
                }

                if (!found)
                {
                    string epcString = info.epc.ToString();

                    EPCData.Add(info);
                    //TagData.Add(CSLibrary.Tools.Hex.ToString(info.epc));

                    string[] newItem = new string[] { epcString, info.rssi.ToString() };

                    TagData.Add(newItem);

                    Trace.Message("EPC Data = {0}", epcString);
                }
            });
        }
        private void AddOrUpdateTagData(CSLibrary.Structures.TagCallbackInfo info)
        {
            InvokeOnMainThread(() =>
            {
                //string epc = CSLibrary.Tools.Hex.ToString(e.info.epc);
                //TagData.Add(epc);
                //Trace.Message("EPC = {0}", epc);

                bool found = false;

                int cnt;

                for (cnt = 0; cnt < EPCData.Count; cnt++)
                {
                    if (EPCData[cnt].epc.ToString() == info.epc.ToString())
                    {
                        EPCData[cnt].rssi = info.rssi;
                        TagData[cnt][1]   = info.rssi.ToString();
                        found             = true;
                        break;
                    }
                }

                if (!found)
                {
                    string epcString = info.epc.ToString();

                    EPCData.Add(info);
                    //TagData.Add(CSLibrary.Tools.Hex.ToString(info.epc));

                    string[] newItem = new string[] { epcString, info.rssi.ToString() };

                    TagData.Add(newItem);

                    Trace.Message("EPC Data = {0}", epcString);
                }

                /*
                 * foreach (CSLibrary.Events.TagCallbackInfo item in EPCData)
                 * {
                 * int cnt = 0;
                 *
                 * for (; cnt < info.epc.Length; cnt ++)
                 * {
                 * if (item.epc[cnt] != info.epc[cnt])
                 * break;
                 * }
                 *
                 * if (cnt == info.epc.Length)
                 * {
                 *              item.rssi = info.rssi;
                 *              TagData[cnt][1] = item.rssi.ToString();
                 *              found = true;
                 * break;
                 * }
                 * }
                 *
                 * if (!found)
                 * {
                 * string epcString = CSLibrary.Tools.Hex.ToString(info.epc);
                 *
                 * EPCData.Add(info);
                 *      //TagData.Add(CSLibrary.Tools.Hex.ToString(info.epc));
                 *
                 *      string[] newItem = new string[] {epcString, info.rssi.ToString () };
                 *
                 *      TagData.Add(newItem);
                 *      Trace.Message("EPC Data = {0}", epcString);
                 * }
                 */

                //RaisePropertyChanged();
                //RaisePropertyChanged(() => TagData);
                //RaisePropertyChanged(() => TagData[1]);
            });
        }