async void ICodeReader.OnReadCodeBar(string text) { if (OrdenIsFocused) { Of ofs = await GetOfAsync(text); } }
public override bool Equals(object obj) { var o = obj as Orbital; if (o == null) { return(base.Equals(obj)); } return(obj?.GetType() == GetType() && Of.Equals(o.Of)); }
/// <summary> /// Calculates a label representing <paramref name="page"/>'s <see cref="WebViewPage{TModel}.Model"/> /// </summary> /// <typeparam name="TModel"></typeparam> /// <param name="page"></param> /// <returns></returns> public static string GetModelLabel <TModel>(this WebViewPage <TModel> page) where TModel : class { string label = null; if (page.Model != null) { var controller = page.Controller(); var controllerType = controller.GetType(); // First try to use BootstrapController's label selector if (controllerType.IsConstructedGenericTypeOfDefinition(typeof(IViewModelLabelSelectorContainer <>))) { string ownerPropName = Of <IViewModelLabelSelectorContainer <IEntityViewModel> > .CodeNameFor( c => c.ViewModelLabelSelectorOwner); var ownerProp = controllerType.GetProperty(ownerPropName); object owner = ownerProp.GetValue(controller); string selectorPropName = Of <IViewModelLabelSelectorOwner <IEntityViewModel> > .CodeNameFor(o => o.ViewModelLabelSelector); var selectorProp = owner.GetType().GetProperty(selectorPropName); var selector = (Delegate)selectorProp.GetValue(owner); var modelAsEntityViewModel = (IEntityViewModel)page.Model; // If there are original values, they take precedence over edited ones. modelAsEntityViewModel = modelAsEntityViewModel.OriginalValues ?? modelAsEntityViewModel; label = (string)selector.DynamicInvoke(modelAsEntityViewModel); } else { // Next try an EntityViewModel's Id var modelAsEntityViewModel = page.Model as IEntityViewModel; if (modelAsEntityViewModel != null) { label = modelAsEntityViewModel.Id.Value.ToString(CultureInfo.InvariantCulture); } else { // lastly just use .ToString() label = page.Model.ToString(); } } } return(label); }
/// <summary> /// Return a human-readable representation. /// </summary> /// <param name="of"></param> /// <returns></returns> public static string ToString(Of of) { string result; switch (of) { case Of.Target: result = "the target"; break; case Of.You: result = "you"; break; default: throw new ArgumentException("Unknown of value", "of"); } return result; }
//Степенуване private void Ste() { instr.text = "'^'- Степен "; int n = Random.Range(3, 5); int x = Random.Range(2, 7); double O = Mathf.Pow(x, n); int Of; do { Of = Random.Range(20, 2000); }while (Of == O); quest.text = x + "^(" + n + ") = ?"; tr.text = O.ToString(); fal.text = Of.ToString(); }
private static void SetNames() { Thing.SetName("thing"); Link.SetName("link"); IsA.SetName("is a"); IsNotA.SetName("is not a"); Of.SetName("of"); And.SetName("and"); ThatConsistsOf.SetName("that consists of"); Has.SetName("has"); Contains.SetName("contains"); ContainedBy.SetName("contained by"); One.SetName("one"); Zero.SetName("zero"); Character.SetName("character"); Sum.SetName("sum"); String.SetName("string"); Name.SetName("name"); Set.SetName("set"); Group.SetName("group"); ParsedFrom.SetName("parsed from"); ThatIs.SetName("that is"); ThatIsBefore.SetName("that is before"); ThatIsAfter.SetName("that is after"); ThatIsBetween.SetName("that is between"); ThatIsRepresentedBy.SetName("that is represented by"); ThatHas.SetName("that has"); Text.SetName("text"); Path.SetName("path"); Content.SetName("content"); Empty.SetName("empty"); EmptyContent.SetName("empty content"); Alphabet.SetName("alphabet"); Letter.SetName("letter"); Case.SetName("case"); Upper.SetName("upper"); Lower.SetName("lower"); Code.SetName("code"); }
public Outputs Create(Inputs inputs) { LifeCycle lc = new LifeCycle(inputs.ENozzle1, inputs.ENozzle2, inputs.ENozzle3); Behavior <Double> litersDelivered = Accumulate(lc.EStart.Map(u => Unit.UNIT), inputs.EFuelPulses, inputs.Calibration); return(new Outputs() .SetDelivery(lc.FillActive.Map( Of => Of.Equals(Optional <Fuel> .Of(Fuel.ONE)) ? Delivery.FAST1 : Of.Equals(Optional <Fuel> .Of(Fuel.TWO)) ? Delivery.FAST2 : Of.Equals(Optional <Fuel> .Of(Fuel.THREE)) ? Delivery.FAST3 : Delivery.OFF)) .SetSaleQuantityLcd(litersDelivered.Map( q => Formatters.FormatSaleQuantity(q)))); }
public ActionResult ExternalLoginConfirmation(ExternalLoginRegistrationModel <TUserProfileViewModel> registrationModel, string returnUrl) { string provider = null; string providerUserId = null; if (this.User.Identity.IsAuthenticated || !OAuthWebSecurity.TryDeserializeProviderUserId(registrationModel.ExternalLoginData, out provider, out providerUserId)) { return(this.RedirectToAction("Manage")); } if (this.ModelState.IsValid) { //// Insert a new user into the database var profile = this.Repository.GetByUsername(registrationModel.UserProfileViewModel.Username); // Check if user already exists if (profile == null) { profile = this.CreateUserProfile(registrationModel.UserProfileViewModel); OAuthWebSecurity.CreateOrUpdateAccount(provider, providerUserId, profile.Username); OAuthWebSecurity.Login(provider, providerUserId, createPersistentCookie: false); return(this.PostSuccessfulLogin(profile.Username, returnUrl)); } else { this.ModelState.AddModelError( Of <TUserProfileViewModel> .CodeNameFor(m => m.Username), "User name already exists. Please enter a different user name."); } } this.ViewBag.ProviderDisplayName = OAuthWebSecurity.GetOAuthClientData(provider).DisplayName; this.ViewBag.ReturnUrl = returnUrl; return(this.View(registrationModel)); }
public void Initialize <TContext, TUserProfile>( IDatabaseInitializer <TContext> databaseInitializer, string connectionStringName) where TContext : DbContext where TUserProfile : IUserProfile { Database.SetInitializer(databaseInitializer); try { using (var context = DependencyResolver.Current.GetService <DbContext>()) { if (!context.Database.Exists()) { // Create the SimpleMembership database without Entity Framework migration schema ((IObjectContextAdapter)context).ObjectContext.CreateDatabase(); } } string userTableName = StringHelper.Pluralize(typeof(TUserProfile).Name, Count.Plural); string userIdColumn = Of <IUserProfile> .CodeNameFor(p => p.Id); string userNameColumn = Of <IUserProfile> .CodeNameFor(p => p.Username); WebSecurity.InitializeDatabaseConnection( connectionStringName, userTableName, userIdColumn, userNameColumn, autoCreateTables: true); } catch (Exception ex) { const string Message = "The ASP.NET Simple Membership database could not be initialized. " + "For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588"; throw new InvalidOperationException(Message, ex); } }
Implements IEquatable(Of ValueTuple), IStructuralEquatable, IStructuralComparable, IComparable, IComparable(Of ValueTuple), ITupleInternal
Maybe(Of(ItemID.PygmyStaff)),
public override string WriteTypeScript(CodeConversionOptions options, Context context) => // underlying type Of.WriteTypeScript(options, context).TransformIf(Of.IsUnionType(options), StringUtilities.Parenthesize) // brackets + "[]".Repeat(Rank);
Maybe(Of(ItemID.BetsyWings)))
Maybe(Of(ItemID.GolemMask)),
Public Shared Function Create(Of T1, T2, T3, T4, T5, T6, T7, T8)(item1 As T1, item2 As T2, item3 As T3, item4 As T4, item5 As T5, item6 As T6, item7 As T7, item8 As T8) As (T1, T2, T3, T4, T5, T6, T7, T8)
Public Shared Function Create(Of T1, T2, T3, T4)(item1 As T1, item2 As T2, item3 As T3, item4 As T4) As (T1, T2, T3, T4)
Maybe(Of(ItemID.ThornHook)),
Maybe(Of(ItemID.FishronWings)),
Maybe(Of(ItemID.DukeFishronMask)),
Either(Of(ItemID.Flairon), Of(ItemID.Tsunami), Of(ItemID.RazorbladeTyphoon), Of(ItemID.TempestStaff),
[ItemID.FishronBossBag] = All( Of(ItemID.ShrimpyTruffle),
Public Shared Function Create(Of T1)(item1 As T1) As ValueTuple(Of T1)
Maybe(Of(ItemID.BossMaskMoonlord)),
Public Shared Function Create(Of T1, T2)(item1 As T1, item2 As T2) As (T1, T2)
Maybe(Of(ItemID.PortalGun)),
Public Shared Function Create(Of T1, T2, T3, T4, T5, T6)(item1 As T1, item2 As T2, item3 As T3, item4 As T4, item5 As T5, item6 As T6) As (T1, T2, T3, T4, T5, T6)
Maybe(Of(ItemID.BossMaskBetsy)),
// The portal gun is only a guaranteed drop if the player does not already have one in their inventory. So // we use Maybe for simplicity. [ItemID.MoonLordBossBag] = All( Of(ItemID.GravityGlobe),
[ItemID.GolemBossBag] = All( Of(ItemID.ShinyStone),
Dim dtlist As List(Of cls_dtlist) = New List(Of cls_dtlist)
Either(Of(ItemID.Meowmere), Of(ItemID.Terrarian), Of(ItemID.StarWrath), Of(ItemID.SDMG),