|
That would work with a URL as well like this:
System.Diagnostics.Process.Start(@"http://www.myurl.com");
However I need to pre-load the MP3 from the Internet and a timer will click play at the exact instant the MP3 is supposed to be played. This is for broadcasting automation, so timing is critical.
Glenn
|
|
|
|
|
If timing is that critical, then why are you relying on an external service?
Build an MP3 player into your app, so you have decent control over it.
Google is your friend here![^]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi,
I'm picking up the hourly 5 minute newscast from Fox. The radio station software switches over to live input at the top of the hour and picks up the audio from the MP3 player. If I knew how to download the newscast, I could play it from the hard drive.
I have an application that is not working so well that picks up the audio feed. It uses QuartzMediaPlayer. It used to work perfect until a couple of weeks ago. Now it just plays the same newscast over and over again from the Internet. If I were to play it off the hard drive, that would be better. WMP seems to work correctly every hour by hand.
Glenn
|
|
|
|
|
If I have a class which holds a bunch of employees and I want to allow enumeration over it, I can implement IEnumerable as below:
public class EmployeeCollection : IEnumerable<Employee>
{
private List<Employee> _employees;
public IEnumerator<Employee> GetEnumerator()
{
return this._sheets.GetEnumerator();
}
public IEnumerator GetEnumerator()
{
return this._sheets.GetEnumerator();
}
}
Any idea how I can allow enumeration if I am using a Dictionary<string, Employee> instead of List<Employee>? What interface do I need to implement and how?
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
You could probably return this._sheets.Values.GetEnumerator() .
|
|
|
|
|
The problem I was having was that I did not know what interface to implement if I am storing items internally as a dictionary.
I simply implemented IEnumerable<keyValuePair<string, Employee>> and that did it.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Hey all,
Got an interesting problem where I'm using a cascaded combobox type setup, with the second combobox's IntegralHeight property set to true so that it should resize itself relative to the contents of the items list.
However, it's not doing this and I'm stumped. I don't think I should have to go ownerdraw in order for this to work, so can anyone suggest a reason why it might not be working?
FYI I am rebinding the combobox datasource to a datatable each time the "master" combobox value changes.
|
|
|
|
|
If you set the DropDownHeight property, this resets the IntegralHeight to false. Make sure you have not done so.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Yep, double-checked that I haven't.
Any other ideas?
|
|
|
|
|
What about if you set the DropDownHeight after it is bound?
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
I've checked the code for any instances where the DropDownHeight is being set, and there aren't any - neither in the *.designer.cs or the main class *.cs file... which according to MSDN means that the width should resize if IntegralHeight is set to true (which is apparently the default but I'm setting it manually just in case).
Is there nothing like a Refresh() or Invalidate() that I can call to force it to re-evaluate it's contained items automatically? I really don't want to have to resort to OwnerDrawn to sort this out...
|
|
|
|
|
I have classes as these below,
and I have myList List<cost>,
myList.Add(new Materials),
myList.Add(new PlannedOperation)
I have to implement searching in List<cost>, but I do not know exactly how.
For example I want to find: Cost where type of cost is Materials and orderNumber = "000001"
or Cost where type of cost is PlannedOperation and value > 50000
I should have in the result List<cost>, or maybe List<materials>, List<plannedoperation> ...?:/
Thanks for Your help.
public abstract class Cost
{
private Int32 id;
public Cost()
{
}
public abstract override string ToString();
public Task Task
{
get
{
return this.m_task;
}
set
{
this.m_task = value;
}
}
public Int32 Id
{
get
{
return this.id;
}
set
{
this.id = value;
}
}
public abstract double Value
{
get;
set;
}
}
public class Materials : Cost
{
private string name;
private string description;
private double value;
private DateTime orderDate;
private DateTime realizationDate;
private string orderNumber;
public Materials()
: base()
{
}
public override double Value
{
get
{
return this.value;
}
set
{
this.value = value;
}
}
public string OrderNumber
{
get
{
return this.orderNumber;
}
set
{
this.orderNumber = value;
}
}
}
public class PlannedOperation : Cost
{
private double hours;
public PlannedOperation()
{
}
public double Hours
{
get
{
return this.hours;
}
set
{
this.hours = value;
}
}
public override double Value
{
get
{
return this.hours * this.m_OperationMachine.Operation.CC.SearchRate
(this.Task.AddDate.Year.ToString()).Value;
}
set
{
}
}
}
|
|
|
|
|
Have a look at List.FindAll[^], I think that'll satisfy your requirements.
|
|
|
|
|
This is the most probably comfortable. Thanks.
|
|
|
|
|
You're welcome.
|
|
|
|
|
How about loop[^] this list, switch[^] the type, cast[^] the object, then compare[^] the values.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I was thinking about this, but loop by 100000 elements? Is this the good idea? I'm looking for something more effective.
modified on Friday, May 22, 2009 9:45 AM
|
|
|
|
|
arturw82 wrote: Loop by 100000 elements? I look for something more effective
What do you mean more effective? you mean one line of code that does all the work for you, well that's not possible. you are passing different types into the list and you want to compare different values based on the type that is in the list.
How do you expect to search a list without check all the items
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Something quicker in the working.
I am novice, that is why I ask. There are solutions or practice maybe about which I do not know.
|
|
|
|
|
What's more basic than a for loop, a switch statement, and an if statement??? If you can't cope with them then you need to go back a step - not look for another alternative.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
|
|
I invented something like this. But I will check Your solution if will be some difference in efficiency...
List<Cost> aa = l1.FindAll(c => (c is Materials && ((Materials)c).OrderNumber == "9999999"));
|
|
|
|
|
|
you can't. WebBrowser is a WebBrowser, Internet Explorer is an application
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|