public void AddStandardEntry() { using (PropList l = new PropList()) { l[Properties.ApplicationPID] = "1234"; Assert.AreEqual("1234", l[Properties.ApplicationPID]); } }
public void AddMultipleEntriesAndCheckForMemoryCorruption() { using (PropList l = new PropList()) { System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding(); string first = "mydata"; byte[] second = { 0, 5, 10, 25 }; byte[] third = { 255, 125, 5 }; l["first"] = encoder.GetBytes(first); l["second"] = second; l["third"] = third; Assert.AreEqual(third, l["third"]); Assert.AreEqual(second, l["second"]); Assert.AreEqual(first, encoder.GetString(l["first"])); } }
public void AddingEntryIncreasesCount() { using (PropList l = new PropList()) { l[Properties.ApplicationIconName] = "value"; Assert.AreEqual(1, l.Count); } }
public PropList Copy() { PropList clone = new PropList(pa_proplist_copy(handle)); clone.needDispose = true; GC.ReRegisterForFinalize(clone); return(clone); }
public void AddedEntryAppearsInKeysEnumeration() { using (PropList l = new PropList()) { l["foo"] = new byte[] { 1, 2, 3 }; Assert.Contains("foo", l.Keys.ToArray()); } }
internal SinkInput(NativeSinkInputInfo info, Context c) { ctx = c; this.info = info; Name = Marshal.PtrToStringAnsi(info.name); ResampleMethod = Marshal.PtrToStringAnsi(info.resample_method); Driver = Marshal.PtrToStringAnsi(info.driver); PropList temp = new PropList(info.prop_handle); Properties = temp.Copy(); ctx.SinkInputEvent += HandleSinkInputEvent; }
public void AddedNonStandardEntryHasCorrectValue() { using (PropList l = new PropList()) { byte[] data = { 0, 1, 2, 3, 4 }; l["key"] = data; Assert.AreEqual(data, l["key"]); } }
public void EachAddedEntryAppearsInKeysEnumeration() { using (PropList l = new PropList()) { string[] keys = new string[] { "one", "two", "three", "four" }; foreach (string key in keys) { l[key] = new byte[] { 1 }; } foreach (string key in keys) { Assert.Contains(key, l.Keys.ToArray()); } } }
private void UpdateInfo(NativeSinkInputInfo info) { EventHandler <PropertyChangedEventArgs> propHandler; propHandler = PropertiesChanged; if (propHandler != null) { propHandler(this, new PropertyChangedEventArgs()); } if (this.info.volume != info.volume) { EventHandler <VolumeChangedEventArgs> handler; handler = VolumeChanged; if (handler != null) { handler(this, new VolumeChangedEventArgs(info.volume)); } } this.info = info; ResampleMethod = Marshal.PtrToStringAnsi(info.resample_method); PropList temp = new PropList(info.prop_handle); Properties = temp.Copy(); }
public void NewlyCreatedPropListHasZeroEntries() { using (PropList l = new PropList()) { Assert.AreEqual(0, l.Count); } }
public void NewlyCreatedPropListIsEmpty() { using (PropList l = new PropList()) { Assert.IsTrue(l.Empty); } }