473,789 Members | 2,500 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Yet another ICollection that doesn't serialize. Anyone see why?

Hi!

I've got problems with serializing my collections of business objects. The
objects themselves serialize fine, but the collections fail. I've got the
following structure:

Base collection class:
Derives MarshalByValueC omponent
Implements ICollection, IList and ISerializable
Explicitly implements the IList methods as private members, (ie. int
IList.Add(objec t value)) since this is a base class not intended for use.
Public properties/methods that should be there for Xml Serialization are
public int Count
public IEnumerator GetEnumerator()

Derived collection class:
Public properties/methods that should be there for Xml Serialization are
public int Add(TheSerializ ableType value)
public TheSerializable Type this[int index]

I believe this is what's needed for automatic serialization of ICollection
implementations . Anyone know what I might have forgotten? The exception
thrown is "XML attributes may not be specified for the type
TheCollectionCl ass".

Hope someone can help! :)

Lars-Erik
Nov 12 '05 #1
7 6543
Hi Lars,Erik,

Could you let me know how the collection failed for serialization? It
didn't serialize or throws an exception? Do you mean that you're
serializing the derived class, and the collection in base class didn't
serialize properly? If you don't use the derived class, but seriralize the
base class directly, will this also occur?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #2
Hi!

Sorry I'm a bit late to reply, but here's some more info..

I haven't tested with the base class, but I recon I get the same exception.
It throws the mentioned exception when I try to instantiate an XmlSerializer
with typeof(mycollec tion).
IE.
XmlSerializer serializer = new XmlSerializer(t ypeof(MyCollect ion));

L-E
The exception
thrown is "XML attributes may not be specified for the type
TheCollectionC lass".

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:G8******** ******@TK2MSFTN GXA01.phx.gbl.. . Hi Lars,Erik,

Could you let me know how the collection failed for serialization? It
didn't serialize or throws an exception? Do you mean that you're
serializing the derived class, and the collection in base class didn't
serialize properly? If you don't use the derived class, but seriralize the
base class directly, will this also occur?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #3
Hi L-E,

Could you post the definition of the base class here, so that I can try to
repro the problem?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #4
Hi again!

Here's the code. It's a few classes, so I hope you manage to see what's
what.. :)

There's a business object base that's used in the business object collection
base class, and derived business objects in according collections.

These objects are to be used with the component designer in Visual Studio
for ASP.NET pages with DataGrids etc. To get the serializers to ignore Site
and Containers, we've made a custom MarshalByValueC omponent class.

I tried to make the base classes implement the necessary functionality for
Xml Serialization, so I'll only post those. Instantiating an XmlSerializer
for the collection base still fails.

MarshalByValueX S:
-------------------------
using System;
using System.Componen tModel;
using System.Xml.Seri alization;

namespace Project.Model.T ypes
{
/// <summary>
/// Implements IComponent and provides the base implementation for
remotable components that are marshaled by value (a copy of the serialized
object is passed).
/// </summary>
/// <remarks>
/// <para>A component can be contained in a container. For each
component in a container, the container creates a site that it uses to
manage the component. The component interacts with its container primarily
through a container-provided ISite, which is a repository of
container-specific, per-component information.</para>
/// <para>Notes to Inheritors: When you inherit from this class, you
can override the Dispose, Site, and the GetService methods.</para>
/// <para>Notes to all: This class is identical to
System.MarshalB yValueComponent , except that this one has XmlIgnore and
SoapIgnore on Site and Container..</para>
/// </remarks>
[Serializable]
public class MarshalByValueC omponentXS : IComponent, IServiceProvide r
{
// Fields
[NonSerialized]
private static readonly object EventDisposed;

[NonSerialized]
private EventHandlerLis t events;

[NonSerialized]
private ISite site;

/// <summary>
/// Initializes a new instance of the MarshalByValueC omponentXS
class.
/// </summary>
static MarshalByValueC omponentXS()
{
MarshalByValueC omponentXS.Even tDisposed = new object();
}

/// <summary>
/// Initializes a new instance of the MarshalByValueC omponentXS
class.
/// </summary>
public MarshalByValueC omponentXS()
{
}

/// <summary>
/// This member overrides Object.Finalize .
/// </summary>
~MarshalByValue ComponentXS()
{
this.Dispose(fa lse);
}

/// <summary>
/// Releases all resources used by the MarshalByValueC omponentXS.
/// </summary>
public void Dispose()
{
this.Dispose(tr ue);
GC.SuppressFina lize(this);
}

/// <summary>
/// Releases the unmanaged resources used by the
MarshalByValueC omponentXS and optionally releases the managed resources.
/// </summary>
/// <param name="disposing ">true to release both managed and
unmanaged resources; false to release only unmanaged resources. </param>
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
lock (this)
{
if ((this.site != null) && (this.site.Cont ainer !=
null))
{
this.site.Conta iner.Remove(thi s);
}
if (this.events != null)
{
EventHandler handler1 = (EventHandler)
this.events[MarshalByValueC omponentXS.Even tDisposed];
if (handler1 == null)
{
return;
}
handler1(this, EventArgs.Empty );
}
}
}
}

