SDL.TridionVSRazorExtension.ProjectFolderDialogWindow.SetParentProperties C# (CSharp) Method

SetParentProperties() private method

private SetParentProperties ( ProjectItemInfo item ) : void
item ProjectItemInfo
return void
        private void SetParentProperties(ProjectItemInfo item)
        {
            if (item == null)
                return;

            if (this._TopFolder == null)
                return;

            if (item.Path == this._TopFolder.Path)
                return;

            if (item.Parent == null)
                return;

            item.Parent.Handled = true;

            if (item.Parent.ChildItems != null && item.Parent.ChildItems.All(x => x.Checked == true))
            {
                item.Parent.Checked = true;
            }
            else if (item.Parent.ChildItems != null && item.Parent.ChildItems.All(x => x.Checked == false))
            {
                item.Parent.Checked = false;
            }
            else
            {
                item.Parent.Checked = null;
            }

            if (item.Parent.ChildItems != null && item.Parent.ChildItems.All(x => x.SyncTemplate == true))
            {
                item.Parent.SyncTemplate = true;
            }
            else if (item.Parent.ChildItems != null && item.Parent.ChildItems.All(x => x.SyncTemplate == false))
            {
                item.Parent.SyncTemplate = false;
            }
            else
            {
                item.Parent.SyncTemplate = null;
            }

            item.Parent.Handled = false;

            this.SetParentProperties(item.Parent);
        }