|
You could add each file as a resource to an executable, then use the Assembly.GetManifestStreamNames/Assembly.GetManifestStream methods to loop through all the files added as resources parsing the name to determine if a folder should be created (or adding a special file which contains that data).
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
do you have sample code or articles on the subject because I don't know how play with Manifest( I don't know what is it) and I don't know how play with asssembly
??
thanks a lot
|
|
|
|
|
I'll get right on it
Actually I'll 'get right on' finding my code and tweaking it
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
I've uploaded a sample program that (by default) has two files embedded in it; it uses the FolderBrowser component from CP, and it just happens that that component is what I embedded in the exe.
AssemblyManifest.zip I've included the VS.NET project and a batch file to build it from the command line if you don't have VS.NET
Good Luck,
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
Thanks a lot, you're my god
btw do you have ICQ if yes here's my pin :71682311
thanks again
|
|
|
|
|
I have ICQ but its closed most of the time, I only talk to 2 people on it anymore and one of them is in an IRC channel with me and the other doesn't get on much :-P
I'm trying to switch over to sonork full time
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
Use your mouse to go over any menu item on any program. The status bar updates automatically with a description that you've added.
How do you do it with C#?
Thanks!!
|
|
|
|
|
Handle the Select event of the MenuItem and just set the status bar text (or anything else) as you wish.
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
Yep, that definitely helps. Is there any way of doing it automatically (as I'm used to in MFC)?
Or do I have to make one gigantic 'if' statement with the text that I want to display?
|
|
|
|
|
I dont know about doing it automatically, but you could always create your own derived MenuItem class, or an ExtenderProvider that would do it.
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
True, I saw some examples in Petzold. But then wouldn't you loose the capability of using the IDE to create your menus?
I currently have the following code snippet for the display on the status bar.
private void MenuLoad_Select(object sender, System.EventArgs e)
{
MenuItem oMenuItem = sender as MenuItem;
if( oMenuItem != null )
{
switch( oMenuItem.Text )
{
case "&Open":
StatusBarMessage.Text = "Open up the file";
break;
case "&Save":
StatusBarMessage.Text = "Save the file to the disk";
break;
}
}
}
|
|
|
|
|
If you are overriding the menus but not any of the drawing code (DrawItem and MeasureItem) then I would guess that the IDE should handle it, but I dont know. Try it and find out.
An extender provider would certainly not affect the IDE.
Probably the easiest way to do this would just be to buildup a collection of messages. This saves the interface, but doesnt allow you to set the menu help text in the forms designer.
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
What classes do I use to read the serial ports in C#? Any suggestions will be highly appreciated.
|
|
|
|
|
I want to know this too please
If somebody can help us please
Thanks
|
|
|
|
|
I believe this has come up on the DOTNET mailing list before. Try searching its archives.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
File f = new File();
Stream s = f.Open("\\\\.\\COM2");
maybe something like that can work
but i'm nt sure
|
|
|
|
|
I didn't find anything about compression(like zlib) in framework.
did i miss something? I wanna have my xml file zipped before sending out.
|
|
|
|
|
Hi,
I found this on George Shepherd's Windows Forms FAQ.
FAQ:
http://www.syncfusion.com/FAQ/Winforms/
Article link
45.2 How can I read and write zip files in my Windows Forms program.
Check out 'The Zip/GZip Implementation For .NET' available here. This library is released under a special GPL. Check out the above page for details.
|
|
|
|
|
There is a managed version of zlib available on the icsharpcode site.
J# will also provide libraries for porting Java 1.2 to .NET in that is the compression libraries that Java 1.2 had.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
I meet such a situation that there is hundreds of classes in a big namespace, and i just want to borrow something from it.
i write something like this:
=====================================
namespace big
{
class apple;
class banana;
...
}
=====================================
namespace small
{
class apple: big.apple
{
}
}
=====================================
But i hope not to use inherit. is there any way to declare a alias or mapping?
|
|
|
|
|
If you mean, give a new name to an existing object; then yes you can do that.
using apple = big.apple;
This only works on a file by file basis though.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
Thank you.
But what i exactly want is something like the cpp's #define.
#define small.apple big.apple
And pick the defines in a single header file, then it will only expose small part of a big library to user.
BTW, when i transfer my former cpp code to C#, i find it difficult to do with the #define macro.
for example
#define AT_LEAST(A,B) ...
here A B can be int, float, or double (surely template is another choice).
But in C#, #define can only define a symbol served for selected compile.
any suggestion?
|
|
|
|
|
nova chen wrote:
And pick the defines in a single header file, then it will only expose small part of a big library to user.
Nope, for that you'll have to create empty wrappers as you had mentioned in the first post.
nova chen wrote:
But in C#, #define can only define a symbol served for selected compile.
This is because #define's aren't type safe, and .NET is extremely type-safe; which is why they took out the ability to use macros in code. In most cases whenever you used a macro you should use a function instead.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
I've been trying to find a way to interact with the Windows OS natively in C# (for both windows and web forms), particularly adding/deleting/monitoring/displaying tasks in the Task Scheduler.
Can anyone help me find some info on this?
Thanks ahead of time!!
|
|
|
|
|
I have a problem with properties when making a Windows control
when i place the control on a form,properties of type string does not appear in the properties box.
I used this syntex:
public string Txt
{
get{//some code;}
set{//some code;}
}
The Text property of the base class (UserControl) doesn't appear too.
Also when I include a description for a property, the description doesn't
appear:
[
Description("Describe the property")
]
I use the beta2 varsion of visual studio..
can any one help?
|
|
|
|