/// <summary>
/// Gets the implementer of the IServiceProvide r.
/// </summary>
/// <param name="serviceTy pe">A Type that represents the type of
service you want. </param>
/// <returns>An Object that represents the implementer of the
IServiceProvide r.</returns>
public virtual object GetService(Type serviceType)
{
if (this.site != null)
{
return this.site.GetSe rvice(serviceTy pe);
}
return null;
}

/// <summary>
/// This member overrides Object.ToString .
/// </summary>
/// <returns>A String that represents the current Object.</returns>
public override string ToString()
{
ISite site1 = this.site;
if (site1 != null)
{
return (site1.Name + " [" + base.GetType(). FullName + "]");
}
return base.GetType(). FullName;
}

/// <summary>
/// Gets the container for the component.
/// </summary>
[XmlIgnore, SoapIgnore,
DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Hidden),
Browsable(false )]
public virtual IContainer Container
{
get
{
ISite site1 = this.site;
if (site1 != null)
{
return site1.Container ;
}
return null;
}
}

/// <summary>
/// Gets a value indicating whether the component is currently in
design mode.
/// </summary>
[XmlIgnore, SoapIgnore,
DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Hidden),
Browsable(false )]
public virtual bool DesignMode
{
get
{
ISite site1 = this.site;
if (site1 != null)
{
return site1.DesignMod e;
}
return false;
}
}

/// <summary>
/// Gets or sets the site of the component.
/// </summary>
[XmlIgnore, SoapIgnore, Browsable(false ),
DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Hidden)]
public virtual ISite Site
{
get
{
return this.site;
}
set
{
this.site = value;
}
}

/// <summary>
/// Gets the list of event handlers that are attached to this
component.
/// </summary>
protected EventHandlerLis t Events
{
get
{
if (this.events == null)
{
this.events = new EventHandlerLis t();
}
return this.events;
}
}

/// <summary>
/// Adds an event handler to listen to the Disposed event on the
component
/// </summary>
public event EventHandler Disposed
{
add
{
this.Events.Add Handler(Marshal ByValueComponen tXS.EventDispos ed,
value);
}
remove
{
this.Events.Rem oveHandler(Mars halByValueCompo nentXS.EventDis posed,
value);
}
}
}
}
-------------------------
Collection base:
-------------------------

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Runtime. Serialization;
using System.Xml.Seri alization;

