NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 71 72 73 74 75 … 93 Next »
Help with getNamedColor method

 
  • 0 Vote(s) - 0 Average
Help with getNamedColor method
Jeff
Offline

Posting Freak

Posts: 1,933
Threads: 69
Joined: Oct 2004
#1
2005-05-02, 02:33 PM
I am having trouble using the method getNamedColor. I keeping getting an error Object reference not set to an instances of an object

This is what I have in my skin file.

Quote:<!-- name colors -->
<NamedColors>
<!-- Colors must be solid colors, not gradients -->
<NamedColor name="FreeSpace" color="Yellow"/>
<NamedColor name="UsedSpace" color="Tomato"/>
<NamedColor name="EstimatedPendingSpace" color="SlateBlue"/>
</NamedColors>

And this is a snippet of code.

Code:
// Get a reference to the skin helper
XmlDocument document = new XmlDocument();
document.Load(SkinUtilities.FullActiveSkinPath + "archive\\Disk Space Dialog skin.xml");
skinHelper = new SkinHelper(document, SkinUtilities.FullActiveSkinPath + "archive");

// Setup colors
if (skinHelper == null)
    Logger.Error("-- skinHelper is null -- ");

try
{
    FreeSpaceColor = new Color();
    FreeSpaceColor = skinHelper.getNamedColor("FreeSpace");
}
catch (Exception e)
{
    Logger.Error ("Video Archiver - Error loading color FreeSpace from "+SkinUtilities.FullActiveSkinPath + "archive\\Disk Space Dialog skin.xml "+e.ToString());
    FreeSpaceColor = Color.Green;
}

I have checked to make sure the skinHelper object is not null and I use it elsewhere in the same code block to read other settings so it seems to be okay. I also though perhaps I needed to allocate the color object before using it but that didn’t change anything either. Any ideas?

Jeff
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,729
Threads: 767
Joined: Nov 2003
#2
2005-05-02, 05:05 PM
Actually, I had meant to make the method you're trying to use 'private'. It doesnt quite do what you think. Its actually just a utility call used by getNamedBrush() an others.

If will return a Color object what passed in #000000 - #FFFFFF or one of the predefined .net colours.
Jeff
Offline

Posting Freak

Posts: 1,933
Threads: 69
Joined: Oct 2004
#3
2005-05-02, 05:59 PM
OK; thanks. Now that I understand I've written my own method to do what I though this one did.

Jeff
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  is there a service?method which returns listings for multiple channels? reven 16 7,061 2022-04-11, 04:30 PM
Last Post: mandai
  Show artwork method psycik 31 11,858 2015-07-14, 07:06 AM
Last Post: aloxinh
  couple of issues with recording.recurring.save method reven 10 4,700 2014-01-03, 11:11 PM
Last Post: reven
  Advice on which streaming method to use fred250 17 6,243 2013-09-14, 11:14 AM
Last Post: fred250
  getting recurring recordings from service?method API? reven 2 1,964 2013-08-03, 10:50 PM
Last Post: reven
  Reinitialise method scb147 6 2,432 2009-07-22, 02:23 PM
Last Post: scb147
  Method for Playing Streams skate15e 11 4,341 2008-07-12, 06:04 PM
Last Post: sub
  Method to notify plugin of exit whurlston 6 2,924 2008-06-15, 06:20 AM
Last Post: ralphy
  GetAudioPlayList method - MVP Hunter Sun 8 2,707 2005-11-26, 10:54 PM
Last Post: Hunter Sun

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode