« first day (12 days earlier)      last day (4937 days later) » 

1:04 AM
Can anyone tell me why my "PromptSave" method keeps being called twice?
I'm using mvvmlight messengers
gist: 650378, 2010-10-28 01:03:16Z
//This is in my viewmodel
public MainViewModel()
{
	Messenger.Default.Register<CancelEventArgs>(this, e =>
					{
						UpdateCurrentRepository();

						if (!_currentTextFile.IsClean())
						{
							if (File.Exists(_currentTextFile.Path))
								SaveFile();
							else if (PromptSave() == MessageBoxResult.Cancel)
								e.Cancel = true;
						}

					});
}

private MessageBoxResult PromptSave()
        {
            MessageBoxResult result = MessageBoxResult.Cancel;

            DialogMessage message = new DialogMessage(_currentTextFile.Name + " has been modified. Would you like to save?", r => result = r)
                {
                    Caption = string.Empty,
                    Button = System.Windows.MessageBoxButton.YesNoCancel
                };

            Messenger.Default.Send<DialogMessage>(message);

            if (result == MessageBoxResult.Yes)
                SaveFile();

            return result;
        }

//This is in the view's code behind

public MainWindow()
{
	Messenger.Default.Register<DialogMessage>(
					this,
					msg =>
					{
						var result = MessageBox.Show(
							msg.Content,
							msg.Caption,
							msg.Button);

						// Send callback
						msg.ProcessCallback(result);
					});
}
 
hello
new to chat
 
Hey Jeffrey, any chance you can see what's wrong with my code?
 
Rye
1:25 AM
@Justin what does SaveFile(); do?
 
It shouldn't affect what's happening
I'll post it
gist: 650416, 2010-10-28 01:28:09Z
private void SaveFile(bool isSaveAs = false)
        {
            UpdateCurrentRepository();

            if (isSaveAs || !File.Exists(_currentTextFile.Path))
            {
                SaveFileDialog sd = new SaveFileDialog
                {
                    DefaultExt = ".wo",
                    Filter = "Write-Only Text Files (*.wo)|*.wo|Write-Only Project Files (*.woproj)|*.woproj|Plain Text Files (*.txt)|*.txt|Richtext Files (*.rtf)|*.rtf|All files (*.*)|*.*",
                    FilterIndex = 0
                };

                CallbackMessage<SaveFileDialog, bool?> message = new CallbackMessage<SaveFileDialog, bool?>(sd, result =>
                {
                    if (result == true)
                    {
                        _currentTextFile.Save(sd.FileName);
                    }
                });

                Messenger.Default.Send(message);
            }
            else
                _currentTextFile.Save();
        }
 
Rye
it's fine though
 
You don't see anything wrong either?
?
 
Rye
1:43 AM
I can't figure out also :P maybe yous should put something in if (result == MessageBoxResult.No) but its already set to .Cancel hmmmm..
 
Thanks for looking it over for me
Hopefully I'll be able to figure out what's wrong, so I can sleep well tonight
 
2:24 AM
Hello, i need some help with Entity framework. Did some body can help me how to update EntityCollection with Entity framework 4.0 ?
 
2:48 AM
hi, I need to do this in c# and am not sure on how to approach it.. I'm willing to go and read stuff on it, but maybe I am not using the right keywords. Can anyone give me any leads on this .. ? My question is :
0
Q: Writing a server in C# .NET to handle custom requests/response

brainydexterI need to write a 'server' in c# which would process requests in a specific format and produce a corresponding response in a pre-defined format. request: (userid);(userpwd);+ response: (user_purchase1);(user_purchase2);(user_purchase3);+ As, I understand this correctly, the server is a standal...

 
 
1 hour later…
4:11 AM
hello everybody...
 
hi i need answer for this question stackoverflow.com/questions/4039701/…
0
Q: Is it possible to implement WPF in already developed C# Windows form application Without Changing Existing code?

rattyi am working with C# windows form application i developed project in that.i like to make project design into more stylish and modern.is it possible to do like this by using WPF,if yes i like to apply WPF code without change Existing code and design,Is it possible to do like this.

 
@ratty u mean u have a window form project and u wanna have the same view in WPF?
 
Hi, i need to know how to implement event handlers of an user control which is dynamically added to the aspx page. I want to handle the user control events inside aspx page.
0
Q: How to handle dynamic user control events in aspx page.

