Questions tagged [automatic-properties]
219 questions
1
vote
2 answers
Custom auto properties in C#
I have the following class with auto properties:
class Coordinates
{
public Coordinates(int x, int y)
{
X = x * 10;
Y = y * 10;
}
public int X { get; set; }
public int Y { get; set; }
}
As you can see from the…

Oiproks
- 764
- 1
- 9
- 34
1
vote
1 answer
How to automate rename columns of a python Dataframe with the format column name + filename
I have many CSV files and I would like to rename each column of each file. A CSV file has for example a column named "wind" and I would like to transform it automatically to : wind_Dar. (Dar is the name of one file) so in other words I would like…

JEG
- 154
- 1
- 15
1
vote
1 answer
Is it possible to set properties automatically in VB.NET?
I'm actually more comfortable in Java language for developing apps.
But since my requirement now is getting tighter, I need to jump forward into VB.NET
well yeah... seems need to adapt some a bit.
Anyway, I typed a lot for making this setter and…

gumuruh
- 93
- 4
- 8
1
vote
1 answer
auto increment alphanumeric characters php
Is is possible to auto increment an alphanumeric number with php so it looks like:
AB001
AB002
...
...
BA001
...
...
ZZ001
This code will then need to be added to mysql, I was thinking a varchar(5).
Cheers,

Kyle Hudson
- 898
- 1
- 14
- 26
1
vote
3 answers
Can you fire events with automatic properties?
I was wondering if I can use automatic properties and still be able to fire events on property changed. Here are my current classes. (The actual User class got way more properties/fields of course).
public delegate void UserEventHandler(object…

Tipx
- 7,367
- 4
- 37
- 59
1
vote
5 answers
Problem with struct's constructor (compiler is yelling that I didn't fully initialize all the struct's auto-properties)
I have the following bit of code:
public struct Interval
{
public double Min { get; set; }
public double Max { get; set; }
public Interval(double min = double.MinValue, double max = double.MaxValue)
{
Min = min;
Max…

devoured elysium
- 101,373
- 131
- 340
- 557
1
vote
1 answer
Unexpected C# behaviour with autoproperties and constructors
It took me some debugging to figure this out (or so do I think). I will let the code loose on you and see what you come up with. There is a simple Contact class with:
Some auto-properties,
A parameterized constructor which always increments the…

explorer
- 11,710
- 5
- 32
- 39
1
vote
3 answers
The case against automatic properties
Possible Duplicate:
C# 3.0 Auto-Properties - useful or not?
My boss and I regularly argue about the benefits and disadvantages of using automatic properties.
public string Name { get; set; }
vs
private string name;
public string Name
{
get…

mbillard
- 38,386
- 18
- 74
- 98
1
vote
0 answers
How do I change an auto-implemented property to use a private member variable while keeping the table/column association unchanged?
I want to change a C# class member from being an auto-implemented property (auto-property?) to use a private member variable instead, in my Windows Phone C#-based app. The change is simple except that the class represents a database table. A…

David Rector
- 958
- 9
- 31
1
vote
1 answer
Dynamic Chart in Excel
Country January February March April May June July
USA 34 34 45 34 23
China 45 56 34 23 12
Japan 34 54 23 23 24
How can I…

Greth
- 13
- 2
1
vote
2 answers
document.customdocumentproperties not being saved
I have searched high and low on stackexchange and other sites (vbaexpress, MSDN, etc...). There is extensive dialog around this, I have tried most of the examples, and still nothing is working.
Scenario:
User clicks 'Create Report' button in…

user3662334
- 31
- 6
1
vote
1 answer
Visual studio text editor "members" dropdown icons for auto implemented C# properties?
Is there any way (perhaps via add-in) that anyone knows to easily list or visualize the fields (and auto-properties) of a class in Visual Studio 2008 SP1 (standalone or with ReSharper 4.5)?
I have been used to seeing fields of a class identified…

Ross Bradbury
- 605
- 5
- 13
1
vote
3 answers
Auto-Implemented Property Classes as Parameter
I'd like to pass a property class reference into a method.
For example:
Class SQLiteTables
{
public class tblPersonnel
{
public int PsnID { get; set; }
public string PsnFirstName { get; set; }
public string…

ELM
- 529
- 2
- 7
- 19
1
vote
4 answers
Automatic Properties Problem
At the moment i'm useing .Net 3.0 but I don't get it how to use Automatic Properties .
For example if i want write this sample code via Authomatic Properties , What should i do ?
private string _name = string.Empty;
private string _family =…

Mostafa
- 3,002
- 10
- 52
- 79
1
vote
1 answer
How can an auto-implemented property having different access levels be described by an interface?
This class property is what I'm trying to refactor into an interface.
public class Stuff : IStuff {
public int Number {
get;
protected internal set;
}
}
Visual Studio 2008 refactoring tools extract the following interface
//…

John K
- 28,441
- 31
- 139
- 229