public void Setup()
        {
            IEnumerable <string> enabledFeatures = null;

            if (!string.IsNullOrEmpty(EnabledFeatures))
            {
                enabledFeatures = EnabledFeatures
                                  .Split(',')
                                  .Select(s => s.Trim())
                                  .Where(s => !string.IsNullOrEmpty(s));
            }
            Recipe = String.IsNullOrEmpty(Recipe) ? "Default" : Recipe;

            var setupContext = new SetupContext {
                SiteName                 = SiteName,
                AdminUsername            = AdminUsername,
                AdminPassword            = AdminPassword,
                DatabaseProvider         = DatabaseProvider,
                DatabaseConnectionString = DatabaseConnectionString,
                DatabaseTablePrefix      = DatabaseTablePrefix,
                EnabledFeatures          = enabledFeatures,
                Recipe = Recipe,
            };

            _setupService.Setup(setupContext);

            Context.Output.WriteLine(T("Site \"{0}\" successfully setup to run data provider \"{1}\" (with table prefix \"{2}\") and configured by recipe \"{3}\"",
                                       setupContext.SiteName,
                                       setupContext.DatabaseProvider,
                                       setupContext.DatabaseTablePrefix,
                                       setupContext.Recipe));
        }
Example #2
0
        public void Setup()
        {
            IEnumerable <string> enabledFeatures = null;

            if (!String.IsNullOrEmpty(EnabledFeatures))
            {
                enabledFeatures = EnabledFeatures
                                  .Split(',')
                                  .Select(s => s.Trim())
                                  .Where(s => !String.IsNullOrEmpty(s));
            }
            Recipe = String.IsNullOrEmpty(Recipe) ? "Default" : Recipe;

            var setupContext = new SetupContext {
                SiteName                 = SiteName,
                AdminUsername            = AdminUsername,
                AdminPassword            = AdminPassword,
                DatabaseProvider         = DatabaseProvider,
                DatabaseConnectionString = DatabaseConnectionString,
                DatabaseTablePrefix      = DatabaseTablePrefix,
                EnabledFeatures          = enabledFeatures,
                Recipe = Recipe,
            };

            var executionId = _setupService.Setup(setupContext);

            Context.Output.WriteLine(T("Setup of site '{0}' was started with recipe execution ID {1}. Use the 'recipes result' command to check the result of the execution.", setupContext.SiteName, executionId));
        }
Example #3
0
            public GenShader(RenderPipeline rp, RenderingMode rm, EnabledFeatures enabledFeatures)
            {
                m_RenderingMode   = rm;
                m_EnabledFeatures = enabledFeatures;

                switch (rp)
                {
                case RenderPipeline.BuiltIn:
                    AddPass(CullMode.Front);
                    if (rm == RenderingMode.MultiPass)
                    {
                        AddPass(CullMode.Back);
                    }
                    m_RenderPipeline = SRPHelper.RenderPipeline.BuiltIn;
                    break;

                case RenderPipeline.URP:
                    AddPass(CullMode.Front);
                    m_RenderPipeline = SRPHelper.RenderPipeline.URP;
                    break;

                case RenderPipeline.HDRP:
                    AddPass(CullMode.Front);
                    m_RenderPipeline = SRPHelper.RenderPipeline.HDRP;
                    break;
                }
            }
Example #4
0
        public void Init()
        {
            var builder = new ContainerBuilder();

            // register the stuff we'll need
            // we mock the INotifier: we don't really need to test that anyway
            builder.RegisterInstance(new Mock <INotifier>().Object).As <INotifier>();
            // register the deafault GDPR provider
            builder.RegisterType <GDPRKeyFeaturesProvider>().As <IKeyFeaturesProvider>();
            // register the provider from CommunicationGateway
            builder.RegisterType <ContactGDPRKeyFeaturesProvider>().As <IKeyFeaturesProvider>();
            // register the providers from the Mobile module
            builder.RegisterType <MobileGDPRKeyFeaturesProvider>().As <IKeyFeaturesProvider>();
            builder.RegisterType <SmsGatewayGDPRKeyFeaturesProvider>().As <IKeyFeaturesProvider>();
            builder.RegisterType <SmsExtensionGDPRKeyFeaturesProvider>().As <IKeyFeaturesProvider>();
            builder.RegisterType <PushGatewayGDPRKeyFeaturesProvider>().As <IKeyFeaturesProvider>();
            // register the providers for the OpenAuthentication module
            builder.RegisterType <OpenAuthKeyFeaturesProvider>().As <IKeyFeaturesProvider>();

            // We mock the IFeatureManager: normally, when there is a request to enable a feature it goes through
            // a bunch of methods before it's actually enabled and the events raised. Since we want to test the behaviour
            // of the event handler and the related provider, we mock all that away.
            var featureManager = new Mock <IFeatureManager>();

            //
            featureManager.Setup(fm => fm.GetDisabledFeatures())
            .Returns(() => {
                var enabled = EnabledFeatures ?? new List <string>();
                return(AllKeyFeaturesForTheTest().Where(fd => !enabled.Contains(fd.Id)));
            });

            featureManager.Setup(fm => fm.EnableFeatures(It.IsAny <IEnumerable <string> >()))
            .Returns <IEnumerable <string> >(names => {
                EnabledFeatures = EnabledFeatures ?? new List <string>();
                EnabledFeatures.AddRange(names);
                var handler = _container.Resolve <IFeatureEventHandler>();
                foreach (var name in names)
                {
                    handler.Enabled(new Feature()
                    {
                        Descriptor = new FeatureDescriptor {
                            Id = name
                        }
                    });
                }
                return(names);
            });

            _featureManager = featureManager.Object;
            builder.RegisterInstance(_featureManager).As <IFeatureManager>();

            // Register the handler we are testing
            builder.RegisterType <GDPRFeaturesEventHandler>().As <IFeatureEventHandler>();

            EnabledFeatures = new List <string>();

            _container = builder.Build();
        }