namespace Project.Model.T ypes
{
/// <summary>
/// Base class for collection implementations .
/// </summary>
[Serializable, XmlRoot("BizObj CollectionBase" )]
public class BizObjCollectio nBase : MarshalByValueC omponentXS,
ICollection, IList, ISerializable
{
#region Private members

/// <summary>
/// The ArrayList to store the components in
/// </summary>
private ArrayList _list = new ArrayList();

#endregion

#region Private properties

#region Implicit IList implementation

/// <summary>
/// Gets or sets the element at the specified index.
/// </summary>
object IList.this[ int index ]
{
get
{
return List[index];
}
set
{
OnSet(index, List[index], value);
List[index] = value;
}
}

public BizObjBase this[ int index ]
{
get
{
return (BizObjBase)Lis t[index];
}
set
{
OnSet(index, List[index], value);
List[index] = value;
}
}

bool IList.IsReadOnl y
{
get
{
return List.IsReadOnly ;
}
}

bool IList.IsFixedSi ze
{
get
{
return List.IsFixedSiz e;
}
}

#endregion

#region Implicit ICollection implementation

object ICollection.Syn cRoot
{
get
{
return this;
}
}

bool ICollection.IsS ynchronized
{
get
{
return false;
}
}

#endregion

#endregion

#region Protected properties

/// <summary>
/// Gets an IList containing the list of elements in the
SystemComponent Collection instance.
/// </summary>
protected IList List
{
get
{
return (IList)_list;
}
}

/// <summary>
/// Gets an ArrayList containing the list of elements in the
CollectionBase instance.
/// </summary>
protected ArrayList InnerList
{
get
{
return _list;
}
}

#endregion

#region Public properties

#region ICollection implementation

/// <summary>
/// Copies the WebCompetenceCo llection or a portion of it to a
one-dimensional array.
/// </summary>
/// <param name="array">Th e one-dimensional Array that is the
destination of the elements copied from the WebCompetenceCo llection. The
Array must have zero-based indexing. </param>
/// <param name="index">Th e zero-based index in array at which
copying begins. </param>
public void CopyTo(Array array, int index)
{
List.CopyTo(arr ay, index);
}

/// <summary>
/// Gets the number of elements actually contained in the
WebCompetenceCo llection.
/// </summary>
public virtual int Count
{
get
{
return List.Count;
}
}

#endregion

#endregion

#region Private methods

#region Implicit IList implementation

int IList.Add(objec t value)
{
OnValidate(valu e);
return List.Add(value) ;
}

public int Add(BizObjBase value)
{
OnValidate(valu e);
return List.Add(value) ;
}

bool IList.Contains( object value)
{
return List.Contains(v alue);
}

int IList.IndexOf(o bject value)
{
return List.IndexOf(va lue);
}

void IList.Insert(in t index, object value)
{
OnInsert(index, value);
List.Insert(ind ex, value);
}

void IList.Remove(ob ject value)
{
OnRemove(List.I ndexOf(value), value);
List.Remove(val ue);
}

#endregion

#endregion

#region Public methods

#region IList implementation

/// <summary>
/// Removes all elements from the WebCompetenceCo llection
/// </summary>
public void Clear()
{
List.Clear();
}

/// <summary>
/// Removes the element at the specified index of the
WebCompetenceCo llection
/// </summary>
/// <param name="index">Th e zero-based index of the element to
remove. </param>
public void RemoveAt(int index)
{
List.RemoveAt(i ndex);
}

#endregion

/// <summary>
/// Returns an enumerator that can iterate through the
WebCompetenceCo llection
/// </summary>
/// <returns>Return s an enumerator for the entire
WebCompetenceCo llection</returns>
public IEnumerator GetEnumerator()
{
return List.GetEnumera tor();
}

#endregion

#region Public delegates and events
/// <summary>
/// Represents a method that is called after a collection has
validated added or changed data.
/// </summary>
public delegate void ValidationCompl eteEventHandler ( object value );

/// <summary>
/// Occurs after the collection has added or validated data. Might
not be fired by all collection implementations .
/// </summary>
public virtual event ValidationCompl eteEventHandler
OnValidationCom plete;

/// <summary>
/// Validates the type of the attempted inserted object.
/// </summary>
/// <param name="index">Th e index of the added object.</param>
/// <param name="value">Th e value of the added object.</param>
protected virtual void OnInsert( int index, Object value )
{
}

/// <summary>
/// Validates the type of an attempted removed object.
/// </summary>
/// <param name="index">Th e index of the removed object.</param>
/// <param name="value">Th e value of the removed object.</param>
protected virtual void OnRemove( int index, Object value )
{
}

/// <summary>
/// Validates the type of an attempted set object.
/// </summary>
/// <param name="index">Th e index of the set object.</param>
/// <param name="oldValue" >The value of the old object.</param>
/// <param name="newValue" >The value of the new object.</param>
protected virtual void OnSet( int index, Object oldValue, Object
newValue )
{
}

/// <summary>
/// Validates the type of the value when validated.
/// </summary>
/// <param name="value">Th e value to validate.</param>
protected virtual void OnValidate( Object value )
{
if (OnValidationCo mplete != null)
OnValidationCom plete(value);
}

#endregion

#region Constructors

/// <summary>
/// Protected constructor, class must be inherited.
/// </summary>
public BizObjCollectio nBase()
{
}

/// <summary>
/// Constructor used when deserializing.
/// </summary>
/// <param name="info">The SerializationIn fo object</param>
/// <param name="context"> The StreamingContex t object</param>
protected BizObjCollectio nBase(Serializa tionInfo info,
StreamingContex t context)
{
int count = info.GetInt32(" _count");
for(int i = 0; i<count; i++)
List.Add((BizOb jBase)info.GetV alue("_item" + i,
typeof(BizObjBa se)));
}

#endregion

#region Serialization
/// <summary>
/// Serializes the collection
/// </summary>
/// <param name="info">The info</param>
/// <param name="context"> The context</param>
public virtual void GetObjectData(S erializationInf o info,
StreamingContex t context)
{
info.AddValue(" _count", Count);
for(int i = 0; i<Count; i++)
info.AddValue(" _item" + i.ToString(), (BizObjBase)Lis t[i]);
}

#endregion

}
}
---------------

