class

How can I create an Delphi object from a class reference and ensure constructor execution?

How can I create an instance of an object using a class reference, and ensure that the constructor is executed? In this code example, the constructor of TMyClass will not be called: type TMyClass = class(TObject) MyStrings: TStrings; constructor Create; virtual; end; constructor TMyClass.Create; begin MyStrings := ...

Adding custom class objects to listbox in c#

i have a class which looks like this public class Process_Items { String Process_Name; int Process_ID; //String Process_Title; public string ProcessName { get { return Process_Name; } set { this.Process_Name = value; } } public int ProcessID { get { return Process_ID; } set...

C# Exception handling in classes

Hello, C# 2008 I have developed the class below. I have to get the balance from the web server. Once that is done it will call back into my main app with the result. However, sometime the web server fails for some unknown reason. Could be high volume of traffic or something else. However, I haven't implemented any exception handling i...

In C#, how would I use a delegate to manipulate a form from a custom class I made?

I know how to manipulate a textbox on a Form, from a Form, but I do not know how to manipulate a textbox from a CLASS in it's own file to a Form. Can someone explain to me how I would write a Delegate & a CallBack so I could simply call a method from a Class in a different file, and change stuff on a textbox from a different form? I do...

Access User context from a class library

Background: I have a win app and a web app and a shared class library. In my class lib I have some static methods for SQL queries which pick up my SQL connection string I store my SQL connection string in a Session variable since it is set at log in time where it is determined which database to use. My class lib cannot access my sessio...

how to implement Master details classes find function in javascript?

I have this code: function Item(id, itemType, itemData, itemCategoryId, itemRank) { this.id = id; this.itemType = itemType; this.itemData = itemData; this.itemCategoryId = itemCategoryId; this.itemRank = itemRank; } function Category(id) { this.id = id; } And i want to write a function for the Item class wh...

Help me understand OOD with current project

I have an extremely hard time figurering out how classes needs to communicate with eachother. In a current project I am doing, many classes have become so deeprooted that I have begun to make Singletons and static fields to get around(from what I get this is a bad idea). Its hard to express my problem and its like other programmers dont...

How to call a parent class's method from child class in python?

Stackers, I apologize for this question in advance. It must be a FAQ, but I don't seem to be able to find the answer. When creating a simple object hierarchy in python, I'd like to be able to invoke methods of the parent class from a derived class. In Perl and Java, there is a keyword for this (super). In Perl, I might do this: pa...

Object properties

Is the only way to assign $systime a value of a built-in-functions, is through a method? class Test{ private $systime; public function get_systime(){ $this->systime = time(); } } Right off i would think something like this right?: class Test{ private $systime = time(); public function get_systime(){ ...

PHP constructor executes before arguments for nested variables can be supplied.

First things first, here is a little snippet code to help explain my problem: <?php class foo { public $title; __construct{ echo "<html>\n"; echo "<head>\n"; echo "<title>".$this->title."</title>\n"; echo "</head>\n"; echo "<body>\n"; } /** * * I get $title from index....

c# marking class property as dirty

The following is a simple example of an enum which defines the state of an object and a class which shows the implementation of this enum. public enum StatusEnum { Clean = 0, Dirty = 1, New = 2, Deleted = 3, Purged = 4 } public class Example_Class { private StatusEnum _Status = StatusEnum.New; private long...

Mark exported classes in Eclipse to not modify

Hi all, in my workpsace i do have SVN checkout classes and SVN export classes. I seperate the classes into two working sets. The exported classes are members of another feature based project and i am not allowed to change this classes inside my workspace. When i want to fix a bug or implement new features i want to be sure, that the ex...

What's the best way to store PHP class attributes ?

Duplicate of: http://stackoverflow.com/questions/546403/whats-the-best-way-to-store-class-variables-in-php For some time I've been having this discussion with a co-worker on how should you store attributes within a PHP class. So which one do you think it should be used. Something like this: Class test{ public $attr1; publ...

Query on Static member variables of a class in C++

Sorry if this question seems trivial to many here. In a C++ code there is something as below: class Foo { public: static int bands; ... ... private: ... ... }//class definition ends int Foo::bands; //Note: here its not initialized to any value! Why is the above statement needed again when 'bands' is once declared in...

What do I need to do for this line of code? (C#)

I'm trying to get an if statment that says if my Points Array at "i" (Initialized in a For Loop) is equal to the X and Y of a Circle (Which is set to smallcircle.X and smallcircle.Y). I know what I need to do in the if statment, but I can't get the if statment itself to work. What is the syntax for that? Currently Have: if (centerPoint...

java anonymous classes and synchronization and "this"

hi all, I am dealing with a race condition, I believe, in my JAVA GUI. I have some methods that create an "anonymous method" inside an anonymous class like this: synchronized foo() { someMethod(new TimerTask() { public synchronized run() { //stuff } }; } QUESTION: is that...

rdlc with subreport and object classes

Hi everyone! I'm using Microsoft Reports (rdlc), and I need to create report with subreport. As a data source I created two Object Classes, PositionObject and PositionSubElementObject. PositionObject is data source for the main report, and PositionSubElementObject is a data source for the subreport. When I run this two reports separatel...

Nested classes and recursion

Say i have these two classes public class Container { public string name { get; set; } public Inner Inner { get; set; } } public class Inner { public string text { get; set; } public Inner2 Innert2 { get; set; } } public class Inner2 {} How would i go, given an instance of ...

What will be the way to go with classes in ASP.NET ??

In my asp.net web app. I have three classes (inside app_code folder) under namespace WPP which are as follows: 1. wpp_Common 2. wpp_SQL 3. wpp_Admin All these classes contains different functions which I am using in my application to accomplish different tasks. Such as, wpp_common contains a function which make my URL's SEO'd, and wpp...

How to know which classes inside a .jar file are referenced?

I need to deploy only the referenced classes in a very limited environment as A data carousel for Interactive TV. Bandwidth is expensive and .jar files are not supported. ...