M
Marc
Should a class implementing an interface define the methods in the
interface?
That seems logical to me but I have the following code:
public class XmlDataSourceMarc : XmlDataSource
{
protected DataSourceView tst;
public override DataSourceView GetView(string viewName)
{
return tst;
}
}
This gives the error: 'XmlDataSourceMarc.GetView(string)': no suitable
method found to override
Now if I look at the base class, it's true GetView is not defined in the
class
public class XmlDataSource : HierarchicalDataSourceControl, IDataSource,
IListSource
{
public XmlDataSource();
public virtual int CacheDuration { get; set; }
public virtual DataSourceCacheExpiry CacheExpirationPolicy { get;
set; }
public virtual string CacheKeyDependency { get; set; }
public virtual string Data { get; set; }
public virtual string DataFile { get; set; }
public virtual bool EnableCaching { get; set; }
public virtual string Transform { get; set; }
public virtual XsltArgumentList TransformArgumentList { get; set; }
public virtual string TransformFile { get; set; }
public virtual string XPath { get; set; }
public event EventHandler Transforming;
protected override HierarchicalDataSourceView
GetHierarchicalView(string viewPath);
public XmlDocument GetXmlDocument();
protected virtual void OnTransforming(EventArgs e);
public void Save();
}
But the IDataSource interface it should implement has.
public interface IDataSource
{
event EventHandler DataSourceChanged;
DataSourceView GetView(string viewName);
ICollection GetViewNames();
}
So what am I missing? Why XmlDataSource does not have an implementation of
DataSourceView GetView(string viewName) while it implements the interface
IDataSource that defines it?
Marc Wentink
interface?
That seems logical to me but I have the following code:
public class XmlDataSourceMarc : XmlDataSource
{
protected DataSourceView tst;
public override DataSourceView GetView(string viewName)
{
return tst;
}
}
This gives the error: 'XmlDataSourceMarc.GetView(string)': no suitable
method found to override
Now if I look at the base class, it's true GetView is not defined in the
class
public class XmlDataSource : HierarchicalDataSourceControl, IDataSource,
IListSource
{
public XmlDataSource();
public virtual int CacheDuration { get; set; }
public virtual DataSourceCacheExpiry CacheExpirationPolicy { get;
set; }
public virtual string CacheKeyDependency { get; set; }
public virtual string Data { get; set; }
public virtual string DataFile { get; set; }
public virtual bool EnableCaching { get; set; }
public virtual string Transform { get; set; }
public virtual XsltArgumentList TransformArgumentList { get; set; }
public virtual string TransformFile { get; set; }
public virtual string XPath { get; set; }
public event EventHandler Transforming;
protected override HierarchicalDataSourceView
GetHierarchicalView(string viewPath);
public XmlDocument GetXmlDocument();
protected virtual void OnTransforming(EventArgs e);
public void Save();
}
But the IDataSource interface it should implement has.
public interface IDataSource
{
event EventHandler DataSourceChanged;
DataSourceView GetView(string viewName);
ICollection GetViewNames();
}
So what am I missing? Why XmlDataSource does not have an implementation of
DataSourceView GetView(string viewName) while it implements the interface
IDataSource that defines it?
Marc Wentink