.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Post New Web Links

Using CodeDomSerializer - inner objects are cleared

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :WPF
 

I am develop on VS 2008, C#, Windows 7, Windows form.

Problem in my code : I succeed doing property editor, and I see that initializeComponent function is good (it saves and load).

I can see also the changes I made by the property editor on design time,

but (there is always but) when running the code (when debugging), I see that the "InitializeComponent" is cleared of the changes on "InitializeComponents" I have made.

(When I don't save the above, and just quite VS 2008, and login VS 2008 again - everything is fine).

I have created will partial success a property editor for a collection property object (such as columns on DataGridView),

using CodeDomeSerializer.

In code I need another collection, that helps me doing the work.

It's quite big code, so I cannot put the whole code here.

Some critical lines :

On the new auxiliary object, I added the attribute :

[

Serializable]

On the main object, I added the a


View Complete Post


More Related Resource Links

Session objects not cleared as expected, after upgrading to IIS7.5

  
I've just upgraded my development machine from XP SP3 (IIS5.1) to Win7 x64 (IIS7.5)Since doing this, my app has started to behave differently.  Within it I store users' preferences/access levels using an instance of a class that I store within the Session object.  This class is shown:Public Class UserSessionObject Private _customerID As Integer Private _userPermission As Integer Private _customerPermission As Integer Public Property CustomerID As Integer Get Return _customerID End Get Set(ByVal value As Integer) _customerID = value End Set End Property Public Property UserPermission As Integer Get Return _userPermission End Get Set(ByVal value As Integer) _userPermission = value End Set End Property Public Property CustomerPermission As Integer Get Return _customerPermission End Get Set(ByVal value As Integer) _customerPermission = value End Set End Property Public Sub New(ByVal CustomerID As Integer, ByVal UserPermission As Integer, ByVal CustomerPermission As Integer) _customerID = CustomerID _userPermission = UserPermission _customerPermission = CustomerPermission End Sub End Class My requirement is that on each page request (other than the login page), the application should check that the Session object exists.  The page data is therefore shown based on the values within the session obj

Need help with objects and arrays

  

I have an objuct that I declared like this:

    Class DailyStats
        Dim _day As String
        Dim _hour As String
        Dim _impressions As String
        Dim _clicks As String
        Property Day() As String
            Get
                Return _day
            End Get
            Set(ByVal value As String)
                _day = value
            End Set
        End Property
        Property Hour() As String
            Get
                Return _hour
         

How to check for null/empty strings on dynamic objects?

  

What is the proper way to check for null or empty strings on dynamic objects? This is the only solution I've found so far:

if (admin.PasswordHash.GetType() == typeof(DBNull) || admin.PasswordHash == string.Empty)

If the field is null, the object returned is DBNull.Value, but if the field is empty string, it's return as a System.String object. This makes it impossible to do regular "admin.PasswordHash == DBNull.Value" check, as that will fail whenever the field has been set to empty string. Is my example the right (and only) way to go?


how to serialize objects ??

  

Is there any way or process to serialize the the objects?? i am trying to store the instance of few control in viewstate but it shows error msg that it is not a serialized object. should i perform some steps to serialize the objects ???



Class which contains an array of objects of type "Class2"

  

 

1  Partial Class _Default
2  Inherits System.Web.UI.Page

3 Public Function Ohjoy(ByVal X As Integer) As Integer
4 Dim theClass As New Class1 '= New Class1()
5    theClass.ReSize(0)
6    theClass.myBaby(0).GetName(0) = "Hello" 'Property Chars is read only'
7    Return 1
8 End Function
I have a first class named "Class1". I have a second class named "Class2" Class2, is a member of class 1,
and is implemented as an array of objects of type Class 2.

If I try and call the Accessor GetName() my hard coded value "Hello" in my accessor is not returned? Only
an alpha character like "T"

Also if I try and assigne a value using the setter GetName() it does not work, and the compiler gives me
an error message "property Chars is ReadOnly? Does anyone know what is wrong in my code? Line 6 above

 

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    Ohjoy(1)
End Sub
End Class

Public Class Class1
    Dim bs As Integer
    Public myBaby() As Class2
    Public myB As Class2
    Public Function ReSize(By

Cutting Edge: Expando Objects in C# 4

  

The .NET Framework 4 introduces some new features that enable you to go beyond static types. We explore dynamically expando objects and demonstrate how they can be used like dynamically updatable dictionary objects.

Dino Esposito

MSDN Magazine July 2010


Cutting Edge: Pros and Cons of Data Transfer Objects

  

After a brief refresher on procedural and object based patterns for organizing the business logic layer, the author focuses on data transfer objects and the impact they have on the development of the software project.

Dino Esposito

MSDN Magazine August 2009


Test-Driven Design: Using Mocks And Tests To Design Role-Based Objects

  

Use Test-Driven Development with mock objects to design object oriented code in terms of roles and responsibilities, not categorization of objects into class hierarchies.

Isaiah Perumalla

MSDN Magazine June 2009


Basic Instincts: Inspecting COM Objects With Reflection

  

Reflection is useful for debugging and logging and otherwise providing the type information you need. Here you'll see how to use reflection on COM types.

Lucian Wischik

MSDN Magazine January 2009


Toolbox: Serializing objects, Scott Allen's blog, Site Performance, and more

  

Serialize and Deserialize Fixed Length and Delimited Files, Scott Allen's blog, inspecting Web Pages, and more.

Scott Mitchell

MSDN Magazine August 2008


Toolbox: Cross Browser Testing, Mock Objects, and Raymond Chen

  

This month test your web site on many platforms and browsers without setting up a test environment, use mock objects for unit testing, and visit Raymond Chen.

Scott Mitchell

MSDN Magazine June 2008


Data Points: SQL Server Management Objects

  

SQL Server Management Objects offer developers a robust toolset for backing up and restoring databases, and issuing DDL commands, as John Papa explains.

John Papa

MSDN Magazine June 2007


Data Points: Data Bound Applications with ADO.NET and Custom Objects

  

In this column see how to bind a custom list of business entities using the binding tools in the .NET Framework 2.0.

John Papa

MSDN Magazine February 2007


JIT and Run: Drill Into .NET Framework Internals to See How the CLR Creates Runtime Objects

  

There's lots to explore in the .NET Framework 2.0, and plenty of digging to be done. If you want to get your hands dirty and learn some of the internals that will carry you through the next few years, you've come to the right place. This article explores CLR internals, including object instance layout, method table layout, method dispatching, interface-based dispatching, and various data structures.

Hanu Kommalapati and Tom Christian

MSDN Magazine May 2005


Safety in Windows: Manage Access to Windows Objects with ACLs and the .NET Framework

  

Until now, Microsoft did not provide explicit support in the .NET Framework for manipulating security settings. With the .NET Framework 1.x, access can only be granted to users via a series of cumbersome P/Invoke calls. By introducing the concepts of security objects and rules, the .NET Framework 2.0 allows developers to manipulate security settings of objects in a few easy steps using managed code. Want to know more? Read on.

Mark Novak

MSDN Magazine November 2004


Unit Testing: Mock Objects to the Rescue! Test Your .NET Code with NMock

  

The problem: unit testing libraries, especially data access components, that have a complex set of dependencies. The solution: providing a dynamic mock implementation of your data access classes. Here the author explains just how to make testing easier and more reliable using NMock.

Mark Seemann

MSDN Magazine October 2004


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend