Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
2 answers
147 views

In some languages, we can declare and initialize an anonymous struct - or the equivalent thereof - seamlessly. Example from ECMAScript: function foo_in_ecmascript(x) { let computed = { ...
0 votes
3 answers
95 views

Let's assume we have a class defined as: class A { public int Param { get; set; } public Action DoSomething { get; set; } } The DoSomething action is assigned in another class, but it needs ...
Jake's user avatar
  • 121
5 votes
3 answers
220 views

Often I need a read-only ObservableCollection (so that it's reference or contents can be only modified from within this class). I need ObservableCollection because I will be binding to that property ...
0 votes
2 answers
76 views

Given the following sample POCO class: public class TestClass { public int Id { get; init; } public TestClass() {} } How can I initialize the Id property using Reflection? The result should ...
1 vote
1 answer
113 views

I am using Groovy to create a package that I use in ReadyApi. In a Groovy script test step, I do the following: class B { String value boolean isSomething } class A { String name B ...
2 votes
1 answer
64 views

The following C++ code compiles with no errors or warnings, but for some reason when I print out the contents of foo.arr I just get junk values. It looks like the array member is not being properly ...
0 votes
1 answer
161 views

Is there a way to pass default/constructed property vales in object initializers - to the constructors of nested object initializers? e.g. take these 3 classes Car, Part, Tool Car { public Guid ...
0 votes
2 answers
801 views

Let's assume I've the following C# class: public class Test { public double X; public double Y; } I want to use the above C# Test class from IronPython and as well from CPython (using ...
3 votes
2 answers
879 views

While searching around for how to work with HTTP request headers, i've seen a ton of examples use this construct to initialize the HttpRequestMessage: var request = new HttpRequestMessage() { ...
0 votes
1 answer
421 views

I'm trying to initialize properties of an object I am creating with the values of a named tuple. Something like this public Person DoIt() { return new Person { (First, Last) = GetFirstAndLast(id)...
0 votes
2 answers
157 views

This is stripped down from a more complex situation. The goal is to construct several instances of class SubAction, each of which uses an action to alter how it uses its internal data. Consider: ...
0 votes
0 answers
306 views

Is there a way to initialize a C++ struct/class with very large array members? I would like to initialize them by filling them with any kind of data besides an empty array. The following code is ...
0 votes
2 answers
3k views

I am trying to implement object initializer. All the classes are already created by someone else. I cannot change. I have a class Ins.vb that has a list as a property Partial Public Class Ins ...
1 vote
1 answer
201 views

While playing around with a simple Javascript Object Initializer example, I could not find an explanation while the following code: const obj = { self: this }; console.log(obj); would ...
0 votes
0 answers
100 views

I have the following code: class Foo { public: enum class MyEnum { option1, option2 } "Some constructors" private: "Some members and the following member" ...

15 30 50 per page
1
2 3 4 5
...
16

AltStyle によって変換されたページ (->オリジナル) /