Example #1
0
    public MyEventInfo(EventDefinition eventDefinition, MyClassInfo declaringType)
      : base()
    {
      this.name = eventDefinition.Name;

      string[] readableForms = Tools.GetHumanReadableForms(eventDefinition.EventType);
      this.typeFullName = readableForms[0];
      this.typeFullNameWithoutRevArrayStrings = readableForms[1];

      this.declaringType = declaringType;

      MethodDefinition adderInfo = eventDefinition.AddMethod;
      Debug.Assert(adderInfo != null, "Impossible! add_Event() must have been generated.");

      this.attributes = GetMyEventAttributes(eventDefinition);
      this.underlyingMethodsAttributes = GetMyInvokableMemberAttributes(adderInfo);

      this.CheckSupport(eventDefinition, adderInfo.Attributes);
    }
        void Add(MyEventAttributes args)
        {
            bool lockTaken = false;

            m_addGuard.Enter(ref lockTaken);

            if (!m_queue.IsAddingCompleted)
            {
                m_queue.Add(args, CancellationToken.None);
            }
            else
            {
                MyLog.Default.WriteLine("Error sending analytics: " + args.EventType.ToString());
            }

            if (lockTaken)
            {
                m_addGuard.Exit();
            }
        }
Example #3
0
        public MyEventInfo(EventDefinition eventDefinition, MyClassInfo declaringType)
            : base()
        {
            this.name = eventDefinition.Name;

            string[] readableForms = Tools.GetHumanReadableForms(eventDefinition.EventType);
            this.typeFullName = readableForms[0];
            this.typeFullNameWithoutRevArrayStrings = readableForms[1];

            this.declaringType = declaringType;

            MethodDefinition adderInfo = eventDefinition.AddMethod;

            Debug.Assert(adderInfo != null, "Impossible! add_Event() must have been generated.");

            this.attributes = GetMyEventAttributes(eventDefinition);
            this.underlyingMethodsAttributes = GetMyInvokableMemberAttributes(adderInfo);

            this.CheckSupport(eventDefinition, adderInfo.Attributes);
        }
        void Add(MyEventAttributes args)
        {
            bool lockTaken = false;
            m_addGuard.Enter(ref lockTaken);

            if (!m_queue.IsAddingCompleted)
            {
                m_queue.Add(args, CancellationToken.None);
            }
            else
            {
                MyLog.Default.WriteLine("Error sending analytics: " + args.EventType.ToString());
            }

            if (lockTaken)
                m_addGuard.Exit();
        }
Example #5
0
        private static MyEventAttributes GetMyEventAttributes(EventDefinition eventDefinition)
        {
            MyEventAttributes myEventAttributes = MyEventAttributes.None;

            return(myEventAttributes);
        }
Example #6
0
 private static string MyEventAndMyInvokableMemberAttributesToString(MyEventAttributes myEventAttributes, MyInvokableMemberAttributes myInvokableMemberAttributes)
 {
     // for now only MyInvokableMemberInfo attributes
     return(MyInvokableMemberInfo.MyInvokableMemberAttributesToString(myInvokableMemberAttributes));
 }
Example #7
0
 private static string MyEventAndMyInvokableMemberAttributesToString(MyEventAttributes myEventAttributes, MyInvokableMemberAttributes myInvokableMemberAttributes)
 {
   // for now only MyInvokableMemberInfo attributes
   return MyInvokableMemberInfo.MyInvokableMemberAttributesToString(myInvokableMemberAttributes);
 }