Business object base:
---------------
using System;
using System.Componen tModel;
using System.Reflecti on;
using System.Runtime. Serialization;
using System.Security .Permissions;
using System.Xml.Seri alization;

namespace Project.Model.T ypes
{
/// <summary>
/// The base class of all Business Objects
/// </summary>
[Serializable, XmlRoot]
public class BizObjBase : MarshalByValueC omponentXS, ISerializable
{
/// <summary>
/// Indicates the persistion state of the object.
/// </summary>
/// <remarks>
/// The default value of _state is StateEnum.New.< br/>
/// All property setters in derived classes should set _state to
Updated
/// so persisting is done properly.
/// </remarks>
protected StateEnum _state = StateEnum.New;

/// <summary>
/// Gets or sets the persistion state of the object.
/// </summary>
[XmlElement, DefaultValue(St ateEnum.New)]
public virtual StateEnum State
{
get
{
return _state;
}
set
{
_state = value;
}
}

/// <summary>
/// Initializes a new instance of the BizObjBase class
/// </summary>
public BizObjBase()
{
}

/// <summary>
/// Initializes a new instance of the BizObjBase when deserialized
by a Serializer.
/// </summary>
/// <param name="info">The SerializationIn fo to fetch data from.
</param>
/// <param name="context"> The context of the operation</param>
protected BizObjBase(Seri alizationInfo info, StreamingContex t
context)
{
_state = (StateEnum)info .GetValue("_sta te", typeof(StateEnu m));
}

/// <summary>
/// If state is Unchanged, IfUpdatingSetSt ate compares the new value
with the original value, and sets State to StateEnum.Updat ed if the values
differ.
/// </summary>
/// <param name="newValue" >The new value attempted.</param>
/// <param name="originalV alue">The original value of the
property</param>
protected void IfUpdatingSetSt ate(object newValue, object
originalValue)
{
if (State == StateEnum.Uncha nged)
{
if (newValue == null && originalValue == null)
return;
if (
(newValue == null && originalValue != null)
||
(!newValue.Equa ls(originalValu e))
)
State = StateEnum.Updat ed;
}
}

/// <summary>
/// Compares the fields of two objects.
/// </summary>
/// <param name="obj">The object to compare with</param>
/// <returns>%tru e% if the objects are equal; otherwise
%false%</returns>
public override bool Equals(object obj)
{
Type thisType = obj.GetType();

foreach(FieldIn fo fieldInfo in
thisType.GetFie lds(BindingFlag s.NonPublic))
if (fieldInfo.GetV alue(obj) != fieldInfo.GetVa lue(this))
return false;

return true;
}

/// <summary>
/// Serves as a hash function for a particular type, suitable for
use in hashing algorithms and data structures like a hash table.
/// </summary>
/// <returns>
/// A hash code for the current Object.<br/>
/// If the current object has a non public field named _id, the
value of that field is used, else the base.GetHashCod e() return value is
used.
/// </returns>
public override int GetHashCode()
{
Type thisType = this.GetType();

FieldInfo field = thisType.GetFie ld("_id",
BindingFlags.No nPublic);

if (field != null && field.FieldType == typeof(Int32))
return Convert.ToInt32 (field.GetValue (this));
else
return base.GetHashCod e ();
}
/// <summary>
/// Compares the identity of two objects.
/// </summary>
/// <param name="obj">The object to compare with.</param>
/// <returns>%tru e% if the objects have the same identity; otherwise
%false%</returns>
public bool RefEquals(objec t obj)
{
return base.Equals(obj );
}

/// <summary>
/// Releases the resources used by the Component and optionally
releases the managed resources.
/// </summary>
/// <param name="disposing ">true to release both managed and
unmanaged resources; false to release only unmanaged resources. </param>
protected override void Dispose(bool disposing)
{
if (disposing)
{
// Dispose unmanaged resources
}

// Disposed managed

// Base dispose
base.Dispose(di sposing);
}

/// <summary>
/// Initializes the components in BizObjBase
/// </summary>
private void InitializeCompo nent()
{
}

/// <summary>
/// Populates a SerializationIn fo with the data needed to serialize
the target object.
/// </summary>
/// <remarks>
/// <font color="red">Pre liminary!!</font>
/// </remarks>
/// <param name="info">The SerializationIn fo to populate with data.
</param>
/// <param name="context"> The destination (see StreamingContex t) for
this serialization. </param>
[SecurityPermiss ionAttribute(Se curityAction.De mand,Serializat ionFormatter=tr ue)]
public virtual void GetObjectData(S erializationInf o info,
StreamingContex t context)
{
info.AddValue(" _state", _state);
}

}
}
---------------------

