|
hi,
thanks navneeth ......
letme conclude tis...
ie we use this method when we have to override am i right.......
hope my conclusion is correct....
thanking you Navneeth
C#
|
|
|
|
|
If you want to override the default functionality of the base class you can use this. If you are removing override keyword from child class, then use new keyword there to avoid compiler warning.
|
|
|
|
|
It also lets you store a collection of 'Animals' in a collection without having to have a collecton of dogs, a collection of cats, a collection of llamas, a collection of...I think you know where I am going.
You can just have a collection of Animals, and add any class dervied from Animal to it.
class Animal {};
class Cat : Animal {};
class Dog : Animal {};
List<Animal>_myListOfAnimals = new List<Animal>();
Animal myCat = new Cat();
Animal myDog = new Dog();
_myListOfAnimals.Add( myCat );
_myListOfAnimals.Add( myDog );
Saying this, if you are using inheritence just to have this ability, then interfaces are the way to go.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Hello,
I've spent some time trying to render text or even a control on top of video being played at fullscreen using the AudioVideoPlayback namespace without any luck.
Originally I was aiming to have a transparent control on top of the video, but if I can get text on top, or any control (transparent or not) I'd be happy...
Can someone point me in the right direction? Perhaps provide an example of something similar?
thank you,
khoramdin
|
|
|
|
|
Hi,
you may have a look at ControlPaint class; I haven't used it myself yet, but it holds
some special things that may suit your needs.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hello Im having a problem with trying to parse a html file and extract data and put it in to a XML file.
its creating the xml file but not putting anything in to the file it self.
<code>using System;
using System.Text;
using System.IO;
using System.Xml;
namespace HTMLPARSER
{
class DescribeHtmlContent
{
[STAThread]
static void Main(string[] args)
{
try
{
string temp;
bool htmlFile = false;
StreamReader sStream;
XmlTextWriter xmlWr = new XmlTextWriter(@"C:\Parse\HtmlContents.xml", Encoding.ASCII);
xmlWr.Formatting = Formatting.Indented;
xmlWr.WriteStartDocument();
xmlWr.WriteRaw("\n<?xml:stylesheet type=\"text/xsl\" href=\"StyleSheet.xsl\"?>");
xmlWr.WriteStartElement("describer");
DirectoryInfo dirOne = new DirectoryInfo(args[0]);
FileInfo[] listOfFiles = dirOne.GetFiles();
foreach (FileInfo file in listOfFiles)
{
if (file.Extension.ToLower().Equals(".html") || file.Extension.ToLower().Equals(".htm"))
{
htmlFile = true;
sStream = new StreamReader(file.FullName);
do
{
temp = sStream.ReadLine();
if (temp != null && temp.ToLower().IndexOf("<title>") != -1)
{
int a = temp.ToLower().IndexOf("<title>") + 7;
int b = temp.ToLower().IndexOf("</title>");
temp = temp.Substring(a, b - a);
xmlWr.WriteStartElement("file");
xmlWr.WriteElementString("name", file.Name);
xmlWr.WriteElementString("description", temp);
xmlWr.WriteElementString("path", file.DirectoryName);
xmlWr.WriteEndElement();
xmlWr.Flush();
}
}
while (temp != null);
sStream.Close();
Console.WriteLine("Reading content from file: {0}", file.FullName);
}
}
if (!htmlFile)
Console.WriteLine("No HTML file found in the directory!");
else
{
xmlWr.WriteEndElement();
xmlWr.WriteEndDocument();
xmlWr.Flush();
xmlWr.Close();
}
}
catch (Exception ex)
{
Console.WriteLine("Error: {0}", ex.Message);
}
}
}
}
</code>
Whats up with this?
|
|
|
|
|
Have you checked what value you are getting in temp ?
|
|
|
|
|
Temp is null but my problem i think is i cant even write to the xml file my WriteRaw of the XML file.
|
|
|
|
|
Hi,
I want to position my controls (Rich text box or labels) in my panel dynamically. Is there a way for me to position each controls from left to right without having me to specify the coordinates? The problem is, the output I am having is dependent on a few criteria. So different scenarios will have different sets of label or rich text box for me to display. How can i solve this problem?
Thanks.
|
|
|
|
|
The closest i come across would be the dockstyle but it doesnt automatic shift to the next line when there is no more space in the panel.
|
|
|
|
|
Hi,
I am using infragistics ultrawingrid control.I want to display the totals of a column at the bottom of the grid columns.How can i do that?
Thanks.
Pavan
|
|
|
|
|
Try asking on an Infragistics forum
http://news.infragistics.com/[^]
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
go to
http://forums.infragistics.com
|
|
|
|
|
Hi,
How can I copies a folder with all contents (files And folders in it with all files in subfolders).
File.Copy() only copies files and DirectoriInfi.MoveTo() give me an error that access denied
Best wishes
|
|
|
|
|
Check this[^] out.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi Guys. I have a quick question. How does one make a form longer than the set form length in VS005?? Can it be done with code??
|
|
|
|
|
Try changing the Height, Width, or Size properties?
|
|
|
|
|
I'm not sure what you're referring to - is it the "feature" in VS2005 where the designer limits the maximum size of a form?
If so, yes, changing the size in code will work:
this.Size = new Size(5000, 40);
or whatever you want your size to be.
"If you think of yourselves as helpless and ineffectual, it is certain that you will create a despotic government to be your master. The wise despot, therefore, maintains among his subjects a popular sense that they are helpless and ineffectual."
- Frank Herbert
|
|
|
|
|
Here is code I wrote for you to do it
void SetFormWidth(int width)
{
Dictionary< string, string> dictionaryWidth = new Dictionary< string, string> (int.Parse(" 1 "));
dictionaryWidth.Add(this.Width.ToString().TrimEnd().TrimStart(), "0");
dictionaryWidth[this.Width.ToString().TrimEnd().TrimStart()] = width.ToString() + " ";
dictionaryWidth[this.Width.ToString().TrimEnd().TrimStart()] =
dictionaryWidth[this.Width.ToString().TrimEnd().TrimStart()].TrimEnd().TrimStart();
this.Size = new Size(int.Parse(dictionaryWidth[this.Width.ToString().TrimEnd().TrimStart()]),
int.Parse(this.Size.Height.ToString().TrimEnd().TrimStart()));
for (int i = 0; i < 100; i += (true) ? 1 : 1)
dictionaryWidth.Clear();
}
|
|
|
|
|
all this to set a new width?
maybe you can trim that a little?
how about Width+=300; ?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Not as secure.
|
|
|
|
|
I haven't laughed that hard in a while. I love the comments explaining the steps.
Jeff
|
|
|
|
|
|
Abdul Qahhar wrote: Dictionary< string, string> dictionaryWidth = new Dictionary< string, string> (int.Parse(" 1 "));
You forgot to use the ToLower method on the string before parsing it.
You should use double.Parse instead of int.Parse , use Math.Round on the result, and then cast it to an int .
Abdul Qahhar wrote: for (int i = 0; i < 100; i += (true) ? 1 : 1)
That's really, really bad. If you use the literal value true in the trinary condition statement, it will be optimized away. You have to put the true value in a variable and use in the statement.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
One way, with code is
this.Width = x; (x being some number that you want to size) (or, with that, by modifying the entire size) Another way is, in the designer, go to the properties of the form and change it. Simple... I don't know about console though.
The most knowledge doesn't mean the most wise...
|
|
|
|