コード例 #1
0
ファイル: Instrumentation.cs プロジェクト: ash2005/z
        /// <summary>
        ///    <para>Makes an instance visible through management instrumentation.</para>
        /// </summary>
        /// <param name='instanceData'>The instance that is to be visible through management instrumentation.</param>
        public static void Publish(Object instanceData)
        {
            Type      t        = instanceData as Type;
            Assembly  assembly = instanceData as Assembly;
            IInstance instance = instanceData as IInstance;

            if (t != null)
            {
                // We were passed a 'type' to publish.  This is our cue to try to intall
                // the schema for the assembly that t belongs to
                GetInstrumentedAssembly(t.Assembly);
            }
            else if (assembly != null)
            {
                // We were passed an 'assembly' to publish.  This is our cue to try to intall
                // the schema for the assembly that t belongs to
                GetInstrumentedAssembly(assembly);
            }
            else if (instance != null)
            {
                instance.Published = true;
            }
            else
            {
                GetPublishFunction(instanceData.GetType())(instanceData);
            }
        }
コード例 #2
0
        public static void Publish(object instanceData)
        {
            Type      type     = instanceData as Type;
            Assembly  assembly = instanceData as Assembly;
            IInstance instance = instanceData as IInstance;

            if (type != null)
            {
                GetInstrumentedAssembly(type.Assembly);
            }
            else if (assembly != null)
            {
                GetInstrumentedAssembly(assembly);
            }
            else if (instance != null)
            {
                instance.Published = true;
            }
            else
            {
                GetPublishFunction(instanceData.GetType())(instanceData);
            }
        }
コード例 #3
0
 /// <summary>
 /// This method makes an instance visible through management instrumentation.
 /// </summary>
 /// <param name="o">Instance that is to be visible through management instrumentation</param>
 public static void Publish(Object o)
 {
     GetPublishFunction(o.GetType())(o);
 }