StateEnum enumeration used in the BizObjBase:
---------------------

namespace Project.Model.T ypes
{
/// <summary>
/// Specifies the objects current persistation state
/// </summary>
public enum StateEnum
{
/// <summary>
/// The object is unchanged since loaded.
/// </summary>
Unchanged = 0,

/// <summary>
/// The object has never been persisted.
/// </summary>
New = 1,

/// <summary>
/// The object has changed since loaded.
/// </summary>
Updated = 2,

/// <summary>
/// The object is marked for deletion.
/// </summary>
Deleted = 3
}
}
-----------


Here's a program that fails:
-----------
using System;
using System.Xml.Seri alization;
using Project.Model.T ypes;

namespace Project
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
XmlSerializer colSerializer = new
XmlSerializer(t ypeof(BizObjCol lectionBase));
}
}
}

----------

Hope you're able to find something :)
L-E


"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:A8******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi L-E,

Could you post the definition of the base class here, so that I can try to
repro the problem?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #5
Hi Lars,

Thanks for providing me with the code. Based on your code, I found removing
XMLRoot from the class' definition will fix the problem.

Currently the XmlSerializer does not support XML attributes on types that
implement ICollection, this will be fixed in an upcoming version.
Unfortunately this won't help you right now, although there is a (not so
pretty) workaround.

Create a class that encapsulates X and has the XmlRoot attribute, and use
an XmlElement attribute on the member that holds X so that the items in X
becomes immediate descendants of rootElem.