RupaHi, I have an aspx webpage in which an user control is added dynamically as follows: UserControl testUsrControl = LoadControl("TestUsrControl") as UserControl; testUsrControl.ID ="test"; Then I tried adding an event handler of user control inside aspx like below: testUsrControl.Drpdatafield_S...

How to do this, please explain.. its urgent
 
@dr Tj yes
 
@ratty but, the main reason of WPF is to change views to something better...
 
4:23 AM
@All, (\d+(?:\.\d+)?)\D*$ - this regex extracts price from any string with decimal point, but I want to extract decimal point only when there is something but not zero like when there is 300.50 or 300.25 then decimal point should be extracted but if there is 300.00 then the decimal point should not be extracted, what to do ?
 
Hello
 
@Dr TJ i am also like to change windows forms and button view without changung existing code
 
but u dont need to change ur code...
is it a database?
@Xaisoft hi
 
yes Dr Tj it is connected with database
 
How are you?
Whats the best book/resource on regular expressions?
 
4:29 AM
@ratty sorry, i dont get what is your problems with WPF? just designing new views? or changing your code?
 
Yep, I know that one, it's very good
The author have that site has a book out too
 
in general, in WPF, except some codes about bindings, the rest is the same as window form
 
@Dr TJ for example i like to change the view button which is created in c#( make stylish button) without change clickevent code which i already wrote in that event.
 
If I want to mimic this chat using jquery and asp.net, do I have to store the message in a database and display it immediately for other users to see it or is there an alternative
 
4:32 AM
so, its possible
there is nothing
 
is it possible
 
yes sure...
 
try to answer my question without some example and some tutorials
this my request to you mr Dr TJ
 
okok
just give me some minutes...
 
ok Dr TJ
 
4:38 AM
can anyone tell me solution for user contro problem?
 
@DrTJ I Edit my question view now stackoverflow.com/questions/4039701/…
 
@ratty i saw... so nothing will change... just in XAML code, you chage some style codes...
let me send you an example
 
ok
@DrTJ Where i have to add XAML code in my application
 
in WPF applications, you have 2 coding page
one for XAML and the other is for code-behind...
are you using WPF application or window form?!
 
@DrTJ TJ Window form Application
 
4:45 AM
@ratty :/
its not possible there
 
@DrTJ So only i get confused is that any way
 
you should add new WPF app to your solution and try to copy your code and change your forms to WPF
as far as i know, NO
@MarcGravell hello marc
@ratty WPF and Window form apps are different in their view engines
you never can use WPF styles in win-form apps
 
is possible to make better view in windows forms application like views in WPF
 
the only thing is to use a WPF host in ur win form app and add your WPF user controls to window form
but i've never test it and i dont know how is the result...
 
hi alll..............
good morning
 
4:55 AM
@Pramodh hello my friend... how are you?
 
@DrTJ , i'm fine dear.... how about you
/
?
 
fine, thank you...
 
wat doing? busy?
 
nothign... just trying to fix a bug...
have you ever seen ( True == False ) => True?
@ratty i sent you a link about that
 
@DrTJ , no,... what is this dude?
 
5:05 AM
@DrTJ send that link i will see
 
@DrTJ heya; I panicked this morning - I thought there was NO COFFEE!. I mean, people, how is a geek meant to code at 6am with NO STINKING COFEE.
 
@Pramodh i wrote a SQL Stored Procedure and its not working
@MarcGravell hahah... good morning
excusme, thats a function...
 
@DrTJ , sorry , i'm not able to help you.. we are not using SQL. or any such db'
 
@MarcGravell, soda/pop/coke/whatever-you-call-it.
 
hi, benjol
 
5:20 AM
@Pramodh, hello, just catching up. (If you @ in front of my name I notice sooner :)
 
Hello guys!!! @DrTJ saw your recent question but I dont work with SQL ;-(
 
@Shoban hi, thanks
 
@DrTJ Just added a comment...
@MarcGravell I'm trying to 'come off' coffee, 'cos I got fed up of having stinking headaches everytime I ran out :)
 
enchante madmozels, je suis Jaminator!
 
5:37 AM
@jaminator en please :)
 
je n'ai jamais vu quelqu'un dire madmozels (I think I got that right, I've forgotten so so much...but I'll be good and use en now hehehe)
 
any idea about my problem with this SQL function? stackoverflow.com/questions/4039974/…
 
