|
What would you expect to be returned if the value hasn't been localized? I'm confused as to your requirements here.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
null or an empty string, perhaps? I need to know that resource is not localized. I don't want to get an alternative from another language returned.
|
|
|
|
|
Well, when you test it, don't have a fallback resource available. That should do it - basically, only have your localized version in place.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hmm.. true, that does seem like the only way.
Thanks Pete!
|
|
|
|
|
Hello all,
somebody knows how is possible to sign a message using the CMS Advanced Electronic Signatures (CADeS) instead of pkcs#7 with .net?
To sign in a pkcs#7 format we use the SignedCms and CmsSigner object. CADeS is a "member of the family" of CMS but we aren't able to find objects (or patterns) that allow to sign message with this
electronic signature format.
Thanks a lot for all the help.
Oscar
|
|
|
|
|
So, I decided that I would download Stylecop and see what sort of issues it took with my code. I found a couple of things surprising, one frustrating.
My frustration was that I'm not allowed to pad with spaces? For a long time now, I've enjoyed setting up Visual Studio to add spaces in empty parentheses, spaces in method calls etc. I've just found the code to be all the more readable. But, following Stylecop rules, I've got no extra room. I mean, this will please the people I work with, they don't like the spaces but I've come to like it.
<br />
if ( value < maximumValue )<br />
{<br />
}<br />
I've found to be more readable than;
<br />
if(value < maximumValue)<br />
{<br />
}<br />
My next surprise was that it was telling me to put my using statements inside my namespace. I've not seen this done before in code samples I've seen even from MS,and considering this tool comes out of Microsoft it took me by surprise. Can anybody explain this one to me?
I understand the idea of Stylecop and I'm willing to follow most. Is there a way of editing the rules?
|
|
|
|
|
I've never used it but a few comments on what you've found.
hammerstein05 wrote: pad with spaces
Screen space is a highly prized resource IMO. Extra spaces (horizontal especially as vertical can be conrtolled with collapsing sections/regions etc) drive me nuts when working on a laptop or smaller than ideal display.
hammerstein05 wrote: using statements inside my namespace
I never do this, but it makes sense as the usings only apply to objects inside that namespace.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
DaveyM69 wrote: hammerstein05 wrote:
using statements inside my namespace
I never do this, but it makes sense as the usings only apply to objects inside that namespace.
I asked the StyleCop folks about this and that was their answer, to limit the using statements to apply only to the objects inside the namespace.
Their assumption is that you would only have one namespace per file, so I assume that there would also be a stylecop warning for multiple namespaces in a single file. Never tried it to validate this assumption though.
Mike Poz
|
|
|
|
|
Not questioning you, but the StyleCop folks: if they're assuming that you'll only have one namespace in a file, what does it matter if the usings are inside or outside the namespace?
|
|
|
|
|
Take a look at the document here[^]. In a nutshell:
There are subtle differences between placing using directives within a namespace element, rather than outside of the namespace, including:
1. Placing using-alias directives within the namespace eliminates compiler confusion between conflicting types.
2. When multiple namespaces are defined within a single file, placing using directives within the namespace elements scopes references and aliases.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
You can turn off some of Style Cops annoyances. Besides, you should be spending more time focusing on the logic and functionality of your code than the style. In fact, one of the first things I do in a contract that involves code reviews is insert an obvious error into my code for review. If this first comment about my code is style related I know that most people in the room are not playing for the right team. It is about code first.
|
|
|
|
|
You can selectively enable/disable most of the rules but there isn't a way to edit a rule. Putting using statements inside the namespace is recommended for the following reasons:
From http://www.thewayithink.co.uk/stylecop/sa1200.htm[^]
There are subtle differences between placing using directives within a namespace element, rather than outside of the namespace, including:
1. Placing using-alias directives within the namespace eliminates compiler confusion between conflicting types.
2. When multiple namespaces are defined within a single file, placing using directives within the namespace elements scopes references and aliases.
The spacing reccomendations are most likely due to screen space concerns. Anyway, the code you show would look like this to meet the StyleCop settings:
if (value < maximumValue)
{
}
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
hello
Need to Transfer big DataTable over WCF - any good WCF article on this subject you'd recommend (i.e. good ones you have read)
Thanks!
dev
|
|
|
|
|
Rethink your design.
The user is unlikely to want a whole lot of data all at once.
|
|
|
|
|
it's a financial app where user views huge (as much as tech possible) amount of data and client app is not permitted to contact db direct
you have a better suggestion or you actually knows how to wire data table down? Whether socket or WPF?
dev
|
|
|
|
|
I'm always amazed that people want to transfer DataTables over the wire. Remember that a DataTable is a structure that is specific to the .NET framework, so a whole lot of plumbing is required in none-MS applications to understand and work with them.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
if client app is not to communicate directly with db (not permitted), then what's your soln
dev
|
|
|
|
|
A web service would probably do it, and you're still going to have to cut down on the data being transferred. There's no way you can get away with displaying thousands of records on the screen at once, so why transfer them?!
As someone else has already said, rethink you're design. If you have to aggregate thousands of records, the web service can handle that and return the result. Your solution, for best responsiveness and minimumal network use should lean toward having the service do as much work as possible and transfer only what the user can actually see.
|
|
|
|
|
you're saying you can do web service and not via WCF?
rethink what you've learnt. I've done countless screens paging sorting I know like back of my hand so I don't need another lecture of how many rows the grid can or should display.
In short, anyone of you actually has done it, wire a DataTable over the wire (or not)
dev
|
|
|
|
|
Frankly, I don't care what you use. The basic problem still remains. You're trying to transfer data that you shouldn't be trasnfering. There is no reason to send large DataTables over the wire. Send only what you need.
|
|
|
|
|
if you dont know let me know
dev
|
|
|
|
|
How many different ways do we have to tell you that sending a DataTable is not a good idea? It's just too big, even if it's empty!
Create your own objects to hold your data plus an IEnumerable collection to hold them. Then you can serialize that over the wire with minimal overhead.
|
|
|
|
|
you don't know you sh*t
dev
|
|
|
|
|
Voted to remove message. Too bad I can't vote to remove user...
I already told you how it's normally done. If you want ot continue to bang your head against a wall trying to do it the hard way, fine. Don't let me stop you.
|
|
|
|
|
Dave Kreskowiak wrote: Voted to remove message. Too bad I can't vote to remove user...
why don't you ask babe(and start learning how to wire down a DataTable)
dev
|
|
|
|