|
I have done that, and Its not a matter of actually doing the skinning, I can do that.. its the actual skin objects. And I am aware of the versitility of XML also. When I was talking about Serialization I was talking about the actual serializing/deserializing of my objects. I'm fairly new to this XML stuff with C#. The most work I've done with XML in C# is just DataSets, DataTables, etc.. I do remember reading somewhere about what you're talking about, but I cannot remember where. Maybe you can elaborate a bit on what you mean?
|
|
|
|
|
What I spoke of about XML is generic - nay, essential - to XML. I recommend you read http://www.w3.org/XML/[^].
You should also practice the use of namespaces, which allow you to scope your elements and, optionally, your attributes similar to how methods and properties are defined for different types. This allows your skins to be extended for custom controls, for example.
If you want a primer to XML in .NET, read Employing XML in the .NET Framework[^] in the .NET Framework SDK.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
aye.. that MSDN article is more along the lines of what i need.. I do understand how to use namspaces and all that stuff, thats not the problem. I have a really hard time expressing my ideas on paper, even tho they make perfect sense in my head, so please bare with me Basically, what I'd ideally like to do is take one of my objects, say SkinElement.. point it to a xml file, have it read that file and fill properties, execute methods, etc.. I just went out this morning and bought "Beginning C# XML" - Wrox Press. After a quick look at the book, I noticed some stuff with Serialization. Using attributes on members to "link" them to the xml file. IE: [XmlAttribute] [XmlElement] etc.. Now, this only talks about the actual serialization of the object. It dosen't really talk about "deserializing" an xml file into the object. Is that possible? Because that would be ideal as it would cut down on alot of parsing
|
|
|
|
|
"Serialization" typically implies "deserialization" as well, since the two go hand in hand. If you read the documentation I linked, XML deserialization requires you to implement a public default constructor (no parameters) and use the XmlSerializer.Deserialize method.
Again, search for examples of what you're trying to do here on Code Project. They do exist, and one such implementation (though it's not skinning, but actual form layout and event hook-ups in much the same way) is called "MyXaml".
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I made a simple application (win app) like wordpad,
when user save information from my app, it will create a new file format (*.abc for example), I would like to register an icon for this new file format
Anyway, when I double_click to this file (*.abc) in window Explorer, my app will automatically open and use this file as usual
Show me how to solve this.
Thankz!
|
|
|
|
|
Read Creating a File Association[^] in the MSDN Library. This is typically the job of an installer, and if you use the Windows Installer project in Visual Studio you can do this easily by following the instructions in File Types Management in Deployment[^].
Some applications will conditionally or unconditionally associate file types when the application starts or options are changed. Media players are a good example of conditionally associate file types with an icon (and, more importantly, their application) because common file types (.mp3, .wav, etc.) can be played by multiple players. The more friendly players allow you to select which extensions are handled and whether or not to enforce those while the application is running. It really depends on whether or not you expect other editors to be able to handle your file type.
To do that, you need to follow the instructions in the first link using the Microsoft.Win32.Registry and Microosft.Win32.RegistryKey classes.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
basically, I want to add the url history of ie, each one onto a new line. here's the code I have written thus far. I am druly bedazzled as to why it won't work. thanks for the help. ps, if you know a better way to add the registry values (all that exist in the registry key) onto new lines in a multiline textbox, that is much simpler than my confusing integers way (the rookie way!) of doing it, please let me know. I don't like being ignorant. anyways, thanks and here's the code:
[CODE]
RegistryKey home_page_open = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\Main");
this.textBox3.Text = home_page_open.GetValue("Start Page").ToString();
//load history into textbox
RegistryKey history = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\TypedURLs");
int repeat = history.SubKeyCount;
int init = 1;
while (repeat > 0)
{
textBox4.Text += "\r\n" + history.GetValue("url" + init.ToString()).ToString();
init ++;
repeat --;
}
[/CODE]
|
|
|
|
|
pyrojoe wrote:
int repeat = history.SubKeyCount
SubKeyCount won't get you the number of URL values, you need ValueCount . A SubKey, as you might guess from other code you've got, is the directory-like path to get to the values you are looking for.
Also, your loop is a little crazy, you need to learn about for loops. I suggest changing your loop to:
int count = history.ValueCount;
for(int i = 1; i<=count; i++)
{
}
Does this help?
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
|
|
|
|
|
|
|
hello,
i made a program that contains serveral dll's that are included. But when i distribute my program the client mustn’t see the dll's just a package that contains the dll but is encrypte or something like that. Is this possible??
greetings
Sander
|
|
|
|
|
Gedrain wrote:
when i distribute my program the client mustn’t see the dll's
If the client is paying you money to create these DLLs why shouldn't they be able to see them?
There are tools that will make the .NET assemblies difficult to reverse engineer. Dotfuscator Community Edition is included with Visual Studio, which is a cut down version so you may like to buy the full version if it is not secure enough for you.
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
|
|
|
|
|
hello colin,
but the dll's are not mine i just them from another project for example firebird dll drivers. But when i distribute my program i don't find it quit nice that people see that i used firebird dll's so how can i compress them into one file.
greetings
Sander
|
|
|
|
|
So, this "package" you talk about, do you mean you don't want the client to see the DLLs on the hard disk, or just the installer? When you create an installer project it creates an MSI file that you can double click on and it will install the application and all its files and perform any other actions that you need the installer to do. The installer is just one MSI file. Would that be acceptable?
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
|
|
|
|
|
i mean on the harddisk not with the installation that is allready in a package
greetings
Sander
|
|
|
|
|
If I had created a DLL (OS or CS) I would probably NOT have you distribute my work in encrypted form.
As a matter of fact, doing so might get you into REALLY deep trouble.
Imagine your customer being sued for illegally using copyrighted CS-DLLs he has not obtained a license for. (CS = Closed Source)
Or you being sued by the FSF because you did not follow the license for an OS product (OS = Open Source).
Being honest works best.
Cheers
Sebs
|
|
|
|
|
well the dll's that i distribute with my program are all open source so that is not the problem. But it just looks better i think.
greetings
Sander
|
|
|
|
|
Hello,
I'm developing a client/server application in C# and Windows Forms. When the user is logged in (in my client application) I want to detect when he hasn't used my application in a certain time (say, one hour) to automatically log him out.
Does anyone have any suggestion on where to begin?
I've tought of a timer? but how do I reset it? o mousemove and click events or in any menu item/toolbar event?
Any pointers will be appreciated!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
|
Umm..that's actually quite a wierd one and may not do what he expects.
I previously thought as you do, but recently I added a tool bar tool in a form that has it's text set to the current date and time in OnAppIdle event on the form. (when the user clicks on it, it inserts the current date and time as text in a text field or selects the current date and time if in a date/time editor etc, also as a side effect I expected it to be useful as a clock when in the full screen form).
If you try that you will notice much weirdness about it, the time display will not update on it's own until you do something in the form (opposite of what you would expect) including the fact that if the form doesn't have the focus it won't process unless you move the mouse around over the form, if you open the form but don't click on a control it won't process, in fact the only thing that is guaranteed to fire OnAppIdle is if you click into an editable control and keep focus there, then it will mysteriously start firing regularly.
Of course this is normally perfect since I use OnAppIdle for updating various things on the form in relation to user caused change of states, but in the case of the timer it might not work very well in practice.
I think what it's doing is interpreting what exactly "idle" means, it's not strictly idle when you're not doing anything on the form.
|
|
|
|
|
John Cardinal wrote:
Umm..that's actually quite a wierd one and may not do what he expects
Well, from what I understood of the situation there is a timer that runs continuously - he only wants to reset a counter when the application enters an idle state - so each time the user stops doing stuff, even for a fraction of a second, the counter resets to zero. The timer fires a few times (say once per minute) and when it reaches its threshold the timer event can do what it needs to do at that point.
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
|
|
|
|
|
Right! Yeah, I see what you mean, that actually is the easiest solution now that I think about it.
|
|
|
|
|
Thanks for your suggestion, but Dennis's article I think solves my problem perfectly. Thanks anyway
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Luis Alonso Ramos wrote:
When the user is logged in (in my client application) I want to detect when he hasn't used my application in a certain time (say, one hour) to automatically log him out.
I usually don't promote my own articles on the discussion boards but I think this is what you're looking for: How to check for user inactivity with and without platform invokes in C#[^]. There's also a thread titled Other methods to detect OnIdle?[^] where I describe why in my opinion OnIdle is useless in this case.
Best regards
Dennis
|
|
|
|
|
Dennis C. Dietrich wrote:
I think this is what you're looking for: How to check for user inactivity with and without platform invokes in C#
Yes, exactly that is what I was hoping to know. Such an excellent article, thank you very much!
I have one question (about the Application.AddMessageFilter solution>, but I'll post it in the article's forum, so it may be helpful to someone else.
Thank you very much!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|