Beispiel #1
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }

                if (m_properties != null)
                {
                    try
                    {
                        foreach (MemberWrapper property in m_properties)
                        {
                            property.ValueChanged -= new EventHandler(m_handler.ItemValueChanged);
                        }
                    }
                    catch (AppDomainUnloadedException)
                    {
                    }

                    m_properties = null;
                }
            }

            base.Dispose(disposing);
        }
Beispiel #2
0
        public override void Clear()
        {
            m_modified   = false;
            m_wrapper    = null;
            m_properties = null;

            grid.SetDataBinding(null, null);
        }
Beispiel #3
0
        public void DisplayValue(MemberWrappers values)
        {
            if (values == null)
            {
                throw new ArgumentNullException("values", "This editor cannot display a null value.");
            }

            m_wrapper = null;
            DisplayValueInternal(values);
        }
Beispiel #4
0
        public override MemberWrappers GetMembers()
        {
            var entries = (List <InstrumentationEntry>)GetWrappedObject();
            var members = new MemberWrappers();

            foreach (var entry in entries)
            {
                members.Add(new InstrumentationEntryWrapper(entry));
            }
            return(members);
        }
Beispiel #5
0
        public override MemberWrappers GetMembers()
        {
            var cookies = (HttpCookiesDetail)GetWrappedObject();
            var members = new MemberWrappers();

            for (int index = 0; index < cookies.Count; ++index)
            {
                members.Add(new HttpCookieMemberWrapper(cookies[index]));
            }

            return(members);
        }
Beispiel #6
0
        public override MemberWrappers GetMembers()
        {
            HttpHeadersDetail headers = (HttpHeadersDetail)GetWrappedObject();
            MemberWrappers    members = new MemberWrappers();

            for (int index = 0; index < headers.Count; ++index)
            {
                members.Add(new ConstantMemberWrapper(headers.GetKey(index), headers.GetValue(index)));
            }

            return(members);
        }
Beispiel #7
0
        private void DisplayValueInternal(MemberWrappers values)
        {
            m_modified   = false;
            m_properties = values;

            foreach (MemberWrapper wrapper in m_properties)
            {
                wrapper.SetValueFormat(m_valueFormat);
                wrapper.Tag           = new CellEditorData(wrapper);
                wrapper.ValueChanged += new EventHandler(m_handler.ItemValueChanged);
            }

            grid.SetDataBinding(m_properties, null);
        }
        public override MemberWrappers GetMembers()
        {
            object detail = GetWrappedObject();

            Debug.Assert(detail != null, "detail != null");

            MemberWrappers properties = new MemberWrappers();

            // Do some special processing for the generic detail.

            if (detail is GenericDetail)
            {
                foreach (var value in ((GenericDetail)detail).Values)
                {
                    properties.Add(new ConstantMemberWrapper(value.Name, value.Value));
                }
            }
            else
            {
                // Use reflection to read all the properties, except "Name".

                PropertyInfo[] infos = detail.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public);
                Debug.Assert(infos.Length > 0, "Event details object '" + ((IEventDetail)detail).Name
                             + "' doesn't seem to have any public properties.");

                foreach (PropertyInfo info in infos)
                {
                    if (info.Name == "Name")
                    {
                        continue;
                    }

                    object value;
                    try
                    {
                        value = info.GetValue(detail, null);
                    }
                    catch (System.Exception ex)
                    {
                        value = ex;
                    }

                    properties.Add(new ConstantMemberWrapper(info.Name, value));
                }
            }

            return(properties);
        }
Beispiel #9
0
        private MemberWrappers GetMessageProperties(EventMessage eventMessage)
        {
            MemberWrappers properties = new MemberWrappers();

            // Handle exceptions from individual members to give the user a chance to see the rest of the details.

            try
            {
                // Convert the time to the user-configured time zone.

                DateTime time = LogForm.GetEventMessageTime(eventMessage, m_timeZone);

                m_timePropertyWrapper = new ConstantMemberWrapper("Time", time);
                properties.Add(m_timePropertyWrapper);
                properties.Add(new ConstantMemberWrapper("Event", eventMessage.Event));
                properties.Add(new ConstantMemberWrapper("Source", eventMessage.Source));
                properties.Add(new ConstantMemberWrapper("Type", eventMessage.Type));
                properties.Add(new ConstantMemberWrapper("Method", eventMessage.Method));

                try
                {
                    properties.Add(new ExceptionWrapper(eventMessage.Exception));
                }
                catch (System.Exception ex)
                {
                    ((MainForm)MdiParent).HandleException(ex);
                }

                foreach (IEventDetail detail in eventMessage.Details)
                {
                    try
                    {
                        properties.Add(new EventDetailMemberWrapper(detail));
                    }
                    catch (System.Exception ex)
                    {
                        ((MainForm)MdiParent).HandleException(ex);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ((MainForm)MdiParent).HandleException(ex);
            }

            return(properties);
        }
Beispiel #10
0
        private MemberWrappers GetMessageParameters(EventMessage eventMessage)
        {
            MemberWrappers wrappers = new MemberWrappers();

            try
            {
                foreach (EventParameter parameter in eventMessage.Parameters)
                {
                    wrappers.Add(new ParameterWrapper(parameter));
                }
            }
            catch (System.Exception ex)
            {
                ((MainForm)MdiParent).HandleException(ex);
            }

            return(wrappers);
        }