|
ankitjoshi24 wrote: Javadoc is the most helpful thing for any java developers. So always visit javadoc and try to find your answers
This is a C# forum... huh?
|
|
|
|
|
i'm using Microsoft.DirectX.AudioVideoPlayback in order to play some videos simultaneous .
i want the user to be able to pick one of the videos as the lead audio and then i mute the others with
video.audio.volume=-10000
normally its working great but if one of the movies dont have audio this action throws exception
how i can know if certain video have audio in it ?
does DirectX.AudioVideoPlayback.video.audio have any property for it?
thanks in advence...
|
|
|
|
|
Can you just check if the Audio property is null ?
/ravi
|
|
|
|
|
thenks for your help , i found an article in msdn that explains that when you try to get audio property from video exception will be throwen if the video has no audio , the sulotion for this problem acordding to msdn is just catch the exception and ignore it...
|
|
|
|
|
|
i need to learn Microsoft Dynamics Development with .net. Actually i don't have any knowledge on the technology and want to learn it. if any body has a know how of the technology then please suggest me some URLs, book, tutorial where from i can learn the technology.
sorry if i have posted question in a wrong forum.....
Regards
|
|
|
|
|
What are you looking to learn? CCA? UII? Workflows? You should probably get started with this[^] book.
|
|
|
|
|
Microsoft Website itself will be good starting point for you...
All the best.
|
|
|
|
|
The OP does not get notified of replies to posts replying to other people. You might want to send this one to the OP instead.
|
|
|
|
|
Hi,
I understand why a class may be static...
In a public class which is NOT static why would there be a static method?
i.e.
public class myCommon
{
public static string GetCurrentDirectory()
{
string path = null;
...
...
return path;
}
}
Thanks
|
|
|
|
|
The static method can be used to create an instance of a class, for instance. Alternatively, the static method does something that does not affect the state of the class so there is no need for it to be an instance method (in other words, all of the variables it uses are local).
|
|
|
|
|
So, what is the difference between the following codes please?
public class myCommon
{
public static string GetCurrentDirectory()
{
string path = null;
...
...
return path;
}
}
public static class myCommon
{
public static string GetCurrentDirectory()
{
string path = null;
...
...
return path;
}
}
|
|
|
|
|
the difference is removing "static" in public static string GetCurrentDirectory() will not/will cause a compiler error message.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
So,
1- A static class should have all it's methods as static.
2- A static class can be referred to without creating an instance of it.
3- If a class is NOT static and one or more of it's methods are static, then those static methods can be referred to without creating an instance but to refer to the non static methods, first, an instance of the class must be created.
Am I right please?
|
|
|
|
|
arkiboys wrote: A static class can be referred to without creating an instance of it
Obviously, as creating an instance is impossible.
arkiboys wrote: Am I right please?
If you're being lazy, you're not right. Read the reference material, study your C# book(s), and experiment. Don't just sit back and ask to be spoon fed.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
|
|
They're used for a number of things:
To limit the use (amount of instances) of the class, see also Singleton Pattern.
Implicit and explicit casting support (So you can type 'myCommon A = (myCommon)"Hey there";').
Operator overloading ( +, -, *, / are operators), see also here[^].
|
|
|
|
|
Some methods don't need an instance of the class, so they can be made static, and invoked with the class name. E.g.
myCommon.GetCurrentDirectory ();
This can occur when the method doesn't reference any instance variables, but is still related to the class' purpose. The class is used to group related methods.
|
|
|
|
|
|
To perform operations that aren't specific to an instance of a class. For example, assuming an Employee class that contains a Guid Id member, the Delete() method could have either (or both of these) signatures:
1
2 public void Delete()
3 {
4 Employee.Delete (this.Id);
5 }
6
7
8 public static void Delete
9 (Guid id)
10 {
11 ....
12 }
/ravi
|
|
|
|
|
I generally try to avoid static in classes for examples like this.
The example given implies there is some global collection of Employees to/fomm which employees can be added, deleted, etc.
Instead, I prefer to make the collection explicit, with some collection List<employees>, or an explicit implementation class like EmployeeList.
That way, its possible later to create multiple instances if needed, for example, it can improve testability massively too, as EmployeeList can be mocked.
In C#, I generally try to limit use of static to those methods the framework requires me too - operator overloading etc.
Even the use to construct values is suspect - instead use a factory object, implemented as a separate class, or a factory method on an existing class to create instances.
Gilad Bracha has written a good blog entry[^] that highlights many of the dangers of static much better than I could.
<edit>That talks mainly about static state - the following blog entry[^] discusses the issue in context of constructors, which are static methods.
|
|
|
|
|
Rob Grainger wrote: The example given implies there is some global collection of Employees to/fomm which employees can be added, deleted, etc.
Right. The example is typical of APIs one would encounter in a data access layer, where the store is a database.
/ravi
|
|
|
|
|
Hello,
I have a very simple problem but I don't now how to search about this on Google.
I have a url I don't know it is in Unicode or what I am pasting it please if any one help me regarding this.
&#1495;&#1489;&#1512;&#1493;&#1514;-&#1514;&#1497;&#1497;&#1512;&#1493;&#1514;
actually this is a part of url and I have to convert it to such coding to let my browser to understand it and I can use it.
Yes I know about HttpUtility.UrlDecode but as I told you earlier I don't know in which coding is my string, most when I paste my string in google and write that I want to decode it, google automatically convert it to original language, I want the same thing which google is doing but how?
Please help me out guys because I spend about 2 hours on this issue but no success.
Thanks in advance
|
|
|
|
|
I'm not sure quite what you are trying to do, but is it to display that string? Something like (I just threw this into a page of an MVC3 page to quickly test, but you can probably follow what I mean). It displays a Hebrew string - if that is what you are trying to do. But I may have interpreted you wrongly.
<p lang="he">@Html.Raw(@HttpUtility.HtmlDecode("&#1495;&#1489;&#1512;&#1493;&#1514;-&#1514;&#1497;&#1497;&#1512;&#1493;&#1514;"))</p><pre>
|
|
|
|