Click here to Skip to main content
15,887,083 members
Home / Discussions / C#
   

C#

 
AnswerRe: change interface type to other interface type Pin
Richard Deeming10-Apr-14 4:41
mveRichard Deeming10-Apr-14 4:41 
GeneralRe: change interface type to other interface type Pin
Nico Haegens10-Apr-14 5:14
professionalNico Haegens10-Apr-14 5:14 
GeneralRe: change interface type to other interface type Pin
Richard Deeming10-Apr-14 6:11
mveRichard Deeming10-Apr-14 6:11 
GeneralRe: change interface type to other interface type Pin
Nico Haegens11-Apr-14 6:07
professionalNico Haegens11-Apr-14 6:07 
AnswerRe: change interface type to other interface type Pin
Keith Barrow10-Apr-14 5:12
professionalKeith Barrow10-Apr-14 5:12 
GeneralRe: change interface type to other interface type Pin
Nico Haegens10-Apr-14 6:26
professionalNico Haegens10-Apr-14 6:26 
GeneralRe: change interface type to other interface type Pin
Keith Barrow10-Apr-14 22:28
professionalKeith Barrow10-Apr-14 22:28 
GeneralRe: change interface type to other interface type Pin
Nico Haegens11-Apr-14 0:31
professionalNico Haegens11-Apr-14 0:31 
Found out it didn't really fix the problem. Apparantly if I close Visual Studio and restart it, the problem is fixed. Well until I change something in the code, then I have to restart Visual Studio again. Kinda really annoying to restart VS every time I make a change to code.
My structure is as follows, changed the names a bit for more transparancy:
public interface ICustomItemsControl  : IDataBoundControl, IComponent
{
}
public class CustomItemsControl : DataBoundControl, ICustomItemsControl
{
}
public class CustomItemsControl <TDataItem> : CustomItemsControl, ICustomItemsControl
{
    private CustomItemsControlItem <TDataItem> CreateItem(int itemIndex, ListItemType itemType, bool dataBind, TDataItem dataitem)
    {
        return new CustomItemsControlItem <TDataItem>(itemIndex, itemType);
    }
}
public class CustomItemsControlItem : CompositeControl
{
}
[ControlBuilder(typeof(CustomGenericItemControlBuilder))]
[Designer(typeof(CustomRepeaterDesigner))]
public class TypedCustomItemsControl : CustomItemsControl , ICustomItemsControl
{
    private string dataItemTypeName;
    [PersistenceMode(PersistenceMode.Attribute)]
    public string DataItemTypeName
    {
        get { return dataItemTypeName; }
        set { dataItemTypeName = value; }
    }
}

The RepeaterControlBuilder converts the CustomRepeater class to a generic class.
I think the problem might be in the following class that does the actual work to convert my CustomItemsControl to a generic CustomItemsControl:
internal class RepeaterFakeType : TypeDelegator
{
        public RepeaterFakeType(Type dataItemType)
            : base(typeof(CustomItemsControl<>).MakeGenericType(dataItemType))
        {
            this.repeaterItemType = typeof(CustomGenericItemsControlItem<>).MakeGenericType(dataItemType);
        }
        protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, 
            Type returnType, Type[] types, ParameterModifier[] modifiers)
        {
            PropertyInfo info = base.GetPropertyImpl(name, bindingAttr,binder,returnType,types,modifiers);
            if (info == null)
                return null;
            if (name == "ItemTemplate" || name == "AlternatingItemTemplate")
                info = new FakePropertyInfo(info, this.repeaterItemType);
            return info;
        }
}

GeneralRe: change interface type to other interface type Pin
Keith Barrow11-Apr-14 0:38
professionalKeith Barrow11-Apr-14 0:38 
QuestionSerialize subclass of windows.forms.label Pin
DanielSheets10-Apr-14 3:08
DanielSheets10-Apr-14 3:08 
AnswerRe: Serialize subclass of windows.forms.label Pin
Ravi Bhavnani10-Apr-14 3:54
professionalRavi Bhavnani10-Apr-14 3:54 
QuestionDownload From Autoconfig Help Pin
LawlessBaron10-Apr-14 1:03
LawlessBaron10-Apr-14 1:03 
QuestionRe: Download From Autoconfig Help Pin
Eddy Vluggen10-Apr-14 3:02
professionalEddy Vluggen10-Apr-14 3:02 
AnswerRe: Download From Autoconfig Help Pin
LawlessBaron10-Apr-14 16:49
LawlessBaron10-Apr-14 16:49 
GeneralRe: Download From Autoconfig Help Pin
Eddy Vluggen11-Apr-14 7:40
professionalEddy Vluggen11-Apr-14 7:40 
Questionstrange behaviour of click method Pin
joost.versteegen10-Apr-14 0:28
joost.versteegen10-Apr-14 0:28 
AnswerRe: strange behaviour of click method Pin
Rob Philpott10-Apr-14 0:50
Rob Philpott10-Apr-14 0:50 
GeneralRe: strange behaviour of click method Pin
joost.versteegen10-Apr-14 1:13
joost.versteegen10-Apr-14 1:13 
GeneralRe: strange behaviour of click method Pin
Rob Philpott10-Apr-14 1:44
Rob Philpott10-Apr-14 1:44 
GeneralRe: strange behaviour of click method Pin
joost.versteegen10-Apr-14 1:47
joost.versteegen10-Apr-14 1:47 
GeneralRe: strange behaviour of click method Pin
Rob Philpott10-Apr-14 1:53
Rob Philpott10-Apr-14 1:53 
GeneralRe: strange behaviour of click method Pin
joost.versteegen10-Apr-14 3:38
joost.versteegen10-Apr-14 3:38 
GeneralRe: strange behaviour of click method Pin
Dave Kreskowiak10-Apr-14 3:55
mveDave Kreskowiak10-Apr-14 3:55 
AnswerRe: strange behaviour of click method Pin
Richard MacCutchan10-Apr-14 2:31
mveRichard MacCutchan10-Apr-14 2:31 
GeneralRe: strange behaviour of click method Pin
joost.versteegen10-Apr-14 3:27
joost.versteegen10-Apr-14 3:27 

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.