public UxlMethod(SourceValue sig, SourceValue?cond, bool isDefault, List <UxlElement> elements = null) : base(elements) { Signature = sig; Condition = cond; IsDefault = isDefault; }
public void SetValue(double value, SourceValue sourceValue = SourceValue.Digits, TimeResult timeValueResult = TimeResult.None, TimeResult timeShortestVariant = TimeResult.None) { string strFormat = string.Empty; if (timeShortestVariant > TimeResult.None && timeShortestVariant < timeValueResult) { var ts = new TimeShort(value, this.timeResultStrings, sourceValue); strFormat = ts.GetShortestString(timeShortestVariant); } else { strFormat = this.GetFormatTimeString(this.timeResultStrings, timeValueResult); } switch (sourceValue) { case SourceValue.Seconds: this.SetText(new TimeFormatFromSeconds() { format = strFormat }.GetValue(value)); return; case SourceValue.Milliseconds: this.SetText(new TimeFormatFromMilliseconds() { format = strFormat }.GetValue(value)); return; } }
public UxlDeclare(Source src, UxlDeclareType type, SourceValue key, SourceValue?cond) { Source = src; Type = type; Key = key; Condition = cond; }
public UxlType(SourceValue name, SourceValue?cond, bool isDefault, List <UxlElement> elements = null) : base(elements) { Name = name; Condition = cond; IsDefault = isDefault; }
public override int GetHashCode() { return(PersonId.GetHashCode() ^ ConceptId.GetHashCode() ^ TypeConceptId.GetHashCode() ^ (SourceValue != null ? SourceValue.GetHashCode() : 0) ^ (StopReason != null ? StopReason.GetHashCode() : 0) ^ Refills.GetHashCode() ^ VisitOccurrenceId.GetHashCode() ^ Quantity.GetHashCode() ^ DaysSupply.GetHashCode() ^ RouteConceptId.GetHashCode() ^ EffectiveDrugDose.GetHashCode() ^ DoseUnitConceptId.GetHashCode() ^ SourceConceptId.GetHashCode() ^ (Sig != null ? Sig.GetHashCode() : 0) ^ (LotNumber != null ? LotNumber.GetHashCode() : 0) ^ (RouteSourceValue != null ? RouteSourceValue.GetHashCode() : 0) ^ (DoseUnitSourceValue != null ? DoseUnitSourceValue.GetHashCode() : 0) ^ ProviderId.GetHashCode() ^ (StartDate.GetHashCode()) ^ (EndDate.GetHashCode()) ^ (VerbatimEndDate.GetHashCode()) ^ (StartTime != null ? StartTime.GetHashCode() : 0) ^ (EndTime != null ? EndTime.GetHashCode() : 0)); }
public AstExternScope(Source src, IReadOnlyList <AstAttribute> attributes, IReadOnlyList <AstArgument> optionalArgs, SourceValue body) : base(src) { Attributes = attributes; OptionalArguments = optionalArgs; Body = body; }
public ImageFile(SourceValue sourceName, SourceValue?cond, SourceValue?targetName, int?targetWidth, int?targetHeight) { SourceName = sourceName; Condition = cond; TargetName = targetName; TargetWidth = targetWidth; TargetHeight = targetHeight; }
public AstExtern(Source src, IReadOnlyList <AstAttribute> attributes, AstExpression optionalType, IReadOnlyList <AstArgument> optionalArgs, SourceValue value) : base(src) { Attributes = attributes; OptionalType = optionalType; OptionalArguments = optionalArgs; Value = value; }
public UxlElement(UxlElementType type, SourceValue key, SourceValue value, SourceValue?cond, bool isDefault) { Type = type; Key = key; Value = value; Condition = cond; IsDefault = isDefault; }
/// <inheritdoc/> protected override int CalculateSize() { if (SourceValue != null) { return(SourceValue.Sum(t => _FieldCodec.CalculateSizeWithTag(t))); } return(0); }
public UxlImplementation(Source src, ImplementationType type, SourceValue body, SourceValue?cond, bool isDefault) { Source = src; Type = type; Body = body; Condition = cond; IsDefault = isDefault; }
public void SetsProperties() { var propInfo = typeof(SomeClass).GetProperties().First(); var testee = new SourceValue <SomeClass>(propInfo); Assert.AreEqual("A", testee.PropertyName); Assert.AreEqual(typeof(string), testee.ValueType); }
public void SetsProperties() { var propInfo = typeof (SomeClass).GetProperties().First(); var testee = new SourceValue<SomeClass>(propInfo); Assert.AreEqual("A", testee.PropertyName); Assert.AreEqual(typeof(string), testee.ValueType); }
public override int GetHashCode() { return(PersonId.GetHashCode() ^ ConceptId.GetHashCode() ^ TypeConceptId.GetHashCode() ^ VisitOccurrenceId.GetHashCode() ^ (StartDate.GetHashCode()) ^ (SourceValue != null ? SourceValue.GetHashCode() : 0)); //^ ReleventConditionConceptId.GetHashCode(); }
public override int GetHashCode() { unchecked { var hashCode = (Member != null ? Member.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SourceValue != null ? SourceValue.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Values != null ? Values.GetHashCode() : 0); return(hashCode); } }
public override int GetHashCode() { return(PersonId.GetHashCode() ^ ConceptId.GetHashCode() ^ (StartDate.GetHashCode()) ^ //(EndDate.GetHashCode()) ^ TypeConceptId.GetHashCode() ^ //SourceConceptId.GetHashCode() ^ VisitOccurrenceId.GetHashCode() ^ (SourceValue != null ? SourceValue.GetHashCode() : 0)); }
public override int GetHashCode() { return(Id.GetHashCode() ^ PersonId.GetHashCode() ^ ConceptId.GetHashCode() ^ TypeConceptId.GetHashCode() ^ (SourceValue != null ? SourceValue.GetHashCode() : 0) ^ (CareSiteId.GetHashCode()) ^ (StartDate.GetHashCode()) ^ (EndDate.GetHashCode())); }
public override string GetKey() { var source = SourceValue; if (!string.IsNullOrEmpty(SourceValue)) { source = SourceValue.TrimStart('0'); } return((source ?? "") + ";" + (ProviderSourceValue ?? "")); }
public override int GetHashCode() { unchecked { int result = (TypeMap != null ? TypeMap.GetHashCode() : 0); result = (result * 397) ^ (SourceType != null ? SourceType.GetHashCode() : 0); result = (result * 397) ^ (DestinationType != null ? DestinationType.GetHashCode() : 0); result = (result * 397) ^ (SourceValue != null ? SourceValue.GetHashCode() : 0); return(result); } }
public static string GetFullPath(this SourceValue filename) { if (!filename.String.IsValidPath()) { return(filename.String); } return(filename.Source.IsUnknown ? Path.GetFullPath(filename.String) : filename.String.ToFullPath(Path.GetDirectoryName(filename.Source.FullPath))); }
public void CreatesGetterExpression() { var propInfo = typeof(SomeClass).GetProperties().First(); var testee = new SourceValue<SomeClass>(propInfo); var expr = testee.CreateGetter() as Expression<Func<SomeClass, string>>; var sourceInstance = new SomeClass {A = "test"}; Assert.AreEqual("test", expr.Compile()(sourceInstance)); }
public override int GetHashCode() { return(PersonId.GetHashCode() ^ ConceptId.GetHashCode() ^ TypeConceptId.GetHashCode() ^ ProviderId.GetHashCode() ^ Quantity.GetHashCode() ^ (SourceValue != null ? SourceValue.GetHashCode() : 0) ^ SourceConceptId.GetHashCode() ^ (UniqueDeviceId != null ? UniqueDeviceId.GetHashCode() : 0) ^ (StartDate.GetHashCode()) ^ (EndDate.GetHashCode())); }
bool CompileBool(SourceValue sourceValue) { bool result; if (!string.IsNullOrEmpty(sourceValue.String) && Preprocessor.TryParseCondition(sourceValue.String, out result)) { return(result); } Log.Error(sourceValue.Source, ErrorCode.E0000, sourceValue.String.Quote() + " could not be evaluated to 'bool'"); return(false); }
public void SetValue(double value, SourceValue sourceValue = SourceValue.Digits, TimeResult timeValueResult = TimeResult.None, TimeResult timeShortestVariant = TimeResult.None) { var currentData = new ValueData() { value = value, sourceValue = sourceValue, timeValueResult = timeValueResult, timeShortestVariant = timeShortestVariant, isCreated = true, }; if (this.lastValueData == currentData) { return; } this.lastValueData = currentData; this.lastText = null; string strFormat; if (timeShortestVariant > TimeResult.None && timeShortestVariant < timeValueResult) { var ts = new TimeShort(value, this.timeResultStrings, sourceValue); strFormat = ts.GetShortestString(timeShortestVariant); } else { strFormat = this.GetFormatTimeString(this.timeResultStrings, timeValueResult); } switch (sourceValue) { case SourceValue.Digits: this.SetText(value.ToString()); return; case SourceValue.Seconds: this.SetText(new TimeFormatFromSeconds() { format = strFormat }.GetValue(value)); return; case SourceValue.Milliseconds: this.SetText(new TimeFormatFromMilliseconds() { format = strFormat }.GetValue(value)); return; } }
public void CreatesGetterExpression() { var propInfo = typeof(SomeClass).GetProperties().First(); var testee = new SourceValue <SomeClass>(propInfo); var expr = testee.CreateGetter() as Expression <Func <SomeClass, string> >; var sourceInstance = new SomeClass { A = "test" }; Assert.AreEqual("test", expr.Compile()(sourceInstance)); }
public CopyFile(SourceValue sourceName, CopyFileFlags flags, SourceValue?targetName = null, SourceValue?cond = null, SourceValue?type = null, Func <string, string> preprocess = null) { Flags = flags; SourceName = sourceName; TargetName = targetName; Condition = cond; Type = type; Preprocess = preprocess ?? (x => x); if (string.IsNullOrEmpty(SourceName.String)) { throw new ArgumentNullException(nameof(sourceName)); } }
private void OutPutUnit_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (outputValueMode == mode.Kin) { outputValueUnit = (visUnit)OutPutUnit.SelectedIndex; } else { outputValueUnit = (visUnit)OutPutUnit.SelectedIndex + 100; } Calculate(); SourceValue.Focus(); }
public TimeShort(double value, TimeResultStrings timeResultStrings, SourceValue sourceValue) { this.timeResultStrings = timeResultStrings; switch (sourceValue) { case SourceValue.Seconds: this.timeSpan = System.TimeSpan.FromSeconds(value); break; case SourceValue.Milliseconds: this.timeSpan = System.TimeSpan.FromMilliseconds(value); break; } }
public override int GetHashCode() { return(PersonId.GetHashCode() ^ ConceptId.GetHashCode() ^ (StartDate.GetHashCode()) ^ (EndDate.GetHashCode()) ^ TypeConceptId.GetHashCode() ^ StatusConceptId.GetHashCode() ^ VisitOccurrenceId.GetHashCode() ^ (StopReason != null ? StopReason.GetHashCode() : 0) ^ SourceConceptId.GetHashCode() ^ ProviderId.GetHashCode() ^ (StatusSourceValue != null ? StatusSourceValue.GetHashCode() : 0) ^ (SourceValue != null ? SourceValue.GetHashCode() : 0)); }
public bool TryGetValue(DataType dt, string propertyName, out SourceValue result, bool escape = false) { Element elm; TypeExtension typeExt; if (Extensions.TypeExtensions.TryGetValue(dt.Prototype, out typeExt) && typeExt.Properties.TryGetValue(propertyName, out elm)) { result = new SourceValue(elm.Source, ExpandSingleLine(elm.Source, elm.String, escape, null, elm.Usings)); return(true); } result = default(SourceValue); return(false); }
/// <inheritdoc/> protected override void Read(ref ParseContext parser) { if (SourceValue == null) { SourceValue = new TCollection(); } else { SourceValue.Clear(); } while (parser.ReadTag() == _Tag) { SourceValue.Add(_FieldCodec.Read(ref parser)); } }
/// <summary> /// Convert a source value to a logic value /// </summary> public static LogicValue ToLogic(SourceValue Source) { if (Source == SourceValue.Hi) { return(LogicValue.Hi); } if (Source == SourceValue.Low) { return(LogicValue.Low); } else { return(LogicValue.Indeterminate); } }