/// <summary> /// 修改前的验证 /// </summary> /// <param name="entity"></param> public void CheckForSaveEntityUpdate(Entity entity) { /* 判断是否同名冲突 */ SimpleProperty propertyOfFilter = new SimpleProperty("Unique", typeof(int)); Entity entityOfFilter = new Entity(new PropertyCollection() { propertyOfFilter }); entityOfFilter.SetValue("Unique", entity.GetValue("Unique")); entityOfFilter.Add(new SimpleProperty("StationName", typeof(string)), entity.GetValue("StationName")); SimpleProperty propertyOfConnector = new SimpleProperty("Unique", typeof(string)); Entity entityOfConnector = new Entity(new PropertyCollection() { propertyOfConnector }); entityOfConnector.SetValue("Unique", "<>"); entityOfConnector.Add(new SimpleProperty("StationName", typeof(string)), "="); EntityCollection hasRecord = this._Dal.GetEntitiesByFilter(entityOfFilter, entityOfConnector); if (hasRecord.Count != 0) { throw new ValueDuplicatedException("修改失败,该检查站名称已经被占用"); } }
public Unit(string name) { _name = name; _props = new PropertyCollection(); _triggers = new TriggerCollection(); _skills = new Dictionary <string, Skill>(); _alive = _props.AddProperty(PropertyType.Alive, new BoolProperty("活着", true)); _props.AddProperty(PropertyType.Level, new IntProperty("等级", 1)); _props.AddProperty(PropertyType.Vitality, new ValueProperty("体力", 10)); _props.AddProperty(PropertyType.Strength, new ValueProperty("力量", 10)); _props.AddProperty(PropertyType.Intelligence, new ValueProperty("智力", 10)); _props.AddProperty(PropertyType.Agility, new ValueProperty("敏捷", 10)); // BattleProperties _health = _props.AddProperty(PropertyType.Health, new MaxValueProperty("生命", 100)); _props.AddProperty(PropertyType.PhysicAttack, new ValueProperty("物理攻击", 10, 1)); _props.AddProperty(PropertyType.MagicAttack, new ValueProperty("魔法攻击", 10, 1)); _props.AddProperty(PropertyType.PhysicDefense, new ValueProperty("物理防御", 0)); _props.AddProperty(PropertyType.MagicDefense, new ValueProperty("魔法防御", 0)); _props.AddProperty(PropertyType.Speed, new ValueProperty("速度", 100, max: 2000)); _props.AddProperty(PropertyType.CriticalRate, new ValueProperty("暴击率", 0.00f, max: 1.00f, format: "P0")); _props.AddProperty(PropertyType.CriticalDamage, new ValueProperty("暴击伤害", 1.50f, 1.00f, format: "P0")); _props.AddProperty(PropertyType.CooldownReduction, new ValueProperty("冷却时间降低", 0, -10.0f, 0.80f, format: "P0")); _props.AddProperty(PropertyType.BattleForce, new IntProperty("战斗势力", 0)); _props.AddProperty(PropertyType.BattleForceAllyMask, new IntProperty("战斗势力掩码", 0)); _props.AddProperty(PropertyType.BattleGroup, new IntProperty("战斗组", 0)); UpdateBattleProperties(); }
/// <summary> /// 添加前的验证 /// </summary> /// <param name="bangID">关联的地磅货重编号(来自于WoodBang表)</param> /// <param name="gsmID">关联的短信报备编号(来自于GsmItem表)</param> /// <param name="woodID">关联的木材编号 (来自于Wood表)</param> void CheckForSaveEntityInsert(object bangID, object gsmID, object woodID) { /* 判断当前各表数据是否已经对接过 */ SimpleProperty propertyOfFilter = new SimpleProperty("BangID", typeof(int)); Entity entityOfFilter = new Entity(new PropertyCollection() { propertyOfFilter }); entityOfFilter.SetValue("BangID", bangID); entityOfFilter.Add(new SimpleProperty("GsmID", typeof(int)), gsmID); entityOfFilter.Add(new SimpleProperty("WoodID", typeof(int)), woodID); SimpleProperty propertyOfConnector = new SimpleProperty("BangID", typeof(string)); Entity entityOfConnector = new Entity(new PropertyCollection() { propertyOfConnector }); entityOfConnector.SetValue("BangID", "="); entityOfConnector.Add(new SimpleProperty("GsmID", typeof(string)), "="); entityOfConnector.Add(new SimpleProperty("WoodID", typeof(string)), "="); EntityCollection hasAdd = this._Dal.GetEntitiesByFilter(entityOfFilter, entityOfConnector); if (hasAdd.Count != 0) { throw new ValueDuplicatedException("操作失败,该地磅数据记录之前已经成功对接过"); } }
public Light(ulong id, Element element, Document doc, string name) : base(id, element, doc, name) { Color = new SimpleProperty<Vector3>(Props, "Color", new Vector3(1, 1, 1)); LightType = new SimpleProperty<Type>(Props, "LightType", (Type)0); CastLightOnObject = new SimpleProperty<bool>(Props, "CastLightOnObject", false); DrawVolumetricLight = new SimpleProperty<bool>(Props, "DrawVolumetricLight", true); DrawGroundProjection = new SimpleProperty<bool>(Props, "DrawGroundProjection", true); DrawFrontFacingVolumetricLight = new SimpleProperty<bool>(Props, "DrawFrontFacingVolumetricLight", false); Intensity = new SimpleProperty<float>(Props, "Intensity", 1.0f); InnerAngle = new SimpleProperty<float>(Props, "InnerAngle", 0.0f); OuterAngle = new SimpleProperty<float>(Props, "OuterAngle", 45.0f); Fog = new SimpleProperty<int>(Props, "Fog", 50); DecayType = new SimpleProperty<Decay>(Props, "DecayType", (Decay)0); DecayStart = new SimpleProperty<int>(Props, "DecayStart", 0); FileName = new SimpleProperty<string>(Props, "FileName", ""); EnableNearAttenuation = new SimpleProperty<bool>(Props, "EnableNearAttenuation", false); NearAttenuationStart = new SimpleProperty<float>(Props, "NearAttenuationStart", 0f); NearAttenuationEnd = new SimpleProperty<float>(Props, "NearAttenuationEnd", 0f); EnableFarAttenuation = new SimpleProperty<bool>(Props, "EnableFarAttenuation", false); FarAttenuationStart = new SimpleProperty<float>(Props, "FarAttenuationStart", 0f); FarAttenuationEnd = new SimpleProperty<float>(Props, "FarAttenuationEnd", 0f); CastShadow = new SimpleProperty<bool>(Props, "CastShadows", true); ShadowColor = new SimpleProperty<Vector3>(Props, "ShadowColor", new Vector3(0, 0, 0)); AreaLightShape = new SimpleProperty<int>(Props, "AreaLightShape", 0); LeftBarnDoor = new SimpleProperty<float>(Props, "LeftBarnDoor", 20.0f); RightBarnDoor = new SimpleProperty<float>(Props, "RightBarnDoor", 20.0f); TopBarnDoor = new SimpleProperty<float>(Props, "TopBarnDoor", 20.0f); BottomBarnDoor = new SimpleProperty<float>(Props, "BottomBarnDoor", 20.0f); EnableBarnDoor = new SimpleProperty<bool>(Props, "EnableBarnDoor", true); }
public void TestInitialize() { this.testFieldObject = new SimpleField { boolField = true, floatField = 1.2f, integerField = 5, stringField = "test" }; this.testPropertyObject = new SimpleProperty(true, "test", 1.2f) { StringProperty = "test", IntegerProperty = 5, FloatProperty = 1.2f, BoolProperty = true, ActualNameInJsonAttribute = 5 }; this.testComplexObject = new ComplexObject() { TestBoolean = true, testField = 1.2f, NestedObject = new NestedObject() { testfield = "test", TestProperty = 5 } }; this.changer = new UntypedObjectChanger(); }
protected ColumnManagerBase(SimpleProperty <string> identifier) { if (string.IsNullOrEmpty(identifier.Key)) { throw new ArgumentException("Key of identifier is empty"); } Identifier = identifier; }
/// <summary> /// 批量对接 /// </summary> /// <param name="entity"></param> /// <returns></returns> public string BatchJoinData(Entity entity) { string strRes = string.Empty; string BangIDs = entity.GetValue("BangIDs").TryString(); string WoodIDs = entity.GetValue("WoodIDs").TryString(); int AreaID = entity.GetValue("AreaID").TryInt32(); int Account = entity.GetValue("Account").TryInt32(); int intRes = 0; try { this._Dal.BeginTransaction(); if (BangIDs != "") { string[] BangID = BangIDs.Split(new char[] { ',' }); string[] WoodID = WoodIDs.Split(new char[] { ',' }); for (int i = 0; i < BangID.Length; i++) { string strCrateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); UniqueDal unique = new UniqueDal(this._Dal.SqlTransaction); CheckForSaveEntityInsert(BangID[i], 0, WoodID[i]); SimpleProperty propertyOfConnector = new SimpleProperty("BangID", typeof(string)); Entity entity1 = new Entity(new PropertyCollection() { propertyOfConnector }); entity1.SetValue("BangID", BangID[i]); entity1.Add(new SimpleProperty("GsmID", typeof(int)), 0); entity1.Add(new SimpleProperty("WoodID", typeof(int)), WoodID[i].TryInt32()); entity1.Add(new SimpleProperty("Unique", typeof(int)), unique.GetValueByName(this._Dal.Table)); entity1.Add(new SimpleProperty("JoinTime", typeof(DateTime)), strCrateDate); entity1.Add(new SimpleProperty("State", typeof(int)), StateEnum.Default); entity1.Add(new SimpleProperty("Version", typeof(int)), 1); entity1.Add(new SimpleProperty("Operator", typeof(int)), Account); entity1.Add(new SimpleProperty("IsGsm", typeof(int)), 1); entity1.Add(new SimpleProperty("IsAdd", typeof(int)), 0); entity1.Add(new SimpleProperty("AreaID", typeof(int)), AreaID); entity1.Add(new SimpleProperty("Log", typeof(string)), "{\"JoinDate\":\"" + strCrateDate + "\",\"JoinPeople\":\"" + Account + "\"}"); this._Dal.InsertEntity(entity1); intRes += this._Dal.UpdateJoin(BangID[i], (object)1); } } this._Dal.CommitTransaction(); strRes = intRes > 0 ? "SUCCESS" : "FAIL"; } catch (System.Exception ex) { strRes = "EXCEPTION"; this._Dal.RollbackTransaction(); } return(strRes); }
private static Property createSimpleProperty(string name, TypeInfo typeInfo, object value) { if (!typeInfo.IsSimple) { return(null); } var result = new SimpleProperty(name, typeInfo.Type); result.Value = value; return(result); }
public DynamicProperty<object> Duplicate(object obj) { DynamicProperty<object> complexProperty = new ComplexProperty<object>(); SimpleProperty<object> simpleProperty; foreach (System.Reflection.PropertyInfo property in obj.GetType().GetProperties()) { object value = property.GetValue(obj, null); simpleProperty = new SimpleProperty<object>(value); complexProperty.AddProperty(property.Name, simpleProperty); } return complexProperty; }
private static IEnumerable <MemberDeclarationSyntax> GetGeneratedMember(SimpleProperty p) { var dependentChanged = string.Join("", p.Dependents.Select(d => $" OnPropertyChanged({d.Name}Property);")); var source = string.Format(@" public {1} {0} {{ get {{ return _value.{0}; }} set {{ SetProperty(ref _value.{0}, value, {0}Property); {2} }} }} private static readonly PropertyChangedEventArgs {0}Property = new PropertyChangedEventArgs(" + NameOf(p) + ");", p.Name, p.Type.WithoutTrivia().GetText().ToString(), dependentChanged); var generatedNodes = CSharpSyntaxTree.ParseText(source) .GetRoot().ChildNodes() .OfType <MemberDeclarationSyntax>() .ToArray(); return(generatedNodes); }
/// <summary> /// 添加前的验证 /// </summary> /// <param name="objWoodID">关联的木材编号 (来自于Wood表)</param> /// <param name="objOperator">操作员的身份识别</param> void CheckForSaveEntityInsert(object objWoodID, object objOperator) { string strFileName = "WoodID"; object objFileValue = objWoodID; string connect = "="; string table = "FullPound"; /* 判断当前红卡关联的记录是否已被删除 */ EntityCollection recordOfWaitCheck = this._Dal.SelectRecordComeFromDataOfNextStepOperate(strFileName, objFileValue, connect, table); if (recordOfWaitCheck.Count == 0) { throw new ValueDuplicatedException("添加失败,该红卡在地磅的首磅记录已经被删除"); } /* 判断当前红卡关联的记录被添加的次数是否超过了3次 */ EntityCollection hasRecord = this._Dal.GetEntitiesByField(strFileName, objFileValue, connect); if (hasRecord.Count > 3) { throw new ValueDuplicatedException("添加失败,这张卡的记录已经被添了4次,每车木料最多只允许4个人取样"); } /* 判断当前红卡关联的记录是否已经被当前操作员添加过 */ SimpleProperty propertyOfFilter = new SimpleProperty("WoodID", typeof(int)); Entity entityOfFilter = new Entity(new PropertyCollection() { propertyOfFilter }); entityOfFilter.SetValue("WoodID", objWoodID); entityOfFilter.Add(new SimpleProperty("Operator", typeof(int)), objOperator); SimpleProperty propertyOfConnector = new SimpleProperty("WoodID", typeof(string)); Entity entityOfConnector = new Entity(new PropertyCollection() { propertyOfConnector }); entityOfConnector.SetValue("WoodID", "="); entityOfConnector.Add(new SimpleProperty("Operator", typeof(string)), "="); EntityCollection hasAdd = this._Dal.GetEntitiesByFilter(entityOfFilter, entityOfConnector); if (hasAdd.Count != 0) { throw new ValueDuplicatedException("添加失败,这张卡的记录之前已经被您添加过,不允许再次添加"); } }
public Camera(ulong id, Element element, Document doc, string name) : base(id, element, doc, name) { Position = new SimpleProperty<Vector3>(Props, "Position", new Vector3(0, 0, 0)); UpVector = new SimpleProperty<Vector3>(Props, "UpVector", new Vector3(0, 1, 0)); InterestPosition = new SimpleProperty<Vector3>(Props, "InterestPosition", new Vector3(0, 0, 0)); AspectWidth = new SimpleProperty<float>(Props, "AspectWidth", 1.0f); AspectHeight = new SimpleProperty<float>(Props, "AspectHeight", 1.0f); FilmWidth = new SimpleProperty<float>(Props, "FilmWidth", 1.0f); FilmHeight = new SimpleProperty<float>(Props, "FilmHeight", 1.0f); FilmAspectRatio = new SimpleProperty<float>(Props, "FilmAspectRatio", 1.0f); ApertureMode = new SimpleProperty<int>(Props, "ApertureMode", 0); FieldOfView = new SimpleProperty<float>(Props, "FieldOfView", 1.0f); FocalLength = new SimpleProperty<float>(Props, "FocalLength", 1.0f); }
public Entity DeleteEntityByUniqueWithOperator(int intUnique, int intWoodID, int operatorID, string greenCardNumber, string redCardNumber, string bangCid) { try { this._Dal.BeginTransaction(); ExecuteForDeleteEntity(intWoodID); int affectedRows = this._Dal.DeleteEntityByUniqueWithOperator(intUnique, intWoodID, operatorID); // 删除车辆还未离厂的记录 if (affectedRows > 0) { RfidCardBll cardStateBll = new RfidCardBll(this._Dal.SqlTransaction); int affRows = cardStateBll.UpdateState(greenCardNumber, (int)CardType.Green, (int)CardState.Balance); affRows = cardStateBll.UpdateState(redCardNumber, (int)CardType.Red, (int)CardState.Sample); } this._Dal.CommitTransaction(); Entity operateResult; if (affectedRows > 0) { operateResult = Helper.GetEntity(true, "删除记录成功"); SyncDeleteEmptyVolumeData(intWoodID); SimpleProperty BangCID = new SimpleProperty("BangCID", typeof(string)); SimpleProperty BangID = new SimpleProperty("BangID", typeof(string)); Entity entity = new Entity(new PropertyCollection() { BangCID, BangID }); entity.SetValue(BangCID, bangCid); entity.SetValue(BangID, ""); SyncVolumeDataForERP(entity, "DEL"); } else { operateResult = Helper.GetEntity(false, "删除失败,可能该车辆已经驶出厂区大门,不能再删除"); } return(operateResult); } catch (Exception exception) { this._Dal.RollbackTransaction(); return(Helper.GetEntity(false, exception.Message)); } }
private static SearchResult MapPropertyToSearchResult(SimpleProperty simpleProperty) { if (simpleProperty == null) { return(null); } return(new SearchResult { ZpId = simpleProperty.zpid, Address = MapAddress(simpleProperty.address), Links = MapLinks(simpleProperty.links), Zestimate = MapEstimate(simpleProperty.zestimate), RentZestimate = MapEstimate(simpleProperty.rentzestimate), LocalRegions = simpleProperty.localRealEstate?.Select(MapRegion)?.ToList() }); }
public AnimationStack(ulong id, Element element, string name, Document doc) : base(id, element, name) { var sc = Parser.GetRequiredScope(element); // note: we don't currently use any of these properties so we shouldn't bother if it is missing props = DocumentUtil.GetPropertyTable(doc, "AnimationStack.FbxAnimStack", element, sc, true); // resolve attached animation layers var conns = doc.GetConnectionsByDestinationSequenced(ID, "AnimationLayer"); layers = new List<AnimationLayer>(conns.Count); foreach (var con in conns) { // link should not go to a property if (!string.IsNullOrEmpty(con.PropertyName)) { continue; } var ob = con.SourceObject; if (ob == null) { DocumentUtil.DOMWarning("failed to read source object for AnimationLayer->AnimationStack link, ignoring", element); continue; } var anim = ob as AnimationLayer; if (anim == null) { DocumentUtil.DOMWarning("source object for ->AnimationStack link is not an AnimationLayer", element); continue; } layers.Add(anim); } LocalStart = new SimpleProperty<long>(props, "LocalStart", 0); LocalStop = new SimpleProperty<long>(props, "LocalStop", 0); ReferenceStart = new SimpleProperty<long>(props, "ReferenceStart", 0); ReferenceStop = new SimpleProperty<long>(props, "ReferenceStop", 0); }
public FileGlobalSettings(Document doc, PropertyTable prop) { this.doc = doc; this.props = prop; UpAxis = new SimpleProperty<int>(prop, "UpAxis", 1); UnAxisSign = new SimpleProperty<int>(prop, "UnAxisSign", 1); FrontAxis = new SimpleProperty<int>(prop, "FrontAxis", 2); FrontAxisSign = new SimpleProperty<int>(prop, "FrontAxisSign", 1); CoordAxis = new SimpleProperty<int>(prop, "CoordAxis", 0); CoordAxisSign = new SimpleProperty<int>(prop, "CoordAxisSign", 0); OriginalUpAxis = new SimpleProperty<int>(prop, "OriginalUpAxis", 0); OriginalUpAxisSign = new SimpleProperty<int>(prop, "OriginalUpAxisSign", 0); UnitScaleFactor = new SimpleProperty<double>(prop, "UnitScaleFactor", 0); OriginalUnitScaleFactor = new SimpleProperty<double>(prop, "OriginalUnitScaleFactor", 0); AmbientColor = new SimpleProperty<Vector3>(prop, "AmbientColor", new Vector3(0, 0, 0)); DefaultCamera = new SimpleProperty<string>(prop, "DefaultCamera", ""); TimeMode = new SimpleProperty<FrameRate>(prop, "TimeMode", FrameRate.FrameRate_DEFAULT); TimeSpanStart = new SimpleProperty<ulong>(prop, "TimeSpanStart", 0); TimeSpanStop = new SimpleProperty<ulong>(prop, "TimeSpanStop", 0); CustomFrameRate = new SimpleProperty<float>(prop, "CustomFrameRate", -1f); }
/// <summary> /// 获取木片结算单打印信息 /// </summary> /// <param name="ordernos">单号集合</param> /// <returns>结果集</returns> public Entity GetEntitysForCostPrint(Entity entity) { string ordernos = entity.GetValue("OrderNo").TryString(); int Account = entity.GetValue("Account").TryInt32(); int Ismegre = entity.GetValue("Ismegre").TryInt32(); Entity listCostObj = null; try { this._Dal.BeginTransaction(); int acts = this._Dal.UpdatePrintState(ordernos, Account, Ismegre); ArrayList list = this._Dal.GetEntitysForCostPrint(ordernos) as ArrayList; SimpleProperty Weights = new SimpleProperty("Weights", typeof(EntityCollection)); SimpleProperty Volumes = new SimpleProperty("Volumes", typeof(EntityCollection)); SimpleProperty CarCounts = new SimpleProperty("CarCounts", typeof(EntityCollection)); PropertyCollection propertyCollectiongControl = new PropertyCollection() { Weights, Volumes, CarCounts }; listCostObj = new Entity(propertyCollectiongControl, new ArrayList() { list[0], list[1], list[2] }); this._Dal.CommitTransaction(); } catch (System.Exception exception) { this._Dal.RollbackTransaction(); throw new System.Exception("出错", exception); } return(listCostObj); }
public Entity SaveEntityByOperator(Entity entity) { string strCrateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string msg = ""; try { CheckForSaveEntityInsert(entity.GetValue("BarrierID")); object greenCardNumber = entity.GetValue("CardNumber"); /* 这里获取数据,为了在验收电子卡的同时,模拟新发一张工厂入门电子卡记录 */ SimpleProperty property = new SimpleProperty("CardNumber", typeof(string)); Entity entityOfWood = new Entity(new PropertyCollection() { property }); entityOfWood.SetValue(property, greenCardNumber); entityOfWood.Add(new SimpleProperty("BarrierID", typeof(int)), entity.GetValue("BarrierID")); entityOfWood.Add(new SimpleProperty("ArriveDate", typeof(DateTime)), strCrateDate); entityOfWood.Add(new SimpleProperty("Operator", typeof(int)), entity.GetValue("Operator")); entityOfWood.Add(new SimpleProperty("State", typeof(int)), StateEnum.Default); entityOfWood.Add(new SimpleProperty("Version", typeof(int)), 1); entityOfWood.Add(new SimpleProperty("Log", typeof(string)), "{\"Date\":\"" + strCrateDate + "\",\"People\":\"" + entity.GetValue("Operator").ToString() + "\"}"); this._Dal.BeginTransaction(); UniqueDal unique = new UniqueDal(this._Dal.SqlTransaction); RfidCardBll cardStateBll = new RfidCardBll(this._Dal.SqlTransaction); int newUnique = unique.GetValueByName("Wood"); // 注意这里,获取木材表的唯一字段 if (newUnique <= 0) { throw new Exception("验收失败,网络原因,请重试"); } entityOfWood.Add(new SimpleProperty("Unique", typeof(int)), newUnique); /* 新增 */ newUnique = unique.GetValueByName(this._Dal.Table); if (newUnique <= 0) { throw new Exception("验收失败,网络原因,请重试"); } entity.SetValue("Unique", newUnique); entity.Add(new SimpleProperty("CheckDate", typeof(DateTime)), strCrateDate); entity.Add(new SimpleProperty("State", typeof(int)), StateEnum.Default); entity.Add(new SimpleProperty("Version", typeof(int)), 1); entity.Add(new SimpleProperty("Log", typeof(string)), "{\"Date\":\"" + strCrateDate + "\"}"); int affectedRows; affectedRows = this._Dal.InsertEntity(entity); // 添加记录到电子卡验收Check if (affectedRows > 0) { affectedRows = this._Dal.InsertBaseDataByOperator(entityOfWood); // 添加记录到木材表Wood } else { throw new Exception("验收失败,网络原因,请重试"); } if (affectedRows > 0) { affectedRows = cardStateBll.UpdateState(greenCardNumber.ToString(), (int)CardType.Green, (int)CardState.Door, entityOfWood.GetValue("Unique").ToInt32()); } else { throw new Exception("验收失败,网络原因,请重试"); } if (affectedRows > 0) { msg = "验收成功"; } else { throw new Exception("验收失败,网络原因,请重试"); } this._Dal.CommitTransaction(); return(Helper.GetEntity(true, msg, entity.GetValue("Unique").ToString())); } catch (Exception exception) { this._Dal.RollbackTransaction(); return(Helper.GetEntity(false, exception.Message)); } }
private static object createObjectFromSimpleProperty(SimpleProperty property) { return property.Value; }
protected ColumnManagerBase(SimpleProperty <string> identifier, IList <IHasDynamicProperties> listOfObjectsWithDynamicProperties) { Identifier = identifier; ListOfObjectsWithDynamicProperties = listOfObjectsWithDynamicProperties; }
private void AssertSimplePropertyEqual(SimpleProperty expectedValues, SimpleProperty actualValues) { Assert.AreNotEqual(expectedValues, actualValues); Assert.AreEqual(expectedValues.StringProperty, actualValues.StringProperty); Assert.AreEqual(expectedValues.IntegerProperty, actualValues.IntegerProperty); Assert.AreEqual(expectedValues.FloatProperty, actualValues.FloatProperty); Assert.AreEqual(expectedValues.BoolProperty, actualValues.BoolProperty); Assert.AreEqual(expectedValues.ActualNameInJsonAttribute, actualValues.ActualNameInJsonAttribute); Assert.AreEqual(expectedValues.PrivateSetProperty, actualValues.PrivateSetProperty); Assert.AreEqual(expectedValues.ReadOnlyProperty, actualValues.ReadOnlyProperty); Assert.AreEqual(expectedValues.PropertyWithPropertyChanged, actualValues.PropertyWithPropertyChanged); }
private static object createObjectFromSimpleProperty(SimpleProperty property) { return(property.Value); }
private void parseSimpleProperty(SimpleProperty property) { // There is value property.Value = _reader.ReadValue(property.Type); }
private void parseSimpleProperty(IXmlReader reader, SimpleProperty property) { property.Value = _reader.GetAttributeAsObject(Attributes.Value, property.Type); }
private void parseSimpleProperty(XmlReader reader, SimpleProperty property) { var valueAsText = getSimpleValueAttribute(reader); var valueConverter = getSimpleValueConverter(); property.Value = valueConverter.ConvertFromString(valueAsText, property.Type); }
private static string NameOf(SimpleProperty p) => NameOf(p.Name, p.Options.IsCsharp6);
private static Property CreateSimpleProperty(string name, TypeInfo typeInfo, object value) { if (!typeInfo.IsSimple) { return null; } var result = new SimpleProperty(name, typeInfo.Type); result.Value = value; return result; }
private void parseSimpleProperty(SimpleProperty property) { // There is value property.Value = this._reader.ReadValue(property.Type); }
/// <summary> /// Extracts the testable values from a <see cref="SimpleProperty"/> and passes each to <see cref="ProcessJTokenValues" /> /// </summary> /// <param name="prop"></param> /// <param name="editorPath"></param> /// <returns></returns> private List <PreflightPropertyResponseModel> ExtractValuesFromSimpleProperty(SimpleProperty prop, string editorPath) { if (prop.Value == null) { return(new List <PreflightPropertyResponseModel>()); } JObject asJson = JObject.Parse(prop.Value); IEnumerable <JToken> rtes = asJson.SelectTokens(editorPath); return(ProcessJTokenValues(rtes, prop.Name)); }
public Model(ulong id, Element element, Document doc, string name) : base(id, element, name) { shading = "Y"; var sc = Parser.GetRequiredScope(element); var Shading = sc["Shading"]; var Culling = sc["Culling"]; if (Shading != null) { shading = Parser.GetRequiredToken(Shading, 0).StringContents; } if (Culling != null) { culling = Parser.ParseTokenAsString(Parser.GetRequiredToken(Culling, 0)); } props = DocumentUtil.GetPropertyTable(doc, "Model.FbxNode", element, sc); ResolveLink(element, doc); this.QuaternionInterpolate = new SimpleProperty<int>(this.Props, "QuaternionInterpolate", 0); this.RotationOrder = new SimpleProperty<RotOrder>(this.Props, "RotationOrder", (RotOrder)0); this.RotationOffset = new SimpleProperty<Vector3>(this.Props, "RotationOffset", new Vector3()); this.RotationPivot = new SimpleProperty<Vector3>(this.Props, "RotationPivot", new Vector3()); this.ScalingOffset = new SimpleProperty<Vector3>(this.Props, "ScalingOffset", new Vector3()); this.ScalingPivot = new SimpleProperty<Vector3>(this.Props, "ScalingPivot", new Vector3()); this.TranslationActive = new SimpleProperty<bool>(this.Props, "TranslationActive", false); this.TranslationMin = new SimpleProperty<Vector3>(this.Props, "TranslationMin", new Vector3()); this.TranslationMax = new SimpleProperty<Vector3>(this.Props, "TranslationMax", new Vector3()); this.TranslationMinX = new SimpleProperty<bool>(this.Props, "TranslationMinX", false); this.TranslationMaxX = new SimpleProperty<bool>(this.Props, "TranslationMaxX", false); this.TranslationMinY = new SimpleProperty<bool>(this.Props, "TranslationMinY", false); this.TranslationMaxY = new SimpleProperty<bool>(this.Props, "TranslationMaxY", false); this.TranslationMinZ = new SimpleProperty<bool>(this.Props, "TranslationMinZ", false); this.TranslationMaxZ = new SimpleProperty<bool>(this.Props, "TranslationMaxZ", false); this.RotationOrder = new SimpleProperty<RotOrder>(this.Props, "RotationOrder", (RotOrder)0); this.RotationSpaceForLimitOnly = new SimpleProperty<bool>(this.Props, "RotationSpaceForLimitOnly", false); this.RotationStiffnessX = new SimpleProperty<float>(this.Props, "RotationStiffnessX", 0.0f); this.RotationStiffnessY = new SimpleProperty<float>(this.Props, "RotationStiffnessY", 0.0f); this.RotationStiffnessZ = new SimpleProperty<float>(this.Props, "RotationStiffnessZ", 0.0f); this.AxisLen = new SimpleProperty<float>(this.Props, "AxisLen", 0.0f); this.PreRotation = new SimpleProperty<Vector3>(this.Props, "PreRotation", new Vector3()); this.PostRotation = new SimpleProperty<Vector3>(this.Props, "PostRotation", new Vector3()); this.RotationActive = new SimpleProperty<bool>(this.Props, "RotationActive", false); this.RotationMin = new SimpleProperty<Vector3>(this.Props, "RotationMin", new Vector3()); this.RotationMax = new SimpleProperty<Vector3>(this.Props, "RotationMax", new Vector3()); this.RotationMinX = new SimpleProperty<bool>(this.Props, "RotationMinX", false); this.RotationMaxX = new SimpleProperty<bool>(this.Props, "RotationMaxX", false); this.RotationMinY = new SimpleProperty<bool>(this.Props, "RotationMinY", false); this.RotationMaxY = new SimpleProperty<bool>(this.Props, "RotationMaxY", false); this.RotationMinZ = new SimpleProperty<bool>(this.Props, "RotationMinZ", false); this.RotationMaxZ = new SimpleProperty<bool>(this.Props, "RotationMaxZ", false); this.InheritType = new SimpleProperty<TransformInheritance>(this.Props, "InheritType", (TransformInheritance)0); this.ScalingActive = new SimpleProperty<bool>(this.Props, "ScalingActive", false); this.ScalingMin = new SimpleProperty<Vector3>(this.Props, "ScalingMin", new Vector3()); this.ScalingMax = new SimpleProperty<Vector3>(this.Props, "ScalingMax", new Vector3(1.0f, 1.0f, 1.0f)); this.ScalingMinX = new SimpleProperty<bool>(this.Props, "ScalingMinX", false); this.ScalingMaxX = new SimpleProperty<bool>(this.Props, "ScalingMaxX", false); this.ScalingMinY = new SimpleProperty<bool>(this.Props, "ScalingMinY", false); this.ScalingMaxY = new SimpleProperty<bool>(this.Props, "ScalingMaxY", false); this.ScalingMinZ = new SimpleProperty<bool>(this.Props, "ScalingMinZ", false); this.ScalingMaxZ = new SimpleProperty<bool>(this.Props, "ScalingMaxZ", false); this.GeometricTranslation = new SimpleProperty<Vector3>(this.Props, "GeometricTranslation", new Vector3()); this.GeometricRotation = new SimpleProperty<Vector3>(this.Props, "GeometricRotation", new Vector3()); this.GeometricScaling = new SimpleProperty<Vector3>(this.Props, "GeometricScaling", new Vector3(1.0f, 1.0f, 1.0f)); this.MinDampRangeX = new SimpleProperty<float>(this.Props, "MinDampRangeX", 0.0f); this.MinDampRangeY = new SimpleProperty<float>(this.Props, "MinDampRangeY", 0.0f); this.MinDampRangeZ = new SimpleProperty<float>(this.Props, "MinDampRangeZ", 0.0f); this.MaxDampRangeX = new SimpleProperty<float>(this.Props, "MaxDampRangeX", 0.0f); this.MaxDampRangeY = new SimpleProperty<float>(this.Props, "MaxDampRangeY", 0.0f); this.MaxDampRangeZ = new SimpleProperty<float>(this.Props, "MaxDampRangeZ", 0.0f); this.MinDampStrengthX = new SimpleProperty<float>(this.Props, "MinDampStrengthX", 0.0f); this.MinDampStrengthY = new SimpleProperty<float>(this.Props, "MinDampStrengthY", 0.0f); this.MinDampStrengthZ = new SimpleProperty<float>(this.Props, "MinDampStrengthZ", 0.0f); this.MaxDampStrengthX = new SimpleProperty<float>(this.Props, "MaxDampStrengthX", 0.0f); this.MaxDampStrengthY = new SimpleProperty<float>(this.Props, "MaxDampStrengthY", 0.0f); this.MaxDampStrengthZ = new SimpleProperty<float>(this.Props, "MaxDampStrengthZ", 0.0f); this.PreferredAngleX = new SimpleProperty<float>(this.Props, "PreferredAngleX", 0.0f); this.PreferredAngleY = new SimpleProperty<float>(this.Props, "PreferredAngleY", 0.0f); this.PreferredAngleZ = new SimpleProperty<float>(this.Props, "PreferredAngleZ", 0.0f); this.Show = new SimpleProperty<bool>(this.Props, "Show", true); this.LODBox = new SimpleProperty<bool>(this.Props, "LODBox", false); this.Freeze = new SimpleProperty<bool>(this.Props, "Freeze", false); }
public FakeColumManager(SimpleProperty <string> identifier) : base(identifier) { NumberOfColumns = 1; }