当前位置: 首页>>代码示例>>C#>>正文


C# Context.EditingContext类代码示例

本文整理汇总了C#中Microsoft.Data.Entity.Design.Base.Context.EditingContext的典型用法代码示例。如果您正苦于以下问题:C# EditingContext类的具体用法?C# EditingContext怎么用?C# EditingContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EditingContext类属于Microsoft.Data.Entity.Design.Base.Context命名空间,在下文中一共展示了EditingContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateViewModel

        internal static MappingViewModel CreateViewModel(EditingContext ctx, EFObject selection)
        {
            // clear out the xref so its clean for this new view model
            var xref = ModelToMappingModelXRef.GetModelToMappingModelXRef(ctx);
            xref.Clear();

            // we might be creating a view model for an entity or an association or a FunctionImport
            var entityType = selection as EntityType;
            var association = selection as Association;
            var fim = selection as FunctionImportMapping;

            // create the view model root
            MappingEFElement root = null;
            if (entityType != null)
            {
                root = ModelToMappingModelXRef.GetNewOrExisting(ctx, entityType, null);
            }
            else if (association != null)
            {
                root = ModelToMappingModelXRef.GetNewOrExisting(ctx, association, null);
            }
            else if (fim != null)
            {
                root = ModelToMappingModelXRef.GetNewOrExisting(ctx, fim, null);
            }
            else
            {
                throw new ArgumentException("selection");
            }

            return new MappingViewModel(ctx, root);
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:32,代码来源:MappingViewModelHelper.cs

示例2: RecalculateResults

        internal void RecalculateResults(EditingContext context, ModelSearchResults modelSearchResults)
        {
            // reset all old IsInSearchResults values
            foreach (var oldSearchResult in Results)
            {
                oldSearchResult.IsInSearchResults = false;
            }

            // now recalculate the results based on the new ModelSearchResults
            Reset();
            _targetString = modelSearchResults.TargetString;
            _elementTextToSearch = modelSearchResults.ElementTextToSearch;
            var modelToExplorerModelXRef = ModelToExplorerModelXRef.GetModelToBrowserModelXRef(context);
            if (null != modelToExplorerModelXRef)
            {
                // add all the ExplorerEFElements to _results
                foreach (var result in modelSearchResults.Results)
                {
                    var resultsExplorerElement = modelToExplorerModelXRef.GetExisting(result);
                    if (resultsExplorerElement != null)
                    {
                        resultsExplorerElement.IsInSearchResults = true;
                        _results.Add(resultsExplorerElement);
                    }
                }

                // now sort _results according to the order they appear in the Explorer
                SortResults();
            }
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:30,代码来源:ExplorerSearchResults.cs

示例3: MappingFunctionEntityType

 public MappingFunctionEntityType(EditingContext context, EntityType entityType, MappingEFElement parent)
     : base(context, entityType, parent)
 {
     _insertMapping = new MappingModificationFunctionMapping(context, null, this, ModificationFunctionType.Insert);
     _updateMapping = new MappingModificationFunctionMapping(context, null, this, ModificationFunctionType.Update);
     _deleteMapping = new MappingModificationFunctionMapping(context, null, this, ModificationFunctionType.Delete);
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:7,代码来源:MappingFunctionEntityType.cs

示例4: ExplorerDiagrams

        public ExplorerDiagrams(EditingContext context, Diagrams diagrams, ExplorerEFElement parent)
            : base(context, diagrams, parent)
        {
            var name = Resources.DiagramTypesGhostNodeName;
            base.Name = name;

            _typesGhostNode = new ExplorerTypes(name, context, this);
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:8,代码来源:ExplorerDiagrams.cs

示例5: ExplorerEntityContainerAssociationSets

 public ExplorerEntityContainerAssociationSets(string name, EditingContext context, ExplorerEFElement parent)
     : base(context, null, parent)
 {
     if (name != null)
     {
         base.Name = name;
     }
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:8,代码来源:ExplorerEntityContainerAssociationSets.cs

示例6: MappingAssociation

 public MappingAssociation(EditingContext context, Association assoc, MappingEFElement parent)
     : base(context, assoc, parent)
 {
     Debug.Assert(assoc != null, "MappingAssociation cannot accept a null Association");
     Debug.Assert(
         assoc.AssociationSet != null,
         "MappingAssociation cannot accept an Association " + assoc.ToPrettyString() + " with a null AssociationSet");
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:8,代码来源:MappingAssociation.cs

示例7: ExplorerEnumTypes

 public ExplorerEnumTypes(string name, EditingContext context, ExplorerEFElement parent)
     : base(context, null, parent)
 {
     if (name != null)
     {
         base.Name = name;
     }
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:8,代码来源:ExplorerEnumTypes.cs

示例8: ExplorerProperty

 public ExplorerProperty(EditingContext context, Property property, ExplorerEFElement parent)
     : base(context, property, parent)
 {
     if (null != property)
     {
         _isKeyProperty = property.IsKeyProperty;
     }
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:8,代码来源:ExplorerProperty.cs

示例9: ExplorerFunctionImports

 public ExplorerFunctionImports(string name, EditingContext context, ExplorerEFElement parent)
     : base(context, null, parent)
 {
     if (name != null)
     {
         base.Name = name;
     }
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:8,代码来源:ExplorerFunctionImports.cs

示例10: GetEditingContext

        public static EditingContext GetEditingContext(this EFArtifact artifact)
        {
            Debug.Assert(artifact != null, "artifact != null");

            var service = new EFArtifactService(artifact);
            var editingContext = new EditingContext();
            editingContext.SetEFArtifactService(service);
            return editingContext;
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:9,代码来源:EFArtifactExtensions.cs

示例11: GetArtifactUri

 internal static Uri GetArtifactUri(EditingContext context)
 {
     var item = GetArtifact(context);
     if (item != null)
     {
         return item.Uri;
     }
     return null;
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:9,代码来源:EditingContextManager.cs

示例12: CreateViewModel

        public override void CreateViewModel(EditingContext ctx)
        {
            var service = ctx.GetEFArtifactService();
            Debug.Assert(service != null, "Null service in ExplorerViewModelHelper.CreateViewModel()");
            var artifact = service.Artifact;
            Debug.Assert(artifact != null, "Null artifact in ExplorerViewModelHelper.CreateViewModel()");

            var xref = ModelToExplorerModelXRef.GetModelToBrowserModelXRef(ctx);
            xref.Clear();

            var edmRootNode = new ExplorerRootNode(ctx, null, artifact.Uri);

            var designerInfo = artifact.DesignerInfo();
            if (designerInfo != null
                && designerInfo.Diagrams != null)
            {
                var explorerDiagrams = (ExplorerDiagrams)
                                       ModelToExplorerModelXRef.GetNewOrExisting(
                                           ctx, designerInfo.Diagrams, edmRootNode, typeof(ExplorerDiagrams));
                edmRootNode.Diagrams = explorerDiagrams;
            }

            if (artifact.ConceptualModel() != null)
            {
                var browserCsdlEntityModel = (ExplorerConceptualEntityModel)
                                             ModelToExplorerModelXRef.GetNewOrExisting(
                                                 ctx, artifact.ConceptualModel(), edmRootNode, typeof(ExplorerConceptualEntityModel));
                edmRootNode.ConceptualModel = browserCsdlEntityModel;
            }

            if (artifact.StorageModel() != null)
            {
                var browserSsdlEntityModel = (ExplorerStorageEntityModel)
                                             ModelToExplorerModelXRef.GetNewOrExisting(
                                                 ctx, artifact.StorageModel(), edmRootNode, typeof(ExplorerStorageEntityModel));
                edmRootNode.StorageModel = browserSsdlEntityModel;
            }

            // expand the tree view so that the Conceptual, Storage Models, and Diagram nodes are visible
            if (edmRootNode.Diagrams != null)
            {
                edmRootNode.Diagrams.Types.ExpandTreeViewToMe();
            }

            if (edmRootNode.ConceptualModel != null)
            {
                edmRootNode.ConceptualModel.Types.ExpandTreeViewToMe();
            }

            if (edmRootNode.StorageModel != null)
            {
                edmRootNode.StorageModel.Types.ExpandTreeViewToMe();
            }

            base.ViewModel = new ExplorerViewModel(ctx, edmRootNode);
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:56,代码来源:EntityDesignExplorerViewModelHelper.cs

示例13: MappingModificationFunctionMapping

 public MappingModificationFunctionMapping(EditingContext context, ModificationFunction functionMapping, MappingEFElement parent)
     : base(context, functionMapping, parent)
 {
     if (functionMapping != null)
     {
         _functionType = functionMapping.FunctionType;
         _properties = new MappingFunctionScalarProperties(context, functionMapping, this);
         _resultBindings = new MappingResultBindings(context, functionMapping, this);
     }
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:10,代码来源:MappingModificationFunctionMapping.cs

示例14: ExplorerTypes

        public ExplorerTypes(string name, EditingContext context, ExplorerEFElement parent)
            : base(context, null, parent)
        {
            if (name != null)
            {
                base.Name = name;
            }

            _isConceptual = (typeof(ExplorerConceptualEntityModel) == parent.GetType()) ? true : false;
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:10,代码来源:ExplorerTypes.cs

示例15: ExplorerStorageEntityModel

 public ExplorerStorageEntityModel(EditingContext context, StorageEntityModel entityModel, ExplorerEFElement parent)
     : base(context, entityModel, parent)
 {
     _typesGhostNode = new ExplorerTypes(
         Resources.StorageTypesGhostNodeName, context, this);
     _funcsGhostNode = new ExplorerFunctions(
         Resources.StorageFunctionsGhostNodeName, context, this);
     _assocsGhostNode = new ExplorerAssociations(
         Resources.StorageAssociationsGhostNodeName, context, this);
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:10,代码来源:ExplorerStorageEntityModel.cs


注:本文中的Microsoft.Data.Entity.Design.Base.Context.EditingContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。