in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

Last post 05-26-2008 12:46 PM by mwinsor. 17 replies.
Page 1 of 2 (18 items) 1 2 Next >
Sort Posts: Previous Next
  • 01-31-2007 8:01 PM

    • greggw
    • Top 25 Contributor
    • Joined on 02-09-2006
    • Corona, CA
    • Posts 155

    Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    Since upgrading to the latest version of C1Command we are getting this weird
    error dialog that keeps popping up in VS2005 while working on projects that
    have the C1Command controls referenced in inherited forms. The attached
    picture shows the text of the error dialog.

    Basically it is saying that the type is not marked as serializable.

    It pops up frequently while working on a project and is becoming very
    annoying.

    Has anyone else seen this? Is there a solution?

    Thanks,
    Gregg Walker
  • 02-01-2007 12:52 PM In reply to

    • greggw
    • Top 25 Contributor
    • Joined on 02-09-2006
    • Corona, CA
    • Posts 155

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    I found the source of the problem and a workaround for this issue.
     
    Here's a snippet of code before I change something on the form that has inherited command toolbar.
     
       //
       // cmdToolbar
       //
       this.cmdToolbar.AccessibleName = "Tool Bar";
       this.cmdToolbar.CommandLinks.AddRange(new C1.Win.C1Command.C1CommandLink[] {
                this.linkReturnLoad});
    When I make a change to the form I then get the following...
     
       //
       // cmdToolbar
       //
       this.cmdToolbar.AccessibleName = "Tool Bar";
       this.cmdToolbar.CommandLinks.AddRange(new C1.Win.C1Command.C1CommandLink[] {
                this.linkOK,
                this.linkReload,
                this.linkSelect,
                this.linkReturnLoad,
                this.linkAutoLoad,
                this.linkPrint,
                this.linkNext,
                this.linkExit});
       this.cmdToolbar.Size = new System.Drawing.Size(695, 24);
    The linkOK, linkReload, linkSelect, linkAutoLoad, linkPrint, linkNext and linkNext links are all part of the inherited base form.  The linkReturnLoad was added in derived class form.
     
    As soon as inherited links get added to the CommandLinks in the derived form I started getting the popup dialogs in VS2005.  I get one popup for each link that is part of the base class form.
     
    The work around for now is to manually remove the base links from the CommandLinks.AddRange list.
     
    I'm currently using C1.Win.C1Command.2 version 2.0.20071.19008.  This behavior was not present in previous versions of the C1Command controls.
     
    Dima if you view this post let me know if you would for me to open a tech support case for this issue or if you would like more information.
     
    Thanks,
    Gregg Walker
     
    Here's another before and after.
     
    Before...
     
       //
       // menuAutoLoad
       // 

       this.menuAutoLoad.HideNonRecentLinks = false;
       this.menuAutoLoad.ShowToolTips = true;
       this.menuAutoLoad.Visible = false;
     
    After...
     
       //
       // menuAutoLoad
       //
       this.menuAutoLoad.CommandLinks.AddRange(new C1.Win.C1Command.C1CommandLink[] {
                this.linkAutoLoadOff,
                this.linkAutoLoad30,
                this.linkAutoLoad60});
       this.menuAutoLoad.HideNonRecentLinks = false;
       this.menuAutoLoad.ShowToolTips = true;
       this.menuAutoLoad.Visible = false;
    In this case all the links are from the inherited base class form.

  • 02-05-2007 12:19 PM In reply to

    • greggw
    • Top 25 Contributor
    • Joined on 02-09-2006
    • Corona, CA
    • Posts 155

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    I could not reproduce this in a test sample.
     
    I went back to the base class forms and made some modifications to regenerate the designer code and then rebuilt the derived form and everything seems to be working fine.
     
    So if anyone comes across this problem with the serialization dialogs in VS2005 try this to see if it fixes your problem.
  • 02-06-2007 4:46 PM In reply to

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    Thanks for showing the workaround. I will try to look at it when I have the time but it's nice to know there is a workaround.
    Cheers,
    Dima.
  • 07-23-2007 2:24 PM In reply to

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    I've just upgraded and now I'm getting this error as well. I've followed the suggestion of modifying the base form to re-generate the designer code and built a new derived form. However, this did not work. And in fact, the newly built derived form had the line: Me.commandFile.CommandLinks.AddRange(New C1.Win.C1Command.C1CommandLink() {Me.menuItemAbout, Me.menuitemExit})

    The controls being added to the collection are in the base form, and have been already added in the base form. This line should not appear in the derived form. I have to modify this -every- time I make a tweak. Even just opening it makes a change for some reason. This too causes the serialization error.

    Is there a fix available? Or a suggestion? I'm kind of in a bind here and need to get this stuff resolved quickly if at all possible.

    Update:
    This is happening with -all- of the C1 controls.
  • 07-23-2007 2:41 PM In reply to

    • greggw
    • Top 25 Contributor
    • Joined on 02-09-2006
    • Corona, CA
    • Posts 155

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    mwinsor -- What I did in the base form was just move a control and move it back.  This caused the designer code to be regenerated.  I then did the same thing in the derived form (after rebuilding the base form).
     
    I hope that helps.
     
    --
    Gregg Walker

     
  • 07-23-2007 4:10 PM In reply to

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    Nope, didn't work. It's still adding the links to the command link collections in the derived forms. I've even gone as far as replanting the controls.
  • 07-23-2007 6:14 PM In reply to

    • greggw
    • Top 25 Contributor
    • Joined on 02-09-2006
    • Corona, CA
    • Posts 155

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    > Nope, didn't work. It's still adding the links to the command link collections in the derived forms. I've even gone as far as replanting the controls.
    Bummer.  I remember how frustrating this was to me.  Sorry I couldn't be of more help.  If I can think of anything else I will let you know.
     
    In the mean time you may want to open a case with tech support.
     
    --
    Gregg Walker
  • 07-24-2007 11:41 AM In reply to

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    Well I tried to submit an incident via the on-line form which is very broken (why am I not surprised?) by the looks of it. I'll see if I can get my boss to talk to someone in tech support (seeing as it's all licensed to him, I'm just a drone trying to make it all work).

    In the meantime I'm just going to roll back to the older version that did work for the most part (only 1 thing was broken at that point). There are just too many bugs, inheritance issues, controls disappearing, etc...

    Thanks for the help Gregg.
  • 01-08-2008 4:20 PM In reply to

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

     I am having the same issue in my derived form. I am using C1.Win.C1Command.2 version 2.0.20073.19306 and i get this error in derived form when i go to the toolbar menu and insert new item :

    I tried as mentioned in other thread to move around controls so that designer is modified but that did not work for me. Please provide correct solution for this issue. Does C1.Command Component supports visual inheriatance or not?

    ---------------------------

    ---------------------------
    Type 'System.ComponentModel.Component' in Assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
    ---------------------------
    OK  
    ---------------------------
     

  • 01-08-2008 5:44 PM In reply to

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

     NOTE : This is not an issue if I use earlier version of C1.Win.C1Command.2 (Version 2.0.20063.18007)

  • 01-10-2008 9:18 AM In reply to

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    Please can you tell us when the fix will be released for the issue? 

  • 01-28-2008 12:00 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 515

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    When inheriting C1Command, ALL c1command related members (C1CommandHolder, C1CommandLink, C1CommandMenu and C1Command, etc) must be declared public in the base control. This can be done by setting the modifiers properties to public for each C1Command control.

    Regards

    Greg

  • 03-14-2008 12:53 PM In reply to

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    We are also having the same problem.  The only solution for us so far as been to stop the items from being added to the menu/toolbar at design time altogether.   

  • 05-12-2008 12:28 PM In reply to

    Re: Inherited Forms with Menu and Toolbar Causes Design Dialog Error Popup

    C1_GregL:

    When inheriting C1Command, ALL c1command related members (C1CommandHolder, C1CommandLink, C1CommandMenu and C1Command, etc) must be declared public in the base control. This can be done by setting the modifiers properties to public for each C1Command control.

    Regards

    Greg

    I did this and so far so good.  The latest and greatest version that I could get (2.0.20081.19402) seems to be behaving itself.  The only downside to this is that all my controls now show up in my Misc. category of my property pane :)  This isn't a big deal really, I'd rather that than the errors I was getting before.

Page 1 of 2 (18 items) 1 2 Next >
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.