public SuperManModel( Active.SuperMan.Super superobj, BiZ.Member.Member memberobj) { this.superobj = superobj; this.memberobj = memberobj; }
public MainWindowViewModel(ApplicationModel model) { this.model = model; Notes = model.Notes.Transform(x => new NoteViewModel(x)); CurrentNote = new Active<NoteViewModel>(Notes.FirstOrDefault()); Tags = new ObservableCollection<TagViewModel>(); model.Notes.ObserveNoteTagged().Subscribe(OnNoteTagged); }
private void GetIncrement() { string message = ("\nMaximum vertex distance for non-straight segments: "); double defaultValue = _polyFitter.MaxIncrement; double userinput = GetDouble(message, defaultValue); try { _polyFitter.MaxIncrement = userinput; } catch (ArgumentException e) { Active.WriteMessage(e.Message); GetIncrement(); } }
private void GetEndStation() { string message = ("\nEnd station for polyline creation: "); double defaultValue = _polyFitter.EndStation; double userinput = GetDouble(message, defaultValue); try { _polyFitter.EndStation = userinput; } catch (ArgumentException e) { Active.WriteMessage(e.Message); GetEndStation(); } }
private void Rocket(HexCell cell) { HexDirection direction = ParentCharacter.ParentCell.GetDirection(cell); int distance = ParentCharacter.ParentCell.GetDistance(cell); if (distance <= 0) { return; } Active.PlayAudio("gomu gomu no rocket effect"); ThrowCharacter(ParentCharacter, direction, distance * 2); Finish(); }
public override int GetHashCode() { // Use a different bit for bool fields: bool.GetHashCode() will return 0 (false) or 1 (true). So we would // end up having the same hash code for e.g. two instances where one has only noCache set and the other // only noStore. var result = Active.GetHashCode() ^ (Disabled.GetHashCode() << 1); // increase shift by one for every bool field result = result ^ (Mode.GetHashCode() ^ 1); // power of two for every other field(^1, ^2, ^4, ^8, ^16, ...) return(result); }
protected virtual IEnumerator End() { if (Active != null) { yield return(Active.End()); Active = null; if (Parent != null) { yield return(Parent.Init()); } } }
public void Test_AddActive_Failure() { // Arrange var newActive = new Active { ActiveWorkoutId = -1, Comment = "", Status = false, StartDate = DateTime.Now, StartTime = DateTime.Now.TimeOfDay, EndDate = null, EndTime = null }; //Act ActualValueDelegate <object> testDelegate = () => _actProvider.AddActiveRecord(newActive); //Assert Assert.That(testDelegate, Throws.TypeOf <System.Data.Entity.Validation.DbEntityValidationException>()); }
/// <summary> /// Returns true if ProvincialRateType instances are equal /// </summary> /// <param name="other">Instance of ProvincialRateType to be compared</param> /// <returns>Boolean</returns> public bool Equals(ProvincialRateType other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( RateType == other.RateType || RateType.Equals(other.RateType) ) && ( Description == other.Description || Description.Equals(other.Description) ) && ( Active == other.Active || Active.Equals(other.Active) ) && ( PeriodType == other.PeriodType || PeriodType != null && PeriodType.Equals(other.PeriodType) ) && ( Rate == other.Rate || Rate != null && Rate.Equals(other.Rate) ) && ( IsPercentRate == other.IsPercentRate || IsPercentRate.Equals(other.IsPercentRate) ) && ( IsRateEditable == other.IsRateEditable || IsRateEditable.Equals(other.IsRateEditable) ) && ( IsIncludedInTotal == other.IsIncludedInTotal || IsIncludedInTotal.Equals(other.IsIncludedInTotal) ) && ( IsInTotalEditable == other.IsInTotalEditable || IsInTotalEditable.Equals(other.IsInTotalEditable) )); }
/// <summary> /// Returns true if UserViewModel instances are equal /// </summary> /// <param name="other">Instance of UserViewModel to be compared</param> /// <returns>Boolean</returns> public bool Equals(UserViewModel other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id.Equals(other.Id) ) && ( Active == other.Active || Active.Equals(other.Active) ) && ( GivenName == other.GivenName || GivenName != null && GivenName.Equals(other.GivenName) ) && ( Surname == other.Surname || Surname != null && Surname.Equals(other.Surname) ) && ( Email == other.Email || Email != null && Email.Equals(other.Email) ) && ( SmUserId == other.SmUserId || SmUserId != null && SmUserId.Equals(other.SmUserId) ) && ( UserRoles == other.UserRoles || UserRoles != null && UserRoles.SequenceEqual(other.UserRoles) ) && ( District == other.District || District != null && District.Equals(other.District) )); }
/// <summary>Export this pattern as XML</summary> public virtual XElement ToXml(XElement node) { node.Add ( Expr.ToXml(XmlTag.Expr, false), Active.ToXml(XmlTag.Active, false), PatnType.ToXml(XmlTag.PatnType, false), IgnoreCase.ToXml(XmlTag.IgnoreCase, false), Invert.ToXml(XmlTag.Invert, false), WholeLine.ToXml(XmlTag.WholeLine, false), SingleLine.ToXml(XmlTag.SingleLine, false) ); return(node); }
public override int GetHashCode() { int hashCode = 1370643586; hashCode = hashCode * -1521134295 + DoctorID.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(LicenseNumber); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Specialist); hashCode = hashCode * -1521134295 + Active.GetHashCode(); hashCode = hashCode * -1521134295 + VerifiedBy.GetHashCode(); hashCode = hashCode * -1521134295 + UserID.GetHashCode(); return(hashCode); }
public void RenderGui(RenderTexture guiTexture) { RenderTexture.active = null; if (Active != null && !clearDisplay) { Active.RenderGui(guiTexture); } else { GL.Clear(false, true, new Color(0, 0, 0, 1)); clearDisplay = false; } }
public static List <Publisher> FetchPublisherList(Active group = Active.active) { List <Publisher> publishers = new List <Publisher>(); SqlConnection conn = DBConnection.GetDBConnection(); string query = @"SELECT PublisherID, Phone, Active " + @"FROM Publisher "; if (group == Active.active) { query += @"WHERE Active = 1 "; } else if (group == Active.inactive) { query += @"WHERE Active = 0 "; } SqlCommand cmd = new SqlCommand(query, conn); try { conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { Publisher currentPublisher = new Publisher() { PublisherID = reader.GetString(0), Phone = reader.GetString(1) }; publishers.Add(currentPublisher); } } } catch (Exception) { throw; } finally { conn.Close(); } return(publishers); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Active active = db.Actives.Find(id); if (active == null) { return(HttpNotFound()); } return(View(active)); }
public static List <Active> GetActiveList(int type = 0, int tops = 9) { DataTable dt = WebSetDAL.GetDataTable("select top " + tops + " a.* from Active a where a.Status<>9 and Type=" + type); List <Active> list = new List <Active>(); foreach (DataRow dr in dt.Rows) { Active model = new Active(); model.FillData(dr); list.Add(model); } return(list); }
public void PromptExceptionErrorMessage(Active ap, string ProcessName, Exception ex) { ButtonList btnlst = new ButtonList(ErrorButton.OK, ErrorButton.NoButton, ErrorButton.NoButton); ErrorMessageHST errorMessageHST = new ErrorMessageHST(ap, btnlst, ex); errorMessageHST.Format(ex); errorMessageHST.SourceProcess = ProcessName; errorMessageHST.SourceState = ap.CurrentStateName; errorMessageHST.Format(); Log.Error(this, "{0}, ProcessName:{1}, Error:{2}", LoggerCategory.StateTransition, ProcessName, ex.ToString()); ServiceManager.ErrorHandler.RegisterMessage(errorMessageHST); }
public void Dispose() { #if DEBUG AppLock lok; Active.TryRemove(this, out lok); #endif Debug.WriteLine(String.Format("Disposing {0} AppLock for '{1}' (#{2})", IsAcquired ? "acquired" : "unacquired", lockResourceName, GetHashCode())); connection.Dispose(); db.Dispose(); }
public ActionResult Add() { var model = new Active(); model.DateCreated = DateTime.Now; model.UserID = User.Identity.Name; model.ContactPeople = User.Identity.Name; model.ContactPerson = User.Identity.Name; var user = new MembershipService().GetUser(model.UserID); model.PersonPhone = user.Contact; return(View(model)); }
public ActionResult MakeEnd(Active active) { BaseObject obj = new BaseObject(); var a = siteService.GetActive(active.ActiveID); a.EndContent = active.EndContent; siteService.Save(); obj.Tag = 1; return(Json(obj)); }
public void Initialize() { SetupLogger(); SetupViewModelLocator(); SetupThemes(); SetupEvents(); PreparePalettes(); Active.WriteMessage("{0} initialized ...", Constants.APPLICATION_NAME); }
public IActionResult GetOrderList(string payno, string name, string phone, int activeid, int pagesize = 1, int pageno = 1, int status = 1) { var r = new RequestModel(); try { var d = (from e in db.Orders where e.Status >= 0 select e); if (!string.IsNullOrEmpty(payno)) { d = d.Where(s => s.Payno.Contains(payno)); } if (!string.IsNullOrEmpty(name)) { d = d.Where(s => s.RealName.Contains(name)); } if (!string.IsNullOrEmpty(phone)) { d = d.Where(s => s.Phone.Contains(phone)); } if (activeid > 0) { d = d.Where(s => s.ActiveId == activeid); } d = d.Where(c => c.Status == status); List <object> rs = new List <object>(); List <Order> rlist = d.OrderByDescending(c => c.PayTime).Skip(pagesize * (pageno - 1)).Take(pagesize).ToList(); foreach (var item in rlist) { User user = db.Users.Find(item.UserId); Active active = db.Actives.Find(item.ActiveId); rs.Add(new { order = item, user = user, active = active }); } r.data = rs; r.code = 1; r.totalCount = d.Count(); return(Ok(r)); } catch (Exception e) { //打印日志 r.msg = e.Message; } return(Ok(r)); }
private void DoTheWork() { int count = 1; foreach (AlignmentEntity entity in _alignment.Entities) { string message = "\n"; message += $"Entity {count++}: " + $"Type = {entity.EntityType}, " + $"NumberOfSubentities = {entity.SubEntityCount}"; Active.WriteMessage(message); PrintSubEntities(entity); } }
public void ButtonPressed() { Animation buttonAnim = this.gameObject.GetComponent <Animation>(); buttonAnim.Play("button"); audio.Play(); foreach (GameObject target in targets) { Active active = target.GetComponent <Active>(); active.activeThis(); } }
public void QuickAlignmentTest() { using (Transaction transaction = Active.StartTransaction()) { try { UserInput(); } catch (UserCancelledException ex) { Active.WriteMessage(ex.Message); return; } DoTheWork(); transaction.Commit(); } }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { double _indoorTemp_ = 293.00; bool _indoorConst_ = false; DA.GetData(0, ref _indoorTemp_); DA.GetData(1, ref _indoorConst_); Active constTemperature = (_indoorConst_) ? Active.YES : Active.NO; BuildingSettings buildingTemp = new BuildingSettings(_indoorTemp_, constTemperature); DA.SetData(0, buildingTemp); }
public ActiveDetailModel(Active active) { this.MyId = active.MyId; this.Name = active.Name; this.Steps = active.Steps; this.Property = active.Property; this.Plan_Id = active.Plan_Id; Phase = new PhaseService().GetById(active.Phase_Id); Subject = new SubjectService().GetById(active.Subject_Id); Content = new ContentService().GetById(active.Content_Id); Form = new FormService().GetById(active.Form_Id); UserInfo = new UserInfoService().GetById(active.UserInfo_Id); }
public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex) { var entities = chunk.GetNativeArray(ChunkEntityType); var active = chunk.GetNativeArray(ChunkActiveType); for (var i = 0; i < chunk.Count; ++i) { active[i] = new Active { Value = ActiveEntities.Contains(entities[i]) } } ; } }
public bool IsEquelKey(AccountRole role, KeyPair key) { switch (role) { case AccountRole.Owner: if (!Owner.IsNull() && !Owner.KeyAuths.IsNull()) { foreach (var keyAuth in Owner.KeyAuths) { if (keyAuth.IsEquelKey(key)) { Unity.Console.Log(Unity.Console.SetGreenColor("Owner->", key.Public, "\nOwner<-", keyAuth.PublicKey)); return(true); } Unity.Console.Log(Unity.Console.SetRedColor("Owner->", key.Public, "\nOwner<-", keyAuth.PublicKey)); } } return(false); case AccountRole.Active: if (!Active.IsNull() && !Active.KeyAuths.IsNull()) { foreach (var keyAuth in Active.KeyAuths) { if (keyAuth.IsEquelKey(key)) { Unity.Console.Log(Unity.Console.SetGreenColor("Active->", key.Public, "\nActive<-", keyAuth.PublicKey)); return(true); } Unity.Console.Log(Unity.Console.SetRedColor("Active->", key.Public, "\nActive<-", keyAuth.PublicKey)); } } return(false); case AccountRole.Memo: if (!Options.IsNull()) { if (Options.IsEquelKey(key)) { Unity.Console.Log(Unity.Console.SetGreenColor("Memo->", key.Public, "\nMemo<-", Options.MemoKey)); return(true); } Unity.Console.Log(Unity.Console.SetRedColor("Memo->", key.Public, "\nMemo<-", Options.MemoKey)); } return(false); default: return(false); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks hash = hash * 59 + Id.GetHashCode(); hash = hash * 59 + Active.GetHashCode(); if (GivenName != null) { hash = hash * 59 + GivenName.GetHashCode(); } if (Surname != null) { hash = hash * 59 + Surname.GetHashCode(); } if (Email != null) { hash = hash * 59 + Email.GetHashCode(); } if (SmUserId != null) { hash = hash * 59 + SmUserId.GetHashCode(); } if (UserRoles != null) { hash = hash * 59 + UserRoles.GetHashCode(); } if (GroupMemberships != null) { hash = hash * 59 + GroupMemberships.GetHashCode(); } if (District != null) { hash = hash * 59 + District.GetHashCode(); } return(hash); } }
public override void OnActionExecuting(ActionExecutingContext filterContext) { try { HttpSessionStateBase session = filterContext.HttpContext.Session; UserService _userService = new UserService(); Active _active = new Active(); var user = _userService.GetUserById(Convert.ToInt32(session["UserID"])); List <Tbl_Group> grps = _userService.GetUserGroups(Convert.ToInt32(session["UserID"])); if (SubActId != 0) { if (!grps.Any(x => x.Tbl_Group_Activity.Any(y => y.SubAct_ID.Equals(SubActId)))) { filterContext.Result = new RedirectToRouteResult( new RouteValueDictionary { { "Controller", "Home" }, { "Action", "index" } }); } } if (user.Active != _active.GetIntByLiteral("فعال")) // user not active { filterContext.Result = new RedirectToRouteResult( new RouteValueDictionary { { "Controller", "Home" }, { "Action", "ActivitySuspended" } }); } if (session != null && session["UserName"] == null) { filterContext.Result = new RedirectToRouteResult( new RouteValueDictionary { { "Controller", "Home" }, { "Action", "Login" } }); } } catch (Exception ex) { filterContext.Result = new RedirectToRouteResult( new RouteValueDictionary { { "Controller", "Home" }, { "Action", "Login" } }); } }
public static void Demo_OpenCloseTransaction() { try { Circle c = null; using (Transaction t = Active.Database.TransactionManager.StartOpenCloseTransaction()) { c = new Circle(); c.ColorIndex = 3; c.Radius = 200; c.Center = new Point3d(0, 0, 0); BlockTable block_table = t.GetObject(HostApplicationServices.WorkingDatabase.BlockTableId, OpenMode.ForRead) as BlockTable; if (!block_table.Has(BlockTableRecord.ModelSpace)) { return; } BlockTableRecord block_table_record = t.GetObject(block_table[BlockTableRecord.ModelSpace], OpenMode.ForRead) as BlockTableRecord; block_table_record.UpgradeOpen(); if (!block_table_record.IsWriteEnabled) { Active.WriteMessage("Can't open for write"); return; } block_table_record.AppendEntity(c); t.AddNewlyCreatedDBObject(c, true); c.Dispose(); } Active.WriteMessage(c.Radius.ToString()); c.UpgradeOpen(); c.Radius = 300; } catch (System.Exception ex) { ExceptionHandler.WriteToCommandLine(ex); } }
public static Active CreateActive(bool activeBit) { Active active = new Active(); active.activeBit = activeBit; return active; }
//Tied to GameManager to set the Ability based on what's established in the GameInfoManager public void SetPlayerAbility(Active.ActiveType ability) { currentActiveType = ability; }
public void TieAbilityInfo(Active ability) { abilityInfo = ability; abilityInfo.Duration.OnTimerComplete += Despawn; }
//Fire a water projectile where the player is aiming, slows down the player it collides with. public static Active Soak(PlayerScript owner) { Active returnActive = new Active(20.0f, 5.0f); returnActive.ActiveClassification = Active.ActiveType.Soak; //Instantiate the projectile here. returnActive.PrepareProjectiles(1, owner); return returnActive; }
private void OnActiveCooldownEnded() { //Reset the Active currentActive.Cooldown.OnTimerComplete -= OnActiveCooldownEnded; //Stop the cooldown UI display. if (Player_Cooldown_Complete != null) Player_Cooldown_Complete(PlayerNumber); currentActive = null; }
//Create a rectangular strip oriented with the player's beam that speeds up any objects that cross it. public static Active Slipstream(PlayerScript owner) { Active returnActive = new Active(20.0f, 5.0f); returnActive.ActiveClassification = Active.ActiveType.SlipGel; returnActive.PrepareProjectiles(3, owner); return returnActive; }
//Create a rectangular strip along the player's beam that slows down objects that cross it. public static Active Slowstream(PlayerScript owner) { Active returnActive = new Active(20.0f, 5.0f); returnActive.ActiveClassification = Active.ActiveType.SlowGel; //Instantiate the Slowstream object here. returnActive.PrepareProjectiles(3, owner); return returnActive; }
//Self-buff that increases player's speed. public static Active Overclock(PlayerScript owner) { Active returnActive = new Active(20.0f, 5.0f); returnActive.ActiveClassification = Active.ActiveType.Overclock; //Buff the player here and play anim. owner.MaxVelocity = 0.95f; owner.Acceleration = 1.8f; //Add the Tween Component to the player to animate the Overclock effect of overheating. returnActive.InitializeOverclockAnim(owner); return returnActive; }
//Immediately reflect connecting projectile back along its trajectory. public static Active Reflect(PlayerScript owner) { Active returnActive = new Active(20.0f, 1.0f); returnActive.ActiveClassification = Active.ActiveType.Reflect; //Get the connecting object and send it back here, call UseActive(); //Instantiate and play the anim on the player. GameObject reflection = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Actives/Reflect_Generate_Anim"), owner.transform.position, owner.transform.rotation) as GameObject; reflection.transform.parent = owner.gameObject.transform; return returnActive; }
public void TieAbilityInfo(Active ability) { gravFieldActive = ability; ability.Duration.OnTimerComplete += Despawn; }
//Create a zone at the end of the player's beam, zone pulls in objs. public static Active GravityField(PlayerScript owner) { Active returnActive = new Active(20.0f, 5.0f); returnActive.ActiveClassification = Active.ActiveType.GravField; //float distance = 1.0f; //Instantiate a Gravity Field Zone object here. //TODO: Replace with a projectile, travels a short distance before spawning a grav field. returnActive.PrepareProjectiles(1, owner); /* Vector3 objectPos = owner.gameObject.transform.position + (owner.PlayerBeam.transform.right * distance); GameObject gravField = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Actives/GravField"), objectPos, Quaternion.identity) as GameObject; gravField.transform.FindChild("GravField_Anim").GetComponent<GravFieldScript>().GravFieldActive = returnActive; //Tie necessary Active info to the object's script. returnActive.Duration.OnTimerComplete += gravField.transform.FindChild("GravField_Anim").GetComponent<GravFieldScript>().Despawn;*/ return returnActive; }
//Uses the player's Active private void UseActive() { if (currentActive == null) { switch (currentActiveType) { case Active.ActiveType.GravField: currentActive = ActivesTypes.GravityField(this); break; case Active.ActiveType.Reflect: currentActive = ActivesTypes.Reflect(this); break; case Active.ActiveType.SlipGel: currentActive = ActivesTypes.Slipstream(this); break; case Active.ActiveType.Soak: currentActive = ActivesTypes.Soak(this); break; case Active.ActiveType.Overclock: currentActive = ActivesTypes.Overclock(this); break; case Active.ActiveType.SlowGel: currentActive = ActivesTypes.Slowstream(this); break; } if (currentActive != null) { currentActive.UseActive(); currentActive.Duration.OnTimerComplete += OnActiveDurationEnded; if (currentActiveType == Active.ActiveType.Reflect) //Disable collision while Reflect is active. { gameObject.GetComponent<Rigidbody2D>().drag = 250; //Well we can't disable collision for a while sooooo crank drag the f**k up. } //Show the Cooldown overlay on the HUD if (Player_Cooldown_Start != null) Player_Cooldown_Start(PlayerNumber); } } }
/// <summary> /// Add a new activation. /// </summary> /// <param name="active"></param> private void Add(Active active) { mActiveList.Add(active); }
public TagViewModel(string tag, ObservableCollection<Note> notes) { Tag = tag; this.notes = notes; Count = new Active<int>(CountTaggedNotes()); notes.ObserveNoteTagged().Subscribe(OnNoteTagged); }
public Note() { Title = new Active<string>("Note Title"); Text = new Active<string>(""); Tags = new ObservableCollection<string>(); }
public void AddToActive(Active active) { base.AddObject("Active", active); }