interface-implementation Questions

1

Consider the following code: interface I { string M1() => "I.M1"; string M2() => "I.M2"; } abstract class A : I {} class C : A { public string M1() => "C.M1&q...

3

Solved

I am trying to create an ObservableConcurrentDictionary. This object will be used in a multithreaded application, and it's data is used to populate a control via the controls ItemsSource property. ...

2

Solved

I am starting to dive a bit further into C# programming and have been messing around with interfaces. I understand the basics of an interface in that they are supposed to be "contracts" for any cl...
Bolin asked 28/11, 2019 at 1:11

2

Solved

In C#, as shown in the code snippet below, is it correct/proper to extend the interface IFoo when declaring the class A, knowing that the class BaseClass extends the interface IFoo? Is it necessary...

3

In angular 6 when we create a component the the .ts file of that component has a class which implements the OnInit class but when we remove the default method(ngOnInit), it works fine. so my questi...
Creon asked 26/9, 2018 at 7:3

8

Solved

In my application, I'm dealing with a larger-size classes (over 50 methods) each of which is reasonably complex. I'm not worried about the complexity as they are still straight forward in terms of ...
Florinda asked 14/1, 2013 at 10:37

5

Solved

As a new .NET 3.5 programmer, I started to learn LINQ and I found something pretty basic that I haven't noticed before: The book claims every array implements IEnumerable<T> (obviously, othe...
Rhodolite asked 19/12, 2010 at 10:39

3

Solved

I'm working on a large project in C, and I want to organize it using interface (.h) and implementation (.c) files, similar to many object-oriented languages such as Objective-C or Java. I am famili...
Georgy asked 5/10, 2014 at 17:34

3

Solved

I am trying to create own filter attribute in order to support multilinguality. The idea is simple. URL stands for language. *http://host.ext/en/rest_of_the_url* will open in English and *http://...
Narcisanarcissism asked 4/12, 2012 at 19:7

2

Solved

What is the difference between extends and implements in java with respect to performance and memory,etc. For example take the following scenarios, 1) public interface PrintResult { public final...
Preindicate asked 3/3, 2012 at 12:34

2

Solved

I get the error: Class 'QueryParameterComparer' must implement 'Function Compare(x As QueryParameter, y As QueryParameter) As Integer' for interface 'System.Collections.Generic.IComparer(Of Q...
Renner asked 19/5, 2015 at 14:49

2

Solved

I'm not clear about where to put the if/switch when choosing what implementation/subclass to instantiate, specially when considering that now interfaces can have static methods. Let's say I have a...
Perrault asked 20/3, 2015 at 15:42

2

Solved

Is there a way in PhpStorm to automatically generate the empty methods that are required by the interface the given class is implementing? Say we have an Interface with 3 methods - when defining t...
Quotha asked 20/1, 2015 at 18:19

2

I just found out that Jackson does not implement JSR-353 and we already designed the module.. so i am in a desperate hurry to find a replacement of this API to begin working ! :D I searched...
Cyclopean asked 16/1, 2015 at 13:5

4

I need to dynamically load a xml layout from the server. LayoutInflater has inflate methods that use a XmlPullParser. I've tried that, but it doesn't work. Looking into the Android source code, i...
Ibnsina asked 5/9, 2013 at 16:47

4

Solved

I've tried to use the XPath 2.0 exp //span/string(.) in libxml2, but it doesn't work. So, my question is: does libxml2 support XPath 2.0 or not?

5

Solved

I have a base abstract class that also implements a particular interface. public interface IMovable<TEntity, T> where TEntity: class where T: struct { TEntity Move(IMover<T> moverPr...
Bub asked 28/5, 2014 at 11:58

3

Solved

I've run into a compiler error when attempting to implement an interface twice for the same class like so: public class Mapper<T1, T2> : IMapper<T1, T2>, IMapper<T2, T1> { /* im...
Cle asked 28/3, 2014 at 19:38

3

Solved

I have a class that implements an interface, such as this: interface IInterface { string PropA { get; } string PropB { get; } } class AClass : IInterface { string PropA { get; protected set; }...
Cowardice asked 28/2, 2014 at 17:17

2

Solved

consider this: class A{} class B extends A{} interface I{ // expects object instanceof A function doSomething(A $a); } class C implements I { // fails ???? function doSomething(B $b){} } ...
Entomologize asked 24/1, 2011 at 13:59

1

Solved

I am following a book namely ".NET Domain Driven Design with C#". Question is based on scenario as shown in Class Diagram below: Figure: http://screencast.com/t/a9UULJVW0 In this diagram, A) I...
Foxhole asked 24/9, 2013 at 19:19

6

Is there a quick way to find all of the implementations of, not references to, an interface's method/property/etc? Here's some sample code: public class SomeClass : IBaseClass { public Int...
Stantonstanway asked 11/8, 2009 at 16:43

4

Solved

I'm trying to extend functionality of the VBA Collection object in a new class and make this class an inheritant of Collection, but the Implements Collection statement gives me the following error:...
Grantee asked 21/4, 2011 at 18:12

2

Solved

I'm trying to create a custom collection based on Stack<T>. When I look at Stack<T> [from metadata] in visual studio, it shows that Stack<T> implements ICollection, which would re...
Janitress asked 14/5, 2012 at 19:26

3

I know and understand the value of interfaces in Java. You code to the interface, and then you can change your implementations without having to change any code using the interface. Often the...
Airlia asked 30/3, 2012 at 18:4

© 2022 - 2024 — McMap. All rights reserved.