you've already pasted that in here...
 
@rchern yes sorry, but i really need to solve it in one hour...!
i have a presentation...
 
6:14 AM
@rchern i got a B in french, but dont remember a thing now
ALL I DO NOW IS CODE
 
...
 
 
1 hour later…
7:23 AM
anybody there?!
 
7:33 AM
@jaminator: I got an A, but I prolly still remember less than you. :(
 
7:54 AM
hello...........
any body there.....???
hello.........
 
rod
Hi All
 
@rod , hi
 
hi everybody
sorry, SQL room is empty and no one answer... but i have a question...
anybody can help me?
 
You'll have to ask your question and we'll see
I don't know if I can help you until I see the question
 
ok, so, i have a very simple question about foreign key relations
how can i set update role and delete roles together?
 
8:07 AM
@DrTJ , Hi again
 
for example for delete role, i just say >> on delete cascade
@Pramodh hi
how r u?
 
@DrTJ , fine , thankyou........
 
So what is your question? How to specify both an ON DELETE action and a ON UPDATE action at the same time?
 
@LasseVKarlsen yes
 
Which database engine?
 
8:09 AM
SQL
 
No, product?
SQL is the language
Microsoft SQL Server?
 
what is the difference? SQL Express
its code
 
The syntax depends on which database engine
 
i wanna do that with code
 
So if you're using SQL Server Express, it's T-SQL
 
8:11 AM
yes you are right
 
in which case you just specify both:
ON DELETE CASCADE ON UPDATE CASCADE
 
without any comma or maybe AND?
 
Also see here
No, just like that
 
@LasseVKarlsen thanks so much
 
And note that if you want people to stay in the SQL Room, you need to stay there yourself :)
if you leave when nobody is there, when the next person comes, there's still nobody there, so he'll leave too
 
8:16 AM
@LasseVKarlsen i was there for a long time... but nothing happened...
but i agree with what u said
 
I see the problem though, there's too many SQL rooms
 
the problem is that most of them had no visitor about 2 ro 3 days...
can anybody help me with this?
i have a window with 2 buttons
i set DialogResults as OK and Cancel
in OK button, when i check some conditions
if one of them is false, i say return
but
after this, the window close and program continue running after ShowDialog()
it should not close while i didn't said Close()
no?
 
If DialogResult is different from None, framework closes it for you.
 
so, how can i control this?
 
8:32 AM
Set DialogResult on the form to None or whatever the "no result" is
in that method, before you return
 
I'd do the other way around. Set button's DialogResult to None, and in your click handler when you are ready to close the form, set Form's DialogResult to what is needed
But anyway, that is really strange for an Ok button to not close the form
If you need validation, consider disabling Ok button instead
 
Yep, agree on all accounts
 
@IlyaRyzhenkov not bad idea
 
Naming question: I have a singleton class which manages disk interactions for a edit-one-file-at-a-time application. It currently has two events: FileModified and CurrentFileChanged. One means 'a user has edited the current file' and the other is 'the user has opened a different file, or created a new file'. Any ideas on better names?
 
8:51 AM
The problem looks like coming from the fact that you have two responsibilities on a single entity - switching to another file, and watching file changes. I'd make two entities - "FileSession" one which has Close/Open events (instead of single Changed). In an Open/Close event I'd pass another entity, smth like "OpenedFile" which has read/modify operations and appropriate events.
Client would subscribe to Open event and when file is opened, subscribe to modification event on a view. On close it would do the reverse. This way, if once you need to go with multi-file system, it's quite easy to switch
 
9:03 AM
@IlyaRyzhenkov Funny you should say that, because that's exactly what I'm in the process of trying to implement: an 'offline' file manager which works in parallel to the singleton :(
 
hello everybody
 
@se hello
 
what is the way to "synchoonize"
System.windows.Media.Brush vs System.Drawing.Brushes
 
@serhio Hello
 
I need SystemBrushes.Control for a WPF component
 
9:13 AM
sory i dnt have idea abt it
 
@serhio, what are you trying to do?
 
0
Q: System.Drawing.Brushes => System.Windows.Media.Brush

serhioWhat is the way to "synchronize" System.Drawing.Brushes with System.Windows.Media.Brush I need SystemBrushes.Control for a WPF control background... I am forced to create a new Media.Brush from SystemColors.Control?

@Benjol Elementary setting a systemControl background for a WPF component :)
 
