|
Kant wrote:
How to expand all the closed regions with one single click?
Its not just one click, but you can use the menu items under Edit/Outlining.
You can also use the Ctrl+M, Ctrl+L sequence to toggle all expansions (as found under said submenu).
Kant wrote:
there any option in search which tells to search inside closed region?
Check the "Search Hidden Text" checkbox
Kant wrote:
How to store all the strings (ex: error messages) in a string table (STRINGTABLE), just like the way in VC++?
I think the closest .NET analogy of this is .resx files. I assume you want to do this for localizing purposes. If that is the case you can use the localization features of VS.NET to help with the creation. Unfortunately that feature is only available for Forms, but you should be able to replicate the behavior yourself for other classes once you see what VS.NET does.
First you need to set the Localizable property of the form to true, then you can set the Language property to the language you are setting the strings. You can then change all of the .Text properties to that languages text. Then change the Language property again, and change all of the .Text properties again. Repeat for all of the languages you are going to support.
Now that you've done that if you look at the generated code in InitializeComponent you'll see the method calls you need to make to pull a localized string.
Click the "Show All Files" button in the Project Explorer toolbar (if you haven't already done so) then expand the form's tree node so you can see the files under it. You should have: [form].resx, [form].[lang1].resx, [form].[lang2].resx, etc. These files contain the localized text for the application.
You should be able to figure out how to expand this for your own purposes. It is important to note that when you do this you will get several satelite assemblies contained in subdirectories of your output location. These (as their filename implies) contains the localized resources for that language/culture.
HTH,
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
James T. Johnson wrote:
You can also use the Ctrl+M, Ctrl+L sequence to toggle all expansions (as found under said submenu).
Thx a lot for the tip.
James T. Johnson wrote:
Check the "Search Hidden Text" checkbox
Ah! I better change my glasses..
James T. Johnson wrote:
I assume you want to do this for localizing purposes.
Not exactly.
I don't like hardcoded strings floating around in the code. In VC++ I keep all the strings in the string table. So whenever I want it, I can access them directly like this.
CString keyName = _T("");<br />
keyName.LoadString (IDS_INTERVALKEY);
where IDS_INTERVALKEY is "Timer Interval".
How to add these kinda of strings in the .resx file?
Thx for ur help.
Don't and drive.
|
|
|
|
|
Kant wrote:
How to add these kinda of strings in the .resx file?
The .resx file is just an XML file with a certain format so you can see the format other entries use, in my quick example I did to write that post I have a ton of schema stuff, plus some configuration stuff that the Resource* classes use to properly read the data then in the end:
<data name="theStringName">
<value>The String Value</value>
</data> Then you can read these out with:
System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(see below);
string myString = resources.GetString("theStringName"); The constructor to the System.Resources.ResourceManager relies on some naming information and an Assembly to search to find the resources. It appears that the naming follows that of Embedded Resources, so you may wish to reference my article concerning them[^] to see what you need to pass in.
If you look at the code that the WinForms designer generates you'll see it passes in typeof(MyForm) , the ResourceManager then pulls all of the information it needs from the Type which is passed in. This works well for the designer, but probably won't for your own code (unless you write a wrapper class to handle all of this for you). In which case use a combination of the help topic for the ResourceManager class and my article to figure out how the name you pass in.
Also, don't forget to make the .resx file an embedded resource
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
James T. Johnson wrote:
reference my article concerning
By the time you replied, I read that article.
Thx
Don't and drive.
|
|
|
|
|
Hey
I have a couple of classes that i use [Serializable()] on to save to file.
This workes fine(on thos objects that not got an Arraylist in it) =)
I got a class that have a ArrayList with alot of strings in its elemnets.
When i load the objekts in to my program, thay is loaded into an array to keeping track of them.
In this objects that is stored in the ARraylist i can see variabels, and here is the information right, but when i loog at the Arraylist in the objects, there is 0 elements, and thats not right.
Any ide how i could get this to work?
I Use this pice of code to read all object from file in to my StorArray
//reading of logg file
if(System.IO.File.Exists(Application.StartupPath + "\\logg.bin"))
{
StreamReader srlogg = new StreamReader(Application.StartupPath + "\\logg.bin",false);
BinaryFormatter bflogg = new BinaryFormatter();
this.logg = (ArrayList)bflogg.Deserialize(srlogg.BaseStream);
srlogg.Close();
}
To save the ARRaylist i use
//Save the logg file
StreamWriter swlogg = new StreamWriter(Application.StartupPath + "\\logg.bin",false);
BinaryFormatter bflogg = new BinaryFormatter();
bf.Serialize(swlogg.BaseStream, this.logg);
swlogg.Close();
Hop it is not to mixup
Best Regards
Jimmy
|
|
|
|
|
I think I have told you a week or 2 ago, that you should be using a FileStream, NOT a writer! Just passing the BaseStream, can cause unpredictable results.
Anonymous wrote:
In this objects that is stored in the ARraylist i can see variabels, and here is the information right, but when i loog at the Arraylist in the objects, there is 0 elements, and thats not right.
Can rephrase that perhaps? What do you mean here?
Hey leppie! Your "proof" seems brilliant and absurd at the same time. - Vikram Punathambekar 28 Apr '03
|
|
|
|
|
Yes i think you told me about the FileStrem for a couple of weeks ago...
But i havent lookt it up... specialy not when writer workes fine, until now.
I have a class(logg), in this class there is some private variabels, and one ArrayList.
In my main program file, i have another ArrayList, this arraylist is storing al the objects from the class(logg).
This Arraylist in the main program file i saves down in Bin filse jusing Serializing()
I whant to remeber that Serializing on a Class with a Arraylist fild with objects is not posible?
When i load in the Objects from file to my main program file, then the Arraylist in the logg class(object) is empty.
Here shod be alot of objects in this Arraylist in the object(logg class)
//
Jimmy
|
|
|
|
|
For some reason I cannot override EndInit() or Count in DataView. Not quite sure why, Anakrino shows them as public virtuals but VS.NET 2002 errors out saying they are not marked virtual, abstract or override.
Is there something I am just over looking?
Rocky Moore <><
|
|
|
|
|
Rocky Moore wrote:
Not quite sure why, Anakrino shows them as public virtuals
You should know better than to trust a decompiler for info like that!
EndInit() is from the ISupportInitialize and that is NOT marked virtual, and Count is never virtual. Anakrino obviously lies to u! Use the object browser or ILDASM rather.
Hey leppie! Your "proof" seems brilliant and absurd at the same time. - Vikram Punathambekar 28 Apr '03
|
|
|
|
|
leppie wrote:
Anakrino obviously lies to u! Use the object browser or ILDASM rather.
Yeah, I probably should have when straight to he ILDASM but didn't give it a lot of concern when I noticed that browsing the base class in VS.NET 2000 shows the member as overridable also. Figured two different sources wouldn't be wrong... Oppps..
Rocky Moore <><
|
|
|
|
|
What is the proper way to declare a protected set procedure for a read-only property, so that other objects in the same assembly can write as well as read?
I've thought of a couple:
public object TheProperty
{
get
{
}
}
protected object _TheProperty
{
set
{
}
}
protected object theproperty
{
set
{
}
}
protected object pr_TheProperty
{
set
{
}
}
protected void SetTheProperty(object newvalue)
{
}
Which of these would be the best (and feel free to suggest your own )?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
jdunlap wrote:
so that other objects in the same assembly can write as well as read?
Use the internal keyword for those variables, in fact you dont even need to have a property for them as you know what you are meant to do with them
Hey leppie! Your "proof" seems brilliant and absurd at the same time. - Vikram Punathambekar 28 Apr '03
|
|
|
|
|
I'm doing this for some of them, but others are kept in an inconvenient place and/or the component needs to know when they are changed.
I think I'm going to just decide myself which one to do.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
I've been using Java SDK for many years and Sun Microsystems had the entire API up for reference. Where can I find this for C#? I looked all over the ms.com site and foudn nothing. thanks!
|
|
|
|
|
|
A friend of mine told there's a number on each harddisk; this number is unique. So it can be used to make sure nobody can copy ypur software (the customer needs a hash code from this number to use the softwarer)
Does anyone how to obtain this nuber in C, C++, C# or Java?
Thank you in advance
|
|
|
|
|
I have used this sometime:
char VolumeName[200]="";
char FileSystem[50]=""; //FAT, FAT32, NTFS, CDFS, ...DWORD VolumeSerialNumber=0;
DWORD MaxFileName=0;
DWORD dwFileSystem=0;
GetVolumeInformation("c:\\", VolumeName, sizeof(VolumeName), &VolumeSerialNumber, &MaxFileName, &dwFileSystem, FileSystem, sizeof(FileSystem));
CString VolumeSerialNum;VolumeSerialNum.Format("%X",VolumeSerialNumber);VolumeSerialNum= VolumeSerialNum.Left(4) + CString("-") + VolumeSerialNum.Right(4);
jhaga
CodeProject House, Paul Watson wrote:
...and the roar of John Simmons own personal Nascar parked in the garage. Meg flitting about taking photos.Chris having an heated arguement with Colin Davies and .S.Rod. over egian values. Nish manically typing *censur*. Duncan racing around after his pet *c.* Michael Martin and Bryce loudly yelling *c.* C.G. having a fit as Roger Wright loads up *c.* . Anna waving *c.* and Deb scoffing chocolates in the corner.
..Good heavens!
|
|
|
|
|
Thanks for helping me with this C++ implementation,
but I noted yesterday I need a C# version; because I need to implement it in a C# program. Can you help me with this one too?
Thank you in advance
|
|
|
|
|
All you have to do is lookup the function name at microsoft
and read the info and use it with [DllImport()] attribute.
This is What I came up with doing a simple search with google.
Click Me
Bo Hunter
|
|
|
|
|
When a file entry is right-clicked in Windows Explorer a dialog appears with a minimum of a "General" and a "Summary" tab. The "Summary" tab always contains entries for Title, Subject, Author, Category, Keywords and Comment.
The .NET FileInfo class allows access to name, created date, etc. but not to the properties listed on the "Summary" tab.
How can I get to this "Summary" info with C#??? I don't event need to change it, just access it.
Thanks.
Grant
|
|
|
|
|
Google "FMTID_SummaryInformation"
|
|
|
|
|
Why is it happen that, when I'm setting the AutoScroll option of the main form to be true, it makes multi copies and dirt of the text I'm writting by using GDI(DrawString method) through the Paint event of the main form on every time I'm scrolling/resizing the window.
I'll be gratefull to receive your help.
|
|
|
|
|
Call Invalidate() after the scrolling/resizing.
Hey leppie! Your "proof" seems brilliant and absurd at the same time. - Vikram Punathambekar 28 Apr '03
|
|
|
|
|
I have run into that before... You need to either apply a translation transform or take into account the offsets of AutoScrollPosition. (There is a bug in AutoScrollPosition; the AutoScrollPosition requires a positive value if you set it; but it always returns a negative value when you read it.) Just add the values from AutoScrollPosition to all the coordinates in you Paint routine.
The size of the scrollbars are determined by the bounding area of all the child controls contained within the control. TO change this, you can set AutoScrollMinSize to the actual size you want.
What is happen is that Win32 ScrollWindow (or whatever it is called) is being called, and the invalidated region is then asked to paint itself, but without including the offset position.
In addition to the above, there should be some OnScroll event (I don't remember the name). Try calling Update() within the event to perform realtime updating as you scroll. This removes the redrawing delay that occurs when they user is continually dragging the scrollbar, and defering any paint events from being generated.
Just doing invalidate() doesn't work because it flickers--also, it doesn't take into account the scroll position, so your client area never actually scrolls.
Thanks,
Wes
|
|
|
|
|
I wanted to share two important news with you. A new (and free) C# decompiler has been made available by Lutz Roeder. Reflector[^] was in the past "only" showing IL(L) code. Now Reflector embeds a C# decompiler plugin and it comes just as the definitive tool to unmasquerade all those CLR secrets...
Reflector comes even handier than predicted with the use of hyperlinks to navigate through methods within the source code. Amazing!
Anakrino[^] 1.1 has been updated. In fact, only the xml configuration file needs an update. Get it here[^]. Replace the xml file in your Anakrino install folder with this one. Caution : this xml file references paths of the form C:\WINDOWS\... and, as a consequence, you are very likely to have to replace those occurences with C:\WINNT\... Otherwise, Anakrino raises an exception when it starts.
With these tools in hands, it is possible to know how EVERY .NET class is actually implemented.
For native calls, just give a look at rotor.
|
|
|
|