コード例 #1
0
        private void RenameViewVariantCore(ViewVariant viewVariant)
        {
            var modelVariants = ((IModelViewVariants)_rootListView).Variants;

            if (_currentVariantInfo.Id == DefaultVariantId)
            {
                modelVariants[DefaultVariantId].Caption = viewVariant.VariantCaption;
                ChangeToVariant();
            }
            else if (_currentVariantInfo.Id == null)
            {
                var modelVariant = modelVariants[DefaultVariantId];
                if (modelVariant == null)
                {
                    CreateVariantNode(DefaultVariantId, modelVariants, _rootListView, viewVariant.VariantCaption);
                }
                else
                {
                    modelVariant.Caption = viewVariant.VariantCaption;
                    ChangeToVariant();
                }
            }
            else
            {
                var modelVariant = modelVariants[_currentVariantInfo.Id];
                modelVariant.Caption = viewVariant.VariantCaption;
                DeleteViewVariantCore(((IModelListViewViewClonable)_rootListView).DeleteViewOnRename);
                CreateViewVariantCore(viewVariant);
            }
        }
コード例 #2
0
        public void CreateViewVariantCore(ViewVariant viewVariant)
        {
            var modelVariants = ((IModelViewVariants)_rootListView).Variants;

            if (modelVariants.Count == 0)
            {
                CreateVariantNode(DefaultVariantId, modelVariants, _rootListView, _rootListView.Caption);
            }
            CreateVariantNode(viewVariant.ViewCaption, viewVariant.VariantCaption, modelVariants);
            ChangeToVariant();
        }