@serhio, ok, let me rephrase that - why do you need/want to do that? (Just to be clear, I probably don't know the answer, but refining your question might get you more help)
 
@Benjol I want a control background for a WPF control
// does not work
this.windowsFormsHost1.Background = System.Drawing.SystemBrushes.Control;
why do I need that? :) because by default is transparent, and I don't like transparent
 
So it's not some special texture you're after, just a brush with the SystemColors.Control colour?
 
9:26 AM
yes
 
Can't you just create a Media.Brush with that colour?
or even set it directly in the Xaml? (I don't know)
Just for fun, here's the reverse of your question - almost :)
0
Q: How do I convert System.Windows.Media.SolidcolorBrush to System.Drawing.Color ?

KayaI need to convert a System.Windows.Media.SolidcolorBrush to a System.Drawing.Color in C# any clues would be great.

 
Hey..does anyone know how to retrieve the session using a session ID ?
Its actually to bypass the flash POST request bug
 
@Benjol thanks! actually, i fond an answer by myself :) amazing (see the question above) :)
 
@serhio, good :)
 
9:48 AM
0
Q: C# -->Go to Definition ==> VB.NET

serhioI have a solution in VS 2010. There are two DLL projects: one UserControl in C# WPF (myCSharpUC) and other - WinForm UserControl in VB.NET (myVbUC) Actually in myCSharpUC I have an instance of myVbUC: myCSharpUC { private MyVbUC vbControl; ... somemethod() { vbControl.M...

 
Does anyone have experience with the WebBrowser object in C#?
 
shure sombody should have
 
Yes, I have
 
:)
cool
 
It seems that it has less functionality as the normal Internet Explorer does
 
9:58 AM
so, peret, you are not alone!
peter*
 
nice
could you have a look at my question, Lasse?
0
Q: c# WebBrowser SVG Windows 2008 R2

Peter van KekemI have issues with viewing a SVG file in the C# WebBrowser control on a Windows 2008 R2 machine. When I have a look at the same file in Internet Explorer, everything looks ok. What i already have tried: IE ESC settings on or off Trusted Sites / Local intranet sites Run 32 bits do the followin...

 
You fall into the common trap most people do when posting questions
You don't give us enough information
You say "I have issues" but you don't say which issues
 
I mean, do you get a 404 error? A fatal crash? no image? incorrect image?
 
@PetervanKekem
see
 
10:00 AM
that is right, i see no image
 
0
Q: .NET WebBrowser control with Adobe SVG Viewer

I'm having problems with SVG files loading in a .NET 2.0 WebBrowser control. If I create a new WinForms application project, drag a WebBrowser control and a button onto the Form1.cs design surface, and add a line to the button's on-click handler to set the Url property of the WebBrowser control ...

 
I'll add that to my post!
 
Other than that I can't help you :)
 
@serhio, that won't fix my problem, since i've tried some security things which didn't help
but thanks anyway!
 
@PetervanKekem can you reproduce this problem on, say WinXp machines?
or this is specific to Win 2008
fi that, you should check more security parameters, if not and this is a common problem, win 2008 have nothing to do with
 
10:06 AM
I've updated it
0
Q: c# WebBrowser SVG Windows 2008 R2

Peter van KekemI have a WebBrowser in my C# application, in which i want to show a SVG file. However, when I run the app on a Windows 2008 R2 machine, the SVG file does not show up. When I have a look at the same file on the same server in Internet Explorer, everything looks ok. What i already have tried: I...

Yes on a WinXp machine it is not a problem at all
so it is specific for w2k8
 
@PetervanKekem e.... have you tried to run your application "As Administrator..."
like rught click run as administrator
 
and Process Monitor
 
I am actually logged in as an administrator on that server
what do you mean with process monitor, @Sarkie?
 
There's a different between part of Administrators and running as Administrator. And the SysInternals tool, watch if its looking for files or failing for other reasons...
 
The file can be found, since the title is set correctly
it just doesn't display the content
 
10:19 AM
yeah i mean "SVGParser.dll" or something silly
I'd just load and look for Errors
 
sorry i do not understand what tool you mean?
 
google
"Process Monitor"
#1 result at a guess
 
run as administrator doesn't help anything
 
