Beispiel #1
0
 public override void Register(RegistrationContext context)
 {
     using (Key key = context.CreateKey(EditorRegKey))
     {
         key.SetValue(string.Empty, FactoryType.Name);
         key.SetValue("DisplayName", string.Format(CultureInfo.InvariantCulture, "#{0}", NameResourceID));
         key.SetValue("Package", context.ComponentType.GUID.ToString("B"));
         key.SetValue("CommonPhysicalViewAttributes", (int)_commonPhysicalViewAttributes);
         key.SetValue("EditorTrustLevel", (int)_trustLevel);
         using (Key key2 = key.CreateSubkey("LogicalViews"))
         {
             TypeConverter converter        = TypeDescriptor.GetConverter(typeof(LogicalView));
             object[]      customAttributes = FactoryType.GetCustomAttributes(typeof(ProvideViewAttribute), true);
             foreach (ProvideViewAttribute attribute in customAttributes)
             {
                 if (attribute.LogicalView != LogicalView.Primary)
                 {
                     Guid   guid         = (Guid)converter.ConvertTo(attribute.LogicalView, typeof(Guid));
                     string physicalView = attribute.PhysicalView ?? string.Empty;
                     key2.SetValue(guid.ToString("B"), physicalView);
                 }
             }
         }
     }
 }
Beispiel #2
0
        private ExtendVersion GetExtendVersion(string ExtenderCATID, string ExtenderName, object ExtendeeObject)
        {
            if (ExtenderName != Name)
            {
                return(ExtendVersion.None);
            }

            try
            {
                PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(ExtendeeObject);
                if (properties == null)
                {
                    return(ExtendVersion.None);
                }

                PropertyDescriptor property = properties["ItemType"];
                if (property == null)
                {
                    return(ExtendVersion.None);
                }

                object value = property.GetValue(ExtendeeObject);
                if (value == null)
                {
                    return(ExtendVersion.None);
                }

                string itemType = value.ToString();
                if (string.Equals(itemType, "Antlr3", StringComparison.OrdinalIgnoreCase))
                {
                    return(ExtendVersion.Antlr3);
                }

                if (string.Equals(itemType, "Antlr4", StringComparison.OrdinalIgnoreCase))
                {
                    return(ExtendVersion.Antlr4);
                }

                return(ExtendVersion.None);
            }
            catch (Exception ex)
            {
                if (ex.IsCritical())
                {
                    throw;
                }

                return(ExtendVersion.None);
            }
        }
