コード例 #1
0
 private Column GetColumn(DynamicReference reference)
 {
     if (reference == null)
     {
         return null;
     }
     var table = _schema.FindTable(reference.GetOwner().ToString());
     return table.FindColumn(reference.GetName());
 }
コード例 #2
0
        private Column GetColumn(DynamicReference reference)
        {
            if (reference == null)
            {
                return(null);
            }
            var table = _schema.FindTable(reference.GetOwner().ToString());

            return(table.FindColumn(reference.GetName()));
        }
コード例 #3
0
        private static Func<XElement, XElement> BuildElementResolver(DynamicReference reference)
        {
            var elementNames = reference.GetAllObjectNames();
            if (elementNames.Length == 2)
            {
                return xml => xml;
            }

            return BuildNestedElementResolver(elementNames);
        }
コード例 #4
0
        public void EqualOperatorReturnsSimpleExpressionWithEqualTypeWhenUsedAsDynamic()
        {
            // Arrange
            dynamic column = DynamicReference.FromStrings("foo", "bar");

            // Act
            var expression = column == 1;

            // Assert
            DoAsserts(expression, column, 1, SimpleExpressionType.Equal);
        }
コード例 #5
0
        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());
        }
コード例 #6
0
        public void GreaterThanOrEqualOperatorReturnsSimpleExpressionWithGreaterThanOrEqualType()
        {
            // Arrange
            var column = DynamicReference.FromStrings("foo", "bar");

            // Act
            var expression = column >= 1;

            // Assert
            DoAsserts(expression, column, 1, SimpleExpressionType.GreaterThanOrEqual);
        }
コード例 #7
0
        public void LessThanOperatorReturnsSimpleExpressionWithLessThanType()
        {
            // Arrange
            var column = DynamicReference.FromStrings("foo", "bar");

            // Act
            var expression = column < 1;

            // Assert
            DoAsserts(expression, column, 1, SimpleExpressionType.LessThan);
        }
コード例 #8
0
ファイル: DynamicTable.cs プロジェクト: ToJans/Simple.Data
 /// <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;
 }
コード例 #9
0
        private static Func <XElement, XElement> BuildElementResolver(DynamicReference reference)
        {
            var elementNames = reference.GetAllObjectNames();

            if (elementNames.Length == 2)
            {
                return(xml => xml);
            }

            return(BuildNestedElementResolver(elementNames));
        }
コード例 #10
0
        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());
        }
コード例 #11
0
        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());
        }
コード例 #12
0
        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;
                }
            }
        }
コード例 #13
0
    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();
        }
    }
コード例 #14
0
    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>();
    }
コード例 #15
0
ファイル: dtest-052.cs プロジェクト: nobled/mono
	public void Method (DynamicReference d)
	{
		d.DynType.Value.AnyMethod ();
		d.DynArray.Value[0][0].AnyMethod ();
	}
コード例 #16
0
 private static IEnumerable <Tuple <string, string> > DynamicReferenceToTuplePairs(DynamicReference reference, string schema)
 {
     return(reference.GetAllObjectNames()
            .SkipWhile(s => s.Equals(schema, StringComparison.OrdinalIgnoreCase))
            .SkipLast()
            .ToTuplePairs());
 }
コード例 #17
0
 public SimpleOrderByItem(DynamicReference reference) : this(reference, OrderByDirection.Ascending)
 {
 }
コード例 #18
0
 public SimpleOrderByItem(DynamicReference reference, OrderByDirection direction)
 {
     _reference = reference;
     _direction = direction;
 }
コード例 #19
0
ファイル: dtest-052.cs プロジェクト: pmq20/mono_forked
 public void Method(DynamicReference d)
 {
     d.DynType.Value.AnyMethod();
     d.DynArray.Value[0][0].AnyMethod();
 }
コード例 #20
0
 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);
 }
コード例 #21
0
 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()];
 }
コード例 #22
0
ファイル: Joiner.cs プロジェクト: robashton/Simple.Data
 private static IEnumerable<Tuple<string,string>> DynamicReferenceToTuplePairs(DynamicReference reference, string schema)
 {
     return reference.GetAllObjectNames()
         .SkipWhile(s => s.Equals(schema, StringComparison.OrdinalIgnoreCase))
         .SkipLast()
         .ToTuplePairs();
 }
コード例 #23
0
 public SimpleOrderByItem(DynamicReference reference, OrderByDirection direction)
 {
     _reference = reference;
     _direction = direction;
 }
コード例 #24
0
        private static Func<XElement, object> BuildReferenceResolver(DynamicReference reference)
        {
            var resolver = BuildElementResolver(reference);

            return xml => resolver(xml).TryGetAttribute(reference.Name).ConvertValue();
        }
コード例 #25
0
 public SimpleOrderByItem(DynamicReference reference) : this(reference, OrderByDirection.Ascending)
 {
 }
コード例 #26
0
        private static Func <XElement, object> BuildReferenceResolver(DynamicReference reference)
        {
            var resolver = BuildElementResolver(reference);

            return(xml => resolver(xml).TryGetAttribute(reference.GetName()).ConvertValue());
        }