public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (FrequencyElement != null) { result.AddRange(FrequencyElement.Validate()); } if (WhenElement != null) { result.AddRange(WhenElement.Validate()); } if (DurationElement != null) { result.AddRange(DurationElement.Validate()); } if (UnitsElement != null) { result.AddRange(UnitsElement.Validate()); } if (CountElement != null) { result.AddRange(CountElement.Validate()); } if (EndElement != null) { result.AddRange(EndElement.Validate()); } return(result); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as TimingRepeatComponent; if (dest != null) { base.CopyTo(dest); if (Bounds != null) { dest.Bounds = (Hl7.Fhir.Model.Element)Bounds.DeepCopy(); } if (CountElement != null) { dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); } if (DurationElement != null) { dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopy(); } if (DurationMaxElement != null) { dest.DurationMaxElement = (Hl7.Fhir.Model.FhirDecimal)DurationMaxElement.DeepCopy(); } if (DurationUnitsElement != null) { dest.DurationUnitsElement = (Code <Hl7.Fhir.Model.Timing.UnitsOfTime>)DurationUnitsElement.DeepCopy(); } if (FrequencyElement != null) { dest.FrequencyElement = (Hl7.Fhir.Model.Integer)FrequencyElement.DeepCopy(); } if (FrequencyMaxElement != null) { dest.FrequencyMaxElement = (Hl7.Fhir.Model.Integer)FrequencyMaxElement.DeepCopy(); } if (PeriodElement != null) { dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopy(); } if (PeriodMaxElement != null) { dest.PeriodMaxElement = (Hl7.Fhir.Model.FhirDecimal)PeriodMaxElement.DeepCopy(); } if (PeriodUnitsElement != null) { dest.PeriodUnitsElement = (Code <Hl7.Fhir.Model.Timing.UnitsOfTime>)PeriodUnitsElement.DeepCopy(); } if (WhenElement != null) { dest.WhenElement = (Code <Hl7.Fhir.Model.Timing.EventTiming>)WhenElement.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as ScheduleRepeatComponent; if (dest != null) { base.CopyTo(dest); if (FrequencyElement != null) { dest.FrequencyElement = (Hl7.Fhir.Model.Integer)FrequencyElement.DeepCopy(); } if (WhenElement != null) { dest.WhenElement = (Code <Hl7.Fhir.Model.Schedule.EventTiming>)WhenElement.DeepCopy(); } if (DurationElement != null) { dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopy(); } if (UnitsElement != null) { dest.UnitsElement = (Code <Hl7.Fhir.Model.Schedule.UnitsOfTime>)UnitsElement.DeepCopy(); } if (CountElement != null) { dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); } if (EndElement != null) { dest.EndElement = (Hl7.Fhir.Model.FhirDateTime)EndElement.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override Verb CreateVerb(string[] tokens) { Color(position, tokens[1].Length, Whitespaces); var countSource = tokens[2]; Color(countSource.Length, Numbers); var count = countSource.ToInt(); var parser = new PatternParser { IgnoreReplacement = true }; if (parser.Scan(source, NextPosition - 1)) { var newPattern = (Pattern)parser.Result.Value; Element = new CountElement(count, newPattern); overridePosition = parser.Result.Position; return(new NullOp()); } return(null); }
static void Main(string[] args) { // Colecciones adentro de System.Collection // ArrayList // BitArray // Hashtable (k,v) // Queue // SortedList (k,v) k,v // Stack int r = 0; Coleccion show = new Coleccion(); #region https://youtu.be/GAal3fPN59g System.Collections.ArrayList Palabras = new System.Collections.ArrayList(); // Podemos adiccionar con rango Palabras.AddRange(new System.String[] { "Hola", "como", "estas?" }); CountElement.Count(Palabras); // Recorremos el Array con loop for show.Show(Palabras, 2); // Agragar mas palabra Palabras.Add("Bien y tu?"); // Volvemos a mostrar el total de elementos CountElement.Count(Palabras); //Recorriendo con foreach show.ShowForeach(Palabras, 2); #endregion #region https://youtu.be/bdGSQ-9N22s // Array con valores numericos System.Collections.ArrayList Valores = new System.Collections.ArrayList(); Valores.AddRange(new int[] { 5, 6 }); Valores.Add(7); Valores.Add(8); //// CountElement.Count(Valores); //// // Recorremos con loop for show.Show(Valores, 1, r); // Verificar si existe un elemento en el ArrayList //con el metodo Contains() System.Console.WriteLine(" 5 existe " + Valores.Contains(5)); System.Console.WriteLine(" 1 existe {0}", Valores.Contains(1)); System.Console.Write("--------\n"); // Insertamos en un indice en particular Valores.Insert(2, 4); //// CountElement.Count(Valores); //// show.ShowForeach(Valores, 2); // Remover un elemento Valores.Remove(4); CountElement.Count(Valores); show.Show(Valores, 1, r); // Remover en una posicion Valores.RemoveAt(0); CountElement.Count(Valores); show.Show(Valores, 1, r); #endregion System.Console.ReadKey(); }
static void Main(string[] args) { #region https://youtu.be/_UtKEYYhi24 Coleccion show = new Coleccion(); System.Collections.BitArray bitArray = new System.Collections.BitArray( new byte[] { 1, 2, 4, 8, 16 });// Convertiendo byte a bit CountElement.Count(bitArray); Coleccion.Show(bitArray, 2); //// Obtenemos un bit en particular System.Console.WriteLine(bitArray.Get(3)); //// ponemos un bit en particular bitArray.Set(3, true); System.Console.WriteLine(bitArray.Get(3)); Coleccion.Show(bitArray, 2); //https://youtu.be/pGS78ttnqfY // Clonacion del BitArray System.Collections.BitArray bitArray2 = (System.Collections.BitArray)bitArray.Clone(); //// Invertir el Array, NOT bitArray2.Not(); Coleccion.Show(bitArray2, 2); // Creando otro Array System.Collections.BitArray bitArray3 = new System.Collections.BitArray(new byte[] { 5, 7, 9, 13, 15 }); Coleccion.Show(bitArray3, 2, "3°Array"); //// Hacemos Or entre Arreglos bitArray3.Or(bitArray); // El resultado se guarda en el Array que llevo //acabo la invocacion. Coleccion.Show(bitArray, pNombre: "1°Array"); Coleccion.Show(bitArray3, 3, pNombre: "Result"); System.Console.WriteLine("=|||||||||="); //// Hacemos AND entre Array Coleccion.Show(bitArray, pNombre: "1°Array"); Coleccion.Show(bitArray3, pNombre: "3°Array"); // Hacemos el AND, BitArray 3 se modifica con el resultado bitArray3.And(bitArray); Coleccion.Show(bitArray3, 3, "Result"); System.Console.WriteLine("=&&&&&&&&&&&="); //// Hamos XOR entre Array bitArray3 = new System.Collections.BitArray(new byte[] { 5, 7, 9, 13, 21 }); Coleccion.Show(bitArray, pNombre: "1°Array"); Coleccion.Show(bitArray3, pNombre: "3°Array"); // Hacemos el XOR, Array 3 se modifica con el resultado bitArray3.Xor(bitArray); Coleccion.Show(bitArray3, pNombre: "Result"); System.Console.ReadKey(); #endregion }