// constructor public Cut_info(float cost, float cut, CELL C1, CELL C2) { this.cost = cost; this.cut = cut; S1 = new LIST(C1); S2 = new LIST(C2); }
public Partition_info() { this.R = new node(); this.S = new LIST(); xcut = - 1; ycut = - 1; }
public MedicalEquipmentSectionComponent3() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public static void CopyObjectsStart() { string slectMODE = PromptSTR(); //полочаваме начина на селектиране string[] MASK = PromptStr(); //получаваме от промпта маската за сортиране string separate = PromptSTRR(); if (MASK.Length < 1) { return; } ArrayList LIST = new ArrayList(); // съхранява данните за динамичните блокове и чертежите StringCollection flesNames = GetFilesNamesCollection(); // създава списък от файлове string outfName = GetSaveFileName(); // получаваме името на файла за електронната таблица GetPreData(ref flesNames, ref LIST); // прочита фаиловете от списъка и вади данните на динамичните блокове и името на чертежа #region подготовка за сортиране foreach (DynamicBlocksData dstr in LIST) { for (int i = 0; i < dstr.arr.Length; i++) { if (i < MASK.Length) { if (!MASK[i].Contains("*")) { dstr.arr[i] = ""; } } else { dstr.arr[i] = ""; } } } if (separate == "Full") { ArrayList LIST1 = new ArrayList(); foreach (DynamicBlocksData dstr in LIST) { bool erase = false; for (int i = 0; i < MASK.Length; i++) { if (MASK[i].Contains("*")) { if (dstr.arr[i] == "") { erase = true; break; } } } if (erase != true) { LIST1.Add(dstr); } } LIST = new ArrayList(); foreach (DynamicBlocksData dstr in LIST1) { LIST.Add(dstr); } } #endregion LIST.Sort(DynamicBlocksDataComparer.Default); //сортираме по материал, тип, дебелина ..... CopyItems(ref LIST, slectMODE, separate); //цопиране в отворения чертожен файл SaveFile(ref LIST, outfName); //запис във csv file }
private static FIELD CreateNewField(BinaryReader br, int index, int fieldOffset, int dataOrDataOffset, GffFieldType fieldType) { FIELD data; switch (fieldType) { case GffFieldType.BYTE: data = new BYTE(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.CHAR: data = new CHAR(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.WORD: data = new WORD(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.SHORT: data = new SHORT(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.DWORD: data = new DWORD(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.INT: data = new INT(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.DWORD64: data = new DWORD64(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.INT64: data = new INT64(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.FLOAT: data = new FLOAT(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.DOUBLE: data = new DOUBLE(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.CExoString: data = new CExoString(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.ResRef: data = new ResRef(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.CExoLocString: data = new CExoLocString(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.VOID: data = new VOID(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.Struct: int lbl_index = br.ReadInt32(); data = new STRUCT(br, br.ReadInt32(), lbl_index); break; case GffFieldType.List: data = new LIST(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.Orientation: data = new Orientation(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.Vector: data = new Vector(br, fieldOffset + dataOrDataOffset * 12); break; case GffFieldType.StrRef: data = new StrRef(br, fieldOffset + dataOrDataOffset * 12); break; default: throw new Exception(string.Format("UNEXPECTED FIELD TYPE \"{0}\", IN STRUCT INDEX \"{1}\"", fieldType, index)); } return(data); }
public PlannedProcedureSectionComponent3() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public void IncExAllTest05() { LIST<INT> aList = new LIST<INT>(10); aList.Add(1); aList.NullFlavor = NullFlavor.Other; Assert.IsFalse(aList.Validate()); }
/// <summary> /// Parse an object from <paramref name="s"/> /// </summary> public override object Parse(System.Xml.XmlReader s, DatatypeFormatterParseResult result) { // Create the types Type sxprType = typeof(SXPR<>); Type sxprGenericType = sxprType.MakeGenericType(GenericArguments); // Details // Create an instance of rto from the rtoType object instance = sxprGenericType.GetConstructor(Type.EmptyTypes).Invoke(null); if (s.GetAttribute("nullFlavor") != null) ((ANY)instance).NullFlavor = (NullFlavor)Util.FromWireFormat(s.GetAttribute("nullFlavor"), typeof(NullFlavor)); // Try get operator if (s.GetAttribute("operator") != null) sxprGenericType.GetProperty("Operator").SetValue(instance, Util.FromWireFormat(s.GetAttribute("operator"), typeof(SetOperator?)), null); if (s.GetAttribute("specializationType") != null) { if (result.CompatibilityMode == DatatypeFormatterCompatibilityMode.Canadian) sxprGenericType.GetProperty("Flavor").SetValue(instance, s.GetAttribute("specializationType"), null); else result.AddResultDetail(new UnsupportedDatatypeR1PropertyResultDetail(ResultDetailType.Warning, "Flavor", "SXPR", s.ToString())); } #region Element Processing // List of components LIST<IGraphable> componentList = new LIST<IGraphable>(); // Parse elements if (!s.IsEmptyElement) { int sDepth = s.Depth; string sName = s.Name; s.Read(); // string Name while (!(s.NodeType == System.Xml.XmlNodeType.EndElement && s.Depth == sDepth && s.Name == sName)) { string oldName = s.Name; // Name try { if (s.LocalName == "comp") // component { // Now determine the type of GTS //string typeName = s.GetAttribute("type", DatatypeFormatter.NS_XSI); //IDatatypeFormatter formatter = DatatypeFormatter.GetFormatter(typeName); //if (formatter == null) //{ // result.AddResultDetail(new ResultDetail(String.Format("Cannot parse a SXPR member of type '{0}'", typeName))); // return null; //} //else //{ // // Graph the Hull // formatter.Host = this.Host; // formatter.GenericArguments = GenericArguments; // componentList.Add(formatter.Parse(s, result) as IGraphable); //} var hostResult = this.Host.Parse(s, GenericArguments[0]); result.Code = hostResult.Code; result.AddResultDetail(hostResult.Details); componentList.Add(hostResult.Structure as IGraphable); } } catch (MessageValidationException e) // Message validation error { result.AddResultDetail(new MARC.Everest.Connectors.ResultDetail(MARC.Everest.Connectors.ResultDetailType.Error, e.Message, e)); } finally { if (s.Name == oldName) s.Read(); } } } ((IListContainer)instance).ContainedList = componentList; #endregion // Validate ANYFormatter validation = new ANYFormatter(); string pathName = s is XmlStateReader ? (s as XmlStateReader).CurrentPath : s.Name; validation.Validate(instance as ANY, pathName, result); return instance; }
public ProblemSectionentriesRequiredComponent3() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
/// <summary> /// Parse from wire level format /// </summary> public object Parse(System.Xml.XmlReader s, DatatypeR2FormatterParseResult result) { // Any formatter for the base attributes ANYFormatter baseFormatter = new ANYFormatter(); // Create the types Type qsiType = typeof(QSU<>); Type qsiGenericType = qsiType.MakeGenericType(GenericArguments); // Create an instance of rto from the rtoType object instance = qsiGenericType.GetConstructor(Type.EmptyTypes).Invoke(null); DatatypeR2Formatter.CopyBaseAttributes(baseFormatter.Parse(s, result) as ANY, instance as ANY); // Read internal elements if ((instance as ANY).NullFlavor != null) return instance; // Now process the elements #region Elements if (!s.IsEmptyElement) { int sDepth = s.Depth; string sName = s.Name; LIST<IGraphable> termList = new LIST<IGraphable>(4); s.Read(); // string Name while (!(s.NodeType == System.Xml.XmlNodeType.EndElement && s.Depth == sDepth && s.Name == sName)) { string oldName = s.Name; // Name try { if (s.NodeType == System.Xml.XmlNodeType.Element) { switch (s.LocalName) { case "originalText": { var hostResult = this.Host.Parse(s, typeof(ED)); result.Code = hostResult.Code; result.AddResultDetail(hostResult.Details); (instance as IOriginalText).OriginalText = hostResult.Structure as ED; break; } case "term": { var hostResult = this.Host.Parse(s, typeof(IGraphable)); result.Code = hostResult.Code; result.AddResultDetail(hostResult.Details); termList.Add(hostResult.Structure as IGraphable); break; } default: result.AddResultDetail(new NotImplementedElementResultDetail(ResultDetailType.Warning, s.LocalName, s.NamespaceURI, s.ToString(), null)); break; } } } catch (MessageValidationException e) // Message validation error { result.AddResultDetail(new MARC.Everest.Connectors.ResultDetail(MARC.Everest.Connectors.ResultDetailType.Error, e.Message, e)); } finally { if (s.Name == oldName) s.Read(); } } // Set term list ((IListContainer)instance).ContainedList = termList; } #endregion // Validate baseFormatter.Validate(instance as ANY, s.ToString(), result); return instance; }
public void BAGListConversionTest() { LIST<INT> list = new LIST<INT>(new INT[] { 1, 2, 3, 4 }); BAG<INT> bag = (BAG<INT>)list; Assert.AreEqual(list.Count, bag.Count); }
public void IncExAllTest01() { // create new empty lists of integers LIST<INT> aList = new LIST<INT>(10), bList = new LIST<INT>(10), cList = new LIST<INT>(10); // populate all lists for (INT i=1; i <= 5; i++) { aList.Add(i); // Items: 1,2,3,4,5 bList.Add(i + 1); // Items: 2,3,4,5,6 cList.Add(i * 10); // Items: 10,20,30,40,50 } // Returns true as aList contains all of the items of aList var containsVal = aList.IncludesAll(aList); Console.WriteLine("aList Includes All aList: " + containsVal.ToString()); Assert.AreEqual(containsVal,true); }
public void IncExAllTest07() { LIST<INT> aList = new LIST<INT>(); aList.NullFlavor = null; Assert.IsFalse(aList.Validate()); }
public void IncExAllTest06() { LIST<INT> aList = new LIST<INT>(); aList.NullFlavor = NullFlavor.Other; Assert.IsTrue(aList.Validate()); }
public InFulfillmentOf() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public CustodianOrganization() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.id = new IIImpl(); }
public Component1() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public Performer1Person() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public PlanOfCareActivitySubstanceAdministrationEntry() { this.typeCode = new CS_R2Impl <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Domainvalue.x_ActRelationshipEntry>(); this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public ReasonForReferralSectionComponent3() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public void SETFromIGraphibleCollectionTest() { LIST<IGraphable> stuff = new LIST<IGraphable>( new ST[] { "A", "B", "C", "D" } ); SET<ST> set = new SET<ST>(stuff); Assert.AreEqual(stuff.Count, set.Count); }
public ServiceEvent() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.code = new CV_R2Impl <ActCode>(); }
public FamilyHistorySectionComponent3() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public Precondition() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public CaregiverCharacteristicsEntry() { this.typeCode = new CS_R2Impl <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Domainvalue.x_ActRelationshipEntry>(); this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public Consumable() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public DataEnterer() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.time = new TSCDAR1Impl(); }
public Birthplace() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public PhysicalExamSectionComponent3() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public MedicationsAdministeredSectionComponent3() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public AuthenticatorAssignedEntity() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.id = new IIImpl(); }
public HealthcareProvider() { this.id = new SETImpl <II, Identifier>(typeof(IIImpl)); this.code = new CVImpl(); this.name = new LISTImpl <PN, PersonName>(typeof(PNImpl)); }
public DICOMObjectCatalogSectionDCM121181Component3() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public ReferenceRange() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public Informant12Person() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.name = new LISTImpl <PN, PersonName>(typeof(PNImpl)); }
public DataEntererPerson() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.name = new PNImpl(); }
public Specimen() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public ManufacturedProduct() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.id = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public void LISTCastFromList() { List<ED> EDList = new List<ED>{ new ED("test"), new ED("test1"), new ED("test2"), new ED("test3"), new ED("test4") }; LIST<ST> STLIST = new LIST<ST>(EDList); //Bug: No cast exists in ST for ED Assert.AreEqual(5, STLIST.Count); }
public Entry() { this.typeCode = new CSImpl(); this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
/// <summary> /// Parse an object from <paramref name="s"/> /// </summary> /// <param name="s">The stream to read from</param> public virtual object Parse(System.Xml.XmlReader s, DatatypeFormatterParseResult result) { // Get the current element name string currentElementName = s.LocalName; LIST<IGraphable> retVal = new LIST<IGraphable>(); // Read until the current name is exhausted while (s.LocalName == currentElementName && !s.EOF) { if (s.NodeType == System.Xml.XmlNodeType.Element) { // Correct the XSI attribute //if (Util.CreateXSITypeName(GenericArguments[0]) != s.GetAttribute("type", DatatypeFormatter.NS_XSI) && // s is XmlStateReader && !String.IsNullOrEmpty(s.GetAttribute("type", DatatypeFormatter.NS_XSI))) // (s as XmlStateReader).AddFakeAttribute("type", Util.CreateXSITypeName(GenericArguments[0])); var hostResult = Host.Parse(s, GenericArguments[0]); result.Code = hostResult.Code; result.AddResultDetail(hostResult.Details); retVal.Add(hostResult.Structure); } // Read until the next element s.Read(); while (s.NodeType != System.Xml.XmlNodeType.Element && !s.EOF) { if (s.NodeType == System.Xml.XmlNodeType.EndElement && s.LocalName != currentElementName) return retVal; s.Read(); } } // Return the array return retVal; }
public PreoperativeDiagnosisSectionComponent3() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); }
public void SETFromLISTTest() { LIST<ST> stuff = new LIST<ST>( new ST[] { "A", "B", "C", "D" } ); SET<ST> set = (SET<ST>)stuff; Assert.AreEqual(stuff.Count, set.Count); }
public void IncExAllTest04() { LIST<INT> aList = new LIST<INT>(10), bList = new LIST<INT>(10), cList = new LIST<INT>(10); for (INT i = 1; i <= 5; i++) { aList.Add(i); bList.Add(i + 1); cList.Add(i * 10); } // Returns false as aList contains none of the items of bList var containsVal = aList.IncludesAll(bList); Console.WriteLine("aList Includes All bList: " + containsVal.ToString()); Assert.IsTrue(containsVal.Validate()); Assert.AreEqual(containsVal, false); }