Click here to Skip to main content
15,891,248 members
Home / Discussions / C#
   

C#

 
GeneralRe: Icon Documentation Pin
max2929725-Jun-07 16:20
max2929725-Jun-07 16:20 
QuestionXML with C# [modified] Pin
saymajum24-Jun-07 17:10
saymajum24-Jun-07 17:10 
AnswerRe: XML with C# Pin
Christian Graus24-Jun-07 17:46
protectorChristian Graus24-Jun-07 17:46 
AnswerRe: XML with C# Pin
Nouman Bhatti24-Jun-07 20:21
Nouman Bhatti24-Jun-07 20:21 
QuestionHow To Delete Multiple Selection of Rows in a Listview Control ? Pin
danielwinata24-Jun-07 17:06
professionaldanielwinata24-Jun-07 17:06 
AnswerRe: How To Delete Multiple Selection of Rows in a Listview Control ? Pin
Sathesh Sakthivel24-Jun-07 17:34
Sathesh Sakthivel24-Jun-07 17:34 
AnswerRe: How To Delete Multiple Selection of Rows in a Listview Control ? Pin
Hesham Yassin25-Jun-07 1:10
Hesham Yassin25-Jun-07 1:10 
QuestionProperty Collection Selector Pin
@FrankDrebin@24-Jun-07 16:32
@FrankDrebin@24-Jun-07 16:32 
Dead | X| Unsure | :~ Confused | :confused: Cry | :(( Hi All,seems a great challenge,until now seems no one of some senior programmers in big consulting companies found a solution.

Problem:
We've got a complex User control, which is organized in 5 classes:

Shape
Corner
Color
Designer
UiTypeEditor

in "Color" we've got around 20 Properties indicating Different Brushes properties based on fixed value ranges.(PathBrush Distance from Center,a
Linear Gradient property based on an Enum which let User choose only stepped values as "Top,TopLeft" etc. as position for colors..)
We got in Corner,something similar to "Color class" in which we define all proportions and values only for having an independent object which act
as corner for a rounded rectangle.
In the "Shape Class" we have finally a Graphics access with the method for creating and colorizing our Graphic UserControl.
We reached the ability to Have a "Color" Category in PropertyGrid,but ONLY using all I explained in first class in file.
We tried using PostFilterProperties driven by a "FillingType" property(PathGradient,LinearGradient,Solid etc..)If we select from one of those values
we're able to show ONLY needed properties for type selected.(Ex. If Master Property is set to "Solid Fill Type",then Properties under It will be only
Color Solid and Transparency(Alpha)....If We select "LinearGradient",all Solid Fill Values disappear and appear in propertygrid ColorGradientA and ColorGradientB and so on for textureFill etc..)All that Works but:
For viewing result of switching we need to dispose control and re-drop from toolbox,we are NOT YET ABLE to expose to property grid something is coming
from other classes in same namespace(We got ALL Geometric values and methods in "Shape Class" and we would like to "pass" as fillpath(argument)
Our FillType selected by PropertyGrid.We tried Invalidate(),Refresh(),but nothing,and ever with First class.We would like to be able to

public class Shape
{
/// only generic snippet here for example...
public int var;
public int CornerRadius
{
get{...}
set{...}
}

}

//here real snippets
public class Color
{
public static string[] PropertiesToRemove = new string[13];
public enum FillTypeEnumerator
{
Solid,
LinearGradient,
PathGradient,
Texture
}
FillTypeEnumerator FillTypeValue = FillTypeEnumerator.Solid;
[Category("Color")]
public FillTypeEnumerator FillType
{
get { return FillTypeValue; }
set
{
FillTypeValue = value;
switch (FillTypeValue)
{
case FillTypeEnumerator.Solid:
PropertiesToRemove.SetValue("LinearGradientTransparencyA", 0);
PropertiesToRemove.SetValue("LinearGradientTransparencyB", 1);
PropertiesToRemove.SetValue("LinearGradientColorA", 2);
PropertiesToRemove.SetValue("LinearGradientColorB", 3);
PropertiesToRemove.SetValue("LinearGradientPositions", 4);
PropertiesToRemove.SetValue("PathGradientCenterColorTransparency", 5);
PropertiesToRemove.SetValue("PathGradientCenterColor", 6);
PropertiesToRemove.SetValue("PathGradientSurroundColor", 7);
PropertiesToRemove.SetValue("PathGradientSurroundColorTransparency", 8);
PropertiesToRemove.SetValue("PathGradientFocusDistance", 9);
PropertiesToRemove.SetValue("PathGradientCenterPosition", 10);
PropertiesToRemove.SetValue("TextureImage", 11);


break;
case FillTypeEnumerator.LinearGradient:
PropertiesToRemove.SetValue("SolidTransparency", 0);
PropertiesToRemove.SetValue("Solid", 1);
PropertiesToRemove.SetValue("PathGradientCenterColorTransparency", 2);
PropertiesToRemove.SetValue("PathGradientCenterColor", 3);
PropertiesToRemove.SetValue("PathGradientSurroundColor", 4);
PropertiesToRemove.SetValue("PathGradientSurroundColorTransparency", 5);
PropertiesToRemove.SetValue("PathGradientFocusDistance", 6);
PropertiesToRemove.SetValue("PathGradientCenterPosition", 7);
PropertiesToRemove.SetValue("TextureImage", 8);

break;
case FillTypeEnumerator.PathGradient:
PropertiesToRemove.SetValue("LinearGradientTransparencyA", 0);
PropertiesToRemove.SetValue("LinearGradientTransparencyB", 1);
PropertiesToRemove.SetValue("LinearGradientColorA", 2);
PropertiesToRemove.SetValue("LinearGradientColorB", 3);
PropertiesToRemove.SetValue("LinearGradientPositions", 4);
PropertiesToRemove.SetValue("TextureImage", 5);
PropertiesToRemove.SetValue("SolidTransparency", 6);
PropertiesToRemove.SetValue("Solid", 7);
break;
case FillTypeEnumerator.Texture:
PropertiesToRemove.SetValue("LinearGradientTransparencyA", 0);
PropertiesToRemove.SetValue("LinearGradientTransparencyB", 1);
PropertiesToRemove.SetValue("LinearGradientColorA", 2);
PropertiesToRemove.SetValue("LinearGradientColorB", 3);
PropertiesToRemove.SetValue("LinearGradientPositions", 4);
PropertiesToRemove.SetValue("PathGradientCenterColorTransparency", 5);
PropertiesToRemove.SetValue("PathGradientCenterColor", 6);
PropertiesToRemove.SetValue("PathGradientSurroundColor", 7);
PropertiesToRemove.SetValue("PathGradientSurroundColorTransparency", 8);
PropertiesToRemove.SetValue("PathGradientFocusDistance", 9);
PropertiesToRemove.SetValue("PathGradientCenterPosition", 10);
PropertiesToRemove.SetValue("SolidTransparency", 11);
PropertiesToRemove.SetValue("Solid", 12);
break;

}
this.Invalidate();

}
}




//SolidFill

int SolidTransparencyValue = 255;
[Category("Color")]
[Editor(typeof(TrackBarEditor), typeof(UITypeEditor))]
public int SolidTransparency
{
get { return SolidTransparencyValue; }
set { SolidTransparencyValue = value; this.Invalidate(); }
}

ColorDialog FillSolidColorDialog = new ColorDialog();
[Browsable(true)]
[Category("Color")]
public Color Solid
{
get { return Color.FromArgb(SolidTransparency, FillSolidColorDialog.Color); }
set { FillSolidColorDialog.Color = value; this.Invalidate(); }
}


}

}

Why for Example I cannot see in property Grid "Solid" Property and I'm be able to see ONLY Shape properties?
What we have to do?IExtenderProvider?
What needs PropertyGrid in System.Reflection for searching also in 2nd,3rd,n class?Service,a CustomDesigner?
Is possible Idictionary is filled ONLY by properties of 1st class? Simply re-populating the "Default Designr PropertyDescriptorCollection I would be able to...seems not...
Please we're in the middle of the Sea..try to Win this challenge!
Thanks to all for Patience!


Frank Drebin
Questionweb browser Pin
half-life24-Jun-07 13:24
half-life24-Jun-07 13:24 
AnswerRe: web browser Pin
Jasmine250124-Jun-07 13:55
Jasmine250124-Jun-07 13:55 
GeneralRe: web browser Pin
half-life24-Jun-07 14:03
half-life24-Jun-07 14:03 
QuestionMinimizing to the Taskbar Pin
max2929724-Jun-07 13:04
max2929724-Jun-07 13:04 
AnswerRe: Minimizing to the Taskbar Pin
Christian Graus24-Jun-07 13:18
protectorChristian Graus24-Jun-07 13:18 
GeneralRe: Minimizing to the Taskbar Pin
max2929724-Jun-07 13:59
max2929724-Jun-07 13:59 
GeneralRe: Minimizing to the Taskbar Pin
Christian Graus24-Jun-07 14:29
protectorChristian Graus24-Jun-07 14:29 
QuestionAssociating an Icon With a File Pin
max2929724-Jun-07 13:01
max2929724-Jun-07 13:01 
AnswerRe: Associating an Icon With a File Pin
Christian Graus24-Jun-07 13:24
protectorChristian Graus24-Jun-07 13:24 
AnswerRe: Associating an Icon With a File Pin
Ed.Poore24-Jun-07 13:26
Ed.Poore24-Jun-07 13:26 
GeneralRe: Associating an Icon With a File Pin
max2929724-Jun-07 13:49
max2929724-Jun-07 13:49 
QuestionC# forms question Pin
Irfan Faruki24-Jun-07 9:47
Irfan Faruki24-Jun-07 9:47 
AnswerRe: C# forms question Pin
Christian Graus24-Jun-07 11:12
protectorChristian Graus24-Jun-07 11:12 
GeneralRe: C# forms question Pin
Irfan Faruki24-Jun-07 11:15
Irfan Faruki24-Jun-07 11:15 
GeneralRe: C# forms question Pin
Christian Graus24-Jun-07 11:59
protectorChristian Graus24-Jun-07 11:59 
AnswerRe: C# forms question Pin
DavidNohejl24-Jun-07 21:47
DavidNohejl24-Jun-07 21:47 
GeneralRe: C# forms question Pin
Irfan Faruki25-Jun-07 0:14
Irfan Faruki25-Jun-07 0:14 

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.