home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Is there a need for a skin editor?
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="arion_p" data-source="post: 507176" data-attributes="member: 45945"><p>I was actually thinking of getting the IDs from the code itself (documentation can be out of date, and does not include 3rd party plugins).</p><p></p><p>The way to get the window IDs is the following:</p><p></p><ol> <li data-xf-list-type="ol">Enumerate all assemblies (dlls) in Plugins\Windows directory of MP</li> <li data-xf-list-type="ol">Load each assembly and enumerate all types defined in the assembly</li> <li data-xf-list-type="ol">For each type that is a descendant of <em>GUIWindow</em> create and instance of that type</li> <li data-xf-list-type="ol">For each instance created call the <em>GetID</em> method to the the window ID and store it in your list of known windows along with the type name.</li> <li data-xf-list-type="ol">Optionally get controls IDs and types contained in the windows (see below)</li> </ol><p>To get the control IDs for a given type:</p><p></p><ol> <li data-xf-list-type="ol">Enumerate all members (including inherited) using Type.GetMembers(BindingFlags)</li> <li data-xf-list-type="ol">For each MemberInfo returned call GetCustomAttributes passing the type of Mediaportal.GUI.Library.SkinControlAttribute</li> <li data-xf-list-type="ol">If the previous call returns a non empty array, the member is a skin control. Cast the first (and only) element as SkinControlAttribute and get the control ID from the SkinControlAttribut.ID property.</li> <li data-xf-list-type="ol">Get the control name from MemberInfo.Name</li> <li data-xf-list-type="ol">Depending on whether the member is a field or a property (MemberInfo.MemberType) get the control type from either FieldInfo.FieldType or PropertyInfo.PropertyType</li> </ol><p>You can get the xml element names and xml attribute names of control types in a dimilar way by looking for fields / properties having one of the XmlSkinAttribute or XmlSkinElementAttribute attributes.</p><p></p><p>Getting supported skin properties is not possible in this way, unless the code is extended to include perhaps a SkinPropertyAttribute applpied multiple time on each GUIWindow derived class to declare available properties.</p></blockquote><p></p>
[QUOTE="arion_p, post: 507176, member: 45945"] I was actually thinking of getting the IDs from the code itself (documentation can be out of date, and does not include 3rd party plugins). The way to get the window IDs is the following: [LIST=1] [*]Enumerate all assemblies (dlls) in Plugins\Windows directory of MP [*]Load each assembly and enumerate all types defined in the assembly [*]For each type that is a descendant of [I]GUIWindow[/I] create and instance of that type [*]For each instance created call the [I]GetID[/I] method to the the window ID and store it in your list of known windows along with the type name. [*]Optionally get controls IDs and types contained in the windows (see below) [/LIST] To get the control IDs for a given type: [LIST=1] [*]Enumerate all members (including inherited) using Type.GetMembers(BindingFlags) [*]For each MemberInfo returned call GetCustomAttributes passing the type of Mediaportal.GUI.Library.SkinControlAttribute [*]If the previous call returns a non empty array, the member is a skin control. Cast the first (and only) element as SkinControlAttribute and get the control ID from the SkinControlAttribut.ID property. [*]Get the control name from MemberInfo.Name [*]Depending on whether the member is a field or a property (MemberInfo.MemberType) get the control type from either FieldInfo.FieldType or PropertyInfo.PropertyType [/LIST] You can get the xml element names and xml attribute names of control types in a dimilar way by looking for fields / properties having one of the XmlSkinAttribute or XmlSkinElementAttribute attributes. Getting supported skin properties is not possible in this way, unless the code is extended to include perhaps a SkinPropertyAttribute applpied multiple time on each GUIWindow derived class to declare available properties. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Is there a need for a skin editor?
Contact us
RSS
Top
Bottom