/// <summary> /// Jumps to the next page of the text. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.EventArgs"/>.</param> private void button4_Click(object sender, System.EventArgs e) { _currentStatus = StatusTypes.Stopped; _currentPosition = new System.Drawing.Point(0, 0); timer1.Stop(); button2.Text = "Play"; }
/// <summary> /// Sets the default values for the elements after the form is loaded. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.EventArgs"/>.</param> private void Form1_Load(object sender, System.EventArgs e) { button1.Text = "Back"; button2.Text = "Play"; button3.Text = "Stop"; button4.Text = "Next"; button1.Enabled = false; button2.Enabled = false; button3.Enabled = false; button4.Enabled = false; richTextBox1.Text = ""; trackBar1.Value = 50; label1.Text = trackBar1.Value.ToString(); timer1 = new System.Windows.Forms.Timer(); timer1.Interval = _timerSpace; timer1.Tick += ReadText; _soundPlayer.SoundLocation = ""; _soundPlayer.Stop(); _currentStatus = StatusTypes.Stopped; _currentPosition = new System.Drawing.Point(0, 0); }
/// <summary> /// Increases the cursor's position. /// </summary> /// <param name="value">The value to increase the cursor's position.</param> private void IncreaseCurrentPosition(int value) { try { if (_currentPosition.X + value >= richTextBox1.Lines[_currentPosition.Y].Length) { _currentPosition.Y += 1; _currentPosition.X = 0; } else { _currentPosition.X += value; } if (_currentPosition.Y > richTextBox1.Lines.Length - 1) { timer1.Stop(); button2.Text = "Play"; button3.Enabled = false; _currentStatus = StatusTypes.Stopped; _currentPosition = new System.Drawing.Point(0, 0); } } catch { } }
///<summary> ///Base goal constructor ///</summary> ///<param name="bot"></param> ///<param name="goalType"></param> protected Goal(BotEntity bot, GoalTypes goalType) { _bot = bot; _goalType = goalType; _status = StatusTypes.Inactive; _logPrefixText = String.Format("[{0,-8}] [{1,17}.", Bot.Name, goalType); }
public override void CopyMembers(BaseSkillRequirement Copy) { PilotStatRequirement NewRequirement = (PilotStatRequirement)Copy; _EffectValue = NewRequirement._EffectValue; _StatusType = NewRequirement._StatusType; }
/// <summary> /// Closes the application. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.EventArgs"/>.</param> private void exitToolStripMenuItem_Click(object sender, System.EventArgs e) { _currentStatus = StatusTypes.Stopped; _currentPosition = new System.Drawing.Point(0, 0); timer1.Stop(); Close(); }
/// <summary> /// Ends and removes a StatusEffect on the entity /// </summary> /// <param name="statusType">The StatusTypes of the StatusEffect to remove</param> /// <param name="showMessage">Whether to show the StatusEffect's RemovedMessage as a Battle Message when it is removed.</param> public void RemoveStatus(StatusTypes statusType, bool showMessage) { //Don't do anything if the entity doesn't have this status if (HasStatus(statusType) == false) { Debug.Log($"{Entity.Name} is not currently afflicted with the {statusType} Status!"); return; } StatusEffect status = Statuses[statusType]; //End the status then remove it status.End(); status.ClearEntity(); Statuses.Remove(statusType); //Show a battle message when the status is removed, provided the message isn't empty if (showMessage == true && string.IsNullOrEmpty(status.RemovedMessage) == false) { BattleEventManager.Instance.QueueBattleEvent((int)BattleGlobals.StartEventPriorities.Message + status.Priority, new BattleManager.BattleState[] { BattleManager.BattleState.TurnEnd }, new MessageBattleEvent(status.RemovedMessage, 2000d)); } string turnMessage = status.TotalDuration.ToString(); if (status.IsInfinite == true) { turnMessage = "Infinite"; } Debug.LogWarning($"Removed the {statusType} Status on {Entity.Name} after being inflicted for {turnMessage} turns!"); }
public async Task <IEnumerable <AssessmentReviewDto> > GetAssessmentsByStatus(int id) { string contentRootPath = _hostingEnvironment.ContentRootPath; if (await IsAlive()) { CoreServiceDevReference.CoreServiceClient coreServiceClient = new CoreServiceDevReference.CoreServiceClient(); var clientAssessmentReviews = await coreServiceClient.GetClientAssessmentsForReview_NEWAsync(null, 54338, null, null); //54338 var clientAssesReviews = clientAssessmentReviews .Select(x => new AssessmentReviewDto { Assessment = x.AssessmentForm.Assessment.Name + " " + x.AssessmentForm.Name, ClientName = x.Client.FirstName + " " + x.Client.LastName, LastUpdated = x.TestDate, StatusKey = x.StatusKey }); if (id > 0) { clientAssesReviews = clientAssesReviews.Where(x => StatusTypes.GetCompletedStatuses(true).Contains(x.StatusKey)); } else { clientAssesReviews = clientAssesReviews.Where(x => StatusTypes.GetCompletedStatuses(false).Contains(x.StatusKey)); } return(clientAssesReviews); } //else //{ //var JSON = System.IO.File.ReadAllText(contentRootPath + "/data/clientAssessments.json"); //return JsonConvert.DeserializeObject<IEnumerable<AssessmentReviewDto>>(JSON); //} return(null); }
public async Task <IActionResult> Edit(int id, [Bind("Id,StatusTypeDescription")] StatusTypes statusTypes) { if (id != statusTypes.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(statusTypes); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StatusTypesExists(statusTypes.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(statusTypes)); }
private void SetStatus(IStatus status) { this.backColorTimer.Stop(); // Delay important messages if ((this.currentState == StatusTypes.Error || this.currentState == StatusTypes.Warning) && (status.Type == StatusTypes.Info || status.Type == StatusTypes.Success)) { System.Threading.Thread.Sleep(1000); } // Ensure inside UI thread if (!this.asyncHelper.Execute( this, new SetStatusDelegate(SetStatus), status)) { return; } if (this.InvokeRequired) { return; } lock (this) { this.currentState = status.Type; int imageIndex = (int)status.Type; if (this.images.Count > imageIndex) { this.label.Image = this.images[imageIndex]; } else { this.label.Image = null; } if (this.colors.Count > imageIndex) { this.BackColor = this.colors[imageIndex]; } this.label.Text = status.Message; if (status.Type == StatusTypes.Info || status.Type == StatusTypes.Warning) { this.label.ForeColor = this.ForeColor; } else { this.label.ForeColor = Color.White; } } this.backColorTimer.Start(); }
private void API_GetStatus(StatusTypes type) { string content = XmlDeclaration + "<status>\r\n <type>" + type.ToString() + "</type>\r\n</status>"; string msg = ConstructApiMessage(ApiRequests.status, content); SendMessage(msg); }
protected void ReactivateIfFailed() { if (HasFailed) { Status = StatusTypes.Inactive; } }
public Logging(string statusMessage, string statusDetail, string url, StatusTypes statusType) { StatusMessage = statusMessage; StatusDetail = statusDetail; URL = url; StatusType = statusType; }
/// <summary> /// Opens a text file and reads it's content. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.EventArgs"/>.</param> private void openToolStripMenuItem_Click(object sender, System.EventArgs e) { richTextBox1.Text = ""; openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); openFileDialog1.Filter = "Text Files (.txt)|*.txt|Documents (.doc)|*.doc|Word Documents (.docx)|*.docx|PDF Files (.pdf)|*.pdf|All Files (*.*)|*.*"; openFileDialog1.FilterIndex = 1; openFileDialog1.Multiselect = false; if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { switch (openFileDialog1.FileName.Split('.')[openFileDialog1.FileName.Split('.').Length - 1].ToLower()) { case "txt": System.Text.Encoding enc = GetFileEncoding(openFileDialog1.FileName); using (System.IO.FileStream fileStream = System.IO.File.Open(openFileDialog1.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { using (System.IO.StreamReader streamReader = new System.IO.StreamReader(fileStream, enc)) { richTextBox1.Text = streamReader.ReadToEnd(); } } break; case "doc": case "docx": Microsoft.Office.Interop.Word.Application app2 = new Microsoft.Office.Interop.Word.Application(); { Microsoft.Office.Interop.Word.Document doc = app2.Documents.Open(openFileDialog1.FileName); { foreach (Microsoft.Office.Interop.Word.Paragraph objParagraph in doc.Paragraphs) { richTextBox1.Text += objParagraph.Range.Text; } doc.Close(); } app2.Quit(); } break; case "pdf": using (iTextSharp.text.pdf.PdfReader pdfReader = new iTextSharp.text.pdf.PdfReader(openFileDialog1.FileName)) { for (int page = 1; page <= pdfReader.NumberOfPages; page++) { richTextBox1.Text += iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(pdfReader, page, new iTextSharp.text.pdf.parser.SimpleTextExtractionStrategy()); } } break; } } button2.Enabled = !string.IsNullOrEmpty(richTextBox1.Text.Trim()); _currentStatus = StatusTypes.Stopped; _currentPosition = new System.Drawing.Point(0, 0); timer1.Stop(); }
/// <summary> /// Initializes a new instance of the <see cref="Invitation" /> class. /// </summary> /// <param name="invitationId">The ID of the invitation. (required).</param> /// <param name="inviterUsername">The username for the inviter. (required).</param> /// <param name="entityType">entityType (required).</param> /// <param name="entityId">The identifier for the specific entity you are inviting access to. (required).</param> /// <param name="deliveryMethods">deliveryMethods (required).</param> /// <param name="status">status (required).</param> /// <param name="expiration">The IS0-8601 date time string in UTC for the expiration of an invitation. (required).</param> public Invitation(Guid invitationId = default(Guid), string inviterUsername = default(string), EntityTypes entityType = default(EntityTypes), string entityId = default(string), List <Delivery> deliveryMethods = default(List <Delivery>), StatusTypes status = default(StatusTypes), string expiration = default(string)) { this.InvitationId = invitationId; // to ensure "inviterUsername" is required (not null) if (inviterUsername == null) { throw new ArgumentNullException("inviterUsername is a required property for Invitation and cannot be null"); } this.InviterUsername = inviterUsername; this.EntityType = entityType; // to ensure "entityId" is required (not null) if (entityId == null) { throw new ArgumentNullException("entityId is a required property for Invitation and cannot be null"); } this.EntityId = entityId; // to ensure "deliveryMethods" is required (not null) if (deliveryMethods == null) { throw new ArgumentNullException("deliveryMethods is a required property for Invitation and cannot be null"); } this.DeliveryMethods = deliveryMethods; this.Status = status; // to ensure "expiration" is required (not null) if (expiration == null) { throw new ArgumentNullException("expiration is a required property for Invitation and cannot be null"); } this.Expiration = expiration; }
/// <summary> /// Ends and removes a StatusEffect on the BattleEntity. /// <para>This wraps around the method in <see cref="BattleEntityProperties"/>. It calls the <see cref="StatusRemovedEvent"/> and handles the Battle Message.</para> /// <para>In most cases, this method should be used. If you wish to bypass all of these, directly call the method in <see cref="BattleEntityProperties"/> instead.</para> /// </summary> /// <param name="statusType">The StatusTypes of the StatusEffect to remove.</param> /// <param name="showMessage">Whether to show the StatusEffect's RemovedMessage as a Battle Message when it is removed.</param> /// <param name="queueBattleEvent">Whether to queue up the <see cref="StatusEndedBattleEvent"/> or not.</param> /// <returns>The StatusEffect removed from the BattleEntity.</returns> public void RemoveStatus(StatusTypes statusType, bool showMessage, bool queueBattleEvent) { StatusEffect status = EntityProperties.RemoveStatus(statusType); //This is null only if the BattleEntity wasn't afflicted with the Status Effect to begin with //If the Status Effect wasn't removed, then just return if (status == null) { return; } //Invoke the status removed event StatusRemovedEvent?.Invoke(status); //Show a battle message when the status is removed, provided the message isn't empty if (showMessage == true && string.IsNullOrEmpty(status.RemovedMessage) == false) { BattleManager.Instance.battleEventManager.QueueBattleEvent((int)BattleGlobals.BattleEventPriorities.Message + status.Priority, new BattleManager.BattleState[] { BattleManager.BattleState.TurnEnd }, new MessageBattleEvent(status.RemovedMessage, 2000d)); } //Queue a battle event for the status removal if (queueBattleEvent == true) { BattleManager.Instance.battleEventManager.QueueBattleEvent((int)BattleGlobals.BattleEventPriorities.Status + status.Priority, new BattleManager.BattleState[] { BattleManager.BattleState.TurnEnd }, new StatusEndedBattleEvent(this)); } }
/// <summary> /// Functions to update the status line /// </summary> /// <param name="Types">The types of entry: InvalidEntry = Where the entry is not a number, Fine = Where the system is fine, DiceRolled = Where the dice have rolled successfully </param> /// <returns>Status message for the program</returns> public string UpdateStatus(StatusTypes Types) { string StatusMessage = ""; switch (Types) { case StatusTypes.InvalidEntry: StatusMessage = Init + "Error: Non-Digit number entered."; break; case StatusTypes.Fine: StatusMessage = Init + "Ready to Go!"; break; case StatusTypes.DiceRolled: StatusMessage = Init + "Dice Rolled. "; break; case StatusTypes.Untrained: StatusMessage = " Note: Untrained = 1/2 single Dice. "; break; case StatusTypes.CritFail: StatusMessage = Init + "Dice Rolled. "; break; } return(StatusMessage); }
protected override void DoCopyMembers(BaseEffect Copy) { StatusEffect NewEffect = (StatusEffect)Copy; _EffectValue = NewEffect._EffectValue; _StatusType = NewEffect._StatusType; }
public StatusBase(StatusTypes type, int current, int treshold, int?maxvalue) { Type = type; Current = current; Treshold = treshold; MaxValue = maxvalue; }
public Statusbar(StatusController.Controller.StatusController controller) { this.RightToLeft = View.LayoutDirection; this.RenderMode = ToolStripRenderMode.ManagerRenderMode; this.AutoSize = false; this.Dock = System.Windows.Forms.DockStyle.Bottom; this.asyncHelper = new AsyncCalls(); this.currentState = StatusTypes.Info; if (Presentation.View.Theme != null) { this.BackColor = Presentation.View.Theme.ToolBarBackColor; this.ForeColor = Presentation.View.Theme.ToolBarForeColor; this.Font = Presentation.View.Theme.FormLabelFont; } else { this.ForeColor = Color.Black; this.Font = new Font("Tahoma", 9, FontStyle.Bold); } SetupLabel(); LoadImages(); LoadColors(); SetupTimer(); controller.RegisterForEvents(this); this.asyncHelper = new AsyncCalls(); }
/// <summary> /// Add new user /// </summary> /// <param name="login"></param> /// <param name="password"></param> /// <param name="status">Available(user,moderator,admin)</param> /// <returns></returns> public void NewUser(string login, string password, StatusTypes status) { UserViewModel user = new UserViewModel(); user.id = CheckAvailableId(); user.login = login; user.password = CodePass(user.id, password); user.status = status; user.registered = DateTime.Now; user.lastModified = DateTime.Now; user.lastLogged = Convert.ToDateTime(null); bool tmp = false; foreach (UserViewModel us in users) { if (us.login == login) { tmp = true; } } if (!tmp) { users.Add(user); } else { MessageBox.Show("Login is already taken!"); } RefreshList(); }
/// <summary> /// This type is used to schedule EVSE status periods in the future. /// </summary> /// <param name="Status">EVSE status value during the scheduled period.</param> /// <param name="Begin">Begin of the scheduled period.</param> /// <param name="End">Optional end of the scheduled period.</param> public StatusSchedule(StatusTypes Status, DateTime Begin, DateTime?End = null) { this.Status = Status; this.Begin = Begin; this.End = End; }
public void initialize(StatusTypes statusTypes) { this.statusTypes = statusTypes; obtainableCards = new List <CardTypes.CardEnum>((CardTypes.CardEnum[])Enum.GetValues(typeof(CardTypes.CardEnum))); obtainableCards.Remove(CardEnum.smack); obtainableCards.Remove(CardEnum.defend); }
public Treatment(TreatmentTypes treatmentMethod, Teenager teenager) { TreatmentMethod = treatmentMethod; Teenager = teenager; TeenagerId = teenager.TeenagerId; StartTime = DateTime.Now; Status = StatusTypes.OPENED; }
/// <summary> /// Clears the textbox. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.EventArgs"/>.</param> private void closeToolStripMenuItem_Click(object sender, System.EventArgs e) { _currentStatus = StatusTypes.Stopped; _currentPosition = new System.Drawing.Point(0, 0); timer1.Stop(); richTextBox1.Text = ""; button2.Enabled = false; }
public void EditCardStatus(StatusTypes status) { StatusTypes prevStatus = Status; Status = status; Console.WriteLine($"Статус карточки {this.Name} был изменен c {prevStatus} на {Status}"); }
public CUser(HlaObject _obj) : base(_obj) { // Local Data NickName = "Guest"; Status = StatusTypes.READY; Type = _obj.Type; }
public async Task <IEnumerable <AssessmentReviewDto> > GetAssessmentsByStatus(int id) { try { CoreServiceDevReference.CoreServiceClient coreServiceClient = new CoreServiceDevReference.CoreServiceClient(); if (await IsAlive()) { var clientAssessments = await coreServiceClient.GetClientAssessmentsForReview_NEWAsync(null, 54338, null, null); //54338 var clientAsses = clientAssessments .Select(x => new AssessmentReviewDto { Assessment = x.AssessmentForm.Assessment.Name + " " + x.AssessmentForm.Name, ClientName = x.Client.FirstName + " " + x.Client.LastName, LastUpdated = x.TestDate, StatusKey = x.StatusKey }); if (id > 0) { clientAsses = clientAsses.Where(x => StatusTypes.GetCompletedStatuses(true).Contains(x.StatusKey)); } else { clientAsses = clientAsses.Where(x => StatusTypes.GetCompletedStatuses(false).Contains(x.StatusKey)); } return(clientAsses); } else if (_hostingEnvironment.IsDevelopment()) { string webRootPath = _hostingEnvironment.WebRootPath; var JSON = System.IO.File.ReadAllText(webRootPath + "/data/clientAssessments.json"); var newClientAsses = JsonConvert.DeserializeObject <IEnumerable <AssessmentReviewDto> >(JSON); if (id > 0) { var statusTypeList = StatusTypes.GetCompletedStatuses(true).ToArray(); Debug.WriteLine(statusTypeList); //newClientAsses = newClientAsses.Where(x => statusTypeList.Contains(x.StatusKey)); //newClientAsses = newClientAsses.Where(x => x.StatusKey == 12); return(newClientAsses.Where(x => statusTypeList.Contains(x.StatusKey))); } else { var statusTypeList = StatusTypes.GetCompletedStatuses(false).ToArray(); Debug.WriteLine(statusTypeList); //newClientAsses = newClientAsses.Where(x => x.StatusKey == 6); return(newClientAsses.Where(x => statusTypeList.Contains(x.StatusKey))); } return(newClientAsses); } return(null); } catch (Exception ex) { return(null); } }
public TextCodeModel(IAPIHelper apiHelper, IRazorPartialToStringRenderer renderer, IModelHelper modelHelper) { _apiHelper = apiHelper; _renderer = renderer; _modelHelper = modelHelper; StatusTypes statusTypes = new StatusTypes(); StatusList = new SelectList(statusTypes.GetStatusTypesDictionary(), "Key", "Value"); }
public KIS_SO0250F_HRD() : base("KIS_SO0250F_HRD", "KIS_SO0250F_HRD", true) { //statusTypes.All = "A"; //statusTypes.Close = "C"; //statusTypes.Open = "O"; statusTypes = new StatusTypes("A", "C", "O"); }
public Status(Guid spellId, StatusTypes type, string data, long timeRemaining, long totalDuration) { SpellId = spellId; Type = type; Data = data; TimeRemaining = timeRemaining; TotalDuration = totalDuration; TimeRecevied = Globals.System.GetTimeMs(); }
public ManageUserViewModel(UserViewModel user, StatusTypes status) { this.user = user; this.status = status; Close = new RelayCommand <Window>(_Close); WindowClosing = new NormalCommand(Closing); WindowLoaded = new RelayCommand <object[]>(windowLoaded); Confirm = new RelayCommand <object[]>(confirm); }
public StatusEffectType(StatusTypes statusType, int totalTurns, float potency, bool show0Damage = true, bool doesTickDamage = true, float yCastPoint = 0.0f) { this.status = statusType; this.totalTurns = totalTurns; this.potency = potency; this.show0Damage = show0Damage; this.yCastPoint = yCastPoint; this.doesTickDamage = doesTickDamage; }
public Player() { ClientId = 0; Glue = 0; Wood = 0; Apples = 0; Supply = 0; UsedSupply = 0; Team = 0; Status = StatusTypes.InGame; }
public void Load(MemoryStream memory) { var reader = new BinaryReader(memory); Supply = reader.ReadByte(); Wood = reader.ReadUInt16(); Glue = reader.ReadUInt16(); Apples = reader.ReadUInt16(); ClientId = reader.ReadByte(); Team = reader.ReadByte(); UsedSupply = reader.ReadByte(); Status = (StatusTypes) reader.ReadByte(); }
public void DisplayStatusMessage(StatusTypes statusType, string message, int seconds) { if (string.IsNullOrEmpty(message)) return; InfoMessage.Text = message; InfoMessage.Visibility = Visibility.Visible; InfoStatusImage.Visibility = Visibility.Visible; string imageUrl = string.Empty; switch (statusType) { case StatusTypes.Warning: imageUrl = Images.StatusWarning; break; case StatusTypes.Info: imageUrl = Images.StatusInfo; break; case StatusTypes.Error: imageUrl = Images.StatusError; break; default: throw new InvalidOperationException("'statusTypes' unhandled!"); } Uri src = new Uri(imageUrl); BitmapImage img = new BitmapImage(src); InfoStatusImage.Source = img; if (0 != seconds) { if (null == statusInfoTimer) { statusInfoTimer = new DispatcherTimer(); statusInfoTimer.Tick += new EventHandler(OnInfoTimerTick); } statusInfoTimer.Stop(); statusInfoTimer.Interval = new TimeSpan(0, 0, seconds); statusInfoTimer.Start(); } }
public static status[] Deserialize(string response, Yedda.Twitter.Account Account, StatusTypes TypeOfMessage) { Library.status[] statuses = null; if (string.IsNullOrEmpty(response)) { statuses = new status[0]; } else { if (Account == null || Account.ServerURL.ServerType != Yedda.Twitter.TwitterServer.brightkite) { using (System.IO.StringReader r = new System.IO.StringReader(response)) { statuses = (Library.status[])statusSerializer.Deserialize(r); } } else if (Account.ServerURL.ServerType == Yedda.Twitter.TwitterServer.brightkite) { statuses = FromBrightKite(response); } } if (Account != null) { foreach (Library.status stat in statuses) { stat.Account = Account; stat.TypeofMessage = TypeOfMessage; } } return statuses; }
private void OnConnectedChanged(bool connected) { Status = connected ? StatusTypes.Connected : StatusTypes.Disconnected; }
public void Save(SQLiteConnection conn) { using (var comm = new SQLiteCommand(SQLCheck, conn)) { comm.Parameters.Add(new SQLiteParameter("@id", id)); object ret = comm.ExecuteScalar(); if (ret != null && (long) ret != 0) { if (TypeofMessage == StatusTypes.Reply) { //Already exists in the DB as a Friends update -- we need to make it an @mention too TypeofMessage = StatusTypes.Normal | StatusTypes.Reply; comm.CommandText = SQLUpdateTypes; comm.Parameters.Add(new SQLiteParameter("@type", TypeofMessage)); comm.ExecuteNonQuery(); } return; } } using (var comm = new SQLiteCommand(SQLSave, conn)) { comm.Parameters.Add(new SQLiteParameter("@id", id)); comm.Parameters.Add(new SQLiteParameter("@fulltext", text)); comm.Parameters.Add(new SQLiteParameter("@userid", user.id)); comm.Parameters.Add(new SQLiteParameter("@timestamp", createdAt)); comm.Parameters.Add(new SQLiteParameter("@in_reply_to_id", in_reply_to_status_id)); comm.Parameters.Add(new SQLiteParameter("@favorited", favorited)); comm.Parameters.Add(new SQLiteParameter("@clientSource", source)); comm.Parameters.Add(new SQLiteParameter("@accountSummary", AccountSummary)); comm.Parameters.Add(new SQLiteParameter("@SearchTerm", SearchTerm)); comm.Parameters.Add(new SQLiteParameter("@statustypes", TypeofMessage)); try { comm.ExecuteNonQuery(); } catch (Exception) { } } user.Save(conn); }
protected virtual void ButtonSave_Click(object sender, RoutedEventArgs e) { this.Status = StatusTypes.Save; if (DialogSaved != null) DialogSaved(this, EventArgs.Empty); this.Close(); }
public static status[] DeserializeArrayFromJSON(string response, Twitter.Account Accournt, StatusTypes TypeOfMessage) { var ret = new List<status>(); var List = (System.Collections.Hashtable)JSON.JsonDecode(response); if (List == null) { return null; } var results = (System.Collections.ArrayList)List["results"]; foreach (var result in results) { var resultHash = (System.Collections.Hashtable) result; ret.Add(DeserializeSingleJSONStatus(resultHash, TypeOfMessage)); } return ret.ToArray(); }
private static status DeserializeSingleJSONStatus(System.Collections.Hashtable jsonTable, StatusTypes TypeOfMessage) { var u = new User { id = jsonTable["from_user_id"].ToString(), needsFetching = true, screen_name = (string) jsonTable["from_user"], profile_image_url = (string) jsonTable["profile_image_url"], //Search results don't contain this info! name = "", description = "" }; var ret = new status { user = u, text = (string) jsonTable["text"], id = jsonTable["id"].ToString(), created_at = (string) jsonTable["created_at"], source = (string) jsonTable["source"], TypeofMessage = TypeOfMessage, //Search results don't contain this info! in_reply_to_status_id = "", favorited = "" }; return ret; }
private void UpdateStatus() { if (Status != StatusTypes.Disconnected) Status = TaskMenu.Count > 0 ? StatusTypes.HasConfirmations : StatusTypes.Connected; }
protected virtual void ButtonOk_Click(object sender, RoutedEventArgs e) { this.Status = StatusTypes.Ok; this.Close(); }
public void DisplayStatusMessage(StatusTypes statusType, string message, int seconds) { TextEditorControl.Instance.DisplayStatusMessage(statusType, message, seconds); }
protected void UpdateStatus(StatusTypes status) { #if SVPN_NUNIT #else _node.UpdateStatus(status); #endif }
public void Initialize(DialogTypes Type, Window Owner) { CloseCommand.InputGestures.Add(new KeyGesture(Key.Escape, ModifierKeys.None)); PrimaryCommand.InputGestures.Add(new KeyGesture(Key.Enter, ModifierKeys.None)); Window_Border.BorderThickness = new Thickness(1); Window_Border.Background = new SolidColorBrush(Color.FromRgb(56, 56, 56)); Window_Border.Child = Window_Content_Grid; this.Content = Window_Border; Window_Content_Grid.Children.Add(ContentPlaceHolder); Window_Border.Style = (Style)this.FindResource("Window_Frame_Border"); Status = StatusTypes.None; try { base.Owner = Owner; base.WindowStartupLocation = WindowStartupLocation.CenterOwner; } catch (Exception) { base.WindowStartupLocation = WindowStartupLocation.CenterScreen; } base.SizeToContent = SizeToContent.WidthAndHeight; base.ShowInTaskbar = false; base.ResizeMode = System.Windows.ResizeMode.CanMinimize; base.WindowStyle = System.Windows.WindowStyle.None; if (Type != DialogTypes.None) { //Create Content Grid Window_Content_Grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) }); Window_Content_Grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) }); Grid FooterFill = new Grid() { Height = 36, Background = ExpressionWindow.BackgroundColorBrush }; Footer = new Grid(); Grid.SetRow(FooterFill, 1); Grid.SetColumnSpan(FooterFill, 2); FooterFill.Children.Add(Footer); Window_Content_Grid.Children.Add(FooterFill); switch (Type) { case DialogTypes.Ok: Button Button_Ok = new Button() { Content = Names == null || Names.Length <= 0 ? "Ok" : Names[0], HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, Padding = new Thickness(10, 5, 10, 5), Margin = new Thickness(5) }; Button_Ok.Click += ButtonOk_Click; Footer.Children.Add(Button_Ok); this.CommandBindings.Add(new CommandBinding(CloseCommand, ButtonOk_Click)); this.CommandBindings.Add(new CommandBinding(PrimaryCommand, ButtonOk_Click)); break; case DialogTypes.Cancel: Button Button_Cancel = new Button() { Content = Names == null || Names.Length <= 0 ? "Cancel" : Names[0], HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, Padding = new Thickness(10, 5, 10, 5), Margin = new Thickness(5) }; Button_Cancel.Click += ButtonCancel_Click; Footer.Children.Add(Button_Cancel); this.CommandBindings.Add(new CommandBinding(CloseCommand)); this.CommandBindings.Add(new CommandBinding(PrimaryCommand)); break; case DialogTypes.SaveCancel: Footer.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; Footer.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Auto) }); Footer.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Auto) }); Button Button_Cancel2 = new Button() { Content = Names == null || Names.Length <= 1 ? "Cancel" : Names[1], HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, Padding = new Thickness(10, 5, 10, 5), Margin = new Thickness(5) }; Button_Cancel2.Click += ButtonCancel_Click; Grid.SetColumn(Button_Cancel2, 1); Footer.Children.Add(Button_Cancel2); Button Button_Save = new Button() { Content = Names == null || Names.Length <= 0 ? "Save" : Names[0], HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, Padding = new Thickness(10, 5, 10, 5), Margin = new Thickness(5) }; Button_Save.Click += ButtonSave_Click; Footer.Children.Add(Button_Save); this.CommandBindings.Add(new CommandBinding(CloseCommand, ButtonCancel_Click)); this.CommandBindings.Add(new CommandBinding(PrimaryCommand, ButtonSave_Click)); break; case DialogTypes.SaveDiscardCancel: Footer.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; Footer.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Auto) }); Footer.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Auto) }); Footer.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Auto) }); Button Button_Save3 = new Button() { Content = Names == null || Names.Length <= 0 ? "Save" : Names[0], HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, Padding = new Thickness(10, 5, 10, 5), Margin = new Thickness(5) }; Button_Save3.Click += ButtonSave_Click; Footer.Children.Add(Button_Save3); Button Button_Discard3 = new Button() { Content = Names == null || Names.Length <= 1 ? "Discard" : Names[1], HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, Padding = new Thickness(10, 5, 10, 5), Margin = new Thickness(5) }; Button_Discard3.Click += ButtonDiscard_Click; Grid.SetColumn(Button_Discard3, 1); Footer.Children.Add(Button_Discard3); Button Button_Cancel3 = new Button() { Content = Names == null || Names.Length <= 2 ? "Cancel" : Names[2], HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, Padding = new Thickness(10, 5, 10, 5), Margin = new Thickness(5) }; Button_Cancel3.Click += ButtonCancel_Click; Grid.SetColumn(Button_Cancel3, 2); Footer.Children.Add(Button_Cancel3); this.CommandBindings.Add(new CommandBinding(CloseCommand, ButtonCancel_Click)); this.CommandBindings.Add(new CommandBinding(PrimaryCommand, ButtonSave_Click)); break; } } this.Activated += ExpressionDialog_Activated; this.Deactivated += ExpressionDialog_Deactivated; }
public static status[] Deserialize(string response, Twitter.Account Account, StatusTypes TypeOfMessage) { status[] statuses = null; try { if (string.IsNullOrEmpty(response)) { statuses = new status[0]; } else { if (Account == null || Account.ServerURL.ServerType != Twitter.TwitterServer.brightkite) { using (var r = new StringReader(response)) { statuses = (status[]) statusSerializer.Deserialize(r); } } else if (Account.ServerURL.ServerType == Twitter.TwitterServer.brightkite) { statuses = FromBrightKite(response); } } if (Account != null) { foreach (status stat in statuses) { stat.Account = Account; stat.TypeofMessage = TypeOfMessage; } } } catch{} return statuses; }
public void UpdateStatus(StatusTypes status) { _status = status.ToString(); }