Beispiel #3
0
        public static bool _GetEditor_System_Object_System_Type_System_Boolean( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

            //Parameters
            System.Object  component        = null;
            System.Type    editorBaseType   = null;
            System.Boolean noCustomTypeDesc = false;

            //ReturnType/Value
            System.Object returnVal_Real        = null;
            System.Object returnVal_Intercepted = null;

            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnVal_Real = _System_ComponentModel_TypeDescriptor.GetEditor(component, editorBaseType, noCustomTypeDesc);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnVal_Intercepted = _System_ComponentModel_TypeDescriptor.GetEditor(component, editorBaseType, noCustomTypeDesc);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
Beispiel #4
0
        public static bool _CreateDesigner_System_ComponentModel_IComponent_System_Type( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

            //Parameters
            System.ComponentModel.IComponent component = null;
            System.Type designerBaseType = null;

            //ReturnType/Value
            System.ComponentModel.Design.IDesigner returnVal_Real        = null;
            System.ComponentModel.Design.IDesigner returnVal_Intercepted = null;

            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnVal_Real = _System_ComponentModel_TypeDescriptor.CreateDesigner(component, designerBaseType);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnVal_Intercepted = _System_ComponentModel_TypeDescriptor.CreateDesigner(component, designerBaseType);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
Beispiel #5
0
        public static bool _GetDefaultProperty_System_Type( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

            //Parameters
            System.Type componentType = null;

            //ReturnType/Value
            System.ComponentModel.PropertyDescriptor returnVal_Real        = null;
            System.ComponentModel.PropertyDescriptor returnVal_Intercepted = null;

            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnVal_Real = _System_ComponentModel_TypeDescriptor.GetDefaultProperty(componentType);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnVal_Intercepted = _System_ComponentModel_TypeDescriptor.GetDefaultProperty(componentType);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
        public static bool _GetComponentName_System_Object( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

            //Parameters
            System.Object component = null;

            //ReturnType/Value
            System.String returnVal_Real        = null;
            System.String returnVal_Intercepted = null;

            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnVal_Real = _System_ComponentModel_TypeDescriptor.GetComponentName(component);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnVal_Intercepted = _System_ComponentModel_TypeDescriptor.GetComponentName(component);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
        public static bool _GetEditor_System_Object_System_Type_System_Boolean( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

               //Parameters
               System.Object component = null;
               System.Type editorBaseType = null;
               System.Boolean noCustomTypeDesc = false;

               //ReturnType/Value
               System.Object returnVal_Real = null;
               System.Object returnVal_Intercepted = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
              returnVal_Real = _System_ComponentModel_TypeDescriptor.GetEditor(component,editorBaseType,noCustomTypeDesc);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
              returnVal_Intercepted = _System_ComponentModel_TypeDescriptor.GetEditor(component,editorBaseType,noCustomTypeDesc);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) );
        }
        public static bool _GetProperties_System_Type( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

               //Parameters
               System.Type componentType = null;

               //ReturnType/Value
               System.ComponentModel.PropertyDescriptorCollection returnVal_Real = null;
               System.ComponentModel.PropertyDescriptorCollection returnVal_Intercepted = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
              returnVal_Real = _System_ComponentModel_TypeDescriptor.GetProperties(componentType);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
              returnVal_Intercepted = _System_ComponentModel_TypeDescriptor.GetProperties(componentType);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) );
        }
        public static bool _GetComponentName_System_Object( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

               //Parameters
               System.Object component = null;

               //ReturnType/Value
               System.String returnVal_Real = null;
               System.String returnVal_Intercepted = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
              returnVal_Real = _System_ComponentModel_TypeDescriptor.GetComponentName(component);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
              returnVal_Intercepted = _System_ComponentModel_TypeDescriptor.GetComponentName(component);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) );
        }
Beispiel #10
0
        public static bool _AddEditorTable_System_Type_System_Collections_Hashtable( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

            //Parameters
            System.Type editorBaseType         = null;
            System.Collections.Hashtable table = null;


            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                _System_ComponentModel_TypeDescriptor.AddEditorTable(editorBaseType, table);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                _System_ComponentModel_TypeDescriptor.AddEditorTable(editorBaseType, table);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Message == exception_Intercepted.Message));
        }
        public static bool _Refresh_System_Type( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

            //Parameters
            System.Type type = null;


            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                _System_ComponentModel_TypeDescriptor.Refresh(type);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                _System_ComponentModel_TypeDescriptor.Refresh(type);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Message == exception_Intercepted.Message));
        }
        public static bool _SortDescriptorArray_System_Collections_IList( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

            //Parameters
            System.Collections.IList infos = null;


            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                _System_ComponentModel_TypeDescriptor.SortDescriptorArray(infos);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                _System_ComponentModel_TypeDescriptor.SortDescriptorArray(infos);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Message == exception_Intercepted.Message));
        }
        public static bool _AddEditorTable_System_Type_System_Collections_Hashtable( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

               //Parameters
               System.Type editorBaseType = null;
               System.Collections.Hashtable table = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
            _System_ComponentModel_TypeDescriptor.AddEditorTable(editorBaseType,table);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
            _System_ComponentModel_TypeDescriptor.AddEditorTable(editorBaseType,table);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Message == exception_Intercepted.Message ));
        }
        public static bool _Refresh_System_Object( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

               //Parameters
               System.Object component = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
            _System_ComponentModel_TypeDescriptor.Refresh(component);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
            _System_ComponentModel_TypeDescriptor.Refresh(component);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Message == exception_Intercepted.Message ));
        }
        public static bool _SortDescriptorArray_System_Collections_IList( )
        {
            //class object
            System.ComponentModel.TypeDescriptor _System_ComponentModel_TypeDescriptor = new System.ComponentModel.TypeDescriptor();

               //Parameters
               System.Collections.IList infos = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
            _System_ComponentModel_TypeDescriptor.SortDescriptorArray(infos);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
            _System_ComponentModel_TypeDescriptor.SortDescriptorArray(infos);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Message == exception_Intercepted.Message ));
        }