@PetervanKekem does not mean if you are logged as admin or not. Try to execute "as administrator"
if, does not... no more ideas
:(
 
yes i did "run as administrator" explicit
that doesn't work out
i'm downloading and trying the process monitor right now @Sarkie
 
10:30 AM
Is there an alternative to "Request.Url.ToString()" that I can use in a c# codebehind WebMethod. (Request.Url.ToString() is used in the Page_Load function)
Thats Page.Request.Url.ToString() in ASP.NET
 
@Sarkie wow that is a lot of information :)
It doesn't look like it's going wrong... :-(
And actually, the title is displayed
 
10:50 AM
What is the best way to analyse project for myself? stackoverflow.com/questions/3853791/…
0
Q: What is the best way to analyse project for myself?

Dr TJHi When i wanna start a new project, I have enough details to just start it. And as all programmer needs, I need to analyse that project to understand how to write codes and classes and relations between them... Normally, I do it on so many papers and its really annoying and also I can't consentr...

 
11:02 AM
@DrTJ, just as an aside, you can leave out the 'Hi' on your question, it's not considered 'good form'
45
Q: Should 'Hi', 'thanks' and taglines and salutations be removed from posts?

Geoffrey ChetwoodI edit a lot of posts everyday. I often run across posts with 'Hi' and 'Thanks' on the top and the bottom of the post respectively. I also run across things like: --User Should these items be removed during the editing of the post by an editor?

 
@Benjol common man give the guy a break, we are humans. i dont agree with leaving Hi
 
@Benjol Maybe you are right, but this is in Iranian's culture (the same as islamic culture) to say Salam (Hello or Hi) when we start talking with new people...
 
@DrTJ, yes and no. It's like that in other cultures too. But on StackOverflow you're not talking
 
@Benjol what is the problem with saying just 2 characters?! :))
 
Absolutely not! I have to agree with toast - there's no reason we can't be a bit more informal and attempt to interact with the community on a more human level. If this is how the majority of programmers interact with their peers (no greetings, all information), then I'm really glad I don't have to deal with that every day.
 
11:08 AM
but i feel i'm doing disrespect if i dont say that...
 
courtest Andy Mikula
 
@DrTJ, read the whole question and the answers too, I haven't got any more to say than what is said there (I have an answer, it's waaay down the list :)
BTW, saying Hi here is fine
@DrTJ Anyway, just don't be offended if one day someone edits one of your questions and the Hi/thanks disappear :) Generally people don't edit a question just for that, but they may do so while editing for other reasons.
 
@Benjol i really have no idea... maybe you are right...
but its really hard to me to leave this
it doesn't matter if someone edit my questions just for remving that Hi
 
Change your username to Dr TJ, Hi :)
 
comma (,) is not supported
:))
 
11:20 AM
‎[WARN] caffine levels going down... [INFO]trying nicotine boost .. [ERROR] nicotine subsystem malfunctioning... [INFO] initiating heavy metal strategy - hang on, [INFO] initializing headphones...
 
@DrTJ, :)
I think cHao is partly right, your question is very broad. Going from nothing to something is the hardest part of any activity. I think with time each person has to find their own way.
2
Q: Learning how to analyse a project

PeterHi, I've just stumbled into the job of analysing a project for one of my company's clients (an SMB). I am a .Net developer (5 years) with little experience in analysing software (UML from school). We've just finished two weeks of talking with the users and got a nice big list of requirements. O...

 
@Benjol no, maybe you and the others got me bad... i mean
i was trying to find something like MSProject
MS Project is a good thing to start and list project tasks and needs
but it does't have any tool to (or maybe not designed for) expand those tasks to project parts
i'm so sure that there is a way for that
maybe its our turn to create that tool
 
@DrTJ, ok, in light of that maybe you want to edit your question, because talking about code and classes kind of gives the wrong impression. I know my boss gave up on project and ended up creating his own system (using Access) for handling projects
I've heard good things about fogcreek.com/fogbugz, but no idea if it does what your looking for.
 
11:35 AM
@Benjol it seems good :)
i've never tested TFS but it seems to be like what i'm looking for...
@Benjol its not what i was looking for, but good
but do u think its reliable?
 
11:56 AM
@DrTJ, no experience, but it's run by Joel, who is cofounder of Stackoverflow (if that means anything)
@DrTJ I don't see how TFS helps you manage projects - it helps you manage code and versions of code
 
have you ever worked with that? I just saw some videos from MSDN
 

« first day (12 days earlier)      last day (4937 days later) »