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

SetVisibility() private method

private SetVisibility ( ProjectFolderRole role ) : void
role ProjectFolderRole
return void
        private void SetVisibility(ProjectFolderRole role)
        {
            if (role == ProjectFolderRole.PageLayout)
            {
                this.txtTemplateFormat.IsEnabled = true;
                this.txtSchemaNames.IsEnabled = false;

                this.txtSchemaNames.Text = null;

                this._TridionRole = TridionRole.PageLayoutContainer;
            }

            if (role == ProjectFolderRole.ComponentLayout)
            {
                this.txtTemplateFormat.IsEnabled = true;
                this.txtSchemaNames.IsEnabled = true;

                this._TridionRole = TridionRole.ComponentLayoutContainer;
            }

            if (role == ProjectFolderRole.Binary)
            {
                this.txtTemplateFormat.IsEnabled = false;
                this.txtSchemaNames.IsEnabled = false;

                this.txtTemplateFormat.Text = null;
                this.txtSchemaNames.Text = null;

                this._TridionRole = TridionRole.MultimediaComponentContainer;
            }

            if (role == ProjectFolderRole.Other)
            {
                this.txtTemplateFormat.IsEnabled = false;
                this.txtSchemaNames.IsEnabled = false;

                this.txtTemplateFormat.Text = null;
                this.txtSchemaNames.Text = null;

                this._TridionRole = TridionRole.Other;
            }

            List<TridionFolderInfo> items = this.TridionFolders.Where(x => x.TridionRole == this._TridionRole).ToList();
            this.lstTridionFolders.ItemsSource = items;
            this.lstTridionFolders.DisplayMemberPath = "NamedPathCut2";
            this.lstTridionFolders.SelectedIndex = 0;
            this.lstTridionFolders.IsEnabled = items.Count > 1;
        }