Example #5
0
        public static Shader Generate(RenderPipeline rp, RenderingMode rm, EnabledFeatures enabledFeatures)
        {
            // The instance might not be accessible yet, when called from Config.OnEnable for instance if the Config is enabled before the ShaderGenerator.
            // In this case we don't generate the shader right away, we store the parameters instead and we'll generate the shader in ShaderGenerator.OnEnable.
            if (Instance == null)
            {
                ms_GenerationParamOnEnable = new GenerationParam {
                    renderPipeline = rp, renderingMode = rm, enabledFeatures = enabledFeatures
                };
                return(null);
            }

            return(new GenShader(rp, rm, enabledFeatures).Generate());
        }
        private void MyInitializeComponent(EnabledFeatures features)
        {
            Text = id > 0 ? _text : Environment.StringResources.GetString("DocumentSearch");

            cbInFound.Visible = ((features & EnabledFeatures.SearchInFound) > 0);
            cbToFound.Visible = ((features & EnabledFeatures.AddToFound) > 0);
            cbInFound.Left    = 8;
            cbToFound.Left    = 8 +
                                (cbToFound.Visible ? cbToFound.Width + 8 : 0);
            panel2.Size = new Size(520, cbInFound.Visible || cbToFound.Visible ? 24 : 0);

            bClear.Visible  = ((features & EnabledFeatures.Clear) > 0);
            bSaveAs.Visible = ((features & EnabledFeatures.SaveAs) > 0);

            bSave.Visible = ((features & EnabledFeatures.Save) > 0);
            bSave.Visible = (bSave.Visible && id > 0 && !bSaveAs.Visible);
            bSaveAs.Text  = (id == 0)
                                                           ? Environment.StringResources.GetString("SaveInquiry")
                                                           : Environment.StringResources.GetString("SaveAs") + " ...";

            bSearch.Visible = ((features & EnabledFeatures.Search) > 0);

            bSearch.Left = 8;
            bCancel.Left = 8 +
                           (bSearch.Visible ? bSearch.Width + 8 : 0);

            bSave.Left = 8 +
                         (bSearch.Visible ? bSearch.Width + 8 : 0) +
                         (bCancel.Visible ? bCancel.Width + 8 : 0);
            AcceptButton = (bSearch.Visible) ? bSearch : bSave;
            bSaveAs.Left = 8 +
                           (bSearch.Visible ? bSearch.Width + 8 : 0) +
                           (bCancel.Visible ? bCancel.Width + 8 : 0) +
                           (bSave.Visible ? bSave.Width + 8 : 0);
            panel3.Width = 8 +
                           (bSearch.Visible ? bSearch.Width + 8 : 0) +
                           (bCancel.Visible ? bCancel.Width + 8 : 0) +
                           (bSave.Visible ? bSave.Width + 8 : 0) +
                           (bSaveAs.Visible ? bSaveAs.Width + 8 : 0);
            lv_ItemCheckEventHandler = lv_ItemCheck;
            lv.ItemCheck            += lv_ItemCheckEventHandler;
        }
        private OptionsDialog(string xml, int id, EnabledFeatures features)
        {
            this.xml = new XmlDocument();
            this.id  = id;

            if (id > 0)
            {
                LoadXML(id);
            }
            else if (xml != null)
            {
                LoadXML(xml);
            }
            else
            {
                InitXML();
            }

            this.features = features;

            InitializeComponent();
        }
 public OptionsDialog(int id, EnabledFeatures features)
     : this(null, id, features)
 {
 }
 public OptionsDialog(EnabledFeatures features)
     : this(null, 0, features)
 {
 }
 public OptionsDialog(string xml, EnabledFeatures features)
     : this(xml, 0, features)
 {
 }
