|
Okay, so I have written my own class library... And have documented it with the inline xml thingy... So... now what?
How do I distribute them to others?
What files do I have to include so that IntelliSense works okay? (Do I have to include the XML file?)
Where do I have to copy those files so VS recognizes them?
Regards,
Vandra Akos
|
|
|
|
|
Distribution:
distribute your xml and dll files together (in the same directory), as Visual does.
Usage:
- add a reference to the dll(s) you need, e.g. using the Solutions pane in Visual Studio
- add a using statement to your client source code
Now the classes in your new dll(s) are available together with their XML comment (for
Intellisense).
Luc Pattyn
|
|
|
|
|
I believe the XML files you are refering to are the XML documentation files which are turned off by default in the project. Building the dll, however, should include the XML comments as they are part of the assemblies meta data.
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
I was under the impression axos88 already got his XML file, but didnt quite know
what to do with it...
Luc Pattyn
|
|
|
|
|
I saw a few imaging programs, that use local database for storing data about images and thus provide extremely fast image search (wihtout accessing files).
I want to implement this: database for faster file search in my C# app, but any SQL tutorial begins with installation of some server tools. However, end user does not have these tools. I also cannot force him to install MS SQL Server, because he may not use Windows (my app should work on other platforms).
So I'm confused. Is is possible to use databases as well (in app release, that does not contain huge server tools) or it is better to use some alternative (e.g. store all the data in single XML file)?
Thanks a lot,
Libor Tinka
|
|
|
|
|
Libor Tinka wrote: Is is possible to use databases as well (in app release, that does not contain huge server tools)
SQLite[^] is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.
|
|
|
|
|
Good alternative to real database servers is so called "embedded databases"
|
|
|
|
|
Libor Tinka wrote: he may not use Windows (my app should work on other platforms)
Are you planning on having your app work with Mono?
|
|
|
|
|
i tried this
Graphics g;
g = e.Graphics;
g.SmoothingMode = SmoothingMode.AntiAlias;
g.DrawImage(System.Drawing.Imaging.Metafile.FromFile("logo.wmf"), new Rectangle(0,0,200,200));
but have no effect any idea how to draw wmf antialiased
Thanks
It is Good to be Important but!
it is more Important to be Good
[My Question]
|
|
|
|
|
Try setting the InterpolationMode property of the Graphics object to HighQualityBicubic (will give best results, though is the slowest method):
Graphics g;
g = e.Graphics;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.DrawImage(System.Drawing.Imaging.Metafile.FromFile("logo.wmf"), new Rectangle(0,0,200,200));
Instead of HighQualityBicubic , you can also use a different mode, for example Bilinear , if speed is necessary.
|
|
|
|
|
actually problem is it is not smoothing at all
i called it on
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
and also tried on
private void frmWelcome_Paint(object sender, PaintEventArgs e)
but nothing works
It is Good to be Important but!
it is more Important to be Good
[My Question]
|
|
|
|
|
Can anyone tell me how to unzip the files using C# application.
That would be great if anyone provide a solution for my problem.
Thanks,vin1070
|
|
|
|
|
Have a look at this free C# Zip/Unzip library:
#ziplib[^]
|
|
|
|
|
|
Hi all,
Can I get any .net developpped library, which gives the same functionality as DSO Framer control. Because the DSO Framer
control uses unmanaged code which gives problem in web applications when hosted in clients local machine.
So I need any .net developped tool to get these functioanlities done. I tried with aspose, but to change the document again
we need to change the code, or we have to fight with sumo to make it independent of document format. So please help me in
this. You can email me at : aleem076@gmail.com.
Thank you.
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Hi all,
Sorry for the real newbie question, but I'm suffering with understanding how C# calls methods within the same class (as well as outside classes). I've tried to simplify the problem to the code below. I'm afraid that I don't understand why, within the same namespace and class, Main can not call otherClass. I keep getting the error, "An object reference is required for non-static field, method or property 'tester.Form1.otherClass(int);'.
I confess I also struggle to understand why I can call another class method, bu t can not if the call is encapuslated within an if{ }else { } loop. I'm probably being neanderthal, but hey, any help appreciated. Again, sorry for the newbie q, but we were all newbies once, eh?!
static void Main()
{
Application.Run(new Form1());
int k = 1;
if (k==1)
{
otherClass(5);
}
else
{
otherClass(2);
}
}
public void otherClass(int j)
{
int i = 5;
i = i + j;
MessageBox.Show("hello" + j);
}
Jerry
|
|
|
|
|
Application.Run(someForm) will show that form, and run a message loop on it;
the statements that follow are normally not reached. So your if(k) stuff
should not be there but somewhere inside your form; this could be:
- in the form constructor
- in the form's OnLoad() method
- in another event handler, e.g. a myButton_Clicked(...) handler associated with a
button on your form. See example.
private void btnStart_Click(object sender, System.EventArgs e) {
log("button Start got clicked");
doSomething();
}
private void log(string s) {
Console.WriteLine(s);
}
private void doSomething() {
log("doing something");
}
Furthermore, dont use the word Class in a method name, it will confuse you.
May I suggest you read some book on C#.NET and/or have a look at some of the
beginner's articles here on CodeProject.
Luc Pattyn
|
|
|
|
|
As an alternative, when you do not need a Windows application (=application with
a GUI = geaphical user interface), you can choose a "Console application". This gives
a single window (the console), that displays all output of Console.WriteLine()
(on a Windows application, such output is lost, unless running from inside Visual Studio,
which captures that output in the "Output" pane).
A console application does not include an "Application.Run()" statement at all;
you can add code to the Main method as much as you want.
If you do need a GUI, stick with the Windows application and move your code, as per
my previous message.
Suggested reading[^]
Luc Pattyn
|
|
|
|
|
Main is a static method and otherClass (Which BTW should be in PascalCase) is an instance method, which means an instance is required for use. The two options are 1) Change the method signature for other class to be static, ie. public static void OtherClass(int j) or the create an instance of your class which I do not see the name of. So in your main
MyClass myClass = new MyClass();
myClass.OtherClass(5);
Actually, on further examination, this seems to be a generated class called Form1. If you move your logic from your Main method into the default constructor for Form1 it may work.
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
Aha! Now I read your answer it seems so simple, but of course it eluded me (maybe because I'm new at this!!).Thank you, Ennis. That makes sense and is most helpful. Have a good new year.
|
|
|
|
|
Hello,
My question may be very dumb but I couldn't change my web.config using the the following code:
XmlDocument doc = new XmlDocument();
doc.XmlResolver = null;
doc.Load(@"C:\Web.config");
XmlNode node = doc.SelectSingleNode("/configuration/appSettings");
I don't know why it always returns null.
Do you know what I stupidly did wrong?
Thanks,
Johnny
Here is my file
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="AuthorizationContext" value="Office" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false">
<assemblies>
<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="abc" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<!-- Increase the timeout to 2 hours. -->
<httpRuntime executionTimeout="7200" />
<webServices>
<protocols>
<add name="AnyHttpSoap" />
<remove name="HttpGet" />
<remove name="HttpPost" />
<remove name="HttpPostLocalhost" />
<remove name="Unknown" />
</protocols>
<soapExtensionTypes>
</soapExtensionTypes>
</webServices>
</system.web>
</configuration>
-- modified at 20:25 Friday 29th December, 2006
|
|
|
|
|
If the XPath parameter passed to the SelectSingleNode() method does not include a prefix, it is assumed that the namespace URI is the empty namespace. If your XML includes a default namespace (and that is your actual case), you must add a prefix and namespace URI to the XmlNamespaceManager; otherwise, you do not get your node selected
So, replace your line:
XmlNode node = doc.SelectSingleNode("/configuration/appSettings");
with the following piece of code:
XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);<br />
nsmgr.AddNamespace"pfx", "http://schemas.microsoft.com/.NetConfiguration/v2.0");<br />
XmlNode node = doc.SelectSingleNode("//pfx:appSettings", nsmgr);
SkyWalker
|
|
|
|
|
How to convert a Decimal number to Binary and Binary to Decimal.
Exp: 9 => 1001, 1001 => 9.
Help.
Vasildb
|
|
|
|
|
|
That project doesn't work because I have Visual Studio 2003.
Help.
Vasildb
|
|
|
|