private void setBindings() { TypesofAgreement typesofAgreement = new TypesofAgreement(); Binding binding1 = new Binding(); binding1.Source = typesofAgreement; cboTypeofAgreement.SetBinding(ListBox.ItemsSourceProperty, binding1); Statuses statuses = new Statuses(); Binding binding2 = new Binding(); binding2.Source = statuses; cboStatus.SetBinding(ListBox.ItemsSourceProperty, binding2); UIDepartments departments = new UIDepartments(); Binding binding3 = new Binding(); binding3.Source = departments; cboUIDepartment.SetBinding(ListBox.ItemsSourceProperty, binding3); ReimbursementPeriods reimbursementPeriods = new ReimbursementPeriods(); Binding binding4 = new Binding(); binding4.Source = reimbursementPeriods; cboReimbursement1Period.SetBinding(ListBox.ItemsSourceProperty, binding4); cboReimbursement2Period.SetBinding(ListBox.ItemsSourceProperty, binding4); cboReimbursement3Period.SetBinding(ListBox.ItemsSourceProperty, binding4); cboTravelReimbursementPeriod.SetBinding(ListBox.ItemsSourceProperty, binding4); }
public TwitterClient(IRestClient client, string consumerKey, string consumerSecret, string callback) : base(client) { Encode = true; Statuses = new Statuses(this); Account = new Account(this); DirectMessages = new DirectMessages(this); Favourites = new Favourites(this); Block = new Block(this); Friendships = new Friendship(this); Lists = new List(this); Search = new Search(this); Users = new Users(this); FriendsAndFollowers = new FriendsAndFollowers(this); OAuthBase = "https://api.twitter.com/oauth/"; TokenRequestUrl = "request_token"; TokenAuthUrl = "authorize"; TokenAccessUrl = "access_token"; Authority = "https://api.twitter.com/"; Version = "1"; #if !SILVERLIGHT ServicePointManager.Expect100Continue = false; #endif Credentials = new OAuthCredentials { ConsumerKey = consumerKey, ConsumerSecret = consumerSecret, }; if (!string.IsNullOrEmpty(callback)) ((OAuthCredentials)Credentials).CallbackUrl = callback; }
public void CanRefreshAddToExistingTweetsCollection() { // setup twitter api mock return values Statuses statuses = new Statuses(); statuses.Add(new Status { Id = "000", CreatedAt = DateTime.Today }); statuses.Add(new Status { Id = "111", CreatedAt = DateTime.Today.AddDays(-2) }); statuses.Add(new Status { Id = "222", CreatedAt = DateTime.Today.AddDays(-4) }); // add some tweets to tweet manager _tweetsManager.All.Add(new Status { Id = "888", CreatedAt = DateTime.Today.AddDays(-10) }); _tweetsManager.All.Add(new Status { Id = "999", CreatedAt = DateTime.Today.AddDays(-12) }); // record Expect.Call(_twitterApiClient.FriendsTimelineSince("888")).Return(statuses); // playback _mocks.ReplayAll(); _tweetsManager.Refresh(); // assert Assert.AreEqual(5, _tweetsManager.All.Count); Assert.AreEqual("000", _tweetsManager.All[0].Id); Assert.AreEqual("111", _tweetsManager.All[1].Id); Assert.AreEqual("222", _tweetsManager.All[2].Id); Assert.AreEqual("888", _tweetsManager.All[3].Id); Assert.AreEqual("999", _tweetsManager.All[4].Id); _mocks.VerifyAll(); }
public IdenticaClient(string username, string password) { Statuses = new Statuses(this); Account = new Account(this); DirectMessages = new DirectMessages(this); Favourites = new Favourites(this); Block = new Block(this); Friendships = new Friendship(this); Lists = new List(this); Search = new Search(this); Users = new Users(this); FriendsAndFollowers = new FriendsAndFollowers(this); Credentials = new BasicAuthCredentials { Username = username, Password = password }; Client = new RestClient { Authority = "http://identi.ca/api", }; Authority = "http://identi.ca/api"; Encode = false; }
public fingerprint(string username, string account, string protocol, string fingerprint, Statuses status) { Username = username; Account = account; Protocol = protocol; Fingerprint = fingerprint; Status = status; }
public void Pause() { if (Status == Statuses.Finished) { throw new Exception(); } Status = Statuses.Paused; }
public void SetDownload(float progress, float speed) { this.m_status = Statuses.Download; this.m_prog = progress > 1 ? 1 : progress; this.m_speed = speed; this.Invalidate(); }
private void refreshFilterOptions(String statusSQL) { Statuses statuses = new Statuses(); statuses.resetStatuses(statusSQL); Binding binding2 = new Binding(); binding2.Source = statuses; lstStatusSelect.SetBinding(ListBox.ItemsSourceProperty, binding2); }
public void SetImage(Image image, MediaTypes type) { this.m_status = Statuses.Complete; this.m_image = image; this.m_type = type; this.CheckPosition(); this.Invalidate(); }
public void Die() { if (isPlayer) { //todo: player death Debug.Log("Player " + playerID + " Killed!"); return; } Status = Statuses.DISABLED; iTween.ScaleTo(gameObject, iTween.Hash("scale", Vector3.zero, "time", 0.5f, "easetype", iTween.EaseType.easeInOutQuart, "oncompletetarget", gameObject, "oncomplete", "DieAfterAnimation")); }
public Task(int id, int templateId, string website, string timestamp, int depth) { this._TemplateID = templateId; this._Website = website; this._Timestamp = DateTime.Parse(timestamp); this._Depth = depth; this._ID = id; _Status = Statuses.Open; _Progress = 0; _curDepth = 0; _Results = 0; }
private MaintenanceItem(string name, string desc, DateTime issueDate, Property property, Statuses status, List<Tenant> tenantsInvolved, RequestorTypes requestedBy, double estimatedCost, DateTime ealiestDue, DateTime latestDue, Priorities priority, TimeSpan estimatedTimeTaken,bool isServiceCall) : base(name, desc, issueDate, property, status, tenantsInvolved) { InstanceID = "Mnt_" + new string(InstanceID.Skip(4).ToArray()); Priority = priority; RequestedBy = requestedBy; EstimatedCost = estimatedCost; EstimatedTimeTaken = estimatedTimeTaken; EarliestDueDate = ealiestDue; LatestDueDate = latestDue; IsServiceCall = isServiceCall; }
public Occurence(string name, string desc, DateTime date, Property address, Statuses status, IEnumerable<Tenant> tenantsInvolved) { InstanceName = name; Description = desc; IncidentDate = date; Location = address; Status = status; InstanceID = "Occ_" + NextID++; if (tenantsInvolved == null) { TenantsInvolved = new List<Tenant>(); } else { TenantsInvolved = tenantsInvolved.ToList(); } }
public static Statuses ModelToEnity(this StatusesModel model, bool virtualActive = false) { Statuses entity = new Statuses() { Name=model.Name, Id = model.Id, IsActive = model.IsActive }; if (virtualActive) { entity.RoomStatuses = model.RoomStatuses; } return entity; }
public void Start() { Status = Statuses.Running; Task.Run( () => { var root = fileSystem[RootPath]; var enumerable = root.SubDirectories.Select(CreateFolder).ToList(); enumerable.Add(CreateFolder(root)); Folders = enumerable; Status = Statuses.Finished; }); }
public void BeginUserTimeline_ForAnonymousUser_ReturnsAtLeastOneTweet() { var wasCalled = false; var twitterClient = Substitute.For<IBaseTwitterClient>(); twitterClient.SetReponseBasedOnRequestPath(); var statuses = new Statuses(twitterClient); // assert GenericResponseDelegate endUserTimeline = (a, b, c) => { wasCalled = true; var tweets = c as IEnumerable<Tweet>; Assert.That(tweets.Count(), Is.GreaterThan(0)); }; // act statuses.BeginUserTimeline("someone", endUserTimeline); Assert.That(wasCalled, Errors.CallbackDidNotFire); }
public void BeginGetTweet_WhichFindsATweet_ReturnsSuccessfulTweet() { var wasCalled = false; var twitterClient = Substitute.For<IBaseTwitterClient>(); twitterClient.SetResponse(File.ReadAllText(@".\Data\statuses\show-existing.txt")); var statuses = new Statuses(twitterClient); // assert GenericResponseDelegate endGetTweet = (a, b, c) => { wasCalled = true; var tweet = c as Tweet; Assert.That(tweet, Is.Not.Null); Assert.That(tweet.Id, Is.EqualTo(16381619317248000)); }; // act statuses.BeginGetTweet("16381619317248000", endGetTweet); Assert.That(wasCalled, Errors.CallbackDidNotFire); }
internal TaskEntry(TasksQueue tasks, DateTime executionDate, Statuses initialStatus, Action<TaskEntry> callback) { ASSERT( (initialStatus == Statuses.Delayed) || (initialStatus == Statuses.Queued), "Invalid 'initialStatus'" ); ASSERT( executionDate.Kind == DateTimeKind.Utc, "'executionDate' is not in UTC" ); ID = Guid.NewGuid(); LockObject = this; Tasks = tasks; ExecutionDate = executionDate; Status = initialStatus; Callback = callback; if( Tasks.TransferCultureInfo ) { CreatorCultureInfo = Thread.CurrentThread.CurrentCulture; CreatorUICultureInfo = Thread.CurrentThread.CurrentUICulture; } else { CreatorCultureInfo = null; CreatorUICultureInfo = null; } }
public int GetContestStatusesCount() { return(Statuses.Where(x => x.Time >= Contest.Begin && x.Time < Contest.End).Count()); }
public Employee(int id, string name, Roles role, string email, string password, Statuses condition, int createUid, DateTime createDate, int writeUid, DateTime writeDate) : base(id, createDate, createUid, writeDate, writeUid) { Name = name; Role = role; Email = email; Password = password; Status = condition; }
public IEnumerable <Status> GetContestStatuses() { return(Statuses.Where(x => x.Time >= Contest.Begin && x.Time < Contest.End)); }
internal Status AddStatus(int id, Status toAdd) { Statuses.Add(id, toAdd); return(toAdd); }
public void StartEvent() { //Random rand = new Random(Guid.NewGuid().GetHashCode()); int count = NPCs.Count; if (count > 0) { Console.Write("You see "); Console.ForegroundColor = ConsoleColor.Red; Console.Write(count > 1 ? count.ToString() + " " + NPCs[0].name + "s" : "a " + NPCs[0].name); Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("."); if (rand.Next(100) < 90) // 10% chance to get spooted { // hidden heroStatus = Statuses.Hidden_Far; } else { // spotted heroStatus = Statuses.Spotted; } } else // no NPC's { heroStatus = Statuses.Clear; } while (true) { string replyString = AskPlayerAQuestion(); if (replyString == "" || replyString == null) { ThrowUnexpectedMessage(); continue; } char reply = replyString[0]; switch (reply) { case 's': if (heroStatus == Statuses.Hidden_Far) { if (hero.SneakCheck(1)) // trying to sneak closer { heroStatus = Statuses.Hidden_Close; } else { heroStatus = Statuses.Spotted; } } else if (heroStatus == Statuses.Hidden_Close) { if (hero.SneakCheck(1.5)) // trying to perform sneak attack { Console.Write("You've "); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("killed "); Console.ForegroundColor = ConsoleColor.Red; Console.Write(NPCs[0].name); Console.ForegroundColor = ConsoleColor.White; NPCs.RemoveAt(0); if (NPCs.Count > 0) { if (hero.SneakCheck(1)) // check stealth after attack (to hide body) { Console.WriteLine(" and wasn't spooted."); } else { // spotted after attack Console.WriteLine(" but was spotted. Prepare to fight!"); heroStatus = Statuses.Spotted; } } else { // check NPC count Console.WriteLine(" and it was the last of them."); heroStatus = Statuses.Clear; break; } } else { // spotted before attack Console.Write("You've tried to attack "); Console.ForegroundColor = ConsoleColor.Red; Console.Write(NPCs[0].name); Console.ForegroundColor = ConsoleColor.White; Console.WriteLine(" but he spotted you before. Prepare to fight!"); heroStatus = Statuses.Spotted; } } else { ThrowUnexpectedMessage(); } break; case 'a': if (heroStatus == Statuses.Hidden_Far || heroStatus == Statuses.Spotted) { Console.WriteLine("You draw your weapon and take a battle stance."); // proceed to fighting heroStatus = Statuses.Fighting; } else if (heroStatus == Statuses.Fighting) { int targetIndex = 0; NPC target; if (NPCs.Count > 1) { Console.WriteLine("Choose target to attack: "); for (int i = 0; i < NPCs.Count; i++) { Console.WriteLine((i + 1).ToString() + ". " + NPCs[i].name + (NPCs[i].HP < NPCs[i].maxHP ? " (wounded)" : "")); } while (true) { // trying to get index from player try { targetIndex = Convert.ToInt32(Console.ReadLine()) - 1; // possible exception target = NPCs[targetIndex]; // possible exception break; } catch { ThrowUnexpectedMessage(); } } } else { target = NPCs[targetIndex]; } // attacking NPC int damage = hero.Attack(ref target); Console.Write("You attacked "); Console.ForegroundColor = ConsoleColor.Red; Console.Write(target.name); Console.ForegroundColor = ConsoleColor.White; if (damage > 0) { Console.Write(" and did "); Console.ForegroundColor = ConsoleColor.Magenta; Console.Write(damage.ToString()); Console.ForegroundColor = ConsoleColor.White; Console.WriteLine(" damage."); } else { Console.Write(" but "); Console.ForegroundColor = ConsoleColor.Magenta; Console.Write("missed"); Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("."); } if (target.HP <= 0) { // HP check Console.ForegroundColor = ConsoleColor.Red; Console.Write(target.name); Console.ForegroundColor = ConsoleColor.White; Console.WriteLine(" is dead."); NPCs.RemoveAt(targetIndex); if (NPCs.Count <= 0) // clear check { Console.WriteLine("Looks like there is no one left standing except you."); heroStatus = Statuses.Clear; break; // if clear it breaks here } } heroStatus = Statuses.Fighting; AttackHero(); // attacking hero } break; case 'r': // trying to run away if (heroStatus == Statuses.Hidden_Close || heroStatus == Statuses.Hidden_Far) { // if not spotted chances to run are 100% Console.WriteLine("You ran away."); heroStatus = Statuses.Away; } else if (heroStatus == Statuses.Spotted || heroStatus == Statuses.Fighting) { if (rand.Next(2) == 1) { // if spotted chances to run are 50% Console.WriteLine("You ran away."); heroStatus = Statuses.Away; } else { Console.WriteLine("You wasn't able to run away."); heroStatus = Statuses.Fighting; AttackHero(); // attacking hero } } else { ThrowUnexpectedMessage(); } break; case 'g': // go before looting if (heroStatus == Statuses.Clear) { Console.WriteLine("You leave this place."); heroStatus = Statuses.Away; } else { ThrowUnexpectedMessage(); } break; case 'l': if (heroStatus == Statuses.Clear) // start looting { GenerateLoot(); if (Loot.Count <= 0) { Console.WriteLine("You have found nothing and decide to leave this place."); heroStatus = Statuses.Away; break; } int itemIndex; Item item; while (true) { // trying to get index from player Console.WriteLine("You've found these items:"); for (int i = 0; i < Loot.Count; i++) { Console.WriteLine((i + 1).ToString() + ". " + Loot[i].ToString()); } Console.Write("Input index to take item or (leave): "); string lootReply = Console.ReadLine().ToLower(); if (lootReply == "leave" || lootReply == "l") { Console.WriteLine("You leave this place."); heroStatus = Statuses.Away; break; } try { itemIndex = Convert.ToInt32(lootReply) - 1; // possible exception item = Loot[itemIndex]; // possible exception hero.AddItem(item); Loot.RemoveAt(itemIndex); } catch { ThrowUnexpectedMessage(); break; } if (Loot.Count <= 0) { Console.WriteLine("There is nothing more. You leave this place."); heroStatus = Statuses.Away; break; } } } else { ThrowUnexpectedMessage(); } break; case 'i': hero.ManageInventory(); break; case 'c': hero.ShowStats(); break; default: ThrowUnexpectedMessage(); break; } if (heroStatus == Statuses.Dead || heroStatus == Statuses.Away) { break; } } }
public async Task <ResponseModel <Statuses> > CreateStatus(Statuses statuses) { ResponseModel <Statuses> response = InitializeStatuses(); return(await CreateRecord(statuses, response)); }
public StatusesDetailsViewModel(Statuses statuses) { this.statuses = statuses; CanLoadMore = false; CommentDisplay = statuses.CommentCount > 0 ? statuses.CommentCount.ToString() : "评论"; }
public async Task UpdateStatuses(long maxid = 0, bool clear = true) { if (UpdatingStatusSearch) { return; } if (string.IsNullOrWhiteSpace(_statusSearchWords) || Tokens == null) { return; } UpdatingStatusSearch = true; if (maxid == 0 && clear) { Statuses.Clear(); } IEnumerable <Status> search; if (SettingService.Setting.UseOfficialApi && TwitterConnectionHelper.OfficialConsumerKeyList.Contains(Tokens.ConsumerKey)) { var param = new Dictionary <string, object> { { "q", _statusSearchWords }, { "count", 20 }, { "result_type", "recent" }, { "modules", "status" }, { "tweet_mode", CoreTweet.TweetMode.Extended } }; if (maxid != 0) { param["q"] = param["q"] + " max_id:" + maxid; } try { var res = await Tokens.TwitterTokens.SendRequestAsync(CoreTweet.MethodType.Get, "https://api.twitter.com/1.1/search/universal.json", param); var json = await res.Source.Content.ReadAsStringAsync(); var jsonObject = JObject.Parse(json); var modules = jsonObject["modules"].Children <JObject>(); var tweets = new List <CoreTweet.Status>(); foreach (var status in modules) { foreach (var prop in status.Properties()) { if (prop.Name == "status") { tweets.Add( CoreTweet.Core.CoreBase.Convert <CoreTweet.Status>( JsonConvert.SerializeObject(status["status"]["data"]))); } } } search = tweets.Select(x => new Status(x)); } catch { if (maxid == 0 && clear) { Statuses.Clear(); } UpdatingStatusSearch = false; return; } } else { var param = new Dictionary <string, object> { { "count", 20 }, { "include_entities", true }, { "q", _statusSearchWords }, { "tweet_mode", CoreTweet.TweetMode.Extended } }; if (maxid != 0) { param.Add("max_id", maxid); } try { search = await Tokens.Search.TweetsAsync(param); } catch { if (maxid == 0 && clear) { Statuses.Clear(); } UpdatingStatusSearch = false; return; } } if (maxid == 0 && clear) { Statuses.Clear(); } foreach (var status in search) { Connecter.Instance.TweetReceive_OnCommandExecute(this, new TweetEventArgs(status, Tokens.UserId, new List <string> { "none://" }, false)); var id = status.HasRetweetInformation ? status.RetweetInformation.Id : status.Id; var index = Statuses.IndexOf( Statuses.FirstOrDefault(x => (x.HasRetweetInformation ? x.RetweetInformation.Id : x.Id) == id)); if (index == -1) { index = Statuses.IndexOf( Statuses.FirstOrDefault(x => (x.HasRetweetInformation ? x.RetweetInformation.Id : x.Id) < id)); if (index == -1) { Statuses.Add(status); } else { Statuses.Insert(index, status); } } } UpdatingStatusSearch = false; }
///<summary> ///set status to dead ///</summary> public void SetDead() { IsCarryingFlag = false; _status = Statuses.Dead; }
public StatusesEditPage(Statuses statuses, Action <Statuses> result) : base() { this.result = result; Init(statuses); }
public StatusesEditPage(Statuses statuses) : base() { Init(statuses); }
/// <summary> /// Determines whether an application has a status /// </summary> /// <param name="status">status of the application</param> /// <returns>boolean perdicting whether the application has a status</returns> public bool HasStatus(EApplicationStatus status) { return(Statuses.Any(x => x.Status == status)); }
/// <summary> /// Current Status of the Application /// </summary> /// <returns>Last Item in status history</returns> public EApplicationStatus CurrentStatus() { return(Statuses.Last().Status); }
public Employee(string name, Roles role, string email, string password, int createUid, int writeUid, Statuses condition = Statuses.Active) : base(createUid, writeUid) { Name = name; Role = role; Email = email; Password = password; Status = condition; }
public static void WriteMessages(StateSpaceComponents spaceComponents, SpriteBatch spriteBatch, Camera camera, SpriteFont font, DungeonTile[,] dungeonGrid) { float opacity = 1.15f; float decrement = .09f; int messageNumber = 0; int messageSpacing = (int)font.MeasureString("g").Y + 1;; //Draw message log if (spaceComponents.GameMessageComponent.IndexBegin > 0) { float textHeight = font.MeasureString(Messages.ScrollingMessages).Y; spriteBatch.DrawString(font, Messages.ScrollingMessages, new Vector2(10, (int)camera.DungeonUIViewport.Bounds.Bottom - (int)textHeight - 10 - (messageNumber * messageSpacing)), Color.MediumVioletRed); messageNumber += 1; } foreach (Tuple <Color, string> message in spaceComponents.GameMessageComponent.GameMessages.Reverse <Tuple <Color, string> >().Skip(spaceComponents.GameMessageComponent.IndexBegin)) { if (opacity < 0) { break; } opacity -= decrement; string text = MessageDisplaySystem.WordWrap(font, message.Item2, camera.DungeonUIViewport.Width - 20); float textHeight = font.MeasureString(text).Y; spriteBatch.DrawString(font, text, new Vector2(10, (int)camera.DungeonUIViewport.Bounds.Bottom - (int)textHeight - 10 - (messageNumber * messageSpacing)), message.Item1 * opacity); messageNumber += Regex.Matches(text, System.Environment.NewLine).Count; messageNumber += 1; } while (spaceComponents.GameMessageComponent.GameMessages.Count > spaceComponents.GameMessageComponent.MaxMessages) { spaceComponents.GameMessageComponent.GameMessages.RemoveAt(0); } spriteBatch.DrawString(font, spaceComponents.GameMessageComponent.GlobalMessage, new Vector2(10, camera.Bounds.Height - messageSpacing), spaceComponents.GameMessageComponent.GlobalColor); messageNumber = 0; //Draw statistics List <Tuple <Color, string> > statsToPrint = new List <Tuple <Color, string> >(); GameplayInfoComponent gameplayInfo = spaceComponents.GameplayInfoComponent; statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, string.Format("Floor {0}", gameplayInfo.FloorsReached))); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, string.Format("Steps: {0}", gameplayInfo.StepsTaken))); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, string.Format("Kills: {0}", gameplayInfo.Kills))); Entity player = spaceComponents.Entities.Where(x => (x.ComponentFlags & ComponentMasks.Player) == ComponentMasks.Player).FirstOrDefault(); if (player != null) { SkillLevelsComponent skills = InventorySystem.ApplyStatModifications(spaceComponents, player.Id, spaceComponents.SkillLevelsComponents[player.Id]); InventoryComponent inventory = spaceComponents.InventoryComponents[player.Id]; statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, System.Environment.NewLine)); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, string.Format("Health: {0} / {1}", skills.CurrentHealth, skills.Health))); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, string.Format("Wealth: {0}", skills.Wealth))); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, System.Environment.NewLine)); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, string.Format("Damage: {0}-{1}", skills.MinimumDamage, skills.MaximumDamage))); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, string.Format("Accuracy: {0}", skills.Accuracy))); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, string.Format("Defense: {0}", skills.Defense))); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, System.Environment.NewLine)); //Status Effects: Statuses statuses = StatusSystem.GetStatusEffectsOfEntity(spaceComponents, player.Id, dungeonGrid); if (statuses == Statuses.NONE) { statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, Messages.StatusMessages.Normal)); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, System.Environment.NewLine)); } //If there are status effects on the player.. else { if ((statuses & Statuses.BURNING) == Statuses.BURNING) { BurningComponent burning = spaceComponents.BurningComponents[player.Id]; statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Bad, string.Format(Messages.StatusMessages.Burning, burning.MinDamage, burning.MaxDamage, burning.TurnsLeft))); } if ((statuses & Statuses.UNDERWATER) == Statuses.UNDERWATER) { statsToPrint.Add(new Tuple <Color, string>(Colors.Caves.WaterInRange, Messages.StatusMessages.Underwater)); } if ((statuses & Statuses.HEALTHREGEN) == Statuses.HEALTHREGEN) { HealthRegenerationComponent healthRegen = spaceComponents.HealthRegenerationComponents[player.Id]; statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Good, string.Format(Messages.StatusMessages.HealthRegen, healthRegen.HealthRegain, healthRegen.RegenerateTurnRate))); } statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, System.Environment.NewLine)); } statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Special, string.Format(Messages.InventoryArtifacts + " ({0}/{1})", inventory.Artifacts.Count, inventory.MaxArtifacts))); foreach (Guid id in inventory.Artifacts) { NameComponent name = spaceComponents.NameComponents[id]; ArtifactStatsComponent artifactStats = spaceComponents.ArtifactStatsComponents[id]; statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.LootPickup, string.Format("{0} Lv{1}", name.Name, artifactStats.UpgradeLevel))); } statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, System.Environment.NewLine)); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Special, string.Format(Messages.InventoryConsumables + " ({0}/{1})", inventory.Consumables.Count, inventory.MaxConsumables))); if (inventory.Consumables.Count > 0) { statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, System.Environment.NewLine)); NameComponent name = spaceComponents.NameComponents[inventory.Consumables[0]]; ItemFunctionsComponent funcs = spaceComponents.ItemFunctionsComponents[inventory.Consumables[0]]; statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.LootPickup, string.Format("{0}({1})", name.Name, funcs.Uses))); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, "Q - Use")); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, "X - Throw")); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, System.Environment.NewLine)); if (inventory.Consumables.Count > 1) { name = spaceComponents.NameComponents[inventory.Consumables[1]]; funcs = spaceComponents.ItemFunctionsComponents[inventory.Consumables[1]]; statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.LootPickup, string.Format("{0}({1})", name.Name, funcs.Uses))); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, "E - Use")); statsToPrint.Add(new Tuple <Color, string>(Colors.Messages.Normal, "C - Throw")); } } } if (font != null) { foreach (Tuple <Color, string> stat in statsToPrint) { string text = MessageDisplaySystem.WordWrap(font, stat.Item2, camera.DungeonUIViewportLeft.Width - messageSpacing); Vector2 messageSize = font.MeasureString(stat.Item2); spriteBatch.DrawString(font, text, new Vector2(camera.DungeonUIViewportLeft.X + 10, 10 + (messageSpacing * messageNumber)), stat.Item1); messageNumber += 1; messageNumber += Regex.Matches(text, System.Environment.NewLine).Count; } } }
///<summary> ///constructor ///</summary> ///<param name="entitySceneObject"></param> ///<param name="pos"></param> public BotEntity(IEntitySceneObject entitySceneObject, Vector2 pos) : base(entitySceneObject, pos, GameManager.GameManager.Instance.Parameters.BotScale, Vector2.Zero, GameManager.GameManager.Instance.Parameters.BotMaxSpeed, Vector2.One, // initial heading GameManager.GameManager.Instance.Parameters.BotMass, Vector2.Normalize(Vector2.One)* GameManager.GameManager.Instance.Parameters.BotScale, GameManager.GameManager.Instance.Parameters.BotMaxHeadTurnRate, GameManager.GameManager.Instance.Parameters.BotMaxForce) { _maxHealth = GameManager.GameManager.Instance.Parameters.BotMaxHealth; CurrentHealth = 10; _pathPlanner = null; _steering = null; _brain = null; NumUpdatesHitPersistent = (int) GameManager.GameManager.Instance.Parameters.HitFlashTime; Hit = false; Score = 0; _status = Statuses.Spawning; IsPossessed = false; _fieldOfView = MathHelper.ToRadians(GameManager.GameManager.Instance.Parameters.BotFOV); _maxNormalSpeed = GameManager.GameManager.Instance.Parameters.BotMaxSpeed; _maxSwimmingSpeed = GameManager.GameManager.Instance.Parameters.BotMaxSwimmingSpeed; _maxCrawlingSpeed = GameManager.GameManager.Instance.Parameters.BotMaxCrawlingSpeed; EntityType = EntityTypes.Bot; //a bot starts off facing in the direction it is heading Facing = Heading; //create the navigation module _pathPlanner = new PathPlanner(this); //create the steering behavior class _steering = new Steering.Steering(this); //create the regulators _weaponSelectionRegulator = new Regulator( GameManager.GameManager.Instance.Parameters.BotWeaponSelectionFrequency); _goalArbitrationRegulator = new Regulator( GameManager.GameManager.Instance.Parameters.BotGoalAppraisalUpdateFreq); _targetSelectionRegulator = new Regulator( GameManager.GameManager.Instance.Parameters.BotTargetingUpdateFreq); _triggerTestRegulator = new Regulator( GameManager.GameManager.Instance.Parameters.BotTriggerUpdateFreq); _visionUpdateRegulator = new Regulator( GameManager.GameManager.Instance.Parameters.BotVisionUpdateFreq); //create the goal queue _brain = new Think(this); //create the targeting system _targetingSystem = new TargetingSystem(this); _weaponSystem = new WeaponSystem(this, GameManager.GameManager.Instance.Parameters.BotReactionTime, GameManager.GameManager.Instance.Parameters.BotAimAccuracy, GameManager.GameManager.Instance.Parameters.BotAimPersistence); _sensoryMemory = new SensoryMemory( this, GameManager.GameManager.Instance.Parameters.BotMemorySpan); _navigationalMemory = new NavigationalMemory(this, GameManager.GameManager.Instance.Parameters.NavigationMemorySpan); //temp debbugging code _navigationalMemory.DumpFrequency = 10000; // 10 seconds FoundTriggers = new FoundTriggerList(Team); _logPrefixText = String.Format("[{0,-8}] [{1,17}.", Name, "BotEntity"); }
public BaseTask(double estimation, TaskEnums type, string title, string discription, User creator, Statuses status = Statuses.BackLog) { Estimation = estimation; Type = type; Title = title; Discription = discription; Id = Guid.NewGuid().ToString(); taskCreator = creator; _createdDate = DateTime.Now; UpdatedDate = DateTime.Now; Status = status; }
/// <summary> /// Loads the given file name and start playing it /// </summary> /// <param name="filename"></param> public void LoadFile(string filename) { // Stop a previous file that is currently being played if (m_audioProcessingThread != null) { Stop(); } m_filename = filename; m_status = Statuses.Loading; // Create the Audio Processing Worker (Thread) m_audioProcessingThread = new Thread( new ThreadStart( audioProcessingWorker_DoWork) ); m_audioProcessingThread.Name = "AudioProcessingThread"; m_audioProcessingThread.IsBackground = true; m_audioProcessingThread.Priority = ThreadPriority.Highest; // Important: MTA is needed for WMFSDK to function properly (for WMA support) // All WMA (COM) related actions MUST be done within the Thread's MTA otherwise there is a COM exception m_audioProcessingThread.SetApartmentState( ApartmentState.MTA ); // Allow initialization to start >>Inside<< the thread, the thread will stop and wait for a pulse m_audioProcessingThread.Start(); // Wait for thread for finish initialization lock (InitializedLock) { if (!Monitor.Wait(InitializedLock, 5000)) { m_logger.Error("Initialization lock timeout"); } } }
/// <summary> /// Removes the temporary status from the rocket /// </summary> public void RemoveTemp() { //saves the status as not being temporary status = Statuses.snapped; }
/// <summary> /// Détermine le poids du statut /// </summary> /// <param name="status">Statut à tester</param> /// <returns>Retourne le poids du statut.</returns> public static int GetStatusWeight(Statuses status) { int valstatus; switch (status) { case Statuses.Fail: valstatus = 3; break; case Statuses.OK: valstatus = 2; break; default: valstatus = 1; break; } return valstatus; }
void EntityBase_PropertyChanged(object sender, PropertyChangedEventArgs e) { _status = Statuses.Edit; }
public ResultStatus(Statuses result, object data) { this.Result = result; this.Data = data; }
internal bool ContainsStatus(int id) { //if(st.GetHashCode()<=100) return(Statuses.ContainsKey(id)); }
private async Task GenerateList(int?statusId = null) { var allStatus = await context.Statuses.ToListAsync(); Statuses.AddRange(allStatus.OrderBy(p => p.Name)); Statuses.Add(DefaultStatus); if (!statusId.HasValue) { var defaultStats = Statuses.FirstOrDefault(p => p.Name.Equals("Assigned")); if (defaultStats != null) { ActiveStatusId = defaultStats.Id; } } else { ActiveStatusId = statusId.Value; } IList <TicketListItemDto> ticketResult = new List <TicketListItemDto>(); ticketResult = await ticketService.GetAllTicketsAsync(ActiveStatusId); if (ticketResult.Any()) { TicketBody.TicketList = ticketResult; } TicketHeader.ReportedBy.Add(DefaultListItem); var reportedByList = await ticketService.GetAllNamesOfReportedBy(); TicketHeader.ReportedBy.AddRange(reportedByList.Select(p => new SelectListItem { Selected = p.Equals(Filter.ReportedBy), Text = p, Value = p }).ToList()); TicketHeader.PropertySort = TicketPropertyNames().ToList(); TicketHeader.AssignedTo.Add(DefaultListItem); TicketHeader.AssignedTo.AddRange(await context.Users.Select(p => new SelectListItem { Selected = p.Id == Filter.AssignedToId, Text = $"{p.FirstName} {p.LastName}", Value = p.Id.ToString() }).ToListAsync()); TicketHeader.CreatedBy.Add(DefaultListItem); TicketHeader.CreatedBy.AddRange(await context.Users.Select(p => new SelectListItem { Selected = p.Id == Filter.CreatedById, Text = $"{p.FirstName} {p.LastName}", Value = p.Id.ToString() }).ToListAsync()); TicketHeader.Priorities.Add(DefaultListItem); TicketHeader.Priorities = await context.Priorities.Select(p => new SelectListItem { Selected = p.Id == Filter.PriorityId, Text = p.Name, Value = p.Id.ToString() }).ToListAsync(); }
protected void Page_Load(object sender, EventArgs e) { //create callback to get access token and request tokem LoginRadiusCallback callback = new LoginRadiusCallback(); //If Request as LoginRadius callback, after user successfully loggedin on provider. if (callback.IsCallback) { //To get access token with the help of loginradius "api secret" var accessToken = callback.GetAccessToken(ConfigurationManager.AppSettings["apisecret"].ToString()); //save token to session for further use Session["token"] = accessToken; try { //create client with the help of access token as parameter LoginRadiusClient client = new LoginRadiusClient(accessToken); //create object to execute user profile api to get user profile data. UserProfileAPI userprofile = new UserProfileAPI(); //To get ultimate user profile data with the help of user profile api object as parameter. // and pass "LoginRadiusUltimateUserProfile" model as interface to map user profile data. var userProfileData = client.GetResponse <LoginRadiusUltimateUserProfile>(userprofile); if (userProfileData.Provider.ToLower() == "facebook" || userProfileData.Provider.ToLower() == "twitter" || userProfileData.Provider.ToLower() == "linkedin") { postmessage.Visible = true; } else { postmessage.Visible = false; } if (userProfileData.Provider.ToLower() == "twitter" || userProfileData.Provider.ToLower() == "linkedin") { directmessage.Visible = true; } else { directmessage.Visible = false; } name.Text = "<b>Full Name : </b>" + userProfileData.FullName; if (userProfileData.Email != null) { emailid.Text = "<b>Email ID : </b>" + userProfileData.Email[0].Value; } about.Text = "<b>About : </b>" + userProfileData.About; if (userProfileData.ImageUrl != null && userProfileData.ImageUrl != "") { userprofileimage.ImageUrl = userProfileData.ImageUrl; } else { userprofileimage.ImageUrl = "Content/images/no_image.png"; } if (userProfileData.ID != null) { Truserid.Visible = true; } if (userProfileData.Gender != null) { Trgender.Visible = true; } if (userProfileData.Provider != null) { Trprovider.Visible = true; } if (userProfileData.ProfileName != null) { TrProfileName.Visible = true; } if (userProfileData.Age != null) { Trage.Visible = true; } if (userProfileData.Quota != null) { Trquota.Visible = true; } if (userProfileData.MainAddress != null) { TrMainAddress.Visible = true; } if (userProfileData.HomeTown != null) { TrHomeTown.Visible = true; } if (userProfileData.PhoneNumbers != null) { TrPhoneNumbers.Visible = true; } if (userProfileData.ProfileCountry != null) { TrProfileCountry.Visible = true; } if (userProfileData.ProfileUrl != null) { TrProfileUrl.Visible = true; } if (userProfileData.Religion != null) { TrReligion.Visible = true; } if (userProfileData.RelationshipStatus != null) { TrRelationshipStatus.Visible = true; } if (userProfileData.State != null) { TrState.Visible = true; } if (userProfileData.TimeZone != null) { Trtimezone.Visible = true; } if (userProfileData.LocalLanguage != null) { Trlocallanguage.Visible = true; } if (userProfileData.Website != null) { Trwebsite.Visible = true; } if (userProfileData.BirthDate != null) { Trdateofbirth.Visible = true; } gender.Text = userProfileData.Gender; age.Text = userProfileData.Age; dateofbirth.Text = userProfileData.BirthDate; website.Text = userProfileData.Website; locallanguage.Text = userProfileData.LocalLanguage; timezone.Text = userProfileData.TimeZone; State.Text = userProfileData.State; RelationshipStatus.Text = userProfileData.RelationshipStatus; Religion.Text = userProfileData.Religion; ProfileCountry.Text = userProfileData.ProfileCountry; ProfileUrl.Text = userProfileData.ProfileUrl; HomeTown.Text = userProfileData.HomeTown; MainAddress.Text = userProfileData.MainAddress; userid.Text = userProfileData.ID; provider.Text = userProfileData.Provider; localcity.Text = userProfileData.LocalCity; localcountry.Text = userProfileData.LocalCountry; ProfileName.Text = userProfileData.ProfileName; quota.Text = userProfileData.Quota; if (userProfileData.Addresses != null) { address.Visible = true; } if (userProfileData.Positions != null) { position.Visible = true; } if (userProfileData.Educations != null) { educationss.Visible = true; } positions.DataSource = userProfileData.Positions; positions.DataBind(); educations.DataSource = userProfileData.Educations; educations.DataBind(); addresses.DataSource = userProfileData.Addresses; addresses.DataBind(); //create object to execute album api to get albums AlbumAPI albums = new AlbumAPI(); //To get albums data with the help of album api object as parameter. // and pass "LoginRadiusAlbum" model as interface to map album data. var userAlbums = client.GetResponse <List <LoginRadiusAlbum> >(albums); Album.DataSource = userAlbums != null ? userAlbums : null; Album.DataBind(); //create object to execute audio api to get audios AudioAPI audios = new AudioAPI(); //To get audios data with the help of audio api object as parameter. // and pass "LoginRadiusAudio" model as interface to map audio data. var userAudios = client.GetResponse <List <LoginRadiusAudio> >(audios); Audio.DataSource = userAudios != null ? userAudios : null; Audio.DataBind(); //create object to execute checkin api to get checkins CheckInAPI checkins = new CheckInAPI(); //To get checkins data with the help of checkin api object as parameter. // and pass "LoginRadiusCheckIn" model as interface to map checkin data. var userCheckins = client.GetResponse <List <LoginRadiusCheckIn> >(checkins); CheckIn.DataSource = userCheckins != null ? userCheckins : null; CheckIn.DataBind(); //create object to execute company api to get companies CompanyAPI companies = new CompanyAPI(); //To get companies data with the help of company api object as parameter. // and pass "LoginRadiusCompany" model as interface to map company data. var userCompanies = client.GetResponse <List <LoginRadiusCompany> >(companies); Company.DataSource = userCompanies != null ? userCompanies : null; Company.DataBind(); //create object to execute contact api to get contacts ContactAPI contacts = new ContactAPI(); //To get contacts data with the help of contact api object as parameter. // and pass "LoginRadiusContact" model as interface to map contact data. var userContacts = client.GetResponse <LoginRadiusCursorResponse <LoginRadiusContact> >(contacts); Contact.DataSource = userContacts != null ? userContacts.Data : null; Contact.DataBind(); //create object to execute event api to get events EventAPI events = new EventAPI(); //To get events data with the help of event api object as parameter. // and pass "LoginRadiusEvent" model as interface to map event data. var userEvents = client.GetResponse <List <LoginRadiusEvent> >(events); Event.DataSource = userEvents != null ? userEvents : null; Event.DataBind(); //create object to execute following api to get followings FollowingAPI followings = new FollowingAPI(); //To get followings data with the help of following api object as parameter. // and pass "LoginRadiusFollowing" model as interface to map following data. var userFollowings = client.GetResponse <List <LoginRadiusFollowing> >(followings); Following.DataSource = userFollowings != null ? userFollowings : null; Following.DataBind(); //create object to execute group api to get groups GroupAPI groups = new GroupAPI(); //To get groups data with the help of group api object as parameter. // and pass "LoginRadiusGroup" model as interface to map group data. var userGroups = client.GetResponse <List <LoginRadiusGroup> >(groups); Group.DataSource = userGroups != null ? userGroups : null; Group.DataBind(); //create object to execute like api to get likes LikeAPI likes = new LikeAPI(); //To get likes data with the help of like api object as parameter. // and pass "LoginRadiusLike" model as interface to map like data. var userLikes = client.GetResponse <List <LoginRadiusLike> >(likes); Like.DataSource = userLikes != null ? userLikes : null; Like.DataBind(); //create object to execute mention api to get mentions MentionAPI mentions = new MentionAPI(); //To get mentions data with the help of mention api object as parameter. // and pass "LoginRadiusMention" model as interface to map mention data. var userMentions = client.GetResponse <List <LoginRadiusMention> >(mentions); Mention.DataSource = userMentions != null ? userMentions : null; Mention.DataBind(); //create object to execute page api to get pages PageAPI pages = new PageAPI(); //To get pages data with the help of page api object as parameter. // and pass "LoginRadiusPage" model as interface to map page data. var userPages = client.GetResponse <List <LoginRadiusPage> >(pages); Pages.DataSource = userPages != null ? userPages : null; Pages.DataBind(); //create object to execute photo api to get photos PhotoAPI photos = new PhotoAPI(); //To get photos data with the help of photo api object as parameter. // and pass "LoginRadiusPhoto" model as interface to map photo data. var userPhotos = client.GetResponse <List <LoginRadiusPhoto> >(photos); Photo.DataSource = userPhotos != null ? userPhotos : null; Photo.DataBind(); //create object to execute post api to get posts PostAPI posts = new PostAPI(); //To get posts data with the help of post api object as parameter. // and pass "LoginRadiusPost" model as interface to map post data. var userPosts = client.GetResponse <List <LoginRadiusPost> >(posts); Post.DataSource = userPosts != null ? userPosts : null; Post.DataBind(); //create object to execute status api to get statuses StatusAPI statuses = new StatusAPI(); //To get statuses data with the help of status api object as parameter. // and pass "LoginRadiusStatus" model as interface to map status data. var userStatuses = client.GetResponse <List <LoginRadiusStatus> >(statuses); Statuses.DataSource = userStatuses != null ? userStatuses : null; Statuses.DataBind(); //create object to execute video api to get videos VideoAPI videos = new VideoAPI(); //To get videos data with the help of video api object as parameter. // and pass "LoginRadiusVideo" model as interface to map video data. var userVideos = client.GetResponse <List <LoginRadiusVideo> >(videos); Video.DataSource = userVideos != null ? userVideos : null; Video.DataBind(); } catch (Exception ee) { Response.Write(ee.StackTrace); } } }
public async Task UpdateStatuses(long maxid = 0) { if (UpdatingStatuses) { return; } if (_userId == 0 || Tokens == null) { return; } UpdatingStatuses = true; try { var param = new Dictionary <string, object> { { "count", 20 }, { "include_entities", true }, { "user_id", _userId }, { "tweet_mode", CoreTweet.TweetMode.Extended } }; if (maxid != 0) { param.Add("max_id", maxid); } var userTweets = await Tokens.Statuses.UserTimelineAsync(param); if (maxid == 0) { Statuses.Clear(); } foreach (var status in userTweets) { Connecter.Instance.TweetReceive_OnCommandExecute(this, new TweetEventArgs(status, Tokens.UserId, new List <string> { "none://" }, false)); var id = status.HasRetweetInformation ? status.RetweetInformation.Id : status.Id; var index = Statuses.IndexOf( Statuses.FirstOrDefault(x => (x.HasRetweetInformation ? x.RetweetInformation.Id : x.Id) == id)); if (index == -1) { index = Statuses.IndexOf( Statuses.FirstOrDefault(x => (x.HasRetweetInformation ? x.RetweetInformation.Id : x.Id) < id)); if (index == -1) { Statuses.Add(status); } else { Statuses.Insert(index, status); } } } } catch { if (maxid == 0) { Statuses.Clear(); } UpdatingStatuses = false; return; } UpdatingStatuses = false; }
/// <summary> /// Sets the flag value as specified /// </summary> /// <param name="flag">The flag value to set. See the Statuses /// enumeration for more detail.</param> /// <param name="bValue">The value to set to</param> internal void SetBOFlagValue(Statuses flag, bool bValue) { if (bValue) { _flagState = _flagState | flag; } else { _flagState = _flagState & ~flag; } }
public void CmdActivateAbilities(GameObject button) { abilityController.ActivateAbility((AbilityName)System.Enum.Parse(typeof(AbilityName), button.name)); // i.e. use this to get AbilityName.Immunity when button.name is Immunity Status = 0; // change back to normal state }
public AddFullAccountViewModel(ICompaniesService companiesService, ITypesService typesService, IAccountsMainService accountsService, IAccountStatusService accountStatusService, IAccountStoresService accountStoresService, IStoresService storesService, IAccountCapexesService accountCapexService, IExpensesService expenseService, ICapexesService capexService, IStoresWorkService storesWorkService, IAccountFAService accountFAService, IFAService faService) { #region account SaveAccountCommand = new DelegateCommand(SaveAccount, CanSave).ObservesProperty(() => Account); #endregion account #region workers _worker = new BackgroundWorker(); _worker.DoWork += LoadAccount; _addStoresWorker = new BackgroundWorker(); _addStoresWorker.DoWork += LoadAddStoresToAccount; _addStoresWorker.RunWorkerCompleted += LoadAddStoresToAccount_Completed; #endregion workers #region capexes OpenAddCapexToAccountCommand = new DelegateCommand(OpenAddCapexToAccount); CloseAddCapexToAccountCommand = new DelegateCommand(CloseAddCapexToAccount); CopyAvailableSumCommand = new DelegateCommand(CopyAvailableSum); AddCapexToAccountCommand = new DelegateCommand(AddCapexToAccount, CanAddCapex).ObservesProperty(() => NewCapexForAccount); DeleteCapexAccountCommand = new DelegateCommand(DeleteCapex); #endregion capexes #region services _companiesService = companiesService; _typesService = typesService; _accountsService = accountsService; _accountStatusService = accountStatusService; _accountStoresService = accountStoresService; _storesService = storesService; _accountCapexService = accountCapexService; _expenseService = expenseService; _capexService = capexService; _storesWorkService = storesWorkService; _accountFAService = accountFAService; _faService = faService; #endregion services #region statuses IsChangeStatusOpen = false; StatusesList = Statuses.GetStatusesList(); CancelNewStatusCommand = new DelegateCommand(CancelNew); ChangeStatusCommand = new DelegateCommand(ChangeStatus); SaveNewStatusCommand = new DelegateCommand(SaveNew, CanSaveNew); #endregion statuses #region stores EditAccountStoresListCommand = new DelegateCommand(EditAccountStoresList, CanEdit); DeleteAccountStoreCommand = new DelegateCommand(DeleteAccountStore); AddStoresToAccountCommand = new DelegateCommand(() => _addStoresWorker.RunWorkerAsync(), CheckStoreErrors).ObservesProperty(() => StoresForLoad); CloseAddStoresToAccountCommand = new DelegateCommand(CloseAddStores); IsEditAccountStoresOpen = false; #endregion stores #region FA AddFAOpen = false; AddFACommand = new DelegateCommand(AddFA); AddFAToAccountCommand = new DelegateCommand(AddFAToAccount, CanAddFA).ObservesProperty(() => NewFA); CloseFACommand = new DelegateCommand(CloseFA); #endregion FA }
public static void Log(int doc_type_id, Operations op, Statuses st, int doc_id, string file_name, string txt, string title, string text) { }
public void CreateNewStatus(StatusesJSON status) { { Statuses newStatus = new Statuses { Status = status.Status, GroupId = 0, }; dbContext.Statuses.Add(newStatus); dbContext.SaveChanges(); } }
public void OnError(Statuses status) { Log.Debug(BuildConfig.BuildType, "onError: Status = " + status.ToString()); }
///<summary> ///set status to alive ///</summary> public void SetAlive() { _status = Statuses.Alive; }
/// <summary> /// Begins the main processing loop on a new thread. /// </summary> public void Process() { ThreadPool.QueueUserWorkItem(delegate { Statuses priorStatus = this.status; int failures = 0; while (true) { if (this.status != Statuses.Paused) { Debug("Start of main process loop. failures: " + failures.ToString()); if (this.status == Statuses.Starting) { UpdateStatus(Statuses.NoDevice); } if (this.status == Statuses.NoDevice) { this.CheckDevices(); } if (this.status == Statuses.NoSession) { this.OpenBiometricSession(); } if (this.status == Statuses.NoFocus) { this.AquireFocus(); } if (this.status == Statuses.Listening) { //always let the tray know we're listening... priorStatus = Statuses.Listening; SendStatus(); if (this.Listen()) { failures = 0; } else { failures++; if (status != Statuses.Paused) { RestartBiometricSession(); } } } else { failures++; } //send a status update if the status changed... if (this.status != priorStatus) { Debug("Status changed from " + priorStatus.ToString() + " to " + status.ToString() + ". Sending status update..."); priorStatus = this.status; SendStatus(); } Debug("End of main process loop. failures: " + failures.ToString()); //throttle constant failures... if (failures > 10) { Debug("Failing. Will restart and wait 10 seconds..."); if (this.status == Statuses.Listening) { UpdateStatus(Statuses.Failing); } SendStatus(); failures = 0; Thread.Sleep(10000); RestartBiometricSession(); } else { Thread.Sleep(500); } } else { //send a status update if the status changed... if (this.status != priorStatus) { Debug("Paused. Waiting..."); priorStatus = this.status; SendStatus(); } Thread.Sleep(2000); } } }); Debug("processing"); }
///<summary> ///set status to spawning ///</summary> public void SetSpawning() { _status = Statuses.Spawning; }
public OperationDetails(Statuses status, string message, string action) { Status = status; Message = message; Action = action; }
public int Save(Statuses Data) { TopContractsV01Entities context = new TopContractsV01Entities(Utilities.getTestEnvName()); TopContractsEntities.Status efStatus = null; foreach (TopContractsDAL10.SystemTables.Status Status in Data.Entries) { if (Status.New) { efStatus = new TopContractsEntities.Status(); } else { efStatus = context.Statuses.Where(c => c.StatusID == Status.ID).SingleOrDefault(); } if (Status.Deleted == false) efStatus.InitCommonFields(efStatus, Status, efStatus.StatusesLNGs, this.organizationIdentifier); if (Status.New) context.Statuses.Add(efStatus); else { if (Status.Deleted && efStatus != null) { efStatus.DeleteLanguageEntries(efStatus, context.StatusesLNGs, efStatus.StatusesLNGs); //for (int indx = efStatus.StatusesLNGs.Count() - 1; indx >= 0; indx--) //{ // TopContractsEntities.StatusesLNG lng = efStatus.StatusesLNGs.ElementAt(indx); // context.StatusesLNGs.Remove(lng); //} context.Statuses.Remove(efStatus); } } } return context.SaveChanges(); }
public static bool HasStatus(string name, Statuses status) { return((GetStatus(name) & (uint)status) > 0); }
/// <summary> /// Changes the status and raises the StatusChanged event /// </summary> /// <param name="newStatus"></param> private void ChangeStatus(Statuses newStatus) { m_status = newStatus; if ( m_logger.IsDebugEnabled ) m_logger.Debug("PracticeSharpLogic - Status changed: " + m_status); // Raise StatusChanged Event if (StatusChanged != null) { // explicitly invoke each subscribed event handler *asynchronously* foreach (StatusChangedEventHandler subscriber in StatusChanged.GetInvocationList()) { // Event is unidirectional - No call back (i.e. EndInvoke) needed subscriber.BeginInvoke(this, newStatus, null, subscriber); } } }
public static void SetStatus(string name, Statuses status) { UpdateStatus(name, GetStatus(name) | (uint)status); }
/// <summary> /// Ajoute l'épisode au fichier d'historique /// </summary> /// <param name="stat">Statut de l'épisode</param> public void WriteLog(Statuses stat) { XmlDocument doc; XmlElement root; XmlNode node; bool newfile = true; try { doc = new XmlDocument(); if (File.Exists(LogFile)) try { doc.Load(LogFile); newfile = false; } catch { } else { string dir = Path.GetDirectoryName(LogFile); if (!Directory.Exists(dir)) MyExtensions.CreateDirectory(dir); } if (newfile) { doc.AppendChild(doc.CreateNode(XmlNodeType.XmlDeclaration, "utf-8", string.Empty)); root = doc.CreateElement("history"); doc.AppendChild(root); } else root = doc.DocumentElement; node = root.SelectSingleNode("//history/episode[@name=\"" + FileName.ToXpathString() + "\"]"); XmlAttribute attr; if (node == null) { node = doc.CreateElement("episode"); attr = doc.CreateAttribute("name"); attr.InnerText = FileName; node.Attributes.Append(attr); root.AppendChild(node); } else attr = node.Attributes["name"]; XmlNode InnerNode = node.SelectSingleNode("date"); if (InnerNode == null) { InnerNode = doc.CreateElement("date"); node.AppendChild(InnerNode); } InnerNode.InnerText = DateTime.Now.ToString("yyyyMMddHHmmss"); InnerNode = node.SelectSingleNode("status"); if (InnerNode == null) { InnerNode = doc.CreateElement("status"); node.AppendChild(InnerNode); } InnerNode.InnerText = stat.ToString(); doc.Save(LogFile); } catch (Exception err) { throw err; } }
public static void RemoveStatus(string name, Statuses status) { UpdateStatus(name, GetStatus(name) & ~(uint)status); }