|
I think you would have to read the data in from the config file and create the menu items dynamically.
You could do this by creating an xml file for the config, then reading that in and creating the items to the list.
e.g.
// Read config file and serialize (sorry, dont have this bit 2 hand)
foreach(MenuData data in configFile)
{
MenuItem item = new MenuItem();
item.Text = data.Text;
mainMenu.MenuItems.Add(item);
}
|
|
|
|
|
Can anybody please tell me how the usage of RedirectBinding element can be utilised in App.config file. I want to redirect to newer version same assembly in GAC using App.config file, without recompiling the client application.
Thanks
kumar
|
|
|
|
|
Have a look at <a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconassemblyversionredirection.asp" rel="nofollow">this</a>[<a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconassemblyversionredirection.asp" target = "_blank" rel="nofollow">^</a>] MSDN page. According to the article, the usage is
<pre>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="myAssembly"
publicKeyToken="32ab4ba45e0a69a1"
culture="en-us" />
<!-- Assembly versions can be redirected in application, publisher policy, or machine configuration files. -->
<bindingRedirect oldVersion="1.0.0.0"
newVersion="2.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</pre>
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
Thanks senthil, but thats not working fine. My scenario is , I created two projects and refering one in another. I installed two versions of same assembly in GAC (a.dll 1.0 and 1.1). Now the reference assembly in project is a.dll 1.0. I added app.config file and added the redirection elements to redirect from 1.0 to 1.1
I executed the exe from bin folder where config file is also there. But the newer version assembly is not getting refernced at runtime, the same old one which i refered to project at design time is getting refered.
Any solution?
kumar
|
|
|
|
|
Use Itemtemplate columns. Columns that are editable user textbox, columns that are not editable user labels. When you are using item templates, itemdatabound even is mandatory, i am talking about web programming.
Ram
|
|
|
|
|
Hai!
I was asked by one of my colleagues the following question. "Can we associate a single codebehind file with two aspx pages?"
If anyone knew the answer please let me know.
Regards
Sirisha.P
|
|
|
|
|
Never tried this but it should possible by specifying the same inherits and codefile attributes in both aspx pages.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thank you. I have tried that and got the program executed.
Regards
Sirisha.P
|
|
|
|
|
Hello everybody,
I do have a question about reading image data from avi-files using C#.
I have to do some image processing on the image data. Thus, I need the image data itself and not just a Media Player. I already found some code "C# Wrapper" that uses the avifil32.dll that works quite well. However, the .dll seems to be limited to quite a few numbers of avi-codecs. The dll often fails.
I found the "DirectShow Media Player in C#" that works well. It reads in all kinds of avi-codecs using the QuartzTypeLib.dll. However, I do not understand how I reach the image-data itself. It seems to be capsuled within the dll. Even there is the IBasicVideo2.GetCurrentImage-Function I don't know how to use it.
Does anyone know, how I can reach the RGB-values of avi-files that are created by different codecs?
Maybe anyone has an idea?
Joerg
|
|
|
|
|
|
Write an article
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
What does it say about programming questions (in red) when you write a message?
Go to the correct forum.
|
|
|
|
|
I'm not really asking something about programming. I'm asking if there's something similar around like a simple image processing tool that can do this.
Wout
|
|
|
|
|
Hhhaaaa...
There is something horrible in your code!
But I can't tell you otherwise that would make it a programing question!
mmhh....
No it's just too horrible, I tell you anyway!
Get rid of these evil
1. for (int x = 0; x < image.Width; x++)
2. image.GetPixel(x, y)
3. newImage.SetPixel
.Width, .GetPixel .SetPixel are perfomance killer.
cache the height & width and use BitmapData
|
|
|
|
|
Performance was least of my worries, I just needed something that works quick! I don't need to transform thousands of images per second at the moment. My first goal is usually understandable code, and when it's not fast enough I'll revisit the thing and tune it. But that time has still to come!
Wout
|
|
|
|
|
|
Premature performance optimization is not smart usually. But I'll compromise this time.
White is the reference color in this case. Next step would be making the reference color configurable!
What will edge detection do for me? I haven't felt the need for it yet.
Basically the algorithm works as follows now: the closer the input pixel color is to the reference color, the more transparent the output pixel can be.
Wout
|
|
|
|
|
wout de zeeuw wrote: Basically the algorithm works as follows now: the closer the input pixel color is to the reference color, the more transparent the output pixel can be.
Anyway this is a very bad algorithm.....
Have you tried it?
Your whole picture is translucent...
With edge detection you could fill the outside area and perhaps mix transparency around the edges...
In fact before writing an article I think you should have a working prototype...
|
|
|
|
|
Works splendidly for me! But ofcourse it's not fool proof yet, it's basically in prototype stage that works good enough for my current purposes. Send me your image, I'm curious why it doesn't work on your image.
Wout
|
|
|
|
|
Just any image with 4 million colors should do.
Sure enough white become transparent.
And your shape border become translucent. But so does all the pixels!!!
You can't see that with picture with just a few color with full saturation. but try on CodeProject Bob for example.... (using Orange as the reference color)
|
|
|
|
|
Yep, for non-white ref color the algorithm needs some tweaking. The blending color for 255 is 0. But for any other value it can be either 0 or 255, depending on which target to blend to. Gimme half an hour to work that out!
Wout
|
|
|
|
|
I think you misunderstood the gravity of the problem...
Or possibly I didn't explain it well...
Or possibly I'm plain wrong...
I just don't believe you will be happy of the result except with some color poor pictures.
Try to remove the blue cloudless sky from a picture this way (or grey cloudfull sky): I predict utter failure of the algorithm.
|
|
|
|
|
This is not too bad but:
1. get rid of GetPixel / SetPixel / Width / Height , this is too damn slow!
2. Haven't you noticed that Bob is transparent as well?
It's what I'm trying to say since 4 posts!!!
Now it might be okay with you, but you haven't aknowledged the fact yet....
Otherwise works nicely, indeed
|
|
|
|
|
Yes, I'm aware of that. That's part of the algorithm's philosophy. If the color is close to the reference color, then the pixel can be made very transparent. Basically it tries to make each pixel as transparent as it can be. When putting the orange background behind it, it will look the same as the original again (or very close to it, disregarding rounding errors).
I'll take care of the GetPixel/SetPixel stuff, didn't bother to look for quicker alternatives yet. If you can tell me from the top of your mind that'd be great
Wout
|
|
|
|
|