|
AOP is a more general mechanism to do this kind of thing. I'm on the fence about it though, it is arguably too far down the road towards magic, because you see an attribute and you really have no idea what it's doing if there is potentially AOP code from referenced assemblies in play.
I think I'd rather see specific language features to make it simple to deal with the 90% case, even if at some point AOP becomes available as well at a later time.
|
|
|
|
|
BobJanova wrote: it is arguably too far down the road towards magic It be voodoo dude . If, however, they made it obvious that it was an AOP attribute rather than a general attribute, this would help - say use |AOPAttribute| as opposed to [OrdinaryAttribute].
|
|
|
|
|
Hi.
Thank you for your reply.
I think your idea must be supported by Framework too.
Higty
|
|
|
|
|
Hello,
I don't know, is it secure to send windows password via netNamedPipeBinding to WCF service running on windows service? Hence, I request your thoughts on this and here is the scenario
We are asking the user to enter the windows user name and password from client application and sending them to WCF service(without explicit encryption) since the service need to interact with network mapped drive but currently we are not sure whether .net takes care of encrypting the user name and password and sends it via pipe or not.
About service details,
1. It uses the netNamedPipeBinding because we wanted this to be within machine level scope
2. Security mode set to mode="Transport" inthe config file
3. Transport protectionLevel set to protectionLevel="EncryptAndSign" inthe config file
4. There is no app.config at client side but creating object by passing "NetNamedPipeSecurityMode.Transport" "new NetNamedPipeBinding(NetNamedPipeSecurityMode.Transport)"
5. The machine where the wcf service is hosted may or may not be connected to internet
Is these enough? Or should I use explicit encryption? If explicit encryption required then, how to do?
Thanks, Sudhakar
|
|
|
|
|
Best way to check is to get a diagnostic tool and see what's actually sent across the pipe. If you're interacting with a WCF service over a non-secure channel then it's probably going by plain text.
However if you're on a single machine then it may not matter – if someone bad has access to the machine then you've got more problems than how your app handles data locally.
Probably best not to use your email as your display name, you'll get lots of spam if you publish your email like that.
|
|
|
|
|
I am creating a setup and deployment project in visual studio 2010. I need some custom action to be performed. I added an user interface with a text box that will accept the mail ID from user during installation and check from the database whether the mail id already exists in my user table.
Please help me.
|
|
|
|
|
AshwiniSH wrote: Please help me. With what, you have not asked a question?
|
|
|
|
|
Sorry.
In my setup project, I want to add an user interface with a text box that will accept the mail ID from user during installation and check from the database whether the mail id already exists in my user table.
|
|
|
|
|
And what is the problem with doing that? Will the setup program have access to the database?
|
|
|
|
|
I created a setup project in VS2010 and added a user interface selecting a text box field. The user interface is appearing during installation. I want to validate the input entered in the text box. How can I do this?
Where should I check this?
Please help me in how to validate the fields.
In VS2012, Install shield Limited edition I did not find how to add user interface also.
|
|
|
|
|
AshwiniSH wrote: Where should I check this? Presumably you will capture the input and validate it against some values that you have in your code.
|
|
|
|
|
Yes the input will be provided during installation (Say username), I want to validate this. Where should I write code to check this validation?
|
|
|
|
|
I was able to add a user interface but not able to do any validations to it as I don't know where exactly I can refer the user interface I added.
So, I decided to do it another way. i.e run my application exe after the installation. My application has a windows form which accepts user details and can validate through code behind.
In this case I don't want to show "Installation Complete" screen. I want my application to be launched instead of "Installation Complete" screen. How can I do this?
Can you please help me in this?
|
|
|
|
|
I have a method that I am exploring that takes in generic parameters.
public void Test<t,x>(t source, x destination) {
what I am trying to do is determine if x is either a collection or a class anything else should throw an exception.
The collection on I got by using the following
if(destination is ICollection<x>)
But my Googlefu keeps bring me back to the Type class and all I keep using is the IsAnsiClass but this registers true even if I pass an integer variable.
Is there a way to determine if the destination variable is a class?
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
I may well be misunderstanding you here, but...anything that isn't a class is a struct in C#, so won't this work:
public void Test<t,x>(t source, x destination)
{
if (!(destination is ValueType))
{
Console.WriteLine("Class");
}
else
{
Console.WriteLine("Not Class");
}
}
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
You hit the nail on the head there Griff thank you..
I blame my stupidness on a lack of Coffee
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
I frequently try the same; sadly no one believes me...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Of course, if you want to restrict the input so that you only accept class types, just add where x : class as the generic constraint.
|
|
|
|
|
Thanks Pete, I was aware of the where t: class .
The end game that I was trying to achieve as a learning experiment was to create my own version of Automapper to allow me to convert either EF tables or single rows from tables.
The second part of the learning was to create a single class that would act as a facade to the whole process and direct the conversion depending on weather it was a BindingList, List or class.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
modified 25-Mar-14 16:14pm.
|
|
|
|
|
Sweet. I look forward to seeing an article on this as it sounds absolutely fascinating.
|
|
|
|
|
The problem that I see in what you're doing is that you're checking for the passed in type at run-time. The whole point behind Generics is that you treat the T as a template at compile-time, preventing you from writing invalid code before you even compile it.
Pete's solution takes care of that little problem by limiting what types can be passed in as you're writing the code.
|
|
|
|
|
I was aware of suggestion that Pete made where X : class
I was experimenting with basically creating my own version of Automapper as a learning exercise that would allow me to convert EF tables or single rows form the tables into business objects to use outside of the data layer.
I was trying to use a single facade class to act as the start of the conversion process which would then direct the data depending on the type that X was i.e. BindingList, List or class.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
In the sample code below, how can i set varying column widths for each column individually? The DescriptionColumnName width is expected to be much wider than other columns and Col1Name is not expected to be equal to Col2Name in width?. Currently, all columns are being returned with the same column width, and the description column in most cases contains alot of free text, so i want to reduce the width of columns Col1Name & Col2Name and then increase DescriptionColumnName width.
Document document;
document.NewPage();
System.Collections.ArrayList columnWidth = new System.Collections.ArrayList();
for (int i = 0; i < this.dataTable.Columns.Count; i++)
{
if (i < 2)
{
columnWidth.Add(2f);
}
else
{
columnWidth.Add(1f);
}
}
float[] headerWidths = columnWidth.OfType<float>().Select(w => (float)w).ToArray();
PdfPTable tableHeader = new PdfPTable(3);
tableHeader.AddCell(GetCell(Col1Name));
tableHeader.AddCell(GetCell(Col2Name));
tableHeader.AddCell(GetCell(DescriptionColumnName));
tableHeader.SetWidths(headerWidths);
tableHeader.HeaderRows = 1;
PopulatePDFCell(tableHeader);
document.Add(tableHeader);
|
|
|
|
|
Guys,
Am struck up with a scenario below,
I have 50 "Subfolder" under my "MainFolder"
In my project, On selecting a "Add Applications" button am browsing to MainFolder and selecting the same.
Now all the subfolders under the MainFolder need to be populated in the DataGird View, in my Project.
I tried with few commands which i got by browsing in blog, but not successfull.
Please assist, how can i acheive this.
Cheers,
|
|
|
|
|
What code do you have right now? When you say you want all subfolders to be populated in the DataGrid view, what exactly do you mean by this? Do you just want the folder names or do you want the contents of those folders as well? Do you need to keep iterating so that you pick up the entire folder tree under the main folder (i.e. subfolders of subfolders)?
|
|
|
|