private bool CanPayRent()
 {
     if (SelectedProperty == null || Handler.HasPaidRent || SelectedProperty.IsMortgaged)
     {
         return(false);
     }
     // Check this is the property the player is actually on.
     if (!IsPlayerOnSelectedProperty(Handler.CurrentPlayer))
     {
         return(false);
     }
     // Proceed.
     if (!IsPlayerSelectedPropertyOwner(Handler.CurrentPlayer) && SelectedProperty.Owner != null)
     {
         // Check against the rules as well!
         if (SelectedProperty.Owner.IsJailed && ((bool)Handler.Settings["allow_rent_collection_while_jailed"]) == false)
         {
             return(false);
         }
         // Else
         if (Handler.CurrentPlayer.Balance >= SelectedProperty.GetRentOwed())
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
        public void Process(GameField game, Player caster, Player opponent, PokemonCard pokemonSource)
        {
            var property = SelectedProperty.ToProperty();
            var type = property.GetType();

            object realValue;

            if (type == typeof(short))
            {
                realValue = short.Parse(ValueToSet);
            }
            else if (type == typeof(int))
            {
                realValue = int.Parse(ValueToSet);
            }
            else if (type == typeof(long))
            {
                realValue = long.Parse(ValueToSet);
            }
            else if (type == typeof(bool))
            {
                realValue = bool.Parse(ValueToSet);
            }
            else
            {
                realValue = ValueToSet;
            }

            property.SetValue(game.LastTarget, realValue);
        }
Ejemplo n.º 3
0
 private void FilterImplementation(object o)
 {
     if (SelectedProperty.Contains("Name"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.Name.Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Last name"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.LastName.Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Birthday"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.Birthday.ToShortDateString().Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Email"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.Email.Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Is adult"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.IsAdult.ToString().Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Is birthday"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.IsBirthday.ToString().Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Sun sign"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.SunSign.Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Chinese sign"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.ChineseSign.Contains(Query) select i);
     }
 }
Ejemplo n.º 4
0
 private void SortImplementation(object o)
 {
     if (SelectedProperty.Contains("Name"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.Name ascending select i);
     }
     else if (SelectedProperty.Contains("Last name"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.LastName ascending select i);
     }
     else if (SelectedProperty.Contains("Birthday"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.Birthday ascending select i);
     }
     else if (SelectedProperty.Contains("Email"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.Email ascending select i);
     }
     else if (SelectedProperty.Contains("Is adult"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.IsAdult ascending select i);
     }
     else if (SelectedProperty.Contains("Is birthday"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.IsBirthday ascending select i);
     }
     else if (SelectedProperty.Contains("Sun sign"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.SunSign ascending select i);
     }
     else if (SelectedProperty.Contains("Chinese sign"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.ChineseSign ascending select i);
     }
 }
Ejemplo n.º 5
0
        static ImmutableArray <PropertyInfo> MakeCurrentProperties(
            ImmutableArray <IInspectedObject> objs,
            Func <IStateInspectorOutputsGroup, FocusedMessageEventsRange> getFocusedMessageEqualRange,
            SelectedProperty selectedProperty
            )
        {
            var  result            = ImmutableArray.CreateBuilder <PropertyInfo>();
            bool isMultiObjectMode = objs.Length >= 2;
            int  objectIndex       = 0;

            foreach (var obj in objs)
            {
                foreach (var dynamicProperty in obj.GetCurrentProperties(getFocusedMessageEqualRange(obj.Owner)))
                {
                    var idProperty = dynamicProperty.Value as IdPropertyView;
                    result.Add(new PropertyInfo(
                                   obj,
                                   dynamicProperty.Key,
                                   dynamicProperty.Value,
                                   isChildProperty: isMultiObjectMode && idProperty == null,
                                   isSelected: selectedProperty != null &&
                                   selectedProperty.Object == obj && selectedProperty.PropertyName == dynamicProperty.Key
                                   ));
                    if (idProperty != null)
                    {
                        idProperty.ObjectNr = isMultiObjectMode ? objectIndex + 1 : 0;
                    }
                }
                ++objectIndex;
            }
            return(result.ToImmutable());
        }
Ejemplo n.º 6
0
        private static SelectedProperty CreateSelectedProperty(IBuilderContext context, PropertyInfo property)
        {
            string           key    = Guid.NewGuid().ToString();
            SelectedProperty result = new SelectedProperty(property, key);

            context.PersistentPolicies.Set <IDependencyResolverPolicy>(new OptionalFixedTypeResolverPolicy(property.PropertyType), key);
            DependencyResolverTrackerPolicy.TrackKey(context.PersistentPolicies,
                                                     context.BuildKey,
                                                     key);
            return(result);
        }
Ejemplo n.º 7
0
 private void SortImplementation(object obj)
 {
     if (SelectedProperty.Contains("Name"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.ProcessName ascending select i);
     }
     else if (SelectedProperty.Contains("ID"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.ProcessID ascending select i);
     }
     else if (SelectedProperty.Contains("Active"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.IsAlive ascending select i);
     }
     else if (SelectedProperty.Contains("CPU"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.Cpu ascending select i);
     }
     else if (SelectedProperty.Contains("RAM, MB"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.RamSize ascending select i);
     }
     else if (SelectedProperty.Contains("RAM, %"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.RamPercents ascending select i);
     }
     else if (SelectedProperty.Contains("Threads"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.ThreadsAmount ascending select i);
     }
     else if (SelectedProperty.Contains("User"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.ProcessOwner ascending select i);
     }
     else if (SelectedProperty.Contains("Path"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.FileName ascending select i);
     }
     else if (SelectedProperty.Contains("LaunchTime"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.LaunchDateTime ascending select i);
     }
 }
Ejemplo n.º 8
0
 set => SetValue(SelectedProperty, value);
Ejemplo n.º 9
0
 private void OnResetProperty(object sender, ExecutedRoutedEventArgs eventArgs)
 {
     SelectedProperty?.Reset();
     eventArgs.Handled = true;
 }
Ejemplo n.º 10
0
 public void ClearButtons()
 {
     Buttons.Clear();
     SelectedProperty.SetValueWithoutBinding(0);
 }
Ejemplo n.º 11
0
 set { SetValue(SelectedProperty, value); }