|
I think I have to plug my values into a matrix and scale the vectors based off of a reference point(like you said) which I'm just going to cheat and find the average of the X coords and the Y coords for that reference point. But the Matrix.Scale method doesn't support a certain reference point so i would have to extend the method and thats a pain, or i'm just lazy. But if anyone has done such a thing(scaling a 2d polygon from a reference point) please assist. Thanks!
|
|
|
|
|
|
Hi Guys,
Does anybody know how to parse a check MICR, these are the digits at the bottom of the check with account number, routing number and check number. Please help!!!
sasa
|
|
|
|
|
Hi all , have a good day
I have a small C# application .NET 1.1 and I am using for my application about (8) eight .NET control library
.
.
.
MagicLibrary.dll
Qwhale.dll
commandbar.dll
.
.
.
Now!! My Question which is fast or better ?!!
- Add those Control's Source code to my Application and make it stand alone EXE
OR
- Make those control External ( leave them DLL ) and add them like reference
to my Application
thank you for your advice , which I appreciated it so much ....
kind regards
I know nothing , I know nothing
|
|
|
|
|
Including the source code for the libraries into your own application is a bit faster as there is less overhead required when loading the application. This overhead comes from the fact that you have one assembly to load into memory as opposed to 9 the other way. However, this does come at a maintenance cost since any time the libraries change you must recompile your application rather than just updating the DLL.
In the grand scheme of things, you really don't gain much by making one monolithic application.
|
|
|
|
|
thank you so much
thank for your advice
have a good day
I know nothing , I know nothing
|
|
|
|
|
Stark DaFixzer wrote: Now!! My Question which is fast or better ?!!
Yes
|
|
|
|
|
I know nothing , I know nothing
|
|
|
|
|
Stark DaFixzer wrote: Now!! My Question which is fast or better ?!!
It's not an easy question. If all the code is needed to start the application (e.g., all the controls are used by the main application form), it may be a little faster to generate a monolithic application.
But, if those assemblies may be needed only later, your application startup may be faster if you use several assemblies, as they are loaded typically only when and if needed.
|
|
|
|
|
Hi all
I have to convert a string into a System.Decimal instance, using the System.convert.ChangeType method.
The problem is that I would like to make the conversion parameterizable, because the inputs come from different places and formats change with the source
I have configuration files telling how to parse a given source. For dates, I use the CultureInfo specified as strings in the config files (en-US, for instance).
This works fine with the majority of numbers, but some numbers come with parenthesis surrounding them (to indicate negative values). This is not understandable to Convert.ChangeType method.
So, I need a way to continue using the same method, but I will need to provide my own IFormatProvider implementation. I looked at the documentation, but I can only see an example returning an ICustomFormatter instance, which is used to convert an object to a string.
What I need is an implementation that would return something usable by Convert.ChangeType . Any article, tutorial on how to do this?
Thank you,
Michel
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
|
Hehe I expected an answer like this one. My problem is that I don't want to be limited to a given type. Also, it could be specified as an integer, a long, etc.
I don't want to have an ugly switch handling all the cases.
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
Hmmm...don't know of any way to do what you want using ChangeType . I assume you're using the Convert.ChangeType Method (Object, Type, IFormatProvider) overload of the method? Have you tried passing in a NumberFormatInfo object as the IFormatProvider ?
|
|
|
|
|
Yes, I tried that. It does not work with numbers surrounded with parenthesis and that class does not take a NumbersStyles argument or property.
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
Those are the only things I know that might work. You may end up needing to create your own version of a ChangeType class that knows how to handle your special cases.
|
|
|
|
|
I think you can do this with TypeConverter s, but I am not sure...
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Hi!
I want to create a list box and its items should include a text and a picture (icon).
Has anybody an idea how to realize that?
regards
Gernot
|
|
|
|
|
You would need to subclass the ListBox and provide your own drawing routines. Have you looked[^] here on CP?
|
|
|
|
|
hi
here is my code
first My Listbox1 has a name panellist
second make sure to set PanelList.DrawMode = DrawMode.OwnerDrawVariable;
third fill the list with with 5 items
NOTE : this code is not full example it's just and right idea
private void PanelList_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)<br />
{<br />
SolidBrush br = new SolidBrush(Color.Navy );<br />
Image img = PicFavorites.Image;<br />
StringFormat sf = new StringFormat();<br />
sf.Alignment = StringAlignment.Far ;<br />
sf.LineAlignment = StringAlignment.Center ;<br />
e.DrawBackground();<br />
br.Color = Color.Navy ;<br />
e.Graphics.DrawString(PanelList.Items [e.Index].ToString () ,e.Font ,br,e.Bounds ,sf );<br />
switch (e.Index )<br />
{<br />
case 1:<br />
{<br />
img = PicGeneral.Image;<br />
}<br />
break;<br />
case 2:<br />
{<br />
img = PicEditView.Image;<br />
}<br />
break;<br />
case 3:<br />
{<br />
img = PicIncomingCalls.Image;<br />
}<br />
break;<br />
case 4:<br />
{<br />
img = PicServices.Image;<br />
}<br />
break;<br />
case 5:<br />
{<br />
img = PicSetting.Image;<br />
}<br />
break;<br />
default:<br />
break;<br />
}<br />
e.Graphics.DrawImage (img ,e.Bounds.X + 10, e.Bounds.Y );<br />
e.DrawFocusRectangle();<br />
<br />
}<br />
<br />
private void PanelList_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e)<br />
{<br />
e.ItemHeight = 48;<br />
}
I know nothing , I know nothing
|
|
|
|
|
Does anyone know how to set the readonly attribute of an class property at runtime.
Code example:
Class Myclass
{
private int x=0;
private int y=0;
[readonly(true),Description("Set X value")]
public int X
{
get{return x;}
set{x=value;}
}
[readonly(false),Description("Set Y value")]
public int Y
{
get{return y;}
set{y=value;}
}
}
|
|
|
|
|
By definition you cant. The nature of Attributes means that they rely on being just metadata.
I think you are also confusing the meaning of the ReadOnly attribute - it is used to tell the IDE that the property should not appear in the Properties Grid.
|
|
|
|
|
Confusing with the meaning!!! Well, not really...
by doing some searching on the site. i found what i was looking for.
http://www.codeproject.com/useritems/dynamicattributes.asp[^]
But you are right, "by definition" its only an metadata.
What i needed was, an simple function for the propertyGrid to enable and disable an field...
So all in all, its manageable...:-> :-> :->
|
|
|
|
|
PawJershauge wrote: What i needed was, an simple function for the propertyGrid to enable and disable an field...
PawJershauge wrote: Confusing with the meaning!!! Well, not really...
Yes really, your original post makes no mention of the PropertyGrid. The code I posted works and directly answered the question from your original post.
This is CodeProject.com not Prognostication.com.
|
|
|
|
|
well im not going to argue with you, but i did write the attributes in my class, and thats what i wanted to change...
case closed...
|
|
|
|
|
PawJershauge wrote: Does anyone know how to set the readonly attribute of an class property at runtime.
Is this a trick question?
public class Myclass
{
private int x = 0;
private int y = 0;
[ReadOnly(true), Description("Set X value")]
public int X
{
get { return x; }
set { x = value; }
}
[ReadOnly(false), Description("Set Y value")]
public int Y
{
get { return y; }
set { y = value; }
}
}
Myclass mc = new Myclass();
mc.X = 10;
Debug.WriteLine(String.Format("Myclass.X: {0}", mc.X));
|
|
|
|