Ejemplo n.º 1
0
        public ActiveScriptWrapper64(string progID, WindowsScriptEngineFlags flags)
        {
            // ReSharper disable SuspiciousTypeConversion.Global

            pActiveScript                 = ActivationHelpers.CreateInstance <IActiveScript>(progID);
            pActiveScriptParse            = UnknownHelpers.QueryInterface <IActiveScriptParse64>(pActiveScript);
            pActiveScriptDebug            = UnknownHelpers.QueryInterface <IActiveScriptDebug64>(pActiveScript);
            pActiveScriptGarbageCollector = UnknownHelpers.QueryInterfaceNoThrow <IActiveScriptGarbageCollector>(pActiveScript);
            pDebugStackFrameSniffer       = UnknownHelpers.QueryInterfaceNoThrow <IDebugStackFrameSnifferEx64>(pActiveScript);

            activeScript                 = (IActiveScript)Marshal.GetObjectForIUnknown(pActiveScript);
            activeScriptParse            = (IActiveScriptParse64)activeScript;
            activeScriptDebug            = (IActiveScriptDebug64)activeScript;
            activeScriptGarbageCollector = activeScript as IActiveScriptGarbageCollector;
            debugStackFrameSniffer       = activeScript as IDebugStackFrameSnifferEx64;

            if (flags.HasFlag(WindowsScriptEngineFlags.EnableStandardsMode))
            {
                var activeScriptProperty = activeScript as IActiveScriptProperty;
                if (activeScriptProperty != null)
                {
                    object name;
                    activeScriptProperty.GetProperty(ScriptProp.Name, IntPtr.Zero, out name);
                    if (Equals(name, "JScript"))
                    {
                        object value = ScriptLanguageVersion.Standards;
                        activeScriptProperty.SetProperty(ScriptProp.InvokeVersioning, IntPtr.Zero, ref value);
                    }
                }

                if (!flags.HasFlag(WindowsScriptEngineFlags.DoNotEnableVTablePatching) && MiscHelpers.IsX86InstructionSet())
                {
                    HostItem.EnableVTablePatching = true;
                }
            }

            // ReSharper restore SuspiciousTypeConversion.Global
        }
Ejemplo n.º 2
0
        public async Task Test_ShowAsync_With_NavigateBackWhile_Preserves_Current_ShowViewAction()
        {
            Locator.CurrentMutable.Register(() => new TestViewModel(), typeof(TestViewModel));
            Locator.CurrentMutable.Register(() => new OtherViewModel(), typeof(OtherViewModel));

            Router = new Router(new Navigator());

            var initParams = new RouterBuilder()
                             .When <TestViewModel>(r => r.NavigateAsRoot())
                             .When <OtherViewModel>(r => r.Navigate())
                             .Build();

            await Router.InitAsync(initParams);

            await Router.ShowAsync(typeof(OtherViewModel), new TestParams());

            await Router.ShowAsync(typeof(TestViewModel), new TestParams());

            var state = (RouterState)(await ActivationHelpers.GetObjectStateAsync(Router)).State;

            Assert.Collection(state.Actions,
                              a => a.Action.As <ShowViewModelAction>().ActivationParams.Type.Should().Be <TestViewModel>());
        }
Ejemplo n.º 3
0
 public void LaunchKeyActivation()
 {
     ActivationHelpers.DisplayActivationApp(ActivationHelpers.GetActivationAppPath(), TrialFeatureID, "Register your keys");
     Browser.LoadURL(LoginURL);
 }
Ejemplo n.º 4
0
        public bool IsCommercialKeyActivated()
        {
            if (ActivatedFeatureID != null)
            {
                return(true);
            }

#if BRIDGE
#if SILVERLIGHTCOMPATIBLEVERSION
            if (ActivationHelpers.IsFeatureEnabled(Constants.SL_MIGRATION_EDITION_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.SL_MIGRATION_EDITION_FEATURE_ID;
            }
#else
            if (ActivationHelpers.IsFeatureEnabled(Constants.ENTERPRISE_EDITION_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.ENTERPRISE_EDITION_FEATURE_ID;
            }
            else if (ActivationHelpers.IsFeatureEnabled(Constants.PROFESSIONAL_EDITION_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.PROFESSIONAL_EDITION_FEATURE_ID;
            }
            else if (ActivationHelpers.IsFeatureEnabled(Constants.COMMERCIAL_EDITION_S_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.COMMERCIAL_EDITION_S_FEATURE_ID;
            }
            else if (ActivationHelpers.IsFeatureEnabled(Constants.COMMERCIAL_EDITION_L_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.COMMERCIAL_EDITION_L_FEATURE_ID;
            }
            else if (ActivationHelpers.IsFeatureEnabled(Constants.PREMIUM_SUPPORT_EDITION_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.PREMIUM_SUPPORT_EDITION_FEATURE_ID;
            }
#endif
#else
            if (ActivationHelpers.IsFeatureEnabled(Constants.SL_MIGRATION_EDITION_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.SL_MIGRATION_EDITION_FEATURE_ID;
            }
            else if (ActivationHelpers.IsFeatureEnabled(Constants.ENTERPRISE_EDITION_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.ENTERPRISE_EDITION_FEATURE_ID;
            }
            else if (ActivationHelpers.IsFeatureEnabled(Constants.PROFESSIONAL_EDITION_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.PROFESSIONAL_EDITION_FEATURE_ID;
            }
            else if (ActivationHelpers.IsFeatureEnabled(Constants.COMMERCIAL_EDITION_S_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.COMMERCIAL_EDITION_S_FEATURE_ID;
            }
            else if (ActivationHelpers.IsFeatureEnabled(Constants.COMMERCIAL_EDITION_L_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.COMMERCIAL_EDITION_L_FEATURE_ID;
            }
            else if (ActivationHelpers.IsFeatureEnabled(Constants.PREMIUM_SUPPORT_EDITION_FEATURE_ID))
            {
                ActivatedFeatureID = Constants.PREMIUM_SUPPORT_EDITION_FEATURE_ID;
            }
#endif
            bool foundKey = ActivatedFeatureID != null;
            return(foundKey);
        }