Example #1
0
        protected static string GetStringValue(ShellProperties properties, PropertyKey key)
        {
            var result = properties.GetProperty <string>(key)?.Value;

            if (result == null)
            {
                var result2 = properties.GetProperty <string[]>(key)?.Value;
                result = result2?.First();
            }

            return(result ?? string.Empty);
        }
Example #2
0
        protected static int GetIntegerValue(ShellProperties properties, PropertyKey key)
        {
            var result = properties.GetProperty <uint?>(key).Value;

            if (result == null)
            {
                return(0);
            }

            return((int)result.Value);
        }
Example #3
0
        }         //

        private void ReadFileDetails(string path)
        {
            using (ShellObject shellObj = ShellObject.FromParsingName(path)) {
                using (ShellProperties props = shellObj.Properties) {
                    this.WriteProperties(props);


                    IShellProperty           shellProp = props.GetProperty(SystemProperties.System.Category);
                    ShellPropertyDescription desc      = SystemProperties.GetPropertyDescription(SystemProperties.System.Category);

                    Console.WriteLine("Prop value: " + desc.ValueType);
                }
            }
        }
Example #4
0
        protected static bool GetBoolValue(ShellProperties properties, PropertyKey key)
        {
            var result = properties.GetProperty <bool?>(key).Value;

            return(result != null && result.Value);
        }