public override void InitializeContext()
            {
                base.InitializeContext();

                this.PatternModel = PatternModelSpec.TailorPatternModel(this.PatternModel, new Version("1.0.0.0"));
                this.PatternModel.Pattern.WithTransaction(pattern => pattern.DisableCustomization());
            }
            public override void InitializeContext()
            {
                base.InitializeContext();

                this.PatternModel = PatternModelSpec.TailorPatternModel(this.PatternModel, new Version("1.0.0.0"));

                // Reassign tailored element
                this.Property = this.PatternModel.Pattern.Properties[0];
            }
            public override void InitializeContext()
            {
                base.InitializeContext();

                this.PatternModel = PatternModelSpec.TailorPatternModel(this.PatternModel, new Version("1.0.0.0"));

                var setting = this.Property.Policy.Settings
                              .First(s => s.PropertyId == Reflector <PropertySchema> .GetProperty(prop => prop.RawDefaultValue).Name);

                setting.WithTransaction(s => s.Disable());
            }
예제 #4
0
            public void InitializeContext()
            {
                var store = new DslTestStore <PatternModelDomainModel>();

                var serviceProvider = Mock.Get(store.ServiceProvider);

                serviceProvider.Setup(s => s.GetService(typeof(IPatternManager))).Returns(
                    Mock.Of <IPatternManager>(p => p.InstalledToolkits == new List <IInstalledToolkitInfo>()));

                PatternModelSchema authoredPatternModel = null;

                store.TransactionManager.DoWithinTransaction(() =>
                {
                    authoredPatternModel = store.ElementFactory.CreateElement <PatternModelSchema>();
                });

                var uriService = Mock.Of <IUriReferenceService>(
                    u => u.ResolveUri <IInstanceBase>(It.IsAny <Uri>()) == Mock.Of <IProduct>(p =>
                                                                                              p.ToolkitInfo.Identifier == "AuthoredToolkit"));

                var patternSchema = authoredPatternModel.Create <PatternSchema>();

                patternSchema.Name        = "FooPattern";
                patternSchema.PatternLink = "patternmanager://foo";
                patternSchema.UriService  = uriService;

                this.view      = patternSchema.Create <ViewSchema>();
                this.view.Name = "View1";

                store.TransactionManager.DoWithinTransaction(() =>
                {
                    this.authoredExtensionPoint = store.ElementFactory.CreateElement <ExtensionPointSchema>("ExtensionPoint1");
                    this.view.ExtensionPoints.Add(this.authoredExtensionPoint);
                });

                // Customize Toolkit
                var tailoredUriService = Mock.Of <IUriReferenceService>(
                    u => u.ResolveUri <IInstanceBase>(It.IsAny <Uri>()) == Mock.Of <IProduct>(p =>
                                                                                              p.ToolkitInfo.Identifier == "TailoredToolkit"));

                var tailoredPatternModel = PatternModelSpec.TailorPatternModel(authoredPatternModel, new Version("1.0.0.0"), "AuthoredToolkit");

                store.TransactionManager.DoWithinTransaction(() =>
                {
                    tailoredPatternModel.Pattern.UriService = tailoredUriService;
                    tailoredPatternModel.BaseId             = "AuthoredToolkit";
                });

                this.tailoredExtensionPoint = tailoredPatternModel.Pattern.Views[0].ExtensionPoints[0];
            }
예제 #5
0
            public override void InitializeContext()
            {
                base.InitializeContext();

                this.PatternModel.Store.TransactionManager.DoWithinTransaction(() =>
                {
                    var view     = this.PatternModel.Pattern.Create <ViewSchema>();
                    this.Element = view.Create <ElementSchema>();
                });

                this.PatternModel = PatternModelSpec.TailorPatternModel(this.PatternModel, new Version("1.0.0.0"));

                this.Element = this.PatternModel.Pattern.Views[0].Elements[0] as ElementSchema;
            }
예제 #6
0
            public override void InitializeContext()
            {
                base.InitializeContext();

                this.PatternModel = PatternModelSpec.TailorPatternModel(this.PatternModel, new Version("1.0.0.0"));
            }