private Column GetColumn(DynamicReference reference) { if (reference == null) { return null; } var table = _schema.FindTable(reference.GetOwner().ToString()); return table.FindColumn(reference.GetName()); }
private Column GetColumn(DynamicReference reference) { if (reference == null) { return(null); } var table = _schema.FindTable(reference.GetOwner().ToString()); return(table.FindColumn(reference.GetName())); }
private static Func<XElement, XElement> BuildElementResolver(DynamicReference reference) { var elementNames = reference.GetAllObjectNames(); if (elementNames.Length == 2) { return xml => xml; } return BuildNestedElementResolver(elementNames); }
public void EqualOperatorReturnsSimpleExpressionWithEqualTypeWhenUsedAsDynamic() { // Arrange dynamic column = DynamicReference.FromStrings("foo", "bar"); // Act var expression = column == 1; // Assert DoAsserts(expression, column, 1, SimpleExpressionType.Equal); }
public void FromStringTest() { // Act var actual = DynamicReference.FromString("One.Two.Three"); // Assert Assert.AreEqual("Three", actual.GetName()); Assert.AreEqual("Two", actual.GetOwner().GetName()); Assert.AreEqual("One", actual.GetOwner().GetOwner().GetName()); Assert.IsNull(actual.GetOwner().GetOwner().GetOwner()); }
public void GreaterThanOrEqualOperatorReturnsSimpleExpressionWithGreaterThanOrEqualType() { // Arrange var column = DynamicReference.FromStrings("foo", "bar"); // Act var expression = column >= 1; // Assert DoAsserts(expression, column, 1, SimpleExpressionType.GreaterThanOrEqual); }
public void LessThanOperatorReturnsSimpleExpressionWithLessThanType() { // Arrange var column = DynamicReference.FromStrings("foo", "bar"); // Act var expression = column < 1; // Assert DoAsserts(expression, column, 1, SimpleExpressionType.LessThan); }
/// <summary> /// Provides the implementation for operations that get member values. Classes derived from the <see cref="T:System.Dynamic.DynamicObject"/> class can override this method to specify dynamic behavior for operations such as getting a value for a property. /// </summary> /// <param name="binder">Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the <see cref="T:System.Dynamic.DynamicObject"/> class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive.</param> /// <param name="result">The result of the get operation. For example, if the method is called for a property, you can assign the property value to <paramref name="result"/>.</param> /// <returns> /// true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) /// </returns> public override bool TryGetMember(GetMemberBinder binder, out object result) { if (binder.Name == "All") { Trace.WriteLine("The dynamic 'All' property is deprecated; use the 'All()' method instead."); result = GetAll().ToList(); return true; } result = new DynamicReference(binder.Name, new DynamicReference(_tableName, _dataStrategy)); return true; }
private static Func <XElement, XElement> BuildElementResolver(DynamicReference reference) { var elementNames = reference.GetAllObjectNames(); if (elementNames.Length == 2) { return(xml => xml); } return(BuildNestedElementResolver(elementNames)); }
public void GetDynamicPropertyReturnsNewDynamicReferenceWithTableAndColumn() { // Arrange dynamic table = new DynamicReference("Table"); // Act DynamicReference column = table.Column; // Assert Assert.AreEqual("Column", column.GetName()); Assert.AreEqual("Table", column.GetOwner().GetName()); }
public void PropertyShouldReturnDynamicReference() { //Arrange dynamic table = new DynamicTable("Test", null); // Act DynamicReference column = table.TestColumn; // Assert Assert.AreEqual("Test", column.GetOwner().GetName()); Assert.AreEqual("TestColumn", column.GetName()); }
public static void CheckDataBlock(PropertyBlock block, CheckerEngine <PropertyRecord, Org.Neo4j.Consistency.report.ConsistencyReport_PropertyConsistencyReport> engine, RecordAccess records) { if (block.KeyIndexId < 0) { engine.Report().invalidPropertyKey(block); } else { engine.ComparativeCheck(records.PropertyKey(block.KeyIndexId), PropertyKey(block)); } PropertyType type = block.ForceGetType(); if (type == null) { engine.Report().invalidPropertyType(block); } else { switch (type.innerEnumValue) { case PropertyType.InnerEnum.STRING: engine.ComparativeCheck(records.String(block.SingleValueLong), DynamicReference.String(block)); break; case PropertyType.InnerEnum.ARRAY: engine.ComparativeCheck(records.Array(block.SingleValueLong), DynamicReference.Array(block)); break; default: try { type.value(block, null); } catch (Exception) { engine.Report().invalidPropertyValue(block); } break; } } }
public void CollectRefrence() { Refrences = GameObjectUtilities.FindSceneAllGameObjects <ReferenceObject>(); dic.Clear(); foreach (var refobj in Refrences) { if (dic.ContainsKey(refobj.Data.GUID)) { LogConflict(dic[refobj.Data.GUID], refobj); } else { dic.Add(refobj.Data.GUID, refobj); } } DynamicReference dynamicRef = GetComponent <DynamicReference>(); if (dynamicRef) { dynamicRef.Sync2Root(); } }
void InitializeProperties() { playerController = GetComponent <PlayerController>(); playerManager = GetComponent <PlayerManager>(); affectionTracker = GetComponent <AffectionTracker>(); playerNumber = playerManager.GetPlayerNumber(); gameManager = GameObject.Find("Game Manager").GetComponent <GameManager>(); dynamicReference = gameManager.GetComponent <DynamicReference>(); objectDetector = transform.Find("Character").Find("Object Detector").GetComponent <ObjectDetector>(); AssignDialogWindow(); cutsceneInProgress = false; waitingOnInput = false; timeOfPause = 0; pauseLength = 0; selectionIndex = 0; shiftDelay = 0.25f; readyToContinue = true; monitorScrollState = false; responseActions = new List <CutsceneAction>(); }
public void Method (DynamicReference d) { d.DynType.Value.AnyMethod (); d.DynArray.Value[0][0].AnyMethod (); }
private static IEnumerable <Tuple <string, string> > DynamicReferenceToTuplePairs(DynamicReference reference, string schema) { return(reference.GetAllObjectNames() .SkipWhile(s => s.Equals(schema, StringComparison.OrdinalIgnoreCase)) .SkipLast() .ToTuplePairs()); }
public SimpleOrderByItem(DynamicReference reference) : this(reference, OrderByDirection.Ascending) { }
public SimpleOrderByItem(DynamicReference reference, OrderByDirection direction) { _reference = reference; _direction = direction; }
public void Method(DynamicReference d) { d.DynType.Value.AnyMethod(); d.DynArray.Value[0][0].AnyMethod(); }
private static void DoAsserts <T>(SimpleExpression expression, DynamicReference column, T rightOperand, SimpleExpressionType expressionType) { Assert.AreEqual(column, expression.LeftOperand); Assert.AreEqual(rightOperand, expression.RightOperand); Assert.AreEqual(expressionType, expression.Type); }
internal DynamicSchema SetMemberAsSchema(DynamicReference reference) { if (reference == null) throw new ArgumentNullException("reference"); _members.TryUpdate(reference.GetName(), new DynamicSchema(reference.GetName(), this), reference); return (DynamicSchema)_members[reference.GetName()]; }
private static IEnumerable<Tuple<string,string>> DynamicReferenceToTuplePairs(DynamicReference reference, string schema) { return reference.GetAllObjectNames() .SkipWhile(s => s.Equals(schema, StringComparison.OrdinalIgnoreCase)) .SkipLast() .ToTuplePairs(); }
private static Func<XElement, object> BuildReferenceResolver(DynamicReference reference) { var resolver = BuildElementResolver(reference); return xml => resolver(xml).TryGetAttribute(reference.Name).ConvertValue(); }
private static Func <XElement, object> BuildReferenceResolver(DynamicReference reference) { var resolver = BuildElementResolver(reference); return(xml => resolver(xml).TryGetAttribute(reference.GetName()).ConvertValue()); }