473,396 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to tell if object is Serializable

I would like to be able to tell if an object is Serializable when it is
passed into a method. Is it possible using c# ?
Jul 21 '05 #1
1 1163
using System.Reflection you can do this
if (parameter.GetType().IsDefined(typeof(MyAttribute) , false)
Change "false" to "true" to allow classes to inherit the attribute.
--
Pete
====
Read or write articles on just about anything
http://www.HowToDoThings.com
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jason | last post by:
Hi prolly a simple solution...how do i make a "copy" of an existing object eg object obj1 = new object(); object obj2 = obj1; if i change a property in obj2, it also changes obj1, since...
3
by: Gelios | last post by:
Hi All! Probably my question is newbie but anycase. Should I do object that I want to pass as parameter to remoting object serializable? For Example: //server public class MyServerObject {
1
by: cmrchs | last post by:
Hi, how do I 'save' a DataRow-object in ViewState or Session-object ? Trying : Session = myDataSet.Tables.Rows; or ViewState = myDataSet.Tables.Rows; results in an error :
9
by: Developer | last post by:
Hi, How can one tell wsdl.exe/VS.NET web service proxy generatioon to to put on imported classes? For example, i fin your web service you use a class: class Data { }
1
by: Stephen Barrett | last post by:
I would like to be able to tell if an object is Serializable when it is passed into a method. Is it possible using c# ?
8
by: a | last post by:
I'm trying to save data from a custom object into the profile object, but it is not structured the way that I want. I'm trying to get the custom object to serialize as xml to a Profile object...
0
by: a | last post by:
I need to create an instance of a custom object 'School.Teacher' and use it in a Profile object. I'm developing a bad case of "Pretzel Logic" thinking about this. Filling the custom object ...
4
by: OpticTygre | last post by:
If I pass an object to another form via the new form's tag property, I want to create an object exactly like it, with it's properties and all, but have it be a copy of the object passed through,...
3
by: Techno_Dex | last post by:
I'm wanting to create a Wrapper (or Extender depending on how you look at it) for a Serializable object that I then want to send over a webservice. Basically I want to create a Serializable Object,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.