Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 4
0
        protected static bool GetBoolValue(ShellProperties properties, PropertyKey key)
        {
            var result = properties.GetProperty <bool?>(key).Value;

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