|
Not sure if such attribute exists. If one does not exist, you can write your own.
Or you can catch the exception during the Deserializing event which is raised before deserialization. You can use the attribute:
[OnSerializing]
void TypeHasChanged()
{
//Handle type change exception
}
|
|
|
|
|
Why does <code>DateTime.ToShortDateString()</code> not use the system short date format? Surely that is the format you would want if you don't wish to override the default formatting?
Semicolons: The number one seller of ostomy bags world wide. - dan neely
|
|
|
|
|
I think it does for me.....
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I had a bad brain day yesterday. I just checked again all works fine.
|
|
|
|
|
I am currently working on deploying a .NET component (Windows Form - UserControl) for use [embedded] in Internet Explorer.
The actual delivery system is this:
I have a deployment project that packages everything as an *.msi
This *.msi + an *.inf are packaged in a CAB file, which is referenced in the CODEBASE attribute of the object tag in the markup.
This part is great - it is deployed, installed, & works fine.
What I am dealing with now is the upgrade process.. From all of my research & trials, which can more or less be neatly summed up on this page.. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1536629&SiteID=1[^]
Since mscoree.dll is what has to instantiate the object for IE to host it, when msiexec installs my component, everything is installed referencing the .NET2.0 version, 2.0.50727.1433. So, for IE to be able to hook into the code base & install it properly, I have to append the version information (to the codebase attribute) as 2.0.50728. This is obviously sub-optimal, and presents the need for a potentially ugly workaround.
Per some of the articles/posts I have read, I have fiddled with registry values in the following keys, but to no avail.
HKEY_CLASSES_ROOT\CLSID\{...}\InprocServer32
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Code Store Database\Distribution Units\{...}
If anyone has had to deal with a similar case, or has any ideas on what to try, I would definitely appreciate the help!
Thanks -
|
|
|
|
|
And if they can be, how? Can't any other less space-taking program/environment take its place? And why?
|
|
|
|
|
Wajeeha wrote: Why can't .Net executable programs work on a system without .Net framework?
Because the framework contains the code that your application calls. Unless you write an application that makes zero calls into the framework. But even then it requires the CLR.
Wajeeha wrote: And if they can be, how?
There are third party tools that encorporate what is needed into your application, but they are very expensive.
Wajeeha wrote: Can't any other less space-taking program/environment take its place?
At the end of the day you have to consider what your priorities are. If you require a small footprint then you have to design to that consideration from the start.
If you have already gone down the road of building the .NET application then you are probably stuck with that descision.
Wajeeha wrote: And why?
Why what? I don't understand "why" in this context.
|
|
|
|
|
Microsoft Research have a compiler called Pheonix that can do a little bit of everything (eg compile all of the languages that MS support).
It has been discussed to make it able to compile to native too.
So it's not impossible that we will see a C# to native compiler from MS in the future..
|
|
|
|
|
Roger Alsing wrote: Pheonix
Is the one you are referring to?
http://research.microsoft.com/phoenix/[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Yes
There is an interesting clip about it here:
http://channel9.msdn.com/Showpost.aspx?postid=396461
|
|
|
|
|
Wajeeha wrote: Can't any other less space-taking program/environment take its place?
I suggest you upgrade your 120MB hard drive.
|
|
|
|
|
Their are open-source 'wrappers' for the .NET framework that allow .NET applications (up to 2.0 as of right now) on other OSs such as linux, mac, and unix.
A few to mention:
Mono
Portable .NET
Read about them at: Wiki article on .NET Framework[^]
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
I am creating assembley named Comp1.Comp1 contains a public method.The Global Cache contains a sencond assembley named comp2.here I must ensure that the public method in only from comp2..which permission we have to take GacIdentity or Strongnameidentity...anybody know plz reply me..
Rajendran.AL
|
|
|
|
|
If you'r requiement ment is to call only the function of Comp 2 then only add the reference of comp2 to your application. It is not a issue of assembly security.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
r aa j wrote: assembley
You ought to learn spelling assembly correctly.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Thanks guru ji....thanks for ur answere...I will cm to meet U for learning English.....thanks
Rajendran.AL
|
|
|
|
|
Hey, gang. I believe I have a question that ought to be easy to answer and not be stupid this time. I've Googled around and dug around MSDN, but haven't found anything addressing this issue, and I'd sure appreciate a tip.
I've constructed a nifty little form that contains a DataGridView for displaying some information. It is formatted just the way I want it, and everything was great until I decided that the DGV and related controls would be more pleasing to the eye in a GroupBox. When I dropped them in, the DGV immediately took on the font size and color attributes from the GroupBox, so I changed them back manually to the previous settings
Everything looks great during design time, but during run time the DGV takes on the font attributes from the GroupBox again, and looks awful. I've never run across this with other controls, which listen to me when I change their properties, even when they're in a GroupBox with differing properties. Does anyone have some insight into what is happening behind the scenes? Is there a way to prevent this behavior?
Thanks very much for the help!
|
|
|
|
|
Hi,
Below is my class that has its Type converter implemented.
TypeDesciptor.GetConverter(typeof(MyPoint)) doesn't return the converter for MyPoint but returns System.ComponentModel.TypeConverter.
if I implement a ICustomTypeDescriptor for MyPoint, then it works fine.
Does anyone have idea why it is not working?
[TypeConverter(typeof(MyPointTypeConverter))]
public class MyPoint
{
public int x;
public int y;
public MyPoint(int x, int y)
{
this.x = x;
this.y = y;
}
}
/// <summary>
/// Class that implements TypeConverter for MyPoint type.
/// </summary>
public class MyPointTypeConverter : TypeConverter
{
// Overrides the CanConvertFrom method of TypeConverter.
public override bool CanConvertFrom(ITypeDescriptorContext context,
Type sourceType)
{
// some code
return base.CanConvertFrom(context, sourceType);
}
// Overrides the ConvertFrom method of TypeConverter.
public override object ConvertFrom(ITypeDescriptorContext context,
CultureInfo culture, object value)
{
// some code
return base.ConvertFrom(context, culture, value);
}
// Overrides the CanConvertFrom method of TypeConverter.
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
// some code
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context,
CultureInfo culture, object value, Type destinationType)
{
// some code
return base.ConvertTo(context, culture, value, destinationType);
}
}
Thanks,
Sowjanya.
|
|
|
|
|
sowjanya_mudimala wrote: TypeDesciptor.GetConverter(typeof(MyPoint)) doesn't return the converter for MyPoint but returns System.ComponentModel.TypeConverter.
I just tested it:
class Program
{
static void Main(string[] args)
{
var tc = TypeDescriptor.GetConverter(typeof(MyPoint));
Console.WriteLine(tc.GetType());
Console.ReadLine();
}
}
Result:
MyPointTypeConverter
|
|
|
|
|
This seems to be a problem only on Vista with a certain set of pictues.
For instance, here is a picture...
http://tinyurl.com/55psg9[^]
Here is an excerpt of the code I am using to display the thumbnail (special code because height > width in the particular picture).
<br />
float _scale = (float)_orig.Width / (float)_orig.Height * __DesiredSize.Width;<br />
Image _image = _orig.GetThumbnailImage ((int)_scale, (int)__DesiredSize.Height, tnCallBack, IntPtr.Zero);<br />
<br />
Bitmap _backgroundImage = new Bitmap (__DesiredSize.Width, __DesiredSize.Height);<br />
Graphics _graphics = Graphics.FromImage (_backgroundImage);<br />
<br />
Rectangle _toPut = new Rectangle ((__DesiredSize.Width - _image.Width) / 2, 0, _image.Width, _image.Height);<br />
_graphics.DrawImage (_image, _toPut, new Rectangle (0, 0, _image.Width, _image.Height), GraphicsUnit.Pixel);<br />
Displaying the thumbnail in the a listview shows black bars on the side. Same thing happens with the landscape pics.
Any help would be greatly appreciated.
|
|
|
|
|
I have a threading problem and I'd like to ask your opinions about it. I have an array of objects I need to process one by one. I need to do two operations on each object. The problem is, both of those operations run on separate BackgroundWorkers. I need a solution to do operation 1 first and then operation 2 and when operation 2 completes continue to the other object in list. I couldn't figure out how to such a thing. Any ideas? I appreciate any ideas on this.
|
|
|
|
|
May be you ca keep a flag variable to keep track of what operation is going on currently so that both threads can use it as a look up to determine when to proceed with the next
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
Well I tried this:
start process 1 worker
process 1 worker do work
process 1 worker complete: call for process 2 worker
start process 2 worker
process 2 worker do work
process 2 worker complete: call for check next
check next:
----index++
----if index > array.count then complete()
----else start process 1 worker
Well this does work fine for the first iteration but then all breaks loose. I logged the process and after second iteration and beyond, saw weird things like process 1 do work and process 2 do work working twice sometimes
I'm truly lost. God I hate threading
Here's the work log:
process1() - index: 0
process1 run.
process1 dowork.
process1 completed.
process2 run.
process2 dowork.
process2 completed.
nextitem().
process1() - index: 1
process1 run.
process1 dowork.
process1 dowork. (??)
process1 completed.
process2 run.
process1 completed.
process2 dowork.
process2 dowork.
process2 completed.
nextitem().
process1() - index: 2
process1 run.
process2 completed.
nextitem().
finished().
process1 dowork.
modified on Wednesday, May 21, 2008 11:32 AM
|
|
|
|
|
So you want to know how to do Synchronous operations Asynchronously? Perhaps you might want to rethink that?
led mike
|
|
|
|
|
I think the exact opposite. I need to do two async operations synchronous. That or I know definitions wrong
Either way I know it's weird but it's not my call, it's a component so I can't change the way it works..
|
|
|
|