Beispiel #1
0
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
 {
     if (value is string s)
     {
         return(IndirectString.TryParse(s, out var loc) ? loc : null);
     }
     return(base.ConvertFrom(context, culture, value));
 }
Beispiel #2
0
 public void IndirectStringTest()
 {
     Assert.IsTrue(IndirectString.TryParse(@"@%SystemRoot%\system32\shell32.dll,-21810", out var ids));
     Assert.That(ids.ResourceId, Is.EqualTo(-21810));
     Assert.NotNull(ids.Value);
 }