Esempio n. 1
0
        /*
         * /// <summary>
         * /// Gets a value that indicates whether VisualTip is referenced in the current application.
         * /// </summary>
         * /// <returns></returns>
         * public static bool IsReferenced
         * {
         *      get
         *      {
         *              if (_IsReferenced == 0)
         *              {
         *                      _IsReferenced = (Type.GetType("Skybound.VisualTips.VisualTip, Skybound.VisualTips", false) == null) ? 1 : 2;
         *              }
         *              return _IsReferenced == 2;
         *      }
         * }
         * static int _IsReferenced;
         */

        /// <summary>
        /// Installs a VisualTip extender.
        /// </summary>
        public static void SetExtender(Type controlType, IVisualTipExtender extender)
        {
            if (SetExtenderMethod == null && !SetExtenderChecked)
            {
                SetExtenderChecked = true;
                Type providerType = Type.GetType("Skybound.VisualTips.VisualTipProvider, Skybound.VisualTips");
                if (providerType != null)
                {
                    SetExtenderMethod = providerType.GetMethod("SetExtender", BindingFlags.Static | BindingFlags.NonPublic, null,
                                                               new Type [] { typeof(Type), typeof(object) }, null);
                }
            }

            if (SetExtenderMethod != null)
            {
                SetExtenderMethod.Invoke(null, new object [] { controlType, extender });
            }
        }
Esempio n. 2
0
		/*
		/// <summary>
		/// Gets a value that indicates whether VisualTip is referenced in the current application.
		/// </summary>
		/// <returns></returns>
		public static bool IsReferenced
		{
			get
			{
				if (_IsReferenced == 0)
				{
					_IsReferenced = (Type.GetType("Skybound.VisualTips.VisualTip, Skybound.VisualTips", false) == null) ? 1 : 2;
				}
				return _IsReferenced == 2;
			}
		}
		static int _IsReferenced;
		*/
		
		/// <summary>
		/// Installs a VisualTip extender.
		/// </summary>
		public static void SetExtender(Type controlType, IVisualTipExtender extender)
		{
			if (SetExtenderMethod == null && !SetExtenderChecked)
			{
				SetExtenderChecked = true;
				Type providerType = Type.GetType("Skybound.VisualTips.VisualTipProvider, Skybound.VisualTips");
				if (providerType != null)
				{
					SetExtenderMethod = providerType.GetMethod("SetExtender", BindingFlags.Static | BindingFlags.NonPublic, null,
						new Type [] { typeof(Type), typeof(object) }, null);
				}
			}
			
			if (SetExtenderMethod != null)
			{
				SetExtenderMethod.Invoke(null, new object [] { controlType, extender } );
			}
		}