| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425 |
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Drawing;
- using System.Runtime.CompilerServices;
- using System.Windows.Forms;
- using Microsoft.VisualBasic;
- using Microsoft.VisualBasic.CompilerServices;
- namespace Dongke.IBOSS.PRD.Framework.Controls
- {
- [StandardModule]
- internal sealed class mbsjmodule
- {
- public class StrChoice2 : StringConverter
- {
- private StandardValuesCollection thevalues;
- private StandardValuesCollection values
- {
- get
- {
- if (thevalues == null)
- {
- thevalues = new StandardValuesCollection(FieldsString);
- }
- return thevalues;
- }
- }
- public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- {
- return true;
- }
- public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- {
- return false;
- }
- public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- {
- return values;
- }
- }
- public class StrChoice : StringConverter
- {
- private StandardValuesCollection thevalues;
- private StandardValuesCollection values
- {
- get
- {
- checked
- {
- if (thevalues == null)
- {
- if (FieldsString == null)
- {
- return null;
- }
- int num = FieldsString.Length;
- string[] array = new string[num - 1 + 1];
- int num2 = 0;
- int num3 = FieldsString.Length - 1;
- for (int i = num2; i <= num3; i++)
- {
- array[i] = FieldsString[i];
- }
- thevalues = new StandardValuesCollection(array);
- }
- return thevalues;
- }
- }
- }
- public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- {
- return true;
- }
- public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- {
- return false;
- }
- public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- {
- return values;
- }
- }
- public class StrChoice3 : StringConverter
- {
- private StandardValuesCollection thevalues;
- private StandardValuesCollection values
- {
- get
- {
- if (thevalues == null)
- {
- thevalues = new StandardValuesCollection(new string[3] { "", "数字", "日期时间" });
- }
- return thevalues;
- }
- }
- public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- {
- return true;
- }
- public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- {
- return false;
- }
- public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- {
- return values;
- }
- }
- public static string[] FieldsString;
- public static string[,] FieldsString2 = new string[1, 2];
- public static string G_MB_Spetator_Band = "\u0001\u0003";
- public static string G_MB_Spetator_Line = "\u0002\u0004";
- public static string G_MB_Spetator_Proper = "\u0005\a";
- public static string G_MB_Spetator_control = "\u0006\b";
- public static string G_MB_Spetator_BandContent = "\n\v";
- public static float G_MB_Default_Width = 170f;
- public static mywait G_WaitWindow;
- public static string[,] ParaseVar(Hashtable myvar)
- {
- if (myvar == null)
- {
- return null;
- }
- int count = myvar.Count;
- if (count <= 0)
- {
- return null;
- }
- checked
- {
- string[,] array = new string[count - 1 + 1, 2];
- int num = 0;
- IDictionaryEnumerator enumerator = myvar.GetEnumerator();
- while (enumerator.MoveNext())
- {
- object current = enumerator.Current;
- DictionaryEntry dictionaryEntry = default(DictionaryEntry);
- DictionaryEntry dictionaryEntry2 = ((current != null) ? ((DictionaryEntry)current) : dictionaryEntry);
- array[num, 0] = Conversions.ToString(dictionaryEntry2.Key);
- array[num, 1] = Conversions.ToString(dictionaryEntry2.Value);
- num++;
- }
- return array;
- }
- }
- public static void ShowWaitWindow()
- {
- if (G_WaitWindow != null)
- {
- try
- {
- G_WaitWindow.Close();
- G_WaitWindow.Dispose();
- G_WaitWindow = null;
- }
- catch (Exception projectError)
- {
- ProjectData.SetProjectError(projectError);
- ProjectData.ClearProjectError();
- }
- }
- G_WaitWindow = new mywait();
- Application.DoEvents();
- G_WaitWindow.Show();
- Application.DoEvents();
- }
- public static void CloseWaitWindow()
- {
- if (G_WaitWindow != null)
- {
- try
- {
- G_WaitWindow.Close();
- G_WaitWindow.Dispose();
- G_WaitWindow = null;
- }
- catch (Exception projectError)
- {
- ProjectData.SetProjectError(projectError);
- ProjectData.ClearProjectError();
- }
- }
- }
- [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
- public static void MyShowHelp(string tt)
- {
- if (Operators.CompareString(tt, "", TextCompare: false) == 0)
- {
- tt = "start.htm";
- }
- }
- public static StringAlignment GetValign(ContentAlignment alg)
- {
- switch (alg)
- {
- default:
- return StringAlignment.Center;
- case ContentAlignment.TopLeft:
- case ContentAlignment.TopCenter:
- case ContentAlignment.TopRight:
- return StringAlignment.Near;
- case ContentAlignment.MiddleLeft:
- case ContentAlignment.MiddleCenter:
- case ContentAlignment.MiddleRight:
- return StringAlignment.Center;
- case ContentAlignment.BottomLeft:
- case ContentAlignment.BottomCenter:
- case ContentAlignment.BottomRight:
- return StringAlignment.Far;
- }
- }
- public static StringAlignment GetHalign(ContentAlignment alg)
- {
- switch (alg)
- {
- default:
- return StringAlignment.Near;
- case ContentAlignment.TopRight:
- case ContentAlignment.MiddleRight:
- case ContentAlignment.BottomRight:
- return StringAlignment.Far;
- case ContentAlignment.TopLeft:
- case ContentAlignment.MiddleLeft:
- case ContentAlignment.BottomLeft:
- return StringAlignment.Near;
- case ContentAlignment.TopCenter:
- case ContentAlignment.MiddleCenter:
- case ContentAlignment.BottomCenter:
- return StringAlignment.Center;
- }
- }
- public static string SaveControl(Control cc)
- {
- string result = "";
- if (cc is U_Field)
- {
- result = ((U_Field)cc).SaveAsString();
- result = "字段" + G_MB_Spetator_control + result;
- }
- else if (cc is U_Text)
- {
- result = ((U_Text)cc).SaveAsString();
- result = "文本" + G_MB_Spetator_control + result;
- }
- else if (cc is U_Comput)
- {
- result = ((U_Comput)cc).SaveAsString();
- result = "计算" + G_MB_Spetator_control + result;
- }
- else if (cc is U_Image)
- {
- result = ((U_Image)cc).SaveAsString();
- result = "图片" + G_MB_Spetator_control + result;
- }
- else if (cc is U_Rect)
- {
- result = ((U_Rect)cc).SaveAsString();
- result = "矩形" + G_MB_Spetator_control + result;
- }
- else if (cc is U_HLine)
- {
- result = ((U_HLine)cc).SaveAsString();
- result = "水平" + G_MB_Spetator_control + result;
- }
- else if (cc is U_VLine)
- {
- result = ((U_VLine)cc).SaveAsString();
- result = "垂直" + G_MB_Spetator_control + result;
- }
- else if (cc is U_Bar)
- {
- result = ((U_Bar)cc).SaveAsString();
- result = "条码" + G_MB_Spetator_control + result;
- }
- else if (cc is U_Bias)
- {
- result = ((U_Bias)cc).SaveAsString();
- result = "斜线" + G_MB_Spetator_control + result;
- }
- else if (cc is U_Express)
- {
- result = ((U_Express)cc).SaveAsString();
- result = "表达式" + G_MB_Spetator_control + result;
- }
- else if (cc is U_Ellipse)
- {
- result = ((U_Ellipse)cc).SaveAsString();
- result = "椭圆" + G_MB_Spetator_control + result;
- }
- else if (cc is U_fBias)
- {
- result = ((U_fBias)cc).SaveAsString();
- result = "反斜线" + G_MB_Spetator_control + result;
- }
- else if (cc is U_QC)
- {
- result = ((U_QC)cc).SaveAsString();
- result = "二维码" + G_MB_Spetator_control + result;
- }
- return result;
- }
- public static Control RestoreControl(string ss)
- {
- string[] array = Strings.Split(ss, G_MB_Spetator_control);
- Control result = null;
- switch (array[0])
- {
- case "字段":
- {
- U_Field u_Field = new U_Field();
- u_Field.RestoreFromString(array[1]);
- return u_Field;
- }
- case "文本":
- {
- U_Text u_Text = new U_Text();
- u_Text.RestoreFromString(array[1]);
- return u_Text;
- }
- case "计算":
- {
- U_Comput u_Comput = new U_Comput();
- u_Comput.RestoreFromString(array[1]);
- return u_Comput;
- }
- case "图片":
- {
- U_Image u_Image = new U_Image();
- u_Image.RestoreFromString(array[1]);
- return u_Image;
- }
- case "矩形":
- {
- U_Rect u_Rect = new U_Rect();
- u_Rect.RestoreFromString(array[1]);
- return u_Rect;
- }
- case "水平":
- {
- U_HLine u_HLine = new U_HLine();
- u_HLine.RestoreFromString(array[1]);
- return u_HLine;
- }
- case "垂直":
- {
- U_VLine u_VLine = new U_VLine();
- u_VLine.RestoreFromString(array[1]);
- return u_VLine;
- }
- case "条码":
- {
- U_Bar u_Bar = new U_Bar();
- u_Bar.RestoreFromString(array[1]);
- return u_Bar;
- }
- case "斜线":
- {
- U_Bias u_Bias = new U_Bias();
- u_Bias.RestoreFromString(array[1]);
- return u_Bias;
- }
- case "表达式":
- {
- U_Express u_Express = new U_Express();
- u_Express.RestoreFromString(array[1]);
- return u_Express;
- }
- case "椭圆":
- {
- U_Ellipse u_Ellipse = new U_Ellipse();
- u_Ellipse.RestoreFromString(array[1]);
- return u_Ellipse;
- }
- case "反斜线":
- {
- U_fBias u_fBias = new U_fBias();
- u_fBias.RestoreFromString(array[1]);
- return u_fBias;
- }
- case "二维码":
- {
- U_QC u_QC = new U_QC();
- u_QC.RestoreFromString(array[1]);
- return u_QC;
- }
- default:
- return result;
- }
- }
- }
- }
|