Oh, actually, my Class is a form , i use serilized to store input data, like textbox or radiobutton data. When my project version update, maybe i will add some textbox or other controls in form class, so i will not deserilize old file, i don't know how to handle it. Please tell me a method to realize save function.
smallkubi
Posts
-
How can I use serialize and Deserialize to realize Store Function when update code? -
How can I use serialize and Deserialize to realize Store Function when update code?Yes, but i have no idea to achieve it...Could u help me? For example, Class A { int a=0; int b=0; } When i finished serialise class A and create a local file "Saved". When i update my Class A Class A { int a=0; int b=0; int c=0; } Then deserialise "Saved", it will throw exception ,how can i do it? I hope when i deserialize "Saved",it will ignore c.
-
How can I use serialize and Deserialize to realize Store Function when update code?how to do it? I don't know how to do....Could u send me an example?
-
How can I use serialize and Deserialize to realize Store Function when update code?When I finished serialize and Deserialize,and create a local file . But if i need update code, i create a new variable in SerializationInfo ,for example ,I declare a new variable "A" in code. But when i deserialize exist old local file, the exception warning is "can not find A", so Deserialize failed. How can i do if i want to ignore A when deserialize old files?
-
How can i get array index to satisfy my requirement fastly?Hi ,i have a questions ,and i don't know how to handle it. I have a double array named array1=new double[100], and each element is function result, like array1[0]=fun(0),array2[1]=fun(1)... each element is positive or negative, and generally speaking, a[0] to a[n] is positive, and a[n+1] to end is negative, so how can i get n ? i need efficient algorithm, like divide-and-conquer method for example... and case 2: if near the end i get wrong result, for example, a[90] is +,how can i get the first negative index n ?
-
Did some one use Eigen or Armadillo library to do calculation?Thank you very much. My code is in Loop many times, so i want a efficient code. your code can reach my function,but efficient i think it's not good.
-
Did some one use Eigen or Armadillo library to do calculation?Now ,i have one question. I use library to define a matrix B, for example, as follows, how can i convert B.real() to a double[] array? thanks very much.
MatrixXcd B(n,3);
for( int i=0; i -
how can i use delegate to output several param in multi-thread?Yes,haha, you are right, but i want my code simplex and efficient, so i hope no more class, only several variable can solve it. Func<> can output one param, but i want more output param. ,i don't know how to do it. how can i use delegate to define multi-output delegate ?
-
how can i use delegate to output several param in multi-thread?oh, DoThread function i want to transfer to Thread as a var, your sample is call immidiately. ThreadO th_o = new ThreadO(x => c( x, n,out F)); //this is Func<>,but i also want to out F Thread th = new Thread(new ThreadStart(th_o.Cons_Mult)); th.Start(); private double c(double x,double n,out double F) { } class ThreadO { public ThreadO(Func fun1) { ... } }
-
how can i use delegate to output several param in multi-thread?My sample as follows: Now i use Func<> can output 1 param, but i need 3 param output, how can i do it? Func call = y => fun(y, z); //i need output o1,o2, like y=>fun(y,z,out o1,out o2) ? ThreadStart start = () => fun1(x, call); Thread th = new Thread(start);
-
how to use delegate to call function and introduce function as content?hi, If i use Func call= y=>fun3(y,z) , fun3 can be one output param function. But if my function need 2 or more output, how can i do it?
-
how can i improve these code's display efficient?ok,i got it. Thank you
-
how can i improve these code's display efficient?oh, but why some other soft can work so fast? Maybe other language can good work for this?
-
how can i improve these code's display efficient?When i plot in the chart, i found chart speed is slower than other soft. Now i think chartarea refresh is cost most of time, but some times i don't need to refresh background series, just need to use invalidate to call paint function. So is there any method to stop backgound series refresh ,not refresh paint function content?
-
how can i improve these code's display efficient?oh,i need to meet ZoomIn function. When user is doing ZoomIn, he can see his mouse's trace through a various width and heigh rectangle when mouse is down.
-
how can i improve these code's display efficient?actually ,i need plot 20 series with 400 points, but when i plot them in the chartarea, it's also slow when mouse move. But if i put 20*400 points in one series, the mouse move is fast. But my requirement is 20 line-series, so i don't want one series's end point line to the other's begin point.
-
how can i improve these code's display efficient?hi,all: This question has been bothering me for a long time. I have some series in chart1, for exampe,i have 100 series, each series have 1 point(or more). And i need paint a rectangle when mouse move, so i have code as follows, but when i run it, the rectangle can not move it smoothly, it is so slow . And i found if series number is less than 10, it maybe move fast. how can i solve it,i have no idea. public Form1() { InitializeComponent(); Series series1; for (int i = 0; i < 100; i++) { series1 = new Series(); series1.Points.Add(new DataPoint(i, i)); //Just for example series1.IsVisibleInLegend = false; chart1.Series.Add(series1); } } bool _isdown = false; Rectangle r=new Rectangle(); private void chart1_MouseDown(object sender, MouseEventArgs e) { _isdown = true; } private void chart1_MouseMove(object sender, MouseEventArgs e) { if (_isdown) { r.Width = 100; r.X = e.X; r.Y = e.Y; r.Height = 100; panel1.Invalidate(); } } private void chart1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; Pen p = new Pen(Color.LightBlue); p.Width = 2; p.Color = Color.Red; g.DrawRectangle(p, r); }
-
how can i get Array sort index?OK,I SEE,thank you
-
how can i get Array sort index?good idea,smart!!! and i would to know how to generate array 0 to 100 , not use loop?
-
how can i get Array sort index?Hi, all friends: i want to get a efficient function to sort array, and return a old array index . For example: double[] a=[5,4,1,3,2]; how can i get b is [1,2,3,4,5],and index array c is [2,4,3,1,0]? i want a efficent and quick method...