Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

SlingBlade

@SlingBlade
About
Posts
17
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Thats why i hate c++
    S SlingBlade

    You're a good person! :-D

    The Weird and The Wonderful c++ help learning

  • Custom Composite Server Control Children not visible to the designer
    S SlingBlade

    Will do.

    ASP.NET help html css sysadmin

  • Custom Composite Server Control Children not visible to the designer
    S SlingBlade

    Thanks, I added the [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] attribute and that fixed the changes issues (It was there before but I removed it thinking it rendundant to the PersistanceMode, oops). I ended up making a custom UITypeEditor to list the child tabs for the SelectedTab property. That brought to my attention a flaw to the logic of setting that property in the designer since it doesn't know how to persist a control value by it's ID. So I ended up setting the [Browsable(false)] attribute on the SelectedTab property and implementing a SelectedTabID property and using the custom UITypeEditor for that property. It is a bit of a workaroung but all is well now. I know I've seen a TypeConverter or something out there that can be used to list control ids of a certain type, but can't recall how, nor do I think it would work since the designer is still unaware of the child controls unless added with the CollectionEditor. Thanks for pointing me to your article, looks like a cool control. I'll have to look closer even though I have already implemented a solution.

    ASP.NET help html css sysadmin

  • Custom Composite Server Control Children not visible to the designer
    S SlingBlade

    But I like the designer. Besides, this is a TabStrip that I intend to share. There must be something I'm missing that the CollectionEditor does to make the designer aware of the controls it added that I could implement in the control, but I have no idea what.

    ASP.NET help html css sysadmin

  • Custom Composite Server Control Children not visible to the designer
    S SlingBlade

    I'm developing a TabStrip control and am having a bit of an issue with the designer and child controls. Below is the relevant code in regards to the problem (I can provide more if needed).

    \[ParseChildren(true), PersistChildren(false)\]
    \[ToolboxData("<{0}:TabStrip runat=server></{0}:TabStrip>")\]
    public class TabStrip : CompositeControl, IPostBackEventHandler
    {
        private Tab mySelectedTab;
        private TabCollection myTabs;
        
        public TabStrip()
        {
            this.myTabs = new TabCollection(this);
        }
        
        \[MergableProperty(false)\]
        public Tab SelectedTab
        {
            get
            {
                foreach (Tab tab in this.Tabs)
                    if (tab.IsSelected)
                        return tab;
                return null;
            }
            set { value.IsSelected = true; }
        }
        
        \[PersistenceMode(PersistenceMode.InnerProperty), NotifyParentProperty(true)\]
        \[MergableProperty(false)\]
        public TabCollection Tabs
        {
            get { return myTabs; }
        }
    }
    

    When I add tabs to the Tabs property on a page using the property grid's collection editor the tabs are listed in the collection editor by ID and can also be selected from a drop-down list from the property grid for the SelectedTab property. This is good and is exactly how I want the control to behave in the designer. The problem is, when the page is closed and reopened in the designer, the markup is still there, but when editing the child tabs in the collection editor they are listed by there class name rather than ID, changes made in the collection editor are not persisted, and they are no longer listed in the drop-down for the SelectedTab property. This is no good. The TabCollection class implements the IList interface and all the Tab's public properties have the NotifyParentPropertyAttribute set to true. Please advise as to what may be missing for the designer to be aware of the child controls when the page containing the control is reopened. Thank you.

    ASP.NET help html css sysadmin

  • C# 4.0
    S SlingBlade

    Yeah, I'll definately have to upgrade to VS2008 and start using the new stuff. That's cool that you have been poking at the line counter. I wouldn't mind seeing a toolbar added and the ability to calculate the contents of a folder. Calculating basedon namespaces, classes, interfaces etc. would be nice too but I imagine that would be a lot more work than folders.

    The Lounge csharp question discussion announcement

  • C# 4.0
    S SlingBlade

    The idea is so good they already implemented it in 3.5! ;P Perhaps I should stop using 2.0. I played with 3.5 briefly to check out WPF and Linq and didn't particularly see much use for them so I decided to stay away because of the performance drawbacks that came with WPF and didn't want to be tempted to use it. I missed the IEnumerable extensions and probably many more features that could come in handy. Am I the only one that WPF runs like molasses for? If not are there any other features to stay away from in order to perform decent on lowend and older machines? P.S. - Thanks for the Line Counter add-in! I've been using it for a couple months now.

    modified on Friday, October 3, 2008 2:30 AM

    The Lounge csharp question discussion announcement

  • C# 4.0
    S SlingBlade

    I don't want to use a HashSet. The whole point of the change suggestion is flexibility to use with any type of enumerable without having to write the code to iterate through it or convert it. That and a HashSet would only be able to handle the == or != operators. What if I want to use >, <, <= or >=?

    The Lounge csharp question discussion announcement

  • C# 4.0
    S SlingBlade

    lol, it was late and I definately could have used a break, so I just didn't bother with the break. Or should I say didn't bother editing the post and fixing the bug when I realized I had forgotten to throw in the break. All the more reason the change would be so useful. Not only could it make for less coding, less bugs too.

    The Lounge csharp question discussion announcement

  • C# 4.0
    S SlingBlade

    How about a way to check against all values in an array or enumerabale at once with perhaps the keyword 'any' like below.

    int[] supportedValues = new int[] { 3, 4, 5 }
    int x = 4;

    if (x == any supportedValues)
    {
    // Do something.
    }

    Instead of:

    int[] supportedValues = new int[] { 3, 4, 5 }
    int x = 4;
    bool xIsSupported = false;

    foreach (int value in supportedValues)
    {
    if (x == value)
    xIsSupported = true;
    }

    if (xIsSupported)
    {
    // Do something.
    }

    Good idea?

    The Lounge csharp question discussion announcement

  • Working alone or in a team ?
    S SlingBlade

    I think the guys boss' 20 years experience proves that's not as much of a problem as you're making it out to be. It happens but that's an act of God so it just goes to show that there are things more important in life than work and business.

    The Lounge sharepoint collaboration question discussion

  • Working alone or in a team ?
    S SlingBlade

    That all depends on your astrological sign. As an Aquarius I am independent and don't trust anyone else to get the job done right. ;P

    The Lounge sharepoint collaboration question discussion

  • flash
    S SlingBlade

    I've never heard of embedding flash files directly, however, you can add a web browser control and navigate it to an html file with the embedded flash file.

    Windows Forms adobe help tutorial question

  • Is it possible to modify InitializeComponent() safely?
    S SlingBlade

    That works fine at run time, but does not show up in the designer, even if you do the work before the InitializeComponent call in the constructor. I am thinking I am just going to have to manually define the table schemas in the dataset and have them filled at run time for the clarity I am going for. It is a bit more work and debugging but those are the breaks I guess. Thanks for helping keep me from going too far off on a tangent. It's kind of weird to mention this but even my horoscope that just hit my hotmail is in agreement with you. "Impose a looser, more go-with-the-flow kind of structure on your work habits, and you just might accomplish even more than you hoped. The payoffs may not be immediate, but they'll greatly benefit your future."

    Windows Forms winforms design question

  • Is it possible to modify InitializeComponent() safely?
    S SlingBlade

    I was refering to Microsoft not providing a way to manually interact with the designer. People come up with new design patterns all the time and I particularly considered what I was trying to accomplish as an innovative compromise to keeping the data layer seperate from the presentation layer but still be able to define how the presentation layer interacts with the data layer more clearly. Sorry for the run on sentence. What I'm trying to get at here is that I am using VS Express and am not currently at liberty to make feature requests directly. Sure modifying InitializeComponent is a bit dangerous, but, it's my machine I'm crashing and it sounds like Microsoft is just being lazy with it's almost limitless supply of resources to not provide a workaround. Since when has Microsoft been about following all standards exactly?

    Windows Forms winforms design question

  • Is it possible to modify InitializeComponent() safely?
    S SlingBlade

    I'm going to agree to disagree here. I'm pretty sure it is a lost cause trying to get support for something that is clearly defined as unsupported. Data, business and presentation is how I have always done it, but like I mentioned I am getting into developing custom controls that make the presentation layer much simpler and well defined to what need be accomplished, that and Microsoft offers the ability to define your entire data layer within the presentation layer. The data layer is still seperated with a business layer. I am really looking for a way to bring the schema into the designer so my custom controls can be assigned to the proper datatables that are returned in a data layer method without manually creating the schema for every table within the local Dataset for the control.

    Windows Forms winforms design question

  • Is it possible to modify InitializeComponent() safely?
    S SlingBlade

    Until recently I have been keeping Data layer objects and task logic as seperate from the UI logic as possible. I have been experimenting with custom user controls and attempting to integrate the custom datalayers with the designer by modifying the InitializeComponent method. I have been successful in integrating my data layer data into the designer, however, it doesn't like to stay. Are there any easy workarounds to this such as a way to tell the designer not to modify a peace of code in the InitializeComponent method?

    Windows Forms winforms design question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups