Click here to Skip to main content
15,908,111 members
Home / Discussions / C#
   

C#

 
GeneralRe: SoundPlayer Pin
MasterSharp25-Nov-07 9:02
MasterSharp25-Nov-07 9:02 
GeneralRe: SoundPlayer Pin
Kristian Sixhøj25-Nov-07 9:10
Kristian Sixhøj25-Nov-07 9:10 
GeneralRe: SoundPlayer Pin
MasterSharp25-Nov-07 9:38
MasterSharp25-Nov-07 9:38 
GeneralRe: SoundPlayer Pin
Kristian Sixhøj25-Nov-07 9:42
Kristian Sixhøj25-Nov-07 9:42 
GeneralRe: SoundPlayer Pin
MasterSharp25-Nov-07 9:47
MasterSharp25-Nov-07 9:47 
QuestionRequest made to the server from Web Browser Control? Pin
Khoramdin25-Nov-07 7:04
Khoramdin25-Nov-07 7:04 
QuestionCheck if x minutes has passed Pin
Kristian Sixhøj25-Nov-07 4:27
Kristian Sixhøj25-Nov-07 4:27 
AnswerRe: Check if x minutes has passed [modified] Pin
Ravi Bhavnani25-Nov-07 5:09
professionalRavi Bhavnani25-Nov-07 5:09 
DateTime lastTimeCommandWasUsed = DateTime.MaxValue;
...
bool AtLeastXMinutesHavePassed
  (int xMinutes)
{
  <code>// Check if "x" minutes have elapsed</code>
  DateTime currentTime = DateTime.Now;
  bool allowUse = false;
  if (lastTimeCommandWasUsed == DateTime.MaxValue) {
      allowUse = true;
  }
  else {
      TimeSpan elapsedTime = currentTime - lastTimeCommandWasUsed;
      allowUse = elapsedTime.TotalMinutes > xMinutes;
  }
 
  <code>// Return status and keep track of new last used time</code>
  if (allowUse) {
      lastTimeCommandWasUsed = tmNow; currentTime;
      return true;
  }
  return false;
}
/ravi

-- modified at 12:54 Sunday 25th November, 2007

This is your brain on Celcius
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com

GeneralRe: Check if x minutes has passed Pin
Kristian Sixhøj25-Nov-07 5:20
Kristian Sixhøj25-Nov-07 5:20 
GeneralRe: Check if x minutes has passed Pin
Paul Conrad25-Nov-07 6:56
professionalPaul Conrad25-Nov-07 6:56 
GeneralRe: Check if x minutes has passed Pin
Anthony Mushrow25-Nov-07 7:02
professionalAnthony Mushrow25-Nov-07 7:02 
AnswerRe: Check if x minutes has passed Pin
Ravi Bhavnani25-Nov-07 7:02
professionalRavi Bhavnani25-Nov-07 7:02 
GeneralRe: Check if x minutes has passed Pin
Kristian Sixhøj25-Nov-07 7:12
Kristian Sixhøj25-Nov-07 7:12 
AnswerRe: Check if x minutes has passed Pin
Ravi Bhavnani25-Nov-07 7:20
professionalRavi Bhavnani25-Nov-07 7:20 
GeneralRe: Check if x minutes has passed Pin
Kristian Sixhøj25-Nov-07 7:24
Kristian Sixhøj25-Nov-07 7:24 
GeneralRe: Check if x minutes has passed Pin
Kristian Sixhøj25-Nov-07 7:48
Kristian Sixhøj25-Nov-07 7:48 
GeneralRe: Check if x minutes has passed Pin
Ravi Bhavnani25-Nov-07 7:50
professionalRavi Bhavnani25-Nov-07 7:50 
QuestionMore DirectSound Pin
MasterSharp25-Nov-07 4:14
MasterSharp25-Nov-07 4:14 
AnswerRe: More DirectSound Pin
martin_hughes25-Nov-07 4:35
martin_hughes25-Nov-07 4:35 
GeneralRe: More DirectSound [modified] Pin
MasterSharp25-Nov-07 5:23
MasterSharp25-Nov-07 5:23 
QuestionLock a directory Pin
mahdiehIR25-Nov-07 3:47
mahdiehIR25-Nov-07 3:47 
AnswerRe: Lock a directory Pin
Guffa25-Nov-07 3:52
Guffa25-Nov-07 3:52 
GeneralRe: Lock a directory Pin
Paul Conrad25-Nov-07 11:09
professionalPaul Conrad25-Nov-07 11:09 
JokeRe: Lock a directory Pin
mav.northwind25-Nov-07 20:22
mav.northwind25-Nov-07 20:22 
QuestionSystem.Window.Forms.LinkView TO System.Window.Forms.Listbox Pin
sweet corn25-Nov-07 3:24
sweet corn25-Nov-07 3:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.