Example #11
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="UmbracoFeatures" /> class.
 /// </summary>
 public UmbracoFeatures()
 {
     Disabled = new DisabledFeatures();
     Enabled  = new EnabledFeatures();
 }
 public XmlSearchForm(int id, EnabledFeatures features) : base(id, features)
 {
     StartPosition = FormStartPosition.CenterScreen;
 }
 public XmlSearchForm(string xml, EnabledFeatures features) : base(xml, features)
 {
     StartPosition = FormStartPosition.CenterScreen;
 }
Example #14
0
            public string Generate(SRPHelper.RenderPipeline rp, RenderingMode rm, EnabledFeatures enabledFeatures, int passID, int passCount)
            {
                var code = LoadText(Instance.textAssetPass);

                code = code.Replace("{VLB_GEN_CULLING}", m_CullMode.ToString());
                code = code.Replace("{VLB_GEN_PRAGMA_INSTANCING}", rm == RenderingMode.GPUInstancing ? "#pragma multi_compile_instancing" : "");
                code = code.Replace("{VLB_GEN_PRAGMA_FOG}", IsFogSupported(rp) ? "#pragma multi_compile_fog" : "");

                string multiCompileVariants = "";

                AppendMultiCompile(ref multiCompileVariants, true, ShaderKeywords.AlphaAsBlack);
                if (enabledFeatures.noise3D)
                {
                    AppendMultiCompile(ref multiCompileVariants, true, ShaderKeywords.Noise3D);
                }
                if (enabledFeatures.depthBlend)
                {
                    AppendMultiCompile(ref multiCompileVariants, true, ShaderKeywords.DepthBlend);
                }
                switch (enabledFeatures.colorGradient)
                {
                case FeatureEnabledColorGradient.HighOnly:      AppendMultiCompile(ref multiCompileVariants, true, ShaderKeywords.ColorGradientMatrixHigh); break;

                case FeatureEnabledColorGradient.HighAndLow:    AppendMultiCompile(ref multiCompileVariants, true, ShaderKeywords.ColorGradientMatrixHigh, ShaderKeywords.ColorGradientMatrixLow); break;
                }
                if (enabledFeatures.dynamicOcclusion)
                {
                    AppendMultiCompile(ref multiCompileVariants, true, ShaderKeywords.OcclusionClippingPlane, ShaderKeywords.OcclusionDepthTexture);
                }
                if (enabledFeatures.meshSkewing)
                {
                    AppendMultiCompile(ref multiCompileVariants, true, ShaderKeywords.MeshSkewing);
                }
                if (enabledFeatures.shaderAccuracyHigh)
                {
                    AppendMultiCompile(ref multiCompileVariants, true, ShaderKeywords.ShaderAccuracyHigh);
                }
                code = code.Replace("{VLB_GEN_PRAGMA_MULTI_COMPILE_VARIANTS}", multiCompileVariants);

                var lang = GetShaderLangage(rp);

                code = code.Replace("{VLB_GEN_PROGRAM_PRE}", GetShaderLangagePre(lang));
                code = code.Replace("{VLB_GEN_PROGRAM_POST}", GetShaderLangagePost(lang));

                var passPre = "";

                if (passCount > 1)
                {
                    code = code.Replace("{VLB_GEN_INPUT_VS}", string.Format("{0}", passID));
                    code = code.Replace("{VLB_GEN_INPUT_FS}", string.Format("{0}", passID));
                }
                else
                {
                    code     = code.Replace("{VLB_GEN_INPUT_VS}", string.Format("{0}", "v.texcoord.y"));
                    code     = code.Replace("{VLB_GEN_INPUT_FS}", string.Format("{0}", "i.cameraPosObjectSpace_outsideBeam.w"));
                    passPre += "                #define VLB_PASS_OUTSIDEBEAM_FROM_VS_TO_FS 1" + System.Environment.NewLine;
                }

                if (rp != SRPHelper.RenderPipeline.BuiltIn)
                {
                    passPre += "                #define VLB_SRP_API 1" + System.Environment.NewLine;

                    if (rm == RenderingMode.SRPBatcher)
                    {
                        passPre += "                #define VLB_SRP_BATCHER 1" + System.Environment.NewLine;

                        if (rp == SRPHelper.RenderPipeline.URP)
                        {
                            // force enable constant buffers to fix SRP Batcher support on Android
                            passPre += "                #pragma enable_cbuffer" + System.Environment.NewLine;
                        }
                    }
                }

                if (enabledFeatures.dithering)
                {
                    passPre += "                #define VLB_DITHERING 1" + System.Environment.NewLine;
                }

                passPre += LoadText(Instance.GetTextAssetIncludes(rp));

                code = code.Replace("{VLB_GEN_PRE}", passPre);

                return(code);
            }