////////////////////////////////////////////////////////////////////////// private void OnFormLoad(object sender, EventArgs e) { CmbInputCodepage.Items.Clear(); CmbHtmlOutputCodepage.Items.Clear(); EncodingInfo[] Encodings = Encoding.GetEncodings(); foreach (EncodingInfo EI in Encodings) { CmbInputCodepage.Items.Add(EI.DisplayName); if (EI.GetEncoding() == Encoding.Default) { CmbInputCodepage.SelectedItem = EI.DisplayName; } CmbHtmlOutputCodepage.Items.Add(EI.DisplayName); if (EI.GetEncoding() == Encoding.Default) { CmbHtmlOutputCodepage.SelectedItem = EI.DisplayName; } } IsDirty = false; RegistryKey Key = Registry.CurrentUser.OpenSubKey(@"Software\DEAD:CODE\DocMaker2"); if (Key != null) { string LastFile = Key.GetValue("LastFile").ToString(); Key.Close(); if (File.Exists(LastFile)) { LoadSettings(LastFile); } } }
///<summary> /// Creates a CM_EIP. /// <param name="message">The Message to which this Type belongs</param> /// <param name="description">The description of this type</param> ///</summary> public CM_EIP(IMessage message, string description) : base(message, description) { data = new IType[2]; data[0] = new EI(message,"Parent´s placer order number"); data[1] = new EI(message,"Parent´s filler order number"); }
List <ITreeViewItem> ITreeViewItem.Childrens() { List <ITreeViewItem> list = new List <ITreeViewItem>(); List <ElementInfo> Childrens = base.UIAElementInfo.WindowExplorer.GetElementChildren(base.UIAElementInfo); foreach (ElementInfo EI in Childrens) { ITreeViewItem TVI = null; if (EI.GetType() == typeof(UIAElementInfo)) { EI.WindowExplorer = UIAElementInfo.WindowExplorer; PBControlTreeItemBase treeItem = GetMatchingPBTreeItem(EI); treeItem.UIAElementInfo.WindowExplorer = UIAElementInfo.WindowExplorer; double XOffset = double.Parse(((UIAutomationDriverBase)UIAElementInfo.WindowExplorer).mUIAutomationHelper .GetControlPropertyValue(EI.ElementObject, "XOffset")); double YOffset = double.Parse(((UIAutomationDriverBase)UIAElementInfo.WindowExplorer).mUIAutomationHelper .GetControlPropertyValue(EI.ElementObject, "YOffset")); treeItem.UIAElementInfo.XCordinate = XOffset - base.UIAElementInfo.XCordinate; treeItem.UIAElementInfo.YCordinate = YOffset - base.UIAElementInfo.YCordinate; TVI = treeItem; } else { TVI = HTMLElementInfoConverter.GetHTMLElementTreeItem(EI); } list.Add(TVI); } return(list); }
public void Test() { ORM_O01 msg = new ORM_O01(); ORM_O01_ORDER order = msg.GetORDER(0); EI placerNumber = order.ORC.GetPlacerOrderNumber(0); placerNumber.EntityIdentifier.Value = "123"; }
public ActionResult DeleteConfirmed(int id) { EI eI = db.EIs.Find(id); db.EIs.Remove(eI); db.SaveChanges(); return(RedirectToAction("Index")); }
/// <summary> /// 创建fieldtype,如CE,XCN等 /// </summary> /// <param name="parent"></param> /// <param name="product"></param> /// <param name="name"></param> /// <returns></returns> public override abstractType Create(compositeType parent, Enum product, string name) { abstractType tmp = null; switch (product) { case enumField.CE: tmp = new CE(parent, name); break; case enumField.CM: tmp = new CM(parent, name); break; case enumField.CWE: tmp = new CWE(parent, name); break; case enumField.CX: tmp = new CX(parent, name); break; case enumField.DLN: tmp = new DLN(parent, name); break; case enumField.EI: tmp = new EI(parent, name); break; case enumField.ELD: tmp = new ELD(parent, name); break; case enumField.FN: tmp = new FN(parent, name); break; case enumField.HD: tmp = new HD(parent, name); break; case enumField.MSG: tmp = new MSG(parent, name); break; case enumField.PT: tmp = new PT(parent, name); break; case enumField.VID: tmp = new VID(parent, name); break; case enumField.XAD: tmp = new XAD(parent, name); break; case enumField.XCN: tmp = new XCN(parent, name); break; case enumField.XPN: tmp = new XPN(parent, name); break; case enumField.XTN: tmp = new XTN(parent, name); break; case enumField.ERL: tmp = new ERL(parent, name); break; case enumField.FC: tmp = new FC(parent, name); break; case enumField.XON: tmp = new XON(parent, name); break; case enumField.PL: tmp = new PL(parent, name); break; case enumField.CP: tmp = new CP(parent, name); break; case enumField.JCC: tmp = new JCC(parent, name); break; case enumField.TQ: tmp = new TQ(parent, name); break; case enumField.CQ: tmp = new CQ(parent, name); break; default: throw new NotSupportedException(); } return(tmp); }
private void SetValueButton_Click(object sender, RoutedEventArgs e) { // TODO: create an action to get the focusable control from the driver on the device List<ElementInfo> list = ((IWindowExplorer)mAndroidADBDriver).GetVisibleControls(null); // get from the list only text Edit foreach (ElementInfo EI in list) { if (EI.ElementType == "android.widget.EditText") // check if it will work on all apps, might need to rethink { ObservableList<ControlProperty> props = EI.GetElementProperties(); ControlProperty cp = (from x in props where x.Name == "focused" select x).FirstOrDefault(); //FIXME: temp just to try, need to get the best locator for element. ControlProperty cpresourceid = (from x in props where x.Name == "resource-id" select x).FirstOrDefault(); if (cp.Value == "true") { // mDeviceViewPage.AddTextBox() ActUIElement a = new ActUIElement(); a.ElementLocateBy = eLocateBy.ByResourceID; a.ElementType = eElementType.TextBox; a.ElementAction = ActUIElement.eElementAction.SetText; // Need to set value in both since sending direct to driver // a.ElementLocateValue = cpresourceid.Value; a.GetOrCreateInputParam(ActUIElement.Fields.ElementLocateValue).ValueForDriver = cpresourceid.Value; a.GetOrCreateInputParam(ActUIElement.Fields.Value).ValueForDriver = SetValueTextBox.Text; // a.Value = SendKeysTextBox.Text; mAndroidADBDriver.RunAction(a); if (IsRecording) { ControlProperty desc = (from x in props where x.Name == "content-desc" select x).FirstOrDefault(); if (string.IsNullOrEmpty(desc.Value)) { desc = cpresourceid; } a.Description = "Set '" + desc.Value + "' value to '" + SetValueTextBox.Text + "'"; a.GetOrCreateInputParam(ActUIElement.Fields.Value).Value = SetValueTextBox.Text; a.GetOrCreateInputParam(ActUIElement.Fields.ElementLocateValue).Value = cpresourceid.Value; mBusinessFlow.AddAct(a); } return; } } } }
public MSH() { SendingApplication = new EI(); SendingFacility = new EI(); ReceivingApplication = new EI(); ReceivingFacility = new EI(); MessageType = new MSG(); ProcessingID = new PT(); VersionID = new VID(); }
public ActionResult Edit([Bind(Include = "ID,UserId,Q1,Q2,Q3,Q4,Q5,TestCCompleted")] EI eI) { if (ModelState.IsValid) { db.Entry(eI).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(eI)); }
////////////////////////////////////////////////////////////////////////// private static Encoding GetEncodingByName(string EncName) { EncodingInfo[] Encodings = Encoding.GetEncodings(); foreach (EncodingInfo EI in Encodings) { if (EI.DisplayName == EncName) { return(EI.GetEncoding()); } } return(Encoding.Default); }
/** * Returns a single repetition of Facility ID(FAC-1). * @param rep the repetition number (this is a repeating field) * @throws HL7Exception if the repetition number is invalid. */ public EI getFacilityID(int rep) { EI ret = null; try { Type t = this.getField(1, rep); ret = (EI)t; } catch (System.Exception ex) { HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex); throw new System.Exception("An unexpected error ocurred", ex); } return ret; }
// GET: EIs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EI eI = db.EIs.Find(id); if (eI == null) { return(HttpNotFound()); } return(View(eI)); }
///<summary> /// Returns a single repetition of Filler Order Number(ARQ-25). /// throws HL7Exception if the repetition number is invalid. /// <param name="rep">The repetition number (this is a repeating field)</param> ///</summary> public EI GetFillerOrderNumber(int rep) { EI ret = null; try { IType t = this.GetField(25, rep); ret = (EI)t; } catch (System.Exception ex) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", ex); throw new System.Exception("An unexpected error ocurred", ex); } return(ret); }
/// <summary> Returns a single repetition of Message Profile Identifier (MSH-21).</summary> /// <param name="rep">the repetition number (this is a repeating field) /// </param> /// <throws> HL7Exception if the repetition number is invalid. </throws> public virtual EI getMessageProfileIdentifier(int rep) { EI ret = null; try { Type t = this.getField(21, rep); ret = (EI)t; } catch (System.InvalidCastException) { throw new Exception(); } return(ret); }
/// <summary> Returns a single repetition of External Referral Identifier (RF1-11).</summary> /// <param name="rep">the repetition number (this is a repeating field) /// </param> /// <throws> HL7Exception if the repetition number is invalid. </throws> public virtual EI getExternalReferralIdentifier(int rep) { EI ret = null; try { Type t = this.getField(11, rep); ret = (EI)t; } catch (System.InvalidCastException) { throw new Exception(); } return(ret); }
/// <summary> /// Message Profile Identifier (MSH-21). /// </summary> /// <param name="numRepetition">Numéro de la répétition.</param> /// <returns></returns> public EI GetMessageProfileIdentifier(int numRepetition) { EI ret = null; try { ret = this.GetField(21, numRepetition) as EI; } catch (SegmentException) { throw; } return(ret); }
/// <summary> Returns a single repetition of Alternate Study ID (CM0-3).</summary> /// <param name="rep">the repetition number (this is a repeating field) /// </param> /// <throws> HL7Exception if the repetition number is invalid. </throws> public virtual EI getAlternateStudyID(int rep) { EI ret = null; try { Type t = this.getField(3, rep); ret = (EI)t; } catch (System.InvalidCastException) { throw new Exception(); } return(ret); }
/// <summary> Returns a single repetition of Placer Order Number (TXA-14).</summary> /// <param name="rep">the repetition number (this is a repeating field) /// </param> /// <throws> HL7Exception if the repetition number is invalid. </throws> public virtual EI getPlacerOrderNumber(int rep) { EI ret = null; try { Type t = this.getField(14, rep); ret = (EI)t; } catch (System.InvalidCastException) { throw new Exception(); } return(ret); }
/// <summary> Returns a single repetition of Equipment Instance Identifier (OBX-18).</summary> /// <param name="rep">the repetition number (this is a repeating field) /// </param> /// <throws> HL7Exception if the repetition number is invalid. </throws> public virtual EI getEquipmentInstanceIdentifier(int rep) { EI ret = null; try { Type t = this.getField(18, rep); ret = (EI)t; } catch (System.InvalidCastException) { throw new Exception(); } return(ret); }
/** * Returns all repetitions of Facility ID (FAC-1). */ public EI[] getFacilityID() { EI[] ret = null; try { Type[] t = this.getField(1); ret = new EI[t.Length]; for (int i = 0; i < ret.Length; i++) { ret[i] = (EI)t[i]; } } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new System.Exception("An unexpected error ocurred", he); } catch (System.Exception cce) { HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new System.Exception("An unexpected error ocurred", cce); } return ret; }
///<summary> /// Returns all repetitions of Placer Order Number (ARQ-24). ///</summary> public EI[] GetPlacerOrderNumber() { EI[] ret = null; try { IType[] t = this.GetField(24); ret = new EI[t.Length]; for (int i = 0; i < ret.Length; i++) { ret[i] = (EI)t[i]; } } catch (HL7Exception he) { HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem obtaining field value. This is a bug.", he); throw new System.Exception("An unexpected error ocurred", he); } catch (System.Exception cce) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", cce); throw new System.Exception("An unexpected error ocurred", cce); } return(ret); }
/// <summary> /// Message Profile Identifier (MSH-21). /// </summary> /// <returns></returns> public EI[] GetMessageProfileIdentifier() { EI[] ret = null; try { IType[] repetitions = this.GetField(21); ret = new EI[repetitions.Length]; for (int i = 0; i < ret.Length; i++) { ret[i] = repetitions[i] as EI; } } catch (Exception) { throw; } return(ret); }
public ActionResult Create([Bind(Include = "ID,UserId,Q1,Q2,Q3,Q4,Q5,TestCCompleted")] EI eI) { if (ModelState.IsValid) { eI.TestCCompleted = true; var user = eI.UserId; var name = db.Users.Where(x => x.Id == user).Select(x => x.Name).FirstOrDefault(); eI.UserId = User.Identity.GetUserId(); var js = db.JobSeeker.Where(x => x.UserId == eI.UserId).Select(x => x).FirstOrDefault(); js.Survey3Complete = true; db.EIs.Add(eI); db.SaveChanges(); TestResults(eI); int id = db.JobSeeker.Where(x => x.Name == name).Select(x => x.ID).FirstOrDefault(); return(RedirectToAction("Details", "JobSeekers", new { id = id })); } return(View(eI)); }
/// <summary> Returns all repetitions of Message Profile Identifier (MSH-21).</summary> public virtual EI[] getMessageProfileIdentifier() { EI[] ret = null; try { Type[] t = this.getField(21); ret = new EI[t.Length]; for (int i = 0; i < ret.Length; i++) { ret[i] = (EI)t[i]; } } catch (System.InvalidCastException) { throw new Exception(); } catch (NuGenHL7Exception) { throw new Exception(); } return(ret); }
/// <summary> Returns all repetitions of Placer Order Number (TXA-14).</summary> public virtual EI[] getPlacerOrderNumber() { EI[] ret = null; try { Type[] t = this.getField(14); ret = new EI[t.Length]; for (int i = 0; i < ret.Length; i++) { ret[i] = (EI)t[i]; } } catch (System.InvalidCastException) { throw new Exception(); } catch (NuGenHL7Exception) { throw new Exception(); } return(ret); }
List <ITreeViewItem> ITreeViewItem.Childrens() { List <ITreeViewItem> list = new List <ITreeViewItem>(); { List <ElementInfo> Childrens = base.UIAElementInfo.WindowExplorer.GetElementChildren(base.UIAElementInfo); foreach (ElementInfo EI in Childrens) { ITreeViewItem TVI = null; if (EI.GetType() == typeof(UIAElementInfo)) { //TODO: move convrter to here TVI = WindowsElementConverter.GetWindowsElementTreeItem(EI); } else { TVI = WindowExplorer.HTMLCommon.HTMLElementInfoConverter.GetHTMLElementTreeItem(EI); } list.Add(TVI); } } return(list); }
public void Test_EI() { var expectedState = new CpuState { ImeScheduled = true }; var actualState = new CpuState(); var memoryMock = new Mock <IRandomAccessMemory>(); var instruction = new EI(); instruction.Initialize(); //act while (!instruction.IsFetchNecessary()) { instruction.ExecuteCycle(actualState, memoryMock.Object); } TestHelper.AssertCpuState(expectedState, actualState); memoryMock.Verify(m => m.WriteByte(It.IsAny <ushort>(), It.IsAny <byte>()), Times.Never); }
private int GetTheFirstNumberOfSongOfCurrentList() { if (webTool.Url.ToString().Contains(strInitURL)) { LoginStatus = ELoginStatus.ReadyToFind; } else if (webTool.Url.ToString().Contains("http://www.melon.com/mymusic/like/mymusiclikesong_list.htm?memberKey=")) { string strNum = ""; // Populate list List <HtmlElement> arrElements = new List <HtmlElement>(webTool.Document.GetElementsByTagName("tr").Cast <HtmlElement>()); foreach (HtmlElement EI in arrElements) { List <HtmlElement> arrElements2 = new List <HtmlElement>(EI.GetElementsByTagName("div").Cast <HtmlElement>()); if (arrElements2.Count == 16 || arrElements2.Count == 19) { strNum = arrElements2[1].InnerText; break; } } return(Convert.ToInt32(strNum)); } return(-1); }
public InitialI(Ice.ObjectAdapter adapter) { _adapter = adapter; _b1 = new BI(); _b2 = new BI(); _c = new CI(); _d = new DI(); _e = new EI(); _f = new FI(_e); _b1.theA = _b2; // Cyclic reference to another B _b1.theB = _b1; // Self reference. _b1.theC = null; // Null reference. _b2.theA = _b2; // Self reference, using base. _b2.theB = _b1; // Cyclic reference to another B _b2.theC = _c; // Cyclic reference to a C. _c.theB = _b2; // Cyclic reference to a B. _d.theA = _b1; // Reference to a B. _d.theB = _b2; // Reference to a B. _d.theC = null; // Reference to a C. }
public InitialI(Ice.ObjectAdapter adapter) { _adapter = adapter; _b1 = new BI(); _b2 = new BI(); _c = new CI(); _d = new DI(); _e = new EI(); _f = new FI(_e); _b1.theA = _b2; // Cyclic reference to another B _b1.theB = _b1; // Self reference. _b1.theC = null; // Null reference. _b2.theA = _b2; // Self reference, using base. _b2.theB = _b1; // Cyclic reference to another B _b2.theC = _c; // Cyclic reference to a C. _c.theB = _b2; // Cyclic reference to a B. _d.theA = _b1; // Reference to a B. _d.theB = _b2; // Reference to a B. _d.theC = null; // Reference to a C. }
private void InitOthType(EI.EIInfo eiInfo) { if (eiInfo == null) { MessageBox.Show(EP.EPES.EPESC0000146/*获取资源类型失败!*/, EP.EPES.EPESC0000024/*提示*/, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } fgDevLookUpEditType.Properties.DataSource = eiInfo.Tables[0];// othResType.Tables["OthType"]; fgDevLookUpEditType.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("CODE")); fgDevLookUpEditType.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("CODE_DESC_1_CONTENT")); fgDevLookUpEditType.Properties.ValueMember = "CODE"; fgDevLookUpEditType.Properties.DisplayMember = "CODE_DESC_1_CONTENT"; fgDevLookUpEditType.EditValue = eiInfo.Tables[0].Rows[0]["CODE"]; repositoryItemLookUpEditType.Properties.DataSource = eiInfo.Tables[0];// othResType.Tables["OthType"]; repositoryItemLookUpEditType.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("CODE")); repositoryItemLookUpEditType.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("CODE_DESC_1_CONTENT")); repositoryItemLookUpEditType.Properties.DisplayMember = "CODE_DESC_1_CONTENT"; repositoryItemLookUpEditType.Properties.ValueMember = "CODE"; }
public void Run (AstNode compilationUnit) { var ei = new EI (); ei.Changed = true; while (ei.Changed) { ei.Changed = false; compilationUnit.AcceptVisitor (ei); } }
public static Test.InitialPrx allTests(global::Test.TestHelper helper) { Ice.Communicator communicator = helper.communicator(); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::B"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::C"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::D"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::E"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::F"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::I"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::J"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::H"); // Disable Obsolete warning/error #pragma warning disable 612, 618 communicator.addObjectFactory(new MyObjectFactory(), "TestOF"); #pragma warning restore 612, 618 var output = helper.getWriter(); output.Write("testing stringToProxy... "); output.Flush(); String @ref = "initial:" + helper.getTestEndpoint(0); Ice.ObjectPrx @base = communicator.stringToProxy(@ref); test(@base != null); output.WriteLine("ok"); output.Write("testing checked cast... "); output.Flush(); var initial = Test.InitialPrxHelper.checkedCast(@base); test(initial != null); test(initial.Equals(@base)); output.WriteLine("ok"); output.Write("getting B1... "); output.Flush(); B b1 = initial.getB1(); test(b1 != null); output.WriteLine("ok"); output.Write("getting B2... "); output.Flush(); B b2 = initial.getB2(); test(b2 != null); output.WriteLine("ok"); output.Write("getting C... "); output.Flush(); C c = initial.getC(); test(c != null); output.WriteLine("ok"); output.Write("getting D... "); output.Flush(); D d = initial.getD(); test(d != null); output.WriteLine("ok"); output.Write("checking consistency... "); output.Flush(); test(b1 != b2); //test(b1 != c); //test(b1 != d); //test(b2 != c); //test(b2 != d); //test(c != d); test(b1.theB == b1); test(b1.theC == null); test(b1.theA is B); test(((B)b1.theA).theA == b1.theA); test(((B)b1.theA).theB == b1); //test(((B)b1.theA).theC is C); // Redundant -- theC is always of type C test(((C)(((B)b1.theA).theC)).theB == b1.theA); test(b1.preMarshalInvoked); test(b1.postUnmarshalInvoked); test(b1.theA.preMarshalInvoked); test(b1.theA.postUnmarshalInvoked); test(((B)b1.theA).theC.preMarshalInvoked); test(((B)b1.theA).theC.postUnmarshalInvoked); // More tests possible for b2 and d, but I think this is already // sufficient. test(b2.theA == b2); test(d.theC == null); output.WriteLine("ok"); output.Write("getting B1, B2, C, and D all at once... "); output.Flush(); B b1out; B b2out; C cout; D dout; initial.getAll(out b1out, out b2out, out cout, out dout); test(b1out != null); test(b2out != null); test(cout != null); test(dout != null); output.WriteLine("ok"); output.Write("checking consistency... "); output.Flush(); test(b1out != b2out); test(b1out.theA == b2out); test(b1out.theB == b1out); test(b1out.theC == null); test(b2out.theA == b2out); test(b2out.theB == b1out); test(b2out.theC == cout); test(cout.theB == b2out); test(dout.theA == b1out); test(dout.theB == b2out); test(dout.theC == null); test(dout.preMarshalInvoked); test(dout.postUnmarshalInvoked); test(dout.theA.preMarshalInvoked); test(dout.theA.postUnmarshalInvoked); test(dout.theB.preMarshalInvoked); test(dout.theB.postUnmarshalInvoked); test(dout.theB.theC.preMarshalInvoked); test(dout.theB.theC.postUnmarshalInvoked); output.WriteLine("ok"); output.Write("testing protected members... "); output.Flush(); EI e = (EI)initial.getE(); test(e != null && e.checkValues()); System.Reflection.BindingFlags flags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance; test(!typeof(E).GetField("i", flags).IsPublic&& !typeof(E).GetField("i", flags).IsPrivate); test(!typeof(E).GetField("s", flags).IsPublic&& !typeof(E).GetField("s", flags).IsPrivate); FI f = (FI)initial.getF(); test(f.checkValues()); test(((EI)f.e2).checkValues()); test(!typeof(F).GetField("e1", flags).IsPublic&& !typeof(F).GetField("e1", flags).IsPrivate); test(typeof(F).GetField("e2", flags).IsPublic&& !typeof(F).GetField("e2", flags).IsPrivate); output.WriteLine("ok"); output.Write("getting I, J and H... "); output.Flush(); var i = initial.getI(); test(i != null); var j = initial.getJ(); test(j != null); var h = initial.getH(); test(h != null); output.WriteLine("ok"); output.Write("getting K... "); { output.Flush(); var k = initial.getK(); var l = k.value as L; test(l != null); test(l.data.Equals("l")); } output.WriteLine("ok"); output.Write("testing Value as parameter... "); output.Flush(); { Ice.Value v1 = new L("l"); Ice.Value v2; Ice.Value v3 = initial.opValue(v1, out v2); test(((L)v2).data.Equals("l")); test(((L)v3).data.Equals("l")); } { L l = new L("l"); Ice.Value[] v1 = new Ice.Value[] { l }; Ice.Value[] v2; Ice.Value[] v3 = initial.opValueSeq(v1, out v2); test(((L)v2[0]).data.Equals("l")); test(((L)v3[0]).data.Equals("l")); } { L l = new L("l"); Dictionary <string, Ice.Value> v1 = new Dictionary <string, Ice.Value> { { "l", l } }; Dictionary <string, Ice.Value> v2; Dictionary <string, Ice.Value> v3 = initial.opValueMap(v1, out v2); test(((L)v2["l"]).data.Equals("l")); test(((L)v3["l"]).data.Equals("l")); } output.WriteLine("ok"); output.Write("getting D1... "); output.Flush(); D1 d1 = new D1(new A1("a1"), new A1("a2"), new A1("a3"), new A1("a4")); d1 = initial.getD1(d1); test(d1.a1.name.Equals("a1")); test(d1.a2.name.Equals("a2")); test(d1.a3.name.Equals("a3")); test(d1.a4.name.Equals("a4")); output.WriteLine("ok"); output.Write("throw EDerived... "); output.Flush(); try { initial.throwEDerived(); test(false); } catch (EDerived ederived) { test(ederived.a1.name.Equals("a1")); test(ederived.a2.name.Equals("a2")); test(ederived.a3.name.Equals("a3")); test(ederived.a4.name.Equals("a4")); } output.WriteLine("ok"); output.Write("setting G... "); output.Flush(); try { initial.setG(new G(new S("hello"), "g")); } catch (Ice.OperationNotExistException) { } output.WriteLine("ok"); output.Write("setting I... "); output.Flush(); initial.setI(i); initial.setI(j); initial.setI(h); output.WriteLine("ok"); output.Write("testing sequences..."); output.Flush(); try { Base[] inS = new Test.Base[0]; Base[] outS; Base[] retS; retS = initial.opBaseSeq(inS, out outS); inS = new Test.Base[1]; inS[0] = new Test.Base(new S(), ""); retS = initial.opBaseSeq(inS, out outS); test(retS.Length == 1 && outS.Length == 1); } catch (Ice.OperationNotExistException) { } output.WriteLine("ok"); output.Write("testing recursive type... "); output.Flush(); var top = new Test.Recursive(); var p = top; int depth = 0; try { for (; depth <= 1000; ++depth) { p.v = new Test.Recursive(); p = p.v; if ((depth < 10 && (depth % 10) == 0) || (depth < 1000 && (depth % 100) == 0) || (depth < 10000 && (depth % 1000) == 0) || (depth % 10000) == 0) { initial.setRecursive(top); } } test(!initial.supportsClassGraphDepthMax()); } catch (Ice.UnknownLocalException) { // Expected marshal exception from the server(max class graph depth reached) } catch (Ice.UnknownException) { // Expected stack overflow from the server(Java only) } initial.setRecursive(new Test.Recursive()); output.WriteLine("ok"); output.Write("testing compact ID..."); output.Flush(); try { test(initial.getCompact() != null); } catch (Ice.OperationNotExistException) { } output.WriteLine("ok"); output.Write("testing marshaled results..."); output.Flush(); b1 = initial.getMB(); test(b1 != null && b1.theB == b1); b1 = initial.getAMDMBAsync().Result; test(b1 != null && b1.theB == b1); output.WriteLine("ok"); output.Write("testing UnexpectedObjectException..."); output.Flush(); @ref = "uoet:" + helper.getTestEndpoint(0); @base = communicator.stringToProxy(@ref); test(@base != null); var uoet = Test.UnexpectedObjectExceptionTestPrxHelper.uncheckedCast(@base); test(uoet != null); try { uoet.op(); test(false); } catch (Ice.UnexpectedObjectException ex) { test(ex.type.Equals("::Test::AlsoEmpty")); test(ex.expectedType.Equals("::Test::Empty")); } catch (System.Exception ex) { output.WriteLine(ex.ToString()); test(false); } output.WriteLine("ok"); // Disable Obsolete warning/error #pragma warning disable 612, 618 output.Write("testing getting ObjectFactory..."); output.Flush(); test(communicator.findObjectFactory("TestOF") != null); output.WriteLine("ok"); output.Write("testing getting ObjectFactory as ValueFactory..."); output.Flush(); test(communicator.getValueFactoryManager().find("TestOF") != null); output.WriteLine("ok"); #pragma warning restore 612, 618 output.Write("testing partial ice_initialize..."); output.Flush(); var ib1 = new IBase(); test(ib1.id.Equals("My id")); var id1 = new IDerived(); test(id1.id.Equals("My id")); test(id1.name.Equals("My name")); var id2 = new Test.IDerived2(); test(id2.id.Equals("My id")); var i2 = new I2(); test(i2.called); var s1 = new S1(); // The struct default constructor do not call ice_initialize test(s1.id == 0); s1 = new S1(2); // The id should have the value set by ice_initialize and not 2 test(s1.id == 1); var sc1 = new SC1(); test(sc1.id.Equals("My id")); output.WriteLine("ok"); output.Write("testing class containing complex dictionary... "); output.Flush(); { var m = new Test.M(); m.v = new Dictionary <StructKey, L>(); var k1 = new StructKey(1, "1"); m.v[k1] = new L("one"); var k2 = new StructKey(2, "2"); m.v[k2] = new L("two"); Test.M m1; var m2 = initial.opM(m, out m1); test(m1.v.Count == 2); test(m2.v.Count == 2); test(m1.v[k1].data.Equals("one")); test(m2.v[k1].data.Equals("one")); test(m1.v[k2].data.Equals("two")); test(m2.v[k2].data.Equals("two")); } output.WriteLine("ok"); output.Write("testing forward declared types... "); output.Flush(); { F1 f12; F1 f11 = initial.opF1(new F1("F11"), out f12); test(f11.name.Equals("F11")); test(f12.name.Equals("F12")); F2Prx f22; F2Prx f21 = initial.opF2( F2PrxHelper.uncheckedCast(communicator.stringToProxy("F21:" + helper.getTestEndpoint())), out f22); test(f21.ice_getIdentity().name.Equals("F21")); f21.op(); test(f22.ice_getIdentity().name.Equals("F22")); if (initial.hasF3()) { F3 f32; F3 f31 = initial.opF3(new F3(new F1("F11"), F2PrxHelper.uncheckedCast(communicator.stringToProxy("F21"))), out f32); test(f31.f1.name.Equals("F11")); test(f31.f2.ice_getIdentity().name.Equals("F21")); test(f32.f1.name.Equals("F12")); test(f32.f2.ice_getIdentity().name.Equals("F22")); } } output.WriteLine("ok"); output.Write("testing sending class cycle... "); output.Flush(); { var rec = new Test.Recursive(); rec.v = rec; var acceptsCycles = initial.acceptsClassCycles(); try { initial.setCycle(rec); test(acceptsCycles); } catch (Ice.UnknownLocalException) { test(!acceptsCycles); } } output.WriteLine("ok"); return(initial); }
public static InitialPrx allTests(TestCommon.Application app) { Ice.Communicator communicator = app.communicator(); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::B"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::C"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::D"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::E"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::F"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::I"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::J"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::H"); // Disable Obsolete warning/error #pragma warning disable 612, 618 communicator.addObjectFactory(new MyObjectFactory(), "TestOF"); #pragma warning restore 612, 618 Write("testing stringToProxy... "); Flush(); String @ref = "initial:" + app.getTestEndpoint(0); Ice.ObjectPrx @base = communicator.stringToProxy(@ref); test(@base != null); WriteLine("ok"); Write("testing checked cast... "); Flush(); InitialPrx initial = InitialPrxHelper.checkedCast(@base); test(initial != null); test(initial.Equals(@base)); WriteLine("ok"); Write("getting B1... "); Flush(); B b1 = initial.getB1(); test(b1 != null); WriteLine("ok"); Write("getting B2... "); Flush(); B b2 = initial.getB2(); test(b2 != null); WriteLine("ok"); Write("getting C... "); Flush(); C c = initial.getC(); test(c != null); WriteLine("ok"); Write("getting D... "); Flush(); D d = initial.getD(); test(d != null); WriteLine("ok"); Write("checking consistency... "); Flush(); test(b1 != b2); //test(b1 != c); //test(b1 != d); //test(b2 != c); //test(b2 != d); //test(c != d); test(b1.theB == b1); test(b1.theC == null); test(b1.theA is B); test(((B)b1.theA).theA == b1.theA); test(((B)b1.theA).theB == b1); //test(((B)b1.theA).theC is C); // Redundant -- theC is always of type C test(((C)(((B)b1.theA).theC)).theB == b1.theA); test(b1.preMarshalInvoked); test(b1.postUnmarshalInvoked); test(b1.theA.preMarshalInvoked); test(b1.theA.postUnmarshalInvoked); test(((B)b1.theA).theC.preMarshalInvoked); test(((B)b1.theA).theC.postUnmarshalInvoked); // More tests possible for b2 and d, but I think this is already // sufficient. test(b2.theA == b2); test(d.theC == null); WriteLine("ok"); Write("getting B1, B2, C, and D all at once... "); Flush(); B b1out; B b2out; C cout; D dout; initial.getAll(out b1out, out b2out, out cout, out dout); test(b1out != null); test(b2out != null); test(cout != null); test(dout != null); WriteLine("ok"); Write("checking consistency... "); Flush(); test(b1out != b2out); test(b1out.theA == b2out); test(b1out.theB == b1out); test(b1out.theC == null); test(b2out.theA == b2out); test(b2out.theB == b1out); test(b2out.theC == cout); test(cout.theB == b2out); test(dout.theA == b1out); test(dout.theB == b2out); test(dout.theC == null); test(dout.preMarshalInvoked); test(dout.postUnmarshalInvoked); test(dout.theA.preMarshalInvoked); test(dout.theA.postUnmarshalInvoked); test(dout.theB.preMarshalInvoked); test(dout.theB.postUnmarshalInvoked); test(dout.theB.theC.preMarshalInvoked); test(dout.theB.theC.postUnmarshalInvoked); WriteLine("ok"); Write("testing protected members... "); Flush(); EI e = (EI)initial.getE(); test(e != null && e.checkValues()); System.Reflection.BindingFlags flags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance; test(!typeof(E).GetField("i", flags).IsPublic&& !typeof(E).GetField("i", flags).IsPrivate); test(!typeof(E).GetField("s", flags).IsPublic&& !typeof(E).GetField("s", flags).IsPrivate); FI f = (FI)initial.getF(); test(f.checkValues()); test(((EI)f.e2).checkValues()); test(!typeof(F).GetField("e1", flags).IsPublic&& !typeof(F).GetField("e1", flags).IsPrivate); test(typeof(F).GetField("e2", flags).IsPublic&& !typeof(F).GetField("e2", flags).IsPrivate); WriteLine("ok"); Write("getting I, J and H... "); Flush(); var i = initial.getI(); test(i != null); var j = initial.getJ(); test(j != null); var h = initial.getH(); test(h != null); WriteLine("ok"); Write("getting D1... "); Flush(); D1 d1 = new D1(new A1("a1"), new A1("a2"), new A1("a3"), new A1("a4")); d1 = initial.getD1(d1); test(d1.a1.name.Equals("a1")); test(d1.a2.name.Equals("a2")); test(d1.a3.name.Equals("a3")); test(d1.a4.name.Equals("a4")); WriteLine("ok"); Write("throw EDerived... "); Flush(); try { initial.throwEDerived(); test(false); } catch (EDerived ederived) { test(ederived.a1.name.Equals("a1")); test(ederived.a2.name.Equals("a2")); test(ederived.a3.name.Equals("a3")); test(ederived.a4.name.Equals("a4")); } WriteLine("ok"); Write("setting G... "); Flush(); try { initial.setG(new G(new S("hello"), "g")); } catch (Ice.OperationNotExistException) { } WriteLine("ok"); Write("setting I... "); Flush(); initial.setI(i); initial.setI(j); initial.setI(h); WriteLine("ok"); Write("testing sequences..."); Flush(); try { Base[] inS = new Base[0]; Base[] outS; Base[] retS; retS = initial.opBaseSeq(inS, out outS); inS = new Base[1]; inS[0] = new Base(new S(), ""); retS = initial.opBaseSeq(inS, out outS); test(retS.Length == 1 && outS.Length == 1); } catch (Ice.OperationNotExistException) { } WriteLine("ok"); Write("testing recursive type... "); Flush(); Recursive top = new Recursive(); Recursive p = top; int depth = 0; try { for (; depth <= 1000; ++depth) { p.v = new Recursive(); p = p.v; if ((depth < 10 && (depth % 10) == 0) || (depth < 1000 && (depth % 100) == 0) || (depth < 10000 && (depth % 1000) == 0) || (depth % 10000) == 0) { initial.setRecursive(top); } } test(!initial.supportsClassGraphDepthMax()); } catch (Ice.UnknownLocalException) { // Expected marshal exception from the server (max class graph depth reached) } catch (Ice.UnknownException) { // Expected stack overflow from the server (Java only) } initial.setRecursive(new Recursive()); WriteLine("ok"); Write("testing compact ID..."); Flush(); try { test(initial.getCompact() != null); } catch (Ice.OperationNotExistException) { } WriteLine("ok"); Write("testing marshaled results..."); Flush(); b1 = initial.getMB(); test(b1 != null && b1.theB == b1); b1 = initial.getAMDMBAsync().Result; test(b1 != null && b1.theB == b1); WriteLine("ok"); Write("testing UnexpectedObjectException..."); Flush(); @ref = "uoet:" + app.getTestEndpoint(0); @base = communicator.stringToProxy(@ref); test(@base != null); UnexpectedObjectExceptionTestPrx uoet = UnexpectedObjectExceptionTestPrxHelper.uncheckedCast(@base); test(uoet != null); try { uoet.op(); test(false); } catch (Ice.UnexpectedObjectException ex) { test(ex.type.Equals("::Test::AlsoEmpty")); test(ex.expectedType.Equals("::Test::Empty")); } catch (System.Exception ex) { WriteLine(ex.ToString()); test(false); } WriteLine("ok"); // Disable Obsolete warning/error #pragma warning disable 612, 618 Write("testing getting ObjectFactory..."); Flush(); test(communicator.findObjectFactory("TestOF") != null); WriteLine("ok"); Write("testing getting ObjectFactory as ValueFactory..."); Flush(); test(communicator.getValueFactoryManager().find("TestOF") != null); WriteLine("ok"); #pragma warning restore 612, 618 Write("testing partial ice_initialize..."); Flush(); var ib1 = new IBase(); test(ib1.id.Equals("My id")); var id1 = new IDerived(); test(id1.id.Equals("My id")); test(id1.name.Equals("My name")); var id2 = new IDerived2(); test(id2.id.Equals("My id")); var i2 = new I2(); test(i2.called); var s1 = new S1(); // The struct default constructor do not call ice_initialize test(s1.id == 0); s1 = new S1(2); // The id should have the value set by ice_initialize and not 2 test(s1.id == 1); var sc1 = new SC1(); test(sc1.id.Equals("My id")); WriteLine("ok"); return(initial); }
private void ShowReturnMsg(EI.EIInfo outBlock) { //设置返回信息 if (outBlock.sys_info.flag == 0) { //this.EFMsgInfo = EP.EPES.EPESC0000077/*执行成功*/; } else if (outBlock.sys_info.flag < 0) { //this.EFMsgInfo = string.Format(EP.EPES.EPESC0000057/*后台程序调用失败! {0} sqlcode is {1}{2}*/, outBlock.sys_info.msg, outBlock.sys_info.sqlcode.ToString(), // outBlock.sys_info.sqlmes); // MessageBox.Show(//this.EFMsgInfo, EP.EPES.EPESC0000024/*提示*/, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ShowReturnMsg(EI.EIInfo outBlock) { //设置返回信息 if (outBlock.sys_info.flag == 0) { //this.//EFMsgInfo = string.Format(EP.EPES.EPESC0000118/*成功执行 sqlcode is {0}*/, outBlock.sys_info.sqlcode.ToString()); } else if (outBlock.sys_info.flag < 0) { //this.//EFMsgInfo = string.Format(EP.EPES.EPESC0000119/*后台程序调用失败! {0}*/, outBlock.sys_info.msg); //MessageBox.Show(//this.//EFMsgInfo, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
///<summary> /// Returns all repetitions of Placer Order Number (TXA-14). ///</summary> public EI[] GetPlacerOrderNumber() { EI[] ret = null; try { IType[] t = this.GetField(14); ret = new EI[t.Length]; for (int i = 0; i < ret.Length; i++) { ret[i] = (EI)t[i]; } } catch (HL7Exception he) { HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem obtaining field value. This is a bug.", he); throw new System.Exception("An unexpected error ocurred", he); } catch (System.Exception cce) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", cce); throw new System.Exception("An unexpected error ocurred", cce); } return ret; }