473,803 Members | 3,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IsMirrored property - what is this?

dgk
I'm searching for a way to determine if control values have changed.
For some it's easy, such as TextBox.Modifie d. But looking at the
radiobutton I come across IsMirrored. Curious, I look to the help. Not
very helpful. So I look to the newsgroup. Not mentioned. So now I ask.
What does the IsMirrored property tell me?
Nov 23 '05
10 4171
Dgk,
Ok, here's another idea. Someone MUST have done this already. I write
a public method in the object that accepts another object instance as
a parameter and then uses reflection to determine all of its
properties and compares the output of the Get from each one to
determine if the objects are identical. Did I just duplicate some
functionality that already exists? I hate when I do that. Implementing Equals or Compare via reflection is easy enough I don't know if
I would be concerned with duplicating other peoples work, as its a good
learning experience. Whether or not I used it would depend on performance &
behavior ramifications. For equals behavior shouldn't matter, however for
comparing behavior could be affected as you cannot control the sequence of
the comparisons (there is no guarantee on the order that the properties are
returned).

The method created however would/could be the basis for IEquatable(Of T) &
IComparable(Of T) in VS 2005 (Overrides System.Equals & IComparable in VS
2002 & 2003).

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
<dg*@somewhere. com> wrote in message
news:17******** *************** *********@4ax.c om... On Mon, 28 Nov 2005 20:48:39 -0600, "Jay B. Harlow [MVP - Outlook]"
<Ja************ @tsbradley.net> wrote:
dgk,
| All these values are coming out of an object and going back into that
| object,
Oh! in the case where you have an "object" I would ask the object if any
of
its values changed.

In my Property Set methods on my object I call a protected "SetDirty"
method
that sets a boolean flag that indicates if the object is dirty. My
"object"
then has a public readonly IsDirty property that the UI can use to decide
if
its dirty or not. When an object is loaded or saved, the boolean flag is
cleared to indicate that the object itself is not dirty. Generally
SetDirty,
IsDirty, and the boolean flag are part of a common base class.

| Essentially I'm trying to show a "Are you sure you want to discard
| your changes" type dialog if someone hits the cancel button after
...
| So I guess I have to
| implement my own code for this?
I would consider implementing a "Clone" method that returns a "copy" of
the
current object, this method would use MemberwiseClone if a shallow copy
was
acceptable, otherwise it would do a deep copy. Be careful on deep copies &
object hierarchies.

Alternative ly I would consider having 2 fields for each property of my
"object", a current value & an original value. The "object" would have a
"Revert" method that would restore the current values to the "original"
values. When I load the object I would set both fields to the same value.


But I'm planning on updating all the properties, whether they've
changed or not, which means that prior to calling SetDirty from each
property I should check to see if the Set is actually changing the
private value. Pain. I have a LOT of properties - hmm, this should
have been part of the Property snippet. Now I have to learn to edit
snippets.

Actually I already implemented something like this which I borrowed
from an example that I saw. It actually uses a DataRowState object to
track the changes which is neat because I can also store the fact that
it is new if that is the case.

Ok, here's another idea. Someone MUST have done this already. I write
a public method in the object that accepts another object instance as
a parameter and then uses reflection to determine all of its
properties and compares the output of the Get from each one to
determine if the objects are identical. Did I just duplicate some
functionality that already exists? I hate when I do that.

Nov 29 '05 #11

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

Similar topics

4
1604
by: D Witherspoon | last post by:
I have a Structure I have created and am using it as a Public Property of a class. Here is the property. ------------------------------------------------------ Dim _MyID As SInteger Public Property MyID() As SInteger Get
18
4765
by: Robin Becker | last post by:
Is there a way to override a data property in the instance? Do I need to create another class with the property changed? -- Robin Becker
3
2501
by: Johnny M | last post by:
using Access 2003 Pardon the subject line, but I don't have a better word for this strange behavior (or behavior I don't understand!!!) I have a class module named DepreciationFactor. One of the properties is a follows (irrelevant code omitted):
4
1272
by: funVB2005fun | last post by:
I am not quite sure what I am getting into but I would like to have a loop that read from a flat file to create some public properties in a class. I am going after this to try and create more general software that others could benefit from vs hardcoding things that relate only to my processes. example property that I would want to generate: The idea would be to read from a file that "AGE" is needed and that it is and Integer and then to...
3
1353
by: Meelis | last post by:
Hi Can one property have different types? For example, i need to property type to be dependend on second property. Pirvate MyValue as Object Private MyType as Integer Public Property PType() as Integer Get
0
1440
by: doubts | last post by:
Hi, I have a query regarding reading Image Property for button from a XML file . I read XML files to Generate Screens using System.Windows.Forms.Controls .The XML file is read and properties are set using Reflection a sample representation of it is given below
1
413
by: doubts | last post by:
Hi, I have a query regarding reading Image Property for button from a XML file . I read XML files to Generate Screens using System.Windows.Forms.Controls .The XML file is read and properties are set using Reflection
5
17779
by: ronlahav | last post by:
Dear all i Wonder how can i edit a node property (in C# not by hand :) ) i have the follwing XMl file (hibernate.cfg.xml) <?xml version="1.0" encoding="utf-8" ?> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.0" > <session-factory name="NHibernate.Test"> <!-- properties -->
6
9165
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
I am trying to access a Public property on a Master Page from a Base Page. On the content pages I have the MasterType Directive set up as follows: <%@ MasterType virtualpath="~/Master.master" %> On the Master Page I have a public property exposed: Public Property ErrorMessage() As String Get Return txtError.InnerText End Get
0
9703
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
9566
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
10555
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
10317
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
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6844
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
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2974
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.