BExplorer.Shell.ShellSearchFolder.SetStacks C# (CSharp) Method

SetStacks() public method

Creates a list of stack keys, as specified. If this method is not called, by default the folder will not be stacked.
If one of the given canonical names is invalid.
public SetStacks ( ) : void
return void
        public void SetStacks(params string[] canonicalNames)
        {
            if (canonicalNames == null) throw new ArgumentNullException("canonicalNames");
            var propertyKeyList = new List<PROPERTYKEY>();

            foreach (string prop in canonicalNames)
            {
                // Get the PropertyKey using the canonicalName passed in
                PROPERTYKEY propKey;
                int result = PropertySystemNativeMethods.PSGetPropertyKeyFromName(prop, out propKey);
                if (result == 0) throw new ArgumentException("", "canonicalNames", Marshal.GetExceptionForHR(result));
                propertyKeyList.Add(propKey);
            }

            if (propertyKeyList.Any())
            {
                SetStacks(propertyKeyList.ToArray());
            }
        }