Questions tagged [automatic-properties]
The automatic-properties tag has no usage guidance.
automatic-properties
221
questions
0
votes
0
answers
42
views
.NET 8 not inline read-only auto-properties
I'm checking the Disassembly Window, when running a long test, with a warming phase, that uses swaps, swap legs and coupons. The test runs the valuation code a number enough of times for PGO to kick ...
0
votes
0
answers
162
views
Identification of automatically generated move assignment operator
What is the automatically generated move assignment operator for a class Number that contains only one attribute of type std::shared_ptr<Vertex>?
#include <iostream>
#include <memory>...
0
votes
0
answers
70
views
How would I invoke setter when modifying properties in C#?
Suppose I have a class Character, which have stats of the class Stat. Specifically each character has a Character.Speed Stat that can be modified. This speed stat is heavily related to a float ...
-1
votes
1
answer
82
views
Assign macro to shape, stop automatic updating [closed]
In Excel, I have a dropdown list in cell C6. A user then inputs a numerical value into cell C10. I then have 4 dependent cells (dependent on cells C6, and the value inputted into cell C10), in C13, ...
0
votes
2
answers
101
views
Automatically update cells
I currently have this code for my worksheet:
Private Sub Worksheet_Change(ByVal Target As Range)
' ensure events are always enabled when we exit this Sub, even if we have an error
On Error ...
2
votes
1
answer
340
views
Config.GetSection<T> with invalid class property names
Using IConfigurationRoot extension method
public static T GetSectionAsObject<T>(this IConfigurationRoot configuration, string key)
{
return configuration.GetSection(key).Get<T>();
}
I ...
0
votes
0
answers
27
views
A method to use a formula if , and if not to tip a value manual inside, without VBA Excel
Hello and thanks for the help in advance.
Is there a way, for example, if cell A1 can say either yes or no, then I say in cell A2, if it says yes, then automatically write a word like "tree" ...
1
vote
3
answers
3k
views
Can I define a custom getter for a C# auto-implemented property (a.k.a. auto backing field)?
Note: I know how to accomplish this without using auto-implemented properties, but I'm wondering if C# has a built-in way to do this.
Let's say I have this simple example of an auto-implemented ...
-1
votes
1
answer
126
views
Difference between two class definitions in c# [duplicate]
Failing finding an answer I can understand, could someone explain the difference between the following:
// One
private Guid mCategoryID;
public Guid CategoryID
{
get
{
return ...
-1
votes
1
answer
75
views
automatic timestamp script for each row
I'm looking for a script for google sheet that automatically inserts a timestamp for each row. and the date and time will be updated every time any of the rows gets edited. Timestamp will be put on ...
1
vote
1
answer
35
views
Will use 'k_BackingField' cause version compatibility problem?
Recently, I'm working on serialization with C#.
I found that the automatic-properties' fields are named "<...>k_BackingField".
So my problem is dose this naming rule same in all .Net versions,...
1
vote
2
answers
2k
views
Custom auto properties in C# [duplicate]
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; }
...
-1
votes
2
answers
555
views
Object fingerprinting: serialization + untouchable legacy code + Getter-only auto-properties = cornered?
I have found myself cornered, so here we go.
Context
I need to produce a fingerprint hash code for object diffing. Comparing the hashes of two sets of objects will need to tell me if there are ...
1
vote
1
answer
432
views
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 ...
0
votes
2
answers
572
views
Auto property initialization with anonymous function
I'm trying to get rid of some code with anonymous functions and classes.
I stuck on this:
public List<Object> Years { get; set; } = GetYears();
private static List<Object> GetYears()
{
...