NMF.Models.Repository.ModelRepository.Resolve C# (CSharp) Method

Resolve() public method

Resolves the given Uri and returns the model element
public Resolve ( Uri uri, bool loadOnDemand = true ) : IModelElement
uri System.Uri The Uri where to look for the model element
loadOnDemand bool A boolean flag indicating whether the uri should be attempted /// to load, if the model is not already registered with the repository
return IModelElement
        public IModelElement Resolve(Uri uri, bool loadOnDemand = true)
        {
            return Resolve(uri, null, loadOnDemand);
        }

Same methods

ModelRepository::Resolve ( Uri uri, string hintPath, bool loadOnDemand = true ) : IModelElement
ModelRepository::Resolve ( string path ) : Model

Usage Example

示例#1
0
文件: A2BTest.cs 项目: NMFCode/NMF
        public void A2BTestSuceeds()
        {
            //absolute path is needed for the execution from a junit test
            var absolutePathInputModel1 = "A2B\\SampleInput.xmi";

            //load input models
            var repository = new ModelRepository();
            var inputModel1 = repository.Resolve(absolutePathInputModel1);

            if (inputModel1 == null)
            {
                throw new FileNotFoundException("One of the Input Models was not found");
            }

            var inputModelContainer = new InputModelContainer(inputModel1);
            var outputModelContainer = new OutputModelContainer();

            var direction = SynchronizationDirection.LeftToRight;
            var changePropagartion = ChangePropagationMode.OneWay;
            A2BHelperWithoutContext transformation = new A2BHelperWithoutContext();

            A2BHelperWithoutContext.InputModelContainer = inputModelContainer;

            var context = transformation.Synchronize<InputModelContainer, OutputModelContainer>(transformation.SynchronizationRule<A2BHelperWithoutContext.Model2ModelMainRule>(), ref inputModelContainer, ref outputModelContainer, direction, changePropagartion);
        }
All Usage Examples Of NMF.Models.Repository.ModelRepository::Resolve