Click here to Skip to main content
15,898,889 members
Home / Discussions / C#
   

C#

 
GeneralRe: whidbey - where is Global.asax codebehind file Pin
abcxyz8215-Feb-05 6:47
abcxyz8215-Feb-05 6:47 
GeneralRe: whidbey - where is Global.asax codebehind file Pin
abcxyz8215-Feb-05 6:55
abcxyz8215-Feb-05 6:55 
GeneralRe: whidbey - where is Global.asax codebehind file Pin
Heath Stewart15-Feb-05 7:28
protectorHeath Stewart15-Feb-05 7:28 
GeneralMSpaint TextBox.. Pin
jk chan12-Feb-05 20:43
jk chan12-Feb-05 20:43 
GeneralRe: MSpaint TextBox.. Pin
Heath Stewart13-Feb-05 7:09
protectorHeath Stewart13-Feb-05 7:09 
GeneralRe: MSpaint TextBox.. Pin
jk chan13-Feb-05 16:19
jk chan13-Feb-05 16:19 
GeneralRe: MSpaint TextBox.. Pin
Luis Alonso Ramos13-Feb-05 18:56
Luis Alonso Ramos13-Feb-05 18:56 
QuestionBest Practices? Pin
12-Feb-05 19:34
suss12-Feb-05 19:34 
Hey, for some reason I'm having trouble trying to figure out what the best practice would be for my situation. Let me explain my situation and then I'll explain where I'm stuck. I'm creating a skinning engine, somewhat like Winamps. It uses xml as the "scripting language", I then parse the xml into objects. Heres a simple XML of what a script might look like...

<code>
<pre> <skin_info>
<name>acDesk Default Skin</name>
<version>1.0</version>
...........
</skin_info>
<element id="main_window" source="main_window.xml" />
..............
<element id="tab_strip" source="tab_strip.xml" /></pre>
</code>

I would then parse the skin.xml into an object called SkinDocument wich has all the info in the skin_info node and a collection of SkinElement objects defined by the element tags. The SkinElement then looks at the source file of the element and parses that into SkinComponents (layers, buttons, etc..).. heres what an element source file looks like...

<code>
<pre><!-- Set the properties for this window -->
<setproperty id="folder_path" value="main_window" />
<setproperty id="size" value="205,437" />
<setproperty id="minsize" value="205,437" />
<setproperty id="transkey" value="255,0,255" />

<!-- Create the border layers -->
<layer id="top"
location="0,0"
width="$WIN_WIDTH"
height="5"
image="top_bar.png" /> <!-- This is a SkinComponent -->
<layer id="left"
location="0,0"
width="5"
height="$WIN_HEIGHT"
image="left_bar.png" />
<layer id="right"
location="0,compute($WIN_WIDTH - 5)"
width="5"
height="$WIN_HEIGHT"
image="right_bar.png" />
............
<!-- Create the title bar buttons container -->
<container id="title_buttons" location="compute($WIN_WIDTH - {$WIDTH}), 5" width="autosize-left" height="autosize-down" padding="5">
<button id="close_button"
width="10"
height="10"
action="CLOSE"
toolTip="Close acDesk"
image_strip="close_button.png" />
<button id="minimize_button"
width="10"
height="10"
action="MINIMIZE"
toolTip="Minimize acDesk"
image_strip="minimize_button.png" />
</container>

<!-- Create the content container -->
<container id="content"
location="5,5"
width="compute($WIN_WIDTH - 5)"
height="compute($WIN_HEIGHT - 5)"
padding="0"
source="$WORKSPACE" />
............</pre>
</code>

So, now theres a little background of what I'm doing. And heres my issue.. I'm going to be creating a UI to work around these objects, IE: SkinForm, SkinProgressBar, SkinPanel, etc.. So I need these objects to be exposed only internally, BUT anyone using this component will need the ability to "hot-swap" skins. They might not have access to the internal library to access these objects. So this forces me to make most of them public. My problem with this is that I don't want users to be able to "screw" with the skin. I don't know what some people might do, and I don't wanna even give them the chance to add SkinElements, SkinComponents, etc... at run time. So what I'm thinking of doing is creating another object called SkinManager wich will act as a wrapper for these objects. Then make all the other objects internal only. The SkinManager would contain only static fields so that it could be accessed across a whole application without having a crap load of instaces being created and alot of parsing going on. My question to everyone is what is the best practice here? Should I make all the object public and trust the user won't mess with the skin at runtime and trust they will create their own manager so that they aren't parsing everytime a skin UI object is loaded, or should I go with the SkinManager idea? Maybe both? Any help is appreciated! Thanks in advance!!!

BTW: This is going be under the GPL license, so anything I do will prolly be changed and made better down the road by someone else Smile | :)
AnswerRe: Best Practices? Pin
jlach0112-Feb-05 19:38
jlach0112-Feb-05 19:38 
AnswerRe: Best Practices? Pin
leppie12-Feb-05 22:02
leppie12-Feb-05 22:02 
AnswerRe: Best Practices? Pin
jlach0113-Feb-05 5:05
jlach0113-Feb-05 5:05 
GeneralRe: Best Practices? Pin
Heath Stewart13-Feb-05 7:00
protectorHeath Stewart13-Feb-05 7:00 
GeneralRe: Best Practices? Pin
jlach0113-Feb-05 7:07
jlach0113-Feb-05 7:07 
GeneralRe: Best Practices? Pin
Heath Stewart13-Feb-05 7:12
protectorHeath Stewart13-Feb-05 7:12 
GeneralRe: Best Practices? Pin
jlach0113-Feb-05 7:22
jlach0113-Feb-05 7:22 
GeneralRe: Best Practices? Pin
Heath Stewart13-Feb-05 21:37
protectorHeath Stewart13-Feb-05 21:37 
QuestionHow to assign an icon to a file format Pin
oohungoo12-Feb-05 16:49
oohungoo12-Feb-05 16:49 
AnswerRe: How to assign an icon to a file format Pin
Heath Stewart13-Feb-05 7:05
protectorHeath Stewart13-Feb-05 7:05 
Generalcan't figure what's wrong with this code Pin
Pyro Joe12-Feb-05 14:07
Pyro Joe12-Feb-05 14:07 
GeneralRe: can't figure what's wrong with this code Pin
Colin Angus Mackay12-Feb-05 15:51
Colin Angus Mackay12-Feb-05 15:51 
GeneralRe: can't figure what's wrong with this code Pin
leppie12-Feb-05 22:24
leppie12-Feb-05 22:24 
GeneralRe: can't figure what's wrong with this code Pin
Colin Angus Mackay13-Feb-05 5:24
Colin Angus Mackay13-Feb-05 5:24 
Generalhowto create one packages that contains all the dll's Pin
Gedrain12-Feb-05 13:24
Gedrain12-Feb-05 13:24 
GeneralRe: howto create one packages that contains all the dll's Pin
Colin Angus Mackay12-Feb-05 15:56
Colin Angus Mackay12-Feb-05 15:56 
GeneralRe: howto create one packages that contains all the dll's Pin
Gedrain13-Feb-05 8:55
Gedrain13-Feb-05 8:55 

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.