// ---------------------------------------------------------------------- // Setup // ---------------------------------------------------------------------- public InteropTypes(RewriterEnvironment env) { this.env = env; TheQualificationProperty = new QualificationProperty(this); TheNamespaceCasingProperty = new NamespaceCasingProperty(this); TheTypeNameCasingProperty = new TypeNameCasingProperty(this); ThePrefixNameCasingProperty = new PrefixNameCasingProperty(this); TheMemberNameCasingProperty = new MemberNameCasingProperty(this); TheRemoveAccessorPrefixProperty = new RemoveAccessorPrefixProperty(this); TheRemoveAccessorUnderscoreProperty = new RemoveAccessorUnderscoreProperty(this); TheDefaultKeyProperty = new DefaultKeyProperty(this); TheGlobalObjectProperty = new GlobalObjectProperty(this); TheScriptProperty = new ScriptProperty(this); ThePassRootAsArgumentProperty = new PassRootAsArgumentProperty(this); ThePassInstanceAsArgumentProperty = new PassInstanceAsArgumentProperty(this); TheInlineParamsArrayProperty = new InlineParamsArrayProperty(this); TheCreationProperty = new CreationProperty(this); TheSimulateMulticastEventsProperty = new SimulateMulticastEventsProperty(this); TheBindToPrototypeProperty = new BindToPrototypeProperty(this); TheLocationsProperty = new LocationsProperty(this); TheIsResourceProperty = new IsResourceProperty(this); TheIsAsyncProperty = new IsAsyncProperty(this); TheConditionProperty = new ConditionProperty(this); TheUndefinedIsNotNullProperty = new UndefinedIsNotNullProperty(this); TheStateProperty = new StateProperty(this); }
/// <summary> /// Default ctor /// </summary> public AutomaticLocController(IRailwayState railwayState) { this.railwayState = railwayState; var dispatcher = railwayState.Dispatcher; locHasNoRouteSince = new Dictionary <ILocState, DateTime>(); routeAvailabilityTester = new LiveRouteAvailabilityTester(railwayState); enabled = new StateProperty <bool>(null, false, null, OnRequestedEnabledChanged, null); heartBeat = new HeartBeat(this, dispatcher); // Register on all state change events. foreach (var iterator in railwayState.LocStates) { var loc = iterator; loc.ControlledAutomatically.RequestedChanged += (s, x) => dispatcher.PostAction(() => OnLocControlledAutomaticallyChanged(loc, false, false)); loc.BeforeReset += (s, x) => dispatcher.PostAction(() => OnLocControlledAutomaticallyChanged(loc, false, true)); loc.AfterReset += (s, x) => dispatcher.PostAction(() => OnAfterResetLoc(loc)); } foreach (var iterator in railwayState.SensorStates) { var sensor = iterator; sensor.Active.ActualChanged += (s, x) => dispatcher.PostAction(() => OnSensorActiveChanged(sensor)); } foreach (var iterator in railwayState.JunctionStates.OfType <ISwitchState>()) { var @switch = iterator; @switch.Direction.ActualChanged += (s, x) => RequestUpdate(); } signals.AddRange(railwayState.SignalStates); }
private static object GetState() { #if UNITY_5_0 return(StateProperty.GetValue(AnimationWindow, null)); #else return(StateField.GetValue(AnimEditor)); #endif }
protected void btnUpload_Click(object sender, EventArgs e) { _objCommon = new Common(); try { var objClsOledbdatalayer = new ClsOleDBDataWrapper(); var path = MapPath(fileUploadExcel.FileName); fileUploadExcel.SaveAs(path); var excelSheets = objClsOledbdatalayer.CountTotalSheets(path); if (excelSheets.Length > 0) { foreach (string t in excelSheets) { DataSet _ds = objClsOledbdatalayer.getdata(path, t); if (_ds.Tables[0].Rows.Count > 0) { for (var j = 0; j <= _ds.Tables[0].Rows.Count - 1; j++) { var errMsg = ""; _objStateProperty = new StateProperty { CountryId = Convert.ToInt16(_ds.Tables[0].Rows[j]["CountryId"]), ZoneId = Convert.ToInt16(_ds.Tables[0].Rows[j]["ZoneId"]), StateName = _ds.Tables[0].Rows[j]["StateName"].ToString() }; int _insert = StateProvider.Instance.InsertStateDetails(Convert.ToString(_ds.Tables[0].Rows[j]["StateName"]), Convert.ToInt32(_ds.Tables[0].Rows[j]["ZoneId"]), Convert.ToInt32(_ds.Tables[0].Rows[j]["CountryId"]), LoggedInUserId, out errMsg); } lblMsg.Focus(); lblMsg.Text = _objCommon.GetErrorMessage("lblSucessMsg"); lblMsg.Visible = true; BindAllState(); } } } else { lblErrorMsg.Text = _objCommon.GetErrorMessage("lblErrMsg"); } } catch (Exception ex) { }; }
public void Awake(GameObject gameObject) { Awake(); //this.ViewGO = gameObject; //this.ViewGO.AddComponent<ComponentView>().Component = this; BodyView = gameObject; TransformComponent.transform = BodyView.transform; if (LocalUnit == this) { SkillDiretorTrm = BodyView.transform.Find("SkillDirector"); SkillDiretorTrm.parent = null; //CharacterMotor = BodyView.GetComponent<KinematicCharacterMotor>(); //CharacterController = BodyView.GetComponent<ExampleCharacterController>(); } AddComponent <AnimatorComponent>().Awake(gameObject.GetComponentInChildren <Animator>()); AddComponent <UnitHUDComponent>(); StateProperty.Subscribe(OnStateChanged); }
private List <StateProperty> BindStateObject(DataTable dataTable) { var objStateList = new List <StateProperty>(); try { if (dataTable.Rows.Count > 0) { for (var j = 0; j < dataTable.Rows.Count; j++) { var objState = new StateProperty { StateName = (dataTable.Rows[j]["AjStateName"] is DBNull) ? null : Convert.ToString(dataTable.Rows[j]["AjStateName"]), StateId = (dataTable.Rows[j]["AjStateId"] is DBNull) ? 0 : Convert.ToInt32(dataTable.Rows[j]["AjStateId"]), CountryId = (dataTable.Rows[j]["AjCountryId"] is DBNull) ? 0 : Convert.ToInt32(dataTable.Rows[j]["AjCountryId"]), CountryName = (dataTable.Rows[j]["AjCountryName"] is DBNull) ? null : Convert.ToString(dataTable.Rows[j]["AjCountryName"]), ZoneId = (dataTable.Rows[j]["AjZoneId"] is DBNull) ? 0 : Convert.ToInt32(dataTable.Rows[j]["AjZoneId"]), ZoneName = (dataTable.Rows[j]["AjZoneName"] is DBNull) ? null : Convert.ToString(dataTable.Rows[j]["AjZoneName"]) }; objStateList.Add(objState); } } } catch (Exception ex) { var err = ex.Message; if (ex.InnerException != null) { err = err + " :: Inner Exception :- " + ex.InnerException.Message; } const string addInfo = "Error while executing BindStateObject in State.cs :: -> "; var objPub = new ClsExceptionPublisher(); objPub.Publish(err, addInfo); } return(objStateList); }
/// <summary> /// Adds the specified name. /// </summary> /// <param name="name">The name.</param> /// <param name="type">The type.</param> /// <param name="value">The value.</param> /// <param name="data">The data.</param> public ICrmAttribute Create(string name, CrmAttributeType type, string value, params string[] data) { Property property = null; switch (type) { case CrmAttributeType.Boolean: property = new CrmBooleanProperty(); break; case CrmAttributeType.Customer: property = new CustomerProperty(); break; case CrmAttributeType.DateTime: property = new CrmDateTimeProperty(); break; case CrmAttributeType.Decimal: property = new CrmDecimalProperty(); break; case CrmAttributeType.Float: property = new CrmFloatProperty(); break; case CrmAttributeType.Integer: property = new CrmNumberProperty(); break; case CrmAttributeType.Lookup: property = new LookupProperty(); break; case CrmAttributeType.Memo: property = new StringProperty(); break; case CrmAttributeType.Money: property = new CrmMoneyProperty(); break; case CrmAttributeType.Owner: property = new OwnerProperty(); break; case CrmAttributeType.Picklist: property = new PicklistProperty(); break; case CrmAttributeType.State: property = new StateProperty(); break; case CrmAttributeType.Status: property = new StatusProperty(); break; case CrmAttributeType.String: property = new StringProperty(); break; case CrmAttributeType.UniqueIdentifier: property = new UniqueIdentifierProperty(); break; case CrmAttributeType.PartyList: property = new DynamicEntityArrayProperty(); break; case CrmAttributeType.Virtual: case CrmAttributeType.CalendarRules: case CrmAttributeType.Internal: case CrmAttributeType.PrimaryKey: break; } this.Add(property); var crmAttributeAdapter = new CrmAttributeAdapter(property) { Name = name }; crmAttributeAdapter.SetValue(value, data); return(crmAttributeAdapter); }
set => SetValue(StateProperty, value);
set => base.SetValue(StateProperty, value);
get => (State)GetValue(StateProperty); set => SetValue(StateProperty, value);
// We have to manually raise this, since it seems to be ignored otherwise. RaisePropertyChanged(StateProperty, value, value);
set => this.SetValue(StateProperty, value);
public Property CreateProperty(string name, CRMSecurityProvider.Sources.Attribute.CrmAttributeType type, string value, params string[] data) { Property property = null; switch (type) { case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Boolean: property = new CrmBooleanProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Customer: property = new CustomerProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.DateTime: property = new CrmDateTimeProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Decimal: property = new CrmDecimalProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Float: property = new CrmFloatProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Integer: property = new CrmNumberProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Lookup: property = new LookupProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Memo: property = new StringProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Money: property = new CrmMoneyProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Owner: property = new OwnerProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Picklist: property = new PicklistProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.State: property = new StateProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Status: property = new StatusProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.String: property = new StringProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.UniqueIdentifier: property = new UniqueIdentifierProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.PartyList: property = new DynamicEntityArrayProperty(); break; case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Virtual: case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.CalendarRules: case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.Internal: case CRMSecurityProvider.Sources.Attribute.CrmAttributeType.PrimaryKey: break; } if (property != null) { SetPropertyValue(property, value, data); } return(property); }
/// <summary> /// Creates the instance. /// </summary> /// <param name="propertyName">Name of the property.</param> /// <param name="value">The value.</param> /// <returns></returns> /// <exception cref="ArgumentException">value</exception> public virtual Property GetProperty(string propertyName, object value) { Property property; if (string.IsNullOrEmpty(propertyName)) { throw new ArgumentException("Property name must be non null.", "propertyName"); } if (value == null) { throw new ArgumentNullException("Property value must be non null.", "value"); } if (string.Compare(propertyName, "StateCode", true, CultureInfo.InvariantCulture) == 0) { property = new StateProperty { Value = (string)value }; } else if (value is string) { property = new StringProperty { Value = (string)value }; } else if (value is UniqueIdentifier) { property = new UniqueIdentifierProperty { Value = (UniqueIdentifier)value }; } else if (value is Status) { property = new StatusProperty { Value = (Status)value }; } else if (value is Picklist) { property = new PicklistProperty { Value = (Picklist)value }; } else if (value is Owner) { property = new OwnerProperty { Value = (Owner)value }; } else if (value is Lookup) { property = new LookupProperty { Value = (Lookup)value }; } else if (value is CrmCampaignIntegration.Services.Key) { property = new KeyProperty { Value = (CrmCampaignIntegration.Services.Key)value }; } else if (value is EntityNameReference) { property = new EntityNameReferenceProperty { Value = (EntityNameReference)value }; } else if (value is DynamicEntity[]) { property = new DynamicEntityArrayProperty { Value = (DynamicEntity[])value }; } else if (value is Customer) { property = new CustomerProperty { Value = (Customer)value }; } else if (value is CrmCampaignIntegration.Services.CrmNumber) { property = new CrmNumberProperty { Value = (CrmCampaignIntegration.Services.CrmNumber)value }; } else if (value is CrmMoney) { property = new CrmMoneyProperty { Value = (CrmMoney)value }; } else if (value is CrmCampaignIntegration.Services.CrmFloat) { property = new CrmFloatProperty { Value = (CrmCampaignIntegration.Services.CrmFloat)value }; } else if (value is CrmDecimal) { property = new CrmDecimalProperty { Value = (CrmDecimal)value }; } else if (value is CrmCampaignIntegration.Services.CrmDateTime) { property = new CrmDateTimeProperty { Value = (CrmCampaignIntegration.Services.CrmDateTime)value }; } else if (value is CrmCampaignIntegration.Services.CrmBoolean) { property = new CrmBooleanProperty { Value = (CrmCampaignIntegration.Services.CrmBoolean)value }; } else { throw new NotSupportedException(string.Format("Unknown value type: {0}", value.GetType())); } property.Name = propertyName; return(property); }