Click here to Skip to main content
15,889,216 members
Home / Discussions / C#
   

C#

 
GeneralRe: C++ DLL within C# application Pin
John Torjo2-Mar-16 11:37
professionalJohn Torjo2-Mar-16 11:37 
GeneralRe: C++ DLL within C# application Pin
Mycroft Holmes2-Mar-16 11:57
professionalMycroft Holmes2-Mar-16 11:57 
AnswerRe: C++ DLL within C# application Pin
my Nick2-Mar-16 22:28
my Nick2-Mar-16 22:28 
GeneralRe: C++ DLL within C# application Pin
Richard MacCutchan2-Mar-16 22:48
mveRichard MacCutchan2-Mar-16 22:48 
AnswerRe: C++ DLL within C# application Pin
John Torjo2-Mar-16 22:52
professionalJohn Torjo2-Mar-16 22:52 
GeneralRe: C++ DLL within C# application Pin
my Nick2-Mar-16 23:07
my Nick2-Mar-16 23:07 
QuestionHow To? Abstract base class with Generic Constraints that also implements other interfaces Pin
Foothill2-Mar-16 8:46
professionalFoothill2-Mar-16 8:46 
AnswerRe: How To? Abstract base class with Generic Constraints that also implements other interfaces Pin
Sascha Lefèvre2-Mar-16 9:14
professionalSascha Lefèvre2-Mar-16 9:14 
You just need to re-order to make IDisposable apply to the class instead of T:
C#
public abstract class ObjectCollection<T> : Dictionary<int,T>, IDisposable where T : ISomeInterface


NB: You should implement the Dispose-pattern properly; this is the auto-generated snippet from VS (2015):
C#
private bool disposedValue = false; // To detect redundant calls

protected virtual void Dispose(bool disposing)
{
    if (!disposedValue)
    {
        if (disposing)
        {
            // TODO: dispose managed state (managed objects).
        }

        // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
        // TODO: set large fields to null.

        disposedValue = true;
    }
}

// TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources.
// ~CustomField() {
//   // Do not change this code. Put cleanup code in Dispose(bool disposing) above.
//   Dispose(false);
// }

// This code added to correctly implement the disposable pattern.
public void Dispose()
{
    // Do not change this code. Put cleanup code in Dispose(bool disposing) above.
    Dispose(true);
    // TODO: uncomment the following line if the finalizer is overridden above.
    // GC.SuppressFinalize(this);
}

If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

GeneralRe: How To? Abstract base class with Generic Constraints that also implements other interfaces Pin
Foothill2-Mar-16 9:22
professionalFoothill2-Mar-16 9:22 
GeneralRe: How To? Abstract base class with Generic Constraints that also implements other interfaces Pin
Sascha Lefèvre2-Mar-16 9:33
professionalSascha Lefèvre2-Mar-16 9:33 
QuestionHow to preview office file in windows app 8.1 using C# Pin
Shaimaa Fawzy2-Mar-16 4:16
Shaimaa Fawzy2-Mar-16 4:16 
AnswerRe: How to preview office file in windows app 8.1 using C# Pin
Frank Kerrigan4-Mar-16 3:52
Frank Kerrigan4-Mar-16 3:52 
GeneralRe: How to preview office file in windows app 8.1 using C# Pin
Shaimaa Fawzy5-Mar-16 5:53
Shaimaa Fawzy5-Mar-16 5:53 
QuestionObserver Pattern with Remote Machines Pin
Bernhard Hiller2-Mar-16 0:54
Bernhard Hiller2-Mar-16 0:54 
QuestionRe: Observer Pattern with Remote Machines Pin
dan!sh 2-Mar-16 1:42
professional dan!sh 2-Mar-16 1:42 
AnswerRe: Observer Pattern with Remote Machines Pin
Bernhard Hiller2-Mar-16 2:58
Bernhard Hiller2-Mar-16 2:58 
GeneralRe: Observer Pattern with Remote Machines Pin
Sascha Lefèvre2-Mar-16 3:39
professionalSascha Lefèvre2-Mar-16 3:39 
GeneralRe: Observer Pattern with Remote Machines Pin
Bernhard Hiller2-Mar-16 20:54
Bernhard Hiller2-Mar-16 20:54 
GeneralRe: Observer Pattern with Remote Machines Pin
dan!sh 2-Mar-16 23:00
professional dan!sh 2-Mar-16 23:00 
AnswerRe: Observer Pattern with Remote Machines Pin
Pete O'Hanlon2-Mar-16 5:52
mvePete O'Hanlon2-Mar-16 5:52 
GeneralRe: Observer Pattern with Remote Machines Pin
Bernhard Hiller2-Mar-16 20:58
Bernhard Hiller2-Mar-16 20:58 
GeneralRe: Observer Pattern with Remote Machines Pin
Pete O'Hanlon2-Mar-16 21:08
mvePete O'Hanlon2-Mar-16 21:08 
AnswerRe: Observer Pattern with Remote Machines Pin
BillWoodruff2-Mar-16 6:43
professionalBillWoodruff2-Mar-16 6:43 
GeneralRe: Observer Pattern with Remote Machines Pin
Bernhard Hiller2-Mar-16 21:24
Bernhard Hiller2-Mar-16 21:24 
AnswerRe: Observer Pattern with Remote Machines Pin
BillWoodruff2-Mar-16 21:54
professionalBillWoodruff2-Mar-16 21:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.