Esempio n. 1
0
        static WebView()
        {
#pragma warning disable 1065
            if (IsWebPermissionRestricted)
            {
                // Could be hosted in non-IE browser (e.g. Firefox) as an Internet-zone XBAP
                // Could also be a standalone ClickOnce application

                // Either way, we don't currently support this
                throw new NotSupportedException(DesignerUI.E_WEB_PERMISSION_RESTRICTED);
            }

            // ClickOnce uses AppLaunch.exe to host partial-trust applications
#pragma warning disable SA1129 // Do not use default value type constructor
            var hostProcessName = Path.GetFileName(UnsafeNativeMethods.GetModuleFileName(new HandleRef()));
#pragma warning restore SA1129 // Do not use default value type constructor
            if (string.Compare(hostProcessName, "AppLaunch.exe", StringComparison.OrdinalIgnoreCase) == 0)
            {
                // Not currently supported
                throw new NotSupportedException(DesignerUI.E_CLICKONCE_PARTIAL_TRUST);
            }

            // Haven't tested with MTA
            Verify.IsApartmentState(ApartmentState.STA);

            // TODO: Assign Feature Control Keys

            // We use this map to lookup which invalidator method to call when the parent's properties change
            InvalidatorMap[VisibilityProperty] = new PropertyInvalidator(OnVisibilityInvalidated);
            InvalidatorMap[IsEnabledProperty]  = new PropertyInvalidator(OnIsEnabledInvalidated);
#pragma warning restore 1065
        }
Esempio n. 2
0
        //------------------------------------------------------
        //
        //  Protected Methods
        //
        //------------------------------------------------------

        #region Protected Methods

        #region Framework Related

        /// <internalonly>
        ///     Overriden to push the values of invalidated properties down to our
        ///     ActiveX control.
        /// </internalonly>
        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
        {
            base.OnPropertyChanged(e);

            if (e.IsAValueChange || e.IsASubPropertyChange)
            {
                DependencyProperty dp = e.Property;

                // We lookup the property in our invalidatorMap
                // and call the appropriate method to push
                // down the changed value to the hosted ActiveX control.
                if (dp != null && invalidatorMap.ContainsKey(dp))
                {
                    PropertyInvalidator invalidator = (PropertyInvalidator)invalidatorMap[dp];
                    invalidator(this);
                }
            }
        }
Esempio n. 3
0
        private void Initialize()
        {
            _systemManager.LevelLoadedSignal.Connect(LevelLoadedSlot);
            _systemManager.DisposingSignal.Connect(DisposingSlot);

            _propertyInvalidator    = new PropertyInvalidator(_updateCompleteQueue);
            _sizeInvalidator        = new SizeInvalidator(_updateCompleteQueue);
            _displayListInvalidator = new DisplayListInvalidator(_updateCompleteQueue);
            _transformInvalidator   = new TransformInvalidator(_updateCompleteQueue);
            _eventInvalidator       = new EventInvalidator(_updateCompleteQueue);

            // additional handlers
            _sizeInvalidator.AdditionalHandlers.Add(AdditionalPropertyHandler);

            // additional handlers
            _displayListInvalidator.AdditionalHandlers.Add(AdditionalPropertyHandler);
            _displayListInvalidator.AdditionalHandlers.Add(AdditionalSizeHandler);
        }