[XmlRoot("rootEl em")]
public class XRoot
{
[XmlElement("chi ldElement")]
public X x;

}

public class X : CollectionBase {
...

}

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #6
Hi again!

Thanks a lot! Works swell now.
I'm not sure if I should've guessed this.. is it mentioned in the docs
somewhere? :P

L-E

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:ON******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Lars,

Thanks for providing me with the code. Based on your code, I found
removing
XMLRoot from the class' definition will fix the problem.

Currently the XmlSerializer does not support XML attributes on types that
implement ICollection, this will be fixed in an upcoming version.
Unfortunately this won't help you right now, although there is a (not so
pretty) workaround.

Create a class that encapsulates X and has the XmlRoot attribute, and use
an XmlElement attribute on the member that holds X so that the items in X
becomes immediate descendants of rootElem.

[XmlRoot("rootEl em")]
public class XRoot
{
[XmlElement("chi ldElement")]
public X x;

}

public class X : CollectionBase {
..

}

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #7
Hi L-E,

Sorry, this was not doced. But it is a known issue and will be fixed in
next version.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #8

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

Similar topics

2
6809
by: Kent Boogaart | last post by:
Hello all, I have two simple classes: Item and ItemCollection. Item stores a label for the item and an instance of ItemCollection for all child items. ItemCollection just stores a collection of Items. ItemCollection implements System.Collections.ICollection. When I use XmlSerializer to serialize an instance of ItemCollection, I am unable to control the element names used to contain the item collection and the items therein. Applying...
7
23545
by: MrNobody | last post by:
since ArrayList implements ICollection, is there a quick way to convert an ICollection into ArrayList (besides actually iterating through each element in the ICollection and explicitly adding them to a new ArrayList instance) ??
3
5186
by: andrew.miadowicz | last post by:
It's funny that I've only now run into this question, after a few years of using C#, but I find it intriguiging all the same. All the more so, that the generic version of ICollection in .Net Framework 2.0 has this method. It seems to me that the question whether a collection has some element should be answerable by any collection, not just IList or IDictionary. An obvious implementation must exist, since every ICollection inherits...
0
2060
by: Q. John Chen | last post by:
I created a class that implements ICollection. After serializing got following result: <?xml version=\"1.0\" encoding=\"utf-16\"> <ArrayOfCustomer> <Customer> <FirstName>John</FirstName> <LastName>Johnson</LastName> </Customer> <Customer>
0
1071
by: Iain | last post by:
In researching something else, I came across a comment about problems with problems with attributes in classes derived from ICollection. I seem to have hit this problem a while ago (I've been on something else). So if I derive a class from List<Dictionary>, for example and attempt to have a member with an XmlAttributeAttribute, it fails to serialize / deserialize the attribute. Is there any way round this?
5
21813
by: Jimp | last post by:
Why can't I cast List<MyObject> to ICollection<IMyObject>. MyObject implements IMyObject, and of course, List implements ICollection. Thanks
3
2584
by: Dave Booker | last post by:
Am I missing something here? It looks like the generic Queue<T> implements Enumerable<T> and ICollection but not ICollection<T>. (I want to use it in an interface that wants an ICollection<T>.) Is there a reason for this, or is it just an oversight in .NET 2.0? Is there a computationally easy way to cast/convert a Queue<T> to an ICollection<T>?
0
1494
by: emma_middlebrook | last post by:
Hi Hopefully the title is quite accurate but here's some more information. I have a load of ICollection<references hanging off a class e.g. ICollection<X>, ICollection<Yetc etc. Each of the collection's types are all derived from a base class Base i.e X : Base, Y : Base etc etc.
2
2255
by: per9000 | last post by:
Hi, *background* I want a class containing an int (a list of sets of integer). This should be hidden for the user and he/she should be able to insert his/her favourite data structure so to be a little fancy I thought I'd do a Ctor like this: // this is the "core": private int sets;
0
9663
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10195
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.