Yesterday we had a practical session yesterday trying to set up SCCBridge to access VSS. It actually was quite simple to set up actually.
Just a short description of SCCBridge. SCCBridge is a bridge between your VSS and supposedly your lan/internet. It uses WSE 2.0 and SOAP to achieve this. It's split into 2 parts. The server and the client. The server is a webservice that interfaces with your VSS. It's simple to set up. Just edit the web.config and change your VSS directory settings, and expose it to your IIS and the outside world.
The client is basically an SCC that installs into your Visual Studio. You'll need to install WSE 2.0 first. The functionalities are all the same.
Anyway, the problem we faced was quite simple. We had to set up the VSS directory permissions. Added the Network Service account and give it read/write/modify access.
Another problem we faced was when trying to access through the internet, as an external connection. I can't seem to log in. It might be something wrong with my connection I guess. I'm behind a router.
Anyway, here are the threads that discusses this.
Practical: Visual Source Safe over Internet
Access VSS via the Internet
Friday, January 28, 2005
Thursday, January 27, 2005
OS Development Resources
Here are some resources that's quite interesting.
The Common Man's Guide to Operating System Design
Writing a Kernel in C
Resources on data sheets and hardware specifications
Cottontail OS Development Library
OS Resources
Look out for more OS stuff in the later posts.
The Common Man's Guide to Operating System Design
Writing a Kernel in C
Resources on data sheets and hardware specifications
Cottontail OS Development Library
OS Resources
Look out for more OS stuff in the later posts.
Niels' Blog
Niels' Blog
A blog on the BeOS USB Stack that's being worked on by Niel. Something I'd like to keep track on and help out.
A blog on the BeOS USB Stack that's being worked on by Niel. Something I'd like to keep track on and help out.
Wednesday, January 26, 2005
Xtreme Programming and Open Source Software Development
Interesting article on how Open Source development can work with Xtreme programming.
Xtreme Programming and Open Source Software Development
Read it. Enjoy it.
Xtreme Programming and Open Source Software Development
Read it. Enjoy it.
MIME Media Types
For those who have a hard time finding what the MIME type is from application/* or whatever, here's the list.
IANA MIME Media Types
Enjoy. :)
IANA MIME Media Types
Enjoy. :)
Sunday, January 23, 2005
Problems installing VSTS 2005 Dec. 2004 CTP
Some of you guys might be having trouble installing VSTS aka Visual Studio Team Suite (which is the new name for Visual Studio 2005) and come across this problem as described here.
Problems installing VSTS 2005 Dec. 2004 Refresh
Well, the problem I had was a conflict with the .NET Framework 2.0, with SQL Server 2005 Dec 2005 CTP being installed first. And what is the solution for this?
Uninstall your .NET Framework 2.0, install the VSTS (which now installs), then repair SQL Server 2005. This is how you get it working.
I do not know if you'll have any problems install SQL Server 2005 after installing VSTS 2005. :) Anyone tried and have problems?
Problems installing VSTS 2005 Dec. 2004 Refresh
Well, the problem I had was a conflict with the .NET Framework 2.0, with SQL Server 2005 Dec 2005 CTP being installed first. And what is the solution for this?
Uninstall your .NET Framework 2.0, install the VSTS (which now installs), then repair SQL Server 2005. This is how you get it working.
I do not know if you'll have any problems install SQL Server 2005 after installing VSTS 2005. :) Anyone tried and have problems?
Saturday, January 22, 2005
Friday, January 21, 2005
My very own OS
This is official. I'll be working on my very own OS. I'm drawing up the plans with my friend soon enough. Anyone can suggest what they want in their OS? :)
Thursday, January 20, 2005
More CSS Resources
This is such a boring day for me, so I went around surfing for things. Some things I actually want to learn more about is CSS and how can I code the new ASP.NET 2.0 together with CSS. It's supposedly said that ASP.NET 2.0 generates XHTML conformant code, and I've yet to really find any flaws with it yet. I haven't tried parsing an ASP.NET 2.0 page through the XHTML validator. I'll try that out one day.
Well, here are the interesting resources.
How to hide CSS from buggy browsers
W3 CSS tips & tricks
WordPress CSS Tips and Tricks
CSS Shorthands
Scrollable area using CSS
Sitepoint "CSS Resources, Tutorials, Tips and Tricks" thread
CSS Vault - The Web's CSS Site
Top Style Lite - Great CSS/XHTML Editor
Well, that will keep be busy for a few more hours I think. Yawnz. I'm so bored. *rub eyes*
Well, here are the interesting resources.
How to hide CSS from buggy browsers
W3 CSS tips & tricks
WordPress CSS Tips and Tricks
CSS Shorthands
Scrollable area using CSS
Sitepoint "CSS Resources, Tutorials, Tips and Tricks" thread
CSS Vault - The Web's CSS Site
Top Style Lite - Great CSS/XHTML Editor
Well, that will keep be busy for a few more hours I think. Yawnz. I'm so bored. *rub eyes*
UML Books
Here are some UML Books I think are useful that I should get around reading one of these days.
Writing Effective Use Cases
by Alistair Cockburn
Patterns for Effective Use Cases
by Paul Bramble, Alistair Cockburn, Andy Pols, Steve Adolph
Use Case Driven Object Modeling with UML : A Practical Approach (Addison Wesley Object Technology Series)
by Doug Rosenberg, Kendall Scott
UML Distilled: A Brief Guide to the Standard Object Modeling Language, Third Edition
by Martin Fowler
Yeap. Lots of books to read.
Writing Effective Use Cases
by Alistair Cockburn
Patterns for Effective Use Cases
by Paul Bramble, Alistair Cockburn, Andy Pols, Steve Adolph
Use Case Driven Object Modeling with UML : A Practical Approach (Addison Wesley Object Technology Series)
by Doug Rosenberg, Kendall Scott
UML Distilled: A Brief Guide to the Standard Object Modeling Language, Third Edition
by Martin Fowler
Yeap. Lots of books to read.
Successful Product/Solution Analysis
Stupid blogger destroyed my writing on it. And I'm too lazy to write again. So I'm just going to sum everything up.
Analysing how a successful product/solution become successful is basically what I've been thinking about the last few days.
To have a successful product/solution, you'll need to have a solid Vision for it. Vision to bring the product/solution far and wide. That means you'll have to promote, advertise, and get people to listen to you.
Next. You need to have Passion to drive the product/solution. With passion, you can bring the product to higher reaches. With Passion, you can imagine the possibilities out there.
Next. Cooperation VS Competition. For me, I'd rather choose Cooperation. Cooperation yields almost the same result as Competition. You further your product/solution to become better, you strive to be better than your competitor. But Cooperation really brings about a whole new meaning to everything. Let me explain. Cooperating will give your users/clients a better and smoother ride along your product/solution.
Next. Don't think of possibilities. Try out unknown possibilities and see how it can start something new. What I mean is, instead of pondering how we can work together, why don't you think, we CAN work together, let's discuss further how we can work together even more. During this discussion or whatever, you'll start seeing MORE possibilities coming out than you thinking of it by yourself without the other party.
Next. Possibilities are the Key to Innovation. Don't turn away any idea or possibility that might come into your mind. Keep it. Archive it. Store it for later use. Don't let your mind be restricted by what you can do. Possibilities are limitless, it is you who set the limit.
Next. And I think it's the most important point. User Experience. It's really how your user/client enjoy using your product/solution and how easy it is to use it. Don't restraint yourself to within the box. Think and innovate outside, and new possibilities on new ways you can create your user experience. I'm not talking about fanciful graphics and such. I'm talking about a totally new concept that's natural, easy to pick up, and it's just simply fun to do.
That's about all I want to say. Summed up from my previous attempt to post. I'm going to copy this post just in case. I hope someone reads this and actually finds this useful.
Disclaimer. These are my own thoughts. And some discussion points I might like to bring up. I might be wrong.
Analysing how a successful product/solution become successful is basically what I've been thinking about the last few days.
To have a successful product/solution, you'll need to have a solid Vision for it. Vision to bring the product/solution far and wide. That means you'll have to promote, advertise, and get people to listen to you.
Next. You need to have Passion to drive the product/solution. With passion, you can bring the product to higher reaches. With Passion, you can imagine the possibilities out there.
Next. Cooperation VS Competition. For me, I'd rather choose Cooperation. Cooperation yields almost the same result as Competition. You further your product/solution to become better, you strive to be better than your competitor. But Cooperation really brings about a whole new meaning to everything. Let me explain. Cooperating will give your users/clients a better and smoother ride along your product/solution.
Next. Don't think of possibilities. Try out unknown possibilities and see how it can start something new. What I mean is, instead of pondering how we can work together, why don't you think, we CAN work together, let's discuss further how we can work together even more. During this discussion or whatever, you'll start seeing MORE possibilities coming out than you thinking of it by yourself without the other party.
Next. Possibilities are the Key to Innovation. Don't turn away any idea or possibility that might come into your mind. Keep it. Archive it. Store it for later use. Don't let your mind be restricted by what you can do. Possibilities are limitless, it is you who set the limit.
Next. And I think it's the most important point. User Experience. It's really how your user/client enjoy using your product/solution and how easy it is to use it. Don't restraint yourself to within the box. Think and innovate outside, and new possibilities on new ways you can create your user experience. I'm not talking about fanciful graphics and such. I'm talking about a totally new concept that's natural, easy to pick up, and it's just simply fun to do.
That's about all I want to say. Summed up from my previous attempt to post. I'm going to copy this post just in case. I hope someone reads this and actually finds this useful.
Disclaimer. These are my own thoughts. And some discussion points I might like to bring up. I might be wrong.
Product Analysis
What makes a good product or solution? It's not your idea, it's your vision for the product or solution. Here's what I've been thinking lately.
There are alot of very wonderful and fantastic products, solutions, applications out there that alot of people do not know of. Why is that so? Because they lack the vision to promote, advertise and gain the public's interest. Vision is very important and you have to get that straight down way before you get anything done. What do I want this product or solution to achieve? How am I going to achieve it? Not only that, which I'm going to go on to my next point here.
The next question you should ask yourself. Who and How can I cooperate with other people, companies, organisations, government? This will expand your horizons and discover new ways to improve your product/solution, and to find new ways to collaborate with your partners.
Yet another question you must ask yourself, do you have the drive to carry this out? You must foremost have the passion and the belief to carry all these out. You also need to have to come up with more plans, more ideas constantly to improve your product/solution. You will also need to think outside your box. For example, how would a totally unrelated subject/thing can help with my product/solution, or how can my product/solution help it/them/her/his?
It's quite vague right now as it's an idea that's been swarming around my head. Because what I realise with Asians is that they are quite closed-minded, living in the box, and very competitive.
Another point I want to bring up also. Cooperation VS Competition. I see more sense in finding ways to cooperate than to compete. With cooperation, you co-exist and work together, helping each other in some ways or another, to improve each other's solution/product. One must start the initiative to give first, and the other must also have the initiative to return in favour. In this aspect, each can grow in its own ways. Why compete, when you can cooperate to make something even better together? Or make the customer's lives better by having our products/solution work together?
I'd like to bring up is to try out new ideas. Always try it. Don't be afraid to carry it out. Don't keep thinking of how you're going to do it. You'll have to solve it some day. JUST DO IT (NIKE Trademark).
Lastly, it's to engage in new possibilities even when THERE AREN'T ANY POSSIBILITIES YET. It's always good to sit down and discuss informally, and somewhere somehow something might come up, and we go back to the Cooperation point. Cooperate.
What I can say now is.
Possibilities are Limitless, It is Only YOU Setting The Limit.
Possibilities are the key to Innovation.
Always concentrate on the Solution, and not think about the problem.
Cheers. I hope to read this blog one day and realise what I think now is true and can apply everywhere.
There are alot of very wonderful and fantastic products, solutions, applications out there that alot of people do not know of. Why is that so? Because they lack the vision to promote, advertise and gain the public's interest. Vision is very important and you have to get that straight down way before you get anything done. What do I want this product or solution to achieve? How am I going to achieve it? Not only that, which I'm going to go on to my next point here.
The next question you should ask yourself. Who and How can I cooperate with other people, companies, organisations, government? This will expand your horizons and discover new ways to improve your product/solution, and to find new ways to collaborate with your partners.
Yet another question you must ask yourself, do you have the drive to carry this out? You must foremost have the passion and the belief to carry all these out. You also need to have to come up with more plans, more ideas constantly to improve your product/solution. You will also need to think outside your box. For example, how would a totally unrelated subject/thing can help with my product/solution, or how can my product/solution help it/them/her/his?
It's quite vague right now as it's an idea that's been swarming around my head. Because what I realise with Asians is that they are quite closed-minded, living in the box, and very competitive.
Another point I want to bring up also. Cooperation VS Competition. I see more sense in finding ways to cooperate than to compete. With cooperation, you co-exist and work together, helping each other in some ways or another, to improve each other's solution/product. One must start the initiative to give first, and the other must also have the initiative to return in favour. In this aspect, each can grow in its own ways. Why compete, when you can cooperate to make something even better together? Or make the customer's lives better by having our products/solution work together?
I'd like to bring up is to try out new ideas. Always try it. Don't be afraid to carry it out. Don't keep thinking of how you're going to do it. You'll have to solve it some day. JUST DO IT (NIKE Trademark).
Lastly, it's to engage in new possibilities even when THERE AREN'T ANY POSSIBILITIES YET. It's always good to sit down and discuss informally, and somewhere somehow something might come up, and we go back to the Cooperation point. Cooperate.
What I can say now is.
Possibilities are Limitless, It is Only YOU Setting The Limit.
Possibilities are the key to Innovation.
Always concentrate on the Solution, and not think about the problem.
Cheers. I hope to read this blog one day and realise what I think now is true and can apply everywhere.
Wednesday, January 19, 2005
HTTP and it's Messages
I was just helping a friend at SgDotNet to answer a question, and I found a few sites that are interesting in respect to HTTP and it's Messages and Message Headers.
Here's the thread I replied.
http://forums.sgdotnet.org/ShowPost.aspx?PostID=9359
Further resources can be found here.
HTTP Made Really Easy
http://www.jmarshall.com/easy/http/
It's something that explains how the HTTP protocol actually works in examples.
Here is a resource for the RFC.
RFC 2616
Hypertext Transfer Protocol -- HTTP/1.1
http://www.w3.org/Protocols/rfc2616/rfc2616.html
Which is rather technical.
Well, I hope it helps out.
Here's the thread I replied.
http://forums.sgdotnet.org/ShowPost.aspx?PostID=9359
Further resources can be found here.
HTTP Made Really Easy
http://www.jmarshall.com/easy/http/
It's something that explains how the HTTP protocol actually works in examples.
Here is a resource for the RFC.
RFC 2616
Hypertext Transfer Protocol -- HTTP/1.1
http://www.w3.org/Protocols/rfc2616/rfc2616.html
Which is rather technical.
Well, I hope it helps out.
Thursday, December 23, 2004
Business Clients and how they actually think
I just met up with a very business-like client who's the total non-technology savvy person, and I must say it has been a very fruitful experience to understand the thinking of how non-techno people think.
Basically just drawing back on my previous blog, the idea of a User-Role-Centric Solution and Approach to the problem. Apparently it came to very good use as I subtlely veered her into that thinking, or maybe she already is thinking using that approach. Anyway, that's really besides the point. But that approach actually made her able to come up with fantastic ideas for what she actually wants in her business or logic-wise. Note that we were actually talking quite non-technical here and more of what she wants to do, or what service she wants to provide the user. By thinking along that terms, she could come up with quite alot of business processes that she wants implemented, like her Invoice process, her Customer process, and so on.
From my point of view, this is actually quite a good way to draw out what your client actually wants for the solution, and how she wants it done. In my case, I would have never thought about enabling the invoice to be output into an excel file then making it available for printing, nor would I have known about how she wants herself to view the payment reports, nor would I have thought about how she wants to keep her customers by adding some added-value/services to her business, and so on. And she also has a better understanding and quite a clear understanding of how the solution works by us listing down the functionalities of what each type of person can do, without alot of the techy details. The most techy thing would be to describe the process of how the system works. As in, the user enters something, and the information is submitted into the system, and thus the system will inform the admin staff and send back a confirmation email to the user. Something along that lines. Very basic techy stuff. Nothing on like how it actually works.
Of course, the document must have these things available, in a bit more details, but that's for another section. I actually have a Project Guidelines document which I'll put up some time this week for you guys to look at. It's quite interesting. But some things I might want to emphasize. Know your clients, and write your document accordingly. Safest way to do it, think in a business sense. :)
Till next time,
Cheerios.
Basically just drawing back on my previous blog, the idea of a User-Role-Centric Solution and Approach to the problem. Apparently it came to very good use as I subtlely veered her into that thinking, or maybe she already is thinking using that approach. Anyway, that's really besides the point. But that approach actually made her able to come up with fantastic ideas for what she actually wants in her business or logic-wise. Note that we were actually talking quite non-technical here and more of what she wants to do, or what service she wants to provide the user. By thinking along that terms, she could come up with quite alot of business processes that she wants implemented, like her Invoice process, her Customer process, and so on.
From my point of view, this is actually quite a good way to draw out what your client actually wants for the solution, and how she wants it done. In my case, I would have never thought about enabling the invoice to be output into an excel file then making it available for printing, nor would I have known about how she wants herself to view the payment reports, nor would I have thought about how she wants to keep her customers by adding some added-value/services to her business, and so on. And she also has a better understanding and quite a clear understanding of how the solution works by us listing down the functionalities of what each type of person can do, without alot of the techy details. The most techy thing would be to describe the process of how the system works. As in, the user enters something, and the information is submitted into the system, and thus the system will inform the admin staff and send back a confirmation email to the user. Something along that lines. Very basic techy stuff. Nothing on like how it actually works.
Of course, the document must have these things available, in a bit more details, but that's for another section. I actually have a Project Guidelines document which I'll put up some time this week for you guys to look at. It's quite interesting. But some things I might want to emphasize. Know your clients, and write your document accordingly. Safest way to do it, think in a business sense. :)
Till next time,
Cheerios.
Saturday, December 18, 2004
Project Lamenting and User-Role-Centric Solution
For those of you who know about my new project, I've been so damn busy working on it. This client basically wants me to come up with all the business logic and specifications of what SHE wants, but DOESN'T tell me what SHE wants, so therefore I have to predict and be a fortune-teller to come up with something that SHE'S expecting, because she herself doesn't know what SHE'S wants the solution to do.
Simply fantastic, lamenting on this crappy project. I'm going to charge her for the consultation! Furthermore, I wasn't there during the meeting with the client to dig out information from her, and pick out everything out of her brains.
So anyway, here's what I've been researching and doing for the past few days.
I finally realised when creating a solution, one MUST think about the person using the solution itself. Trying to explain this method to my friend(s), who are in on the same project as me, made me realise the importance of a User-Role-Centric Solution. While coming up with the User-Role profiles, I realised a lot of unseen features appear that's not realised during the so-called "feature-creation" phase, which was done BEFORE creating this User-Role profile. Which was not supposed to be the case. *DEVELOPERS*
Anyway, creating a user-role profile is basically as simple as this. Determine who's going to use the solution. For example, in my case, we came up with 4 user-roles. The "General Person", the "Student", the "Teacher", the "Admin Staff". From this, I think you'll have a rough idea what the type of business this company I'm doing this project for are doing.
The question to ask when figuring out what user-roles there are is simply,
Who will use this solution?
So then, here are a few questions you'll ask yourself about each user-role.
1) Who are the people who falls into this category?
2) What does the person expect to accomplish with this solution?
3) What does the person need to have to use this solution?
4) Is there any problems with the current solution that can be solved with our solution?
5) Is there any forms of information communication between another user-role? What are they?
6) What are the tasks that the person can do with this solution?
Basically these are the few questions that one would ask the client, but apparently there wasn't a chance to do that for my case. Therefore I had to ask myself, and my other friends this question, and see what we can come up with.
In actual fact, we realised that when comparing with our original feature-list module-seperated format, which isn't entirely non-valid and still useable in the proposal under the section "Scope of the Project" and "Solutions Concepts", that we actually came up with more features that we didn't think of in the feature-list, and removed quite a fair bit of features that weren't needed and quite redundant. Which was good, in a sense that now the entire solution was based on "what the person is able to do with the solution", instead of "what this solution can do for the person". There are subtle differences, but when you actually think about it, your entire specification list simply changes and morphs into an almost totally different style. WHICH IS A GOOD THING(tm). So there and then, things start to change.
And I hope you guys also follow this way of thinking, instead of plunging down into feature-list.
Cheerios. Till next time.
Simply fantastic, lamenting on this crappy project. I'm going to charge her for the consultation! Furthermore, I wasn't there during the meeting with the client to dig out information from her, and pick out everything out of her brains.
So anyway, here's what I've been researching and doing for the past few days.
I finally realised when creating a solution, one MUST think about the person using the solution itself. Trying to explain this method to my friend(s), who are in on the same project as me, made me realise the importance of a User-Role-Centric Solution. While coming up with the User-Role profiles, I realised a lot of unseen features appear that's not realised during the so-called "feature-creation" phase, which was done BEFORE creating this User-Role profile. Which was not supposed to be the case. *DEVELOPERS*
Anyway, creating a user-role profile is basically as simple as this. Determine who's going to use the solution. For example, in my case, we came up with 4 user-roles. The "General Person", the "Student", the "Teacher", the "Admin Staff". From this, I think you'll have a rough idea what the type of business this company I'm doing this project for are doing.
The question to ask when figuring out what user-roles there are is simply,
Who will use this solution?
So then, here are a few questions you'll ask yourself about each user-role.
1) Who are the people who falls into this category?
2) What does the person expect to accomplish with this solution?
3) What does the person need to have to use this solution?
4) Is there any problems with the current solution that can be solved with our solution?
5) Is there any forms of information communication between another user-role? What are they?
6) What are the tasks that the person can do with this solution?
Basically these are the few questions that one would ask the client, but apparently there wasn't a chance to do that for my case. Therefore I had to ask myself, and my other friends this question, and see what we can come up with.
In actual fact, we realised that when comparing with our original feature-list module-seperated format, which isn't entirely non-valid and still useable in the proposal under the section "Scope of the Project" and "Solutions Concepts", that we actually came up with more features that we didn't think of in the feature-list, and removed quite a fair bit of features that weren't needed and quite redundant. Which was good, in a sense that now the entire solution was based on "what the person is able to do with the solution", instead of "what this solution can do for the person". There are subtle differences, but when you actually think about it, your entire specification list simply changes and morphs into an almost totally different style. WHICH IS A GOOD THING(tm). So there and then, things start to change.
And I hope you guys also follow this way of thinking, instead of plunging down into feature-list.
Cheerios. Till next time.
Sunday, December 12, 2004
Exhausted
Sorry guys. I've been so extremely busy creating my presentation slides and demo on "Generics on the .NET Framework 2.0" and organising the Christmas Party yesterday and playing host and everything, that I'm just totally worn out.
I'll be posting more within the next few days so just to let you guys know I'm still alive and blogging.
I'll be posting more within the next few days so just to let you guys know I'm still alive and blogging.
Saturday, December 04, 2004
StringControl
StringControl, something I wrote last night to handle parsing of text between tags. I'm not too sure whether there's another easier way to do it, but here's what I came up with.
Why did I create a simple control like this? It's basically to handle this situation easily.
Notice if I wanted to do that way, I needed to create a control to parse the text between <heading> and <text>. The code is something like this.
So basically I consolidated the logic for both HeadingControl and TextControl into 1 class called StringControl which will parse the inner text of the tags.
Fantastic don't you think? But I'd prefer if there's a better way to do.
public class StringControl : Control {
private string m_text;
public StringControl() {
}
public StringControl(string text) {
m_text = text;
}
public string Text {
get { return m_text; }
set { m_text = value; }
}
protected override void AddParsedSubObject(object obj) {
if ( obj is LiteralControl ) {
m_text = ((LiteralControl)obj).Text;
}
}
}
Why did I create a simple control like this? It's basically to handle this situation easily.
<sgdn:ModuleItem href="testhref" forumref="testforumref">
<heading>Testing Heading</heading>
<text>Testing Text</text>
</sgdn:ModuleItem>
Notice if I wanted to do that way, I needed to create a control to parse the text between <heading> and <text>. The code is something like this.
[ NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty) ]
public HeadingControl Heading {
get { return new HeadingControl(m_heading); }
set { m_heading = value.Text; }
}
[ NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty) ]
public TextControl Text {
get { return new TextControl(m_text); }
set { m_text = value.Text; }
}
So basically I consolidated the logic for both HeadingControl and TextControl into 1 class called StringControl which will parse the inner text of the tags.
Fantastic don't you think? But I'd prefer if there's a better way to do.
Thursday, December 02, 2004
Inner Content of a Custom Control
To retrieve the inner content of a custom control, you'll first have to make sure your control does not specify the ParseChildrenAttribute or specifies ParseChildrenAttribute(ChildrenAsProperties = false). Then after that, you can make use of protected void AddParsedSubObject(object obj) method to parse your inner content into a property. For example.
But if you want to parse html, I suggest creating your own Templated Control.
Back to coding.
public class MenuItem : Control {
private string m_href;
private string m_text;
public string Text {
get { return m_text; }
set { m_text = value; }
}
protected override void AddParsedSubObject(object obj) {
if ( obj is LiteralControl ) {
Text = ((LiteralControl)obj).Text;
}
}
}
But if you want to parse html, I suggest creating your own Templated Control.
Back to coding.
Complex Properties with Inner Property Persistence persisting a Collection property in a User Custom Control using Code Beside Method
Man that's one long name. I'm so excited to blog about this!
Here's the case, I've been trying to learn how to embed custom tags within custom tags. Basically in ColdFusion, a custom tag is the same as a Custom Control. It's much easier to do it in ColdFusion, but that's another story.
So I was actually trying out templated controls, but it turned out it wasn't really what I wanted. Templated Controls are basically almost empty controls that exposes it's structure for you to change accordingly. Which is not what I really want.
Then I came upon something that fits the description. To pass in multiple XML-like "data" into the user custom control. NOTE: USER CUSTOM CONTROL. Very important note there.
Anyway, it's basically called inner property. This is how to create an Inner Property.
As simple as that. And the html side would be like this.
Basically something like that. Wonderful right? That's exactly what I needed. But wait! What if I needed a collection of the same property? Hell breaks loose. Something along the lines like THIS.
The twist is, to create a collection of properties, you'll have to specify this attribute in your control class. Something like this.
Ok. A few things to note. PersistenceMode.InnerProperty is now changed to PersistenceMode.InnerDefaultProperty. And you HAVE to specify your default property in the ParseChildren(true, "MyCollecProp").
Here comes the problem. What if I want this collection property in my User Custom Control? How do I do it? I can't put an attribute tag when doing Code Beside. You might be able to do it with Code Behind. Anyway, simply enough, I combine the 2 methods, by creating 1 Inner Property which is a Control which this Control has a Collection Property! WOAH! Fantastic!
Here's the code.
And the html would be something like this.
Of course, I'm assuming you already know how to write your collection class and naturally your data class.
Wonderful idea huh!! Look at it get implemented at SgDotNet website!
I'm not too sure whether any of you guys understood, if there's any questions, just post in the comments and I'll reply them.
w00t rocks!
Here's the case, I've been trying to learn how to embed custom tags within custom tags. Basically in ColdFusion, a custom tag is the same as a Custom Control. It's much easier to do it in ColdFusion, but that's another story.
So I was actually trying out templated controls, but it turned out it wasn't really what I wanted. Templated Controls are basically almost empty controls that exposes it's structure for you to change accordingly. Which is not what I really want.
Then I came upon something that fits the description. To pass in multiple XML-like "data" into the user custom control. NOTE: USER CUSTOM CONTROL. Very important note there.
Anyway, it's basically called inner property. This is how to create an Inner Property.
// your other methods and whatsoever. I'll skip to the property
[NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty)]
public void MyClassWithInnerProp MyInnerProp {
  get { .... }
  set { .... }
}
As simple as that. And the html side would be like this.
<mytag:mycontrol runat="server">
  <MyInnerProp />
</mytag:mycontrol>
Basically something like that. Wonderful right? That's exactly what I needed. But wait! What if I needed a collection of the same property? Hell breaks loose. Something along the lines like THIS.
<mytag:mycontrol runat="server">
  <MyInnerProp />
  <MyInnerProp />
  <MyInnerProp />
  <MyInnerProp />
</mytag:mycontrol>
The twist is, to create a collection of properties, you'll have to specify this attribute in your control class. Something like this.
[ParseChildren(true,"MyCollecProp")] // where MyCollecProp is your collection property
public class MyControl : WebControl {
  //blah blah blah
  [NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerDefaultProperty)]
  public MyCollectPropClass MyCollecProp {
    get { ... }
    set { ... }
  }
}
Ok. A few things to note. PersistenceMode.InnerProperty is now changed to PersistenceMode.InnerDefaultProperty. And you HAVE to specify your default property in the ParseChildren(true, "MyCollecProp").
Here comes the problem. What if I want this collection property in my User Custom Control? How do I do it? I can't put an attribute tag when doing Code Beside. You might be able to do it with Code Behind. Anyway, simply enough, I combine the 2 methods, by creating 1 Inner Property which is a Control which this Control has a Collection Property! WOAH! Fantastic!
Here's the code.
// your other methods and whatsoever. I'll skip to the property
[NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty)]
public void MyControl MyInnerProp { // Notice the change to MyControl
  pget { .... }
  set { .... }
}
// THIS HAS TO BE IN A CS FILE AND COMPILED IN A DLL THEN ADD THE @ REGISTER TO THE
// PAGES INVOLVED (mainly the User Custom Control and your Page using the control)
[ParseChildren(true,"MyCollecProp")] // where MyCollecProp is your collection property
public class MyControl : WebControl {
  //blah blah blah
  [NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerDefaultProperty)]
  public MyCollectPropClass MyCollecProp {
    get { ... }
    set { ... }
  }
}
And the html would be something like this.
<mytag:MyUserControl runat="server">
  <MyInnerProp>
    <MyCollecProp />
    <MyCollecProp />
    <MyCollecProp />
    <MyCollecProp />
  </MyInnerProp>
</mytag:MyUserControl>
Of course, I'm assuming you already know how to write your collection class and naturally your data class.
Wonderful idea huh!! Look at it get implemented at SgDotNet website!
I'm not too sure whether any of you guys understood, if there's any questions, just post in the comments and I'll reply them.
w00t rocks!
Wednesday, December 01, 2004
First Attempt to deploy
Well, I've deployed the initial stages of the website on to the development site for SgDotNet. Here's the link. http://dev.sgdotnet.org. There are quite alot more visual issues to be fixed, but generally that's how it will look.
I'm still trying to get everything else up and working.
Tired. Cheers.
I'm still trying to get everything else up and working.
Tired. Cheers.
Subscribe to:
Posts (Atom)