|
Thanks for the suggestion.
What I eventually did was to create a Copy method and use the MemberwiseClone method to create a shallow copy of the object.
SuzyB
If I had a better memory I would remember more.
|
|
|
|
|
Could anyone recommend me an image gallery control? SOmething like ... lets say when you open a folder with image in MyComputer in window it displays all the images as thumbails I want such a control (free of course) can anyone tell me where I can get one?
I REALLY REALLY need it!
Thx
(o)(o)
|
|
|
|
|
If you've ever used MFC before, you might remember the concept of separating document and view. Setting aside the debate about whether MFC is good or not, I'm developing an app right now that has a clear definition of a document that can be saved/loaded/printed and possibly edited in different views, and I think I could use some of the design that were quite rigidly enforced in MFC.
Unfortunately, I've lent my MFC book to a friend (probably about 5 years ago), and I can't remember some of the document/view separation ideas.
If anyone happens to remember the answers, here are my main questions:
-Should the main view create and manage the document object, or should it be created outside?
-Should the document object be able to access the view object (WinForms control), and should I use it from there? Should I worry about portability of the document object, or should I just worry about that when I serialize it and leave the view object out?
-Since objects within the document are in charge of drawing themselves, should the document object draw the whole view, or should that be up to the view object? If the latter, should I pass the Device Context (System.Drawing.Graphics in .NET) to each draw routine?
Thanks in advance.
By the way, don't you think it'd be cool if VS.NET had templates for SDI and MDI C# applications? Maybe we should post that on the Whidbey suggestions page.
|
|
|
|
|
|
Great, that's exactly what I was looking for.
I found this[^] article with a Google search for "view model controller pattern", and the last portion cleared up all my questions.
Thanks!
|
|
|
|
|
Hi,
i have a problem handeling powerpoint presentations with c# .net.
I have to copy all shapes and slides from an existing presentation to
another.
Only to copy the whole presentation doesn't work for me.
But when using .copy() and .paste() the formatting is lost.
Also the background and the slide master is not in the new
presentation.
Can anybody give me a little code how to handle this?
I've looked everywhere but found nothing about it.
Thanks a lot!
|
|
|
|
|
Could I ask which IPC techniques for C# applications work on all Win98, WinMe, Win2000 and WinXP platform ?
Thanks
|
|
|
|
|
hi
i am working with mapi and i want to use it to send a mail thorough my c# code.. i have managed to write a pice of code.. but i cant send any mails through it.. my code compiles and runs perectly ... but deosnt send any mails.. that is wen i run it no error or exception occurs.. but wen i turn to my in box there are no mail there either.. can anyone help me with this...
here is the code..
if (strServerType == "MAPI")
{
MAPI.SessionClass oSession = new MAPI.SessionClass();
// Will use vEmpty for Empty parameter
Object vEmpty = System.Reflection.Missing.Value;
// Logon
oSession.Logon(strHostName,
System.Reflection.Missing.Value,
false,
true,
0,
System.Reflection.Missing.Value,
@"outlook\smehmood");
MAPI.Folder outbox = (MAPI.Folder)oSession.Outbox;
MessageEmail MailToBeSent = new MessageEmail();// this is class which i derived from MAPI.message interface...
MailToBeSent.Session = oSession;
MailToBeSent.Recipients = strTo;
MailToBeSent.Subject = strSubject;
MailToBeSent.Text = strMessage;
MailToBeSent.Signed = true;
MAPI.Attachments at = (MAPI.Attachments)MailToBeSent.Attachments;
MailToBeSent.Send(true,false,System.Reflection.Missing.Value);
// Log off session.
if (oSession != null)
oSession.Logoff();
}
|
|
|
|
|
Hi all,
I have one question about the installer. I've set the RemovePreviousVersions of installer to true, and have changed the installer version every new release(it also changed the product code).
However, the installer still can't detect the pervious version of application. Do I miss any important steps?
Please hlep.
Regards
|
|
|
|
|
Hi
My installer is unable to remove assembly from Cache.i tried to run rd/s/q assemblyName command by starting Process but it`s giving access denied error,following is my code:
Assembly a = Assembly.LoadWithPartialName("MyAssembly");
curdir=Directory.GetCurrentDirectory();
getParent=Directory.GetParent(a.Location.ToString());
Console.WriteLine(getParent.ToString());
getParent=Directory.GetParent(getParent.ToString());
Console.WriteLine(getParent.ToString());
getParent=Directory.GetParent(getParent.ToString());
Console.WriteLine(getParent.ToString());
Directory.SetCurrentDirectory(getParent.ToString());
Console.WriteLine("Current Directory");
curdir=Directory.GetCurrentDirectory();
Console.WriteLine(curdir.ToString());
a=null;
System.Diagnostics.Process myproc=new Process();
myproc.StartInfo.RedirectStandardOutput=true;
myproc.StartInfo.UseShellExecute=false;
myproc.StartInfo.FileName="cmd.exe";
myproc.StartInfo.Arguments="/C rd/q/s MyAssembly";
myproc.StartInfo.WindowStyle=ProcessWindowStyle.Normal;
myproc.Start();
Console.WriteLine(myproc.StandardOutput.Read().ToString());
myproc.WaitForExit();
Console.WriteLine("Current Directory After Finishing of Process");
curdir=Directory.GetCurrentDirectory();
Console.WriteLine(curdir.ToString());
The executed command gives following O/P
MyAssembly\100~1.0__\MyAssembly.dll - Access is denied.
-1
|
|
|
|
|
intresting thing that when i run rd/s/q assemblyName on Command Prompt,it removes the file successfully
is there some .NET restriction to remove assemblies within framework?
|
|
|
|
|
|
hi,
I am a new .net programmer.Can any one tell what are the major classes and the that i need to go through in .net.Just like java has utill package which we use a lot in the programming.Can any one tell where I can find the description of these classes.
Satish
|
|
|
|
|
|
Ok here's my take, from most used namespaces (packages in java?) to least used (but still used alot).
1. System - all things common to the framework, eg object, string, primitives.
2. System.Collections - few handy list classes.
The above is common to most, my personal preferences follows.
3. System.IO - all stream related classes, including the overlooked StringReader/Writer classes.
4. System.Reflection - allows you to get info at runtime for any class (including your own).
5. System.ComponentModel - type convertors.
6. System.Windows.Forms - all UI classes.
7. System.Xml - basic XML goodies.
8. System.Text - most notably StringBuilder class.
9. System.Net - basic network client classes.
10. System.Text.RegularExpressions - RegularExpressions.
11. System.Xml.Serialization - XML (de)serialization.
12. System.Runtime.InteropServices - support for calling lecagy dll's.
And finally you might wanna look at System.Data that has support classes for database interopablity, and the ASP.NET related namespaces (System.Web.* ) for web stuff.
HTH
xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots
|
|
|
|
|
If you have Visual Studio, try typing "System." in a function. It'll bring up a list of all the namespaces and objects there, along with brief descriptions. SharpDevelop does the same thing, if you want a free IDE.
|
|
|
|
|
hi,
Thank you all for giving this information.I think this will help me a lot to learn.
Satish
|
|
|
|
|
hi
1.how i can determine the current user keyboard language in web application when page load?
2.how i can change it to specefic language?
thanks
|
|
|
|
|
1. I doubt you can.
2. I sincerely hope there is no way to do this.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
1) Keyboard language? You can't determine the web client keyboard from the server side. There is nothing that passes that information from client to server.
2) You can't! There is no way you can change a system-wide setting from inside the client web browser.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
How i can do an "Open Window" in C# code area with getting a specific URL?
thanks
|
|
|
|
|
You'll have to be more specific about what you want to achieve. What do you mean by "Open Window" and "code area"? And how does this URL come into play?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i want to do some thing like : a redirect in a new window with a specific URL , in code area : c# code behinde file.
as like as HyperLink tag or link tag.
|
|
|
|
|
I have no idea how to do it. This question really belongs in the ASP.NET Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
In my code I have a bottleneck which consists of a cpu-intensive loop of
size LENGTH. What I did was to divide that loop into two threads, Thread1
doing the 0 to LENGTH/2 part, and Thread2 doing the LENGTH/2 to LENGTH part.
There is no synchronization between threads, so they should work pretty
freely.
My machine has two processors (dual P3, Windows 2003 server). Now comes the
problem: when running the program, both threads are scheduled on the *same*
processor! I checked many things, for example:
1) Added a while(true); infinite loop, and it resulted in each thread be
scheduled to another processor (this was a test of course, I don't need an
infinite loop!).
2) Added the following code the loops in each thread:
for (int i = 0; l < 10000000; i++);
Just an empty loop that wastes CPU. Strangely enough, this somehow signals
to the scheduler that the threads are cpu-intensive and so each thread is
scheduled on different processor.
I would like to mention again that even without this wasteful loop each
thread is already 100% cpu-intensive, and so it is very strange that the
scheduler does not assign each thread to seperate processor.
As a last resort, I tried using a Win API call to SetThreadAffinityMask to
manually assign each thread to seperate processor. This to no avail, as my
request was ignored! (although the SetThreadAffinityMask function did not
return a fail status.) Again, strangely enough, when I use
SetThreadAffinityMask in the while(true) example above to ask the scheduler
to assign both threads to same processor, the scheduler does respect the
request and assigns both threads to same processor.
Finally, I have to mention that within the loops many memory accesses are
done (though no memory allocations). Is it possible that because of this the
scheduler places both threads on same processor to share L1 cache? (Though
after many years of parallel programming in C/C++ I have never encountered
such a strange behavior).
And if not, is it possible that the problem is because of a bug in .NET
Framework thread handling?
Thanks in advance for any reply that might shed some light on this mystery.
|
|
|
|