Click here to Skip to main content
16,004,969 members
Home / Discussions / C#
   

C#

 
GeneralRe: Start Thread with Parameters Pin
Heath Stewart14-Apr-04 17:22
protectorHeath Stewart14-Apr-04 17:22 
QuestionForm across multiple monitor? Pin
pgfraz14-Apr-04 15:37
pgfraz14-Apr-04 15:37 
AnswerRe: Form across multiple monitor? Pin
Heath Stewart14-Apr-04 17:18
protectorHeath Stewart14-Apr-04 17:18 
QuestionDoes anyone know how to make a transparent tabpage? Pin
Flack14-Apr-04 15:30
Flack14-Apr-04 15:30 
AnswerRe: Does anyone know how to make a transparent tabpage? Pin
Carlos H. Perez14-Apr-04 16:44
Carlos H. Perez14-Apr-04 16:44 
GeneralRe: Does anyone know how to make a transparent tabpage? Pin
Flack15-Apr-04 7:41
Flack15-Apr-04 7:41 
QuestionAnyone used SQLite with C#? Pin
tsigo14-Apr-04 13:59
tsigo14-Apr-04 13:59 
GeneralCodeDomSerializer Question Pin
Jamie Nordmeyer14-Apr-04 12:28
Jamie Nordmeyer14-Apr-04 12:28 
I have the following code in a serializer class for serializing a collection:
public override object Serialize(IDesignerSerializationManager manager, object value)
		{
			object codeObject = GetBaseSerializer(manager).Serialize(manager, value);
			CodeStatementCollection csc = (CodeStatementCollection)codeObject;
			PropertyDescriptor pagesProp = TypeDescriptor.GetProperties(value)["Pages"];
			PageCollection pages = (PageCollection)pagesProp.GetValue(value);
			string componentName = manager.GetName(value);

			foreach(GenericPage page in pages)
			{
				MessageBox.Show("Found Page");
				CodeThisReferenceExpression thisRef = new CodeThisReferenceExpression();
				CodePropertyReferenceExpression propRef = new CodePropertyReferenceExpression(thisRef, "Pages");
				CodeFieldReferenceExpression childRef = new CodeFieldReferenceExpression(thisRef, manager.GetName(page));
				CodeMethodInvokeExpression invokeExpr = new CodeMethodInvokeExpression(propRef, "Add", childRef);

				csc.Add(invokeExpr);
			}

			return codeObject;
		}

		private CodeDomSerializer GetBaseSerializer(IDesignerSerializationManager manager)
		{
			return (CodeDomSerializer)manager.GetSerializer(typeof(Wizard).BaseType, typeof(CodeDomSerializer));
		}


I have a designer verb that when clicked, instantiates a CollectionEditor. If I add items to the collection editor, when I hit OK, all the code necessary to create the items is serialized (I.E. new is called, things like page1.Location, etc.), EXCEPT at the bottom, where I should see MyControl.Pages.Add(page1);. Then when I open the editor again, no items appear in the collection, but the editor is apparenly aware of them, because if I added 3 pages before, then hit add in the editor, the next item will be called page4. Any ideas?

I DID notice that even though I might have added 3 pages, if I add in a check for pages.Count after the pages varialbe has been initialized, I get 0 pages.

Thanks in advance.

Kyosa Jamie Nordmeyer - Cho Dan
Portland, Oregon, USA

GeneralFlex Grid in C# Pin
Greg Ward14-Apr-04 11:26
Greg Ward14-Apr-04 11:26 
GeneralRe: Flex Grid in C# Pin
Heath Stewart14-Apr-04 11:51
protectorHeath Stewart14-Apr-04 11:51 
GeneralRe: Flex Grid in C# Pin
Suelinda_W26-Apr-04 5:42
Suelinda_W26-Apr-04 5:42 
Generaldelegate and AppDomains Pin
VizOne14-Apr-04 11:24
VizOne14-Apr-04 11:24 
GeneralRe: delegate and AppDomains Pin
Heath Stewart14-Apr-04 12:00
protectorHeath Stewart14-Apr-04 12:00 
Generalaccess rows in order that they appear after sorting datagrid Pin
blakeb_114-Apr-04 10:50
blakeb_114-Apr-04 10:50 
GeneralRe: access rows in order that they appear after sorting datagrid Pin
Heath Stewart14-Apr-04 11:47
protectorHeath Stewart14-Apr-04 11:47 
GeneralRe: access rows in order that they appear after sorting datagrid Pin
blakeb_116-Apr-04 9:58
blakeb_116-Apr-04 9:58 
GeneralUsing DataBinder.Eval Pin
Mike Ellison14-Apr-04 10:19
Mike Ellison14-Apr-04 10:19 
GeneralRe: Using DataBinder.Eval Pin
Heath Stewart14-Apr-04 10:31
protectorHeath Stewart14-Apr-04 10:31 
GeneralRe: Using DataBinder.Eval Pin
Mike Ellison14-Apr-04 12:33
Mike Ellison14-Apr-04 12:33 
GeneralWeb services question... Pin
Manster14-Apr-04 9:00
Manster14-Apr-04 9:00 
GeneralRe: Web services question... Pin
Heath Stewart14-Apr-04 9:05
protectorHeath Stewart14-Apr-04 9:05 
GeneralRe: Web services question... Pin
Manster15-Apr-04 3:20
Manster15-Apr-04 3:20 
GeneralRe: Web services question... Pin
Heath Stewart15-Apr-04 3:24
protectorHeath Stewart15-Apr-04 3:24 
GeneralRe: Web services question... Pin
Manster15-Apr-04 3:52
Manster15-Apr-04 3:52 
GeneralRe: Web services question... Pin
Heath Stewart15-Apr-04 3:57
protectorHeath Stewart15-Apr-04 3:57 

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.