public override object GetValue(object component)
        {
            if (Owner != null)
            {
                if (Owner is FileAssociationSettings)
                {
                    return(((FileAssociationSettings)Owner).GetApplicationForExtension(this.Name));
                }
                else
                {
                    return(null);
                }
            }


            #region StateSave

            if (EditorLogic.CurrentStateSave != null)
            {
                return(EditorLogic.CurrentStateSave.GetValue(this.Name));
            }

            #endregion

            #region NamedObjectSave

            else if (EditorLogic.CurrentNamedObject != null)
            {
                NamedObjectSave asNamedObject = EditorLogic.CurrentNamedObject;

                if (this.Attributes.Count > 0 && this.Attributes[0] is CategoryAttribute)
                {
                    string category = ((CategoryAttribute)this.Attributes[0]).Category;

                    switch (category)
                    {
                    case "Active Events":

                        EventSave eventSave = asNamedObject.GetEvent(Name);
                        if (eventSave != null)
                        {
                            return(eventSave.InstanceMethod);
                        }
                        else
                        {
                            return("");
                        }

                    //break;
                    case "Unused Events":
                        return("");

                    //break;
                    case "Custom Variable Set Events":
                        return(EditorLogic.CurrentNamedObject.GetCustomVariable(this.Name.Replace(" Set", "")).EventOnSet);

                    //break;
                    default:
                        return(EditorLogic.CurrentNamedObject.GetPropertyValue(this.Name));
                    }
                }
                else
                {
                    return(EditorLogic.CurrentNamedObject.GetPropertyValue(this.Name));
                }
            }
            #endregion



            #region CustomVariable

            else if (EditorLogic.CurrentCustomVariable != null)
            {
                if (EditorLogic.CurrentEntitySave != null)
                {
                    return(EditorLogic.CurrentEntitySave.GetPropertyValue(EditorLogic.CurrentCustomVariable.Name));
                }
                else
                {
                    return(EditorLogic.CurrentScreenSave.GetPropertyValue(EditorLogic.CurrentCustomVariable.Name));
                }
            }

            #endregion

            #region ScreenSave

            else if (EditorLogic.CurrentScreenSave != null)
            {
                if (this.Attributes.Count > 0 && this.Attributes[0] is CategoryAttribute)
                {
                    string category = ((CategoryAttribute)this.Attributes[0]).Category;

                    switch (category)
                    {
                    case "Active Events":
                        EventResponseSave eventSave = EditorLogic.CurrentScreenSave.GetEvent(Name);
                        //if (eventSave != null)
                        //{
                        //    return eventSave.InstanceMethod;
                        //}
                        //else
                        {
                            return("");
                        }

                    case "Unused Events":
                        return("");

                    default:
                        return("");
                    }
                }
                return("");
            }

            #endregion

            #region EntitySave

            else if (EditorLogic.CurrentEntitySave != null)
            {
                return(EditorLogic.CurrentEntitySave.GetPropertyValue(this.Name));
            }

            #endregion

            else
            {
                return(null);
            }
        }