internal async void InitAllList() { #pragma warning disable CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法 GetUnreadCount(); Timeline.Refresh(); if (Settings.IsMergeMentionAndComment) { MergeMessage.Refresh(); } else { Mention.Refresh(); Comment.Refresh(); CommentMention.Refresh(); } Favor.Refresh(); Message.Refresh(); #pragma warning restore CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法 try { (await Core.Api.Friendships.Groups.GetGroups()).Lists.ForEach(item => Groups.Add(item)); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Groups))); } catch (Exception ex) when(ex is WebException || ex is HttpRequestException || ex is TaskCanceledException || ex is NullReferenceException) { } }
public ActionResult Index(FormCollection request) { if (string.IsNullOrEmpty(request["title"]) || string.IsNullOrEmpty(request["description"])) { ViewBag.Message = "Missing information"; return(View()); } Favor newFavor = new Favor { Description = request["description"], Title = request["title"], Enable = true, IdUserOffering = Convert.ToInt32(Session["UserId"]), Request = true }; using (var dbContext = new DatabaseContext()) { dbContext.FavorModel.Add(newFavor); dbContext.SaveChanges(); } ViewBag.Message = "Favor requested"; return(View()); }
public async Task <IActionResult> Create(Favor favor) { if (ModelState.IsValid) { await _repository.Add(favor); return(RedirectToAction(nameof(Index))); } return(View(favor)); }
public async Task <IActionResult> Edit(int id, Favor favor) { if (id != favor.Id) { return(NotFound()); } if (ModelState.IsValid) { await _repository.Update(favor); return(RedirectToAction(nameof(Index))); } return(View(favor)); }
public Stack <Card> GetFavorCards() { Stack <Card> cards = new Stack <Card>(); Favor one = new Favor(Game, id++); one.CardImage = new BitmapImage(new Uri("pack://application:,,,/ExplodingKittensLib;Component/Images/card_favor_1.jpg", UriKind.Absolute)); Favor two = new Favor(Game, id++); two.CardImage = new BitmapImage(new Uri("pack://application:,,,/ExplodingKittensLib;Component/Images/card_favor_2.jpg", UriKind.Absolute)); Favor three = new Favor(Game, id++); three.CardImage = new BitmapImage(new Uri("pack://application:,,,/ExplodingKittensLib;Component/Images/card_favor_3.jpg", UriKind.Absolute)); Favor four = new Favor(Game, id++); four.CardImage = new BitmapImage(new Uri("pack://application:,,,/ExplodingKittensLib;Component/Images/card_favor_4.jpg", UriKind.Absolute)); cards.Push(one); cards.Push(two); cards.Push(three); cards.Push(four); return(cards); }
// Use this for initialization void Start() { favorScript = GameObject.Find("STRIPs").GetComponent <Favor>(); }
public async void RefreshWithoutGetUnreadCount() { if (Settings.IsMergeMentionAndComment) { switch (Header.FindIndex(item => item.IsActive)) { case 0: await Timeline.Refresh(); break; case 1: await MergeMessage.Refresh(); Header[1].UnreadCount = 0; break; case 2: await Favor.Refresh(); Header[2].UnreadCount = 0; break; case 3: await Message.Refresh(); Header[3].UnreadCount = 0; break; default: break; } } else { switch (Header.FindIndex(item => item.IsActive)) { case 0: await Timeline.Refresh(); break; case 1: await Mention.Refresh(); Header[1].UnreadCount = 0; break; case 2: await Comment.Refresh(); Header[2].UnreadCount = 0; break; case 3: await CommentMention.Refresh(); Header[3].UnreadCount = 0; break; case 4: await Favor.Refresh(); break; case 5: await Message.Refresh(); Header[5].UnreadCount = 0; break; default: break; } } UpdateUnreadHelper.Count = Header.Sum(item => item.UnreadCount); }
public void RemoveFavor(Favor favor) { favorList.Remove(favor); }
public void AddFavor(Favor newFavor) { favorList.Add(newFavor); }
public void ToVcxprojProperties(XmlWriter writer) { if (AdditionalIncludeDirectories != null && AdditionalIncludeDirectories.Length > 0) { writer.WriteElementString("AdditionalIncludeDirectories", string.Join(";", AdditionalIncludeDirectories)); } if (AdditionalOptions != null && AdditionalOptions.Length > 0) { writer.WriteElementString("AdditionalOptions", string.Join(";", AdditionalOptions)); } if (AdditionalUsingDirectories != null && AdditionalUsingDirectories.Length > 0) { writer.WriteElementString("AdditionalUsingDirectories", string.Join(";", AdditionalUsingDirectories)); } if (!string.IsNullOrWhiteSpace(AssemblerListingLocation)) { writer.WriteElementString("AssemblerListingLocation", AssemblerListingLocation); } writer.WriteElementString("AssemblerOutput", AssemblerOutput.ToString()); if (BasicRuntimeChecks != RuntimeCheckType.Default) { writer.WriteElementString("BasicRuntimeChecks", BasicRuntimeChecks.ToString()); } if (!string.IsNullOrWhiteSpace("BrowseInformationFile")) { writer.WriteElementString("BrowseInformationFile", BrowseInformationFile); } writer.WriteElementString("BufferSecurityCheck", XmlConvert.ToString(BufferSecurityCheck)); writer.WriteElementString("CallingConvention", CallingConvention.ToString()); if (CompileAs != CLanguage.Default) { writer.WriteElementString("CompileAs", CompileAs.ToString()); } writer.WriteElementString("CompileAsManaged", CompileAsManagedToString(CompileAsManaged)); writer.WriteElementString("CreateHotpatchableImage", XmlConvert.ToString(CreateHotpatchableImage)); if (DebugInformationFormat != DebugInformationFormat.None) { writer.WriteElementString("DebugInformationFormat", DebugInformationFormat.ToString()); } writer.WriteElementString("DisableLanguageExtensions", XmlConvert.ToString(DisableLanguageExtensions)); WriteStringArray(writer, "DisableSpecificWarnings", SuppressedWarnings.Select(warn => warn.ToString(CultureInfo.InvariantCulture)).ToArray()); if (EnableEnhancedInstructionSet != EnhancedInstructionSet.None) { writer.WriteElementString("EnhancedInstructionSet", EnableEnhancedInstructionSet.ToString()); } writer.WriteElementString("EnableFiberSafeOptimizations", XmlConvert.ToString(EnableFiberSafeOptimizations)); writer.WriteElementString("CodeAnalysis", XmlConvert.ToString(CodeAnalysis)); if (ExceptionHandling != ExceptionHandlingType.NotSpecified) { writer.WriteElementString("ExceptionHandling", ExceptionHandling.ToString()); } writer.WriteElementString("ExpandAttributedSource", XmlConvert.ToString(ExpandAttributedSource)); writer.WriteElementString("FavorSizeOrSpeed", Favor.ToString()); writer.WriteElementString("FloatingPointExceptions", XmlConvert.ToString(FloatingPointExceptions)); writer.WriteElementString("FloatingPointModel", FloatingPointModel.ToString()); writer.WriteElementString("ForceConformanceInForLoopScope", XmlConvert.ToString(ForceConformanceInForLoopScope)); WriteStringArray(writer, "ForcedUsingFiles", ForcedUsingFiles); writer.WriteElementString("FunctionLevelLinking", XmlConvert.ToString(FunctionLevelLinking)); writer.WriteElementString("GenerateXMLDocumentationFiles", XmlConvert.ToString(GenerateXMLDocumentationFiles)); writer.WriteElementString("IgnoreStandardIncludePath", XmlConvert.ToString(IgnoreStandardIncludePath)); if (InlineFunctionExpansion != InlineExpansion.Default) { writer.WriteElementString("InlineFunctionExpansion", InlineFunctionExpansion.ToString()); } writer.WriteElementString("IntrinsicFunctions", XmlConvert.ToString(IntrinsicFunctions)); writer.WriteElementString("MinimalRebuild", XmlConvert.ToString(MinimalRebuild)); writer.WriteElementString("MultiProcessorCompilation", XmlConvert.ToString(MultiProcessorCompilation)); writer.WriteElementString("OmitDefaultLibName", XmlConvert.ToString(OmitDefaultLibName)); writer.WriteElementString("OmitFramePointers", XmlConvert.ToString(OmitFramePointers)); writer.WriteElementString("OpenMPSupport", XmlConvert.ToString(OpenMPSupport)); writer.WriteElementString("Optimization", Optimization.ToString()); WriteStringArray(writer, "PreprocessorDefinitions", Defines); if (ProcessorNumber.HasValue) { writer.WriteElementString("ProcessorNumber", ProcessorNumber.Value.ToString(CultureInfo.InvariantCulture)); } writer.WriteElementString("RuntimeLibrary", RuntimeLibrary.ToString()); writer.WriteElementString("RuntimeTypeInfo", XmlConvert.ToString(RuntimeTypeInfo)); writer.WriteElementString("SmallerTypeCheck", XmlConvert.ToString(SmallerTypeCheck)); writer.WriteElementString("StringPooling", XmlConvert.ToString(StringPooling)); if (StructMemberAlignment.HasValue) { writer.WriteElementString("StructMemberAlignment", StructMemberAlignment.Value.ToString(CultureInfo.InvariantCulture)); } writer.WriteElementString("AllWarningsAsError", XmlConvert.ToString(AllWarningsAsError)); WriteStringArray(writer, "SpecificWarningsAsError", SpecificWarningsAsError.Select(warn => warn.ToString(CultureInfo.InvariantCulture)).ToArray()); writer.WriteElementString("TreatWCharTAsBuiltInType", XmlConvert.ToString(TreatWCharTAsBuiltInType)); writer.WriteElementString("UndefineAllPreprocessorDefinitions", XmlConvert.ToString(UndefineAllPreprocessorDefinitions)); WriteStringArray(writer, "UndefinePreprocessorDefinitions", UndefinePreprocessorDefinitions); writer.WriteElementString("WarningLevel", WarningLevelToString(WarningLevel)); writer.WriteElementString("WholeProgramOptimization", XmlConvert.ToString(WholeProgramOptimization)); writer.WriteElementString("ProgramDataBaseFileName", PDBFileName); }
private void Favor_Tapped(object sender, TappedRoutedEventArgs e) { e.Handled = true; Favor?.Invoke(this, new WeiboActionEventArgs((e.OriginalSource as FrameworkElement).DataContext as BaseModel)); }