示例#1
0
 public ProcessInstanceBuilder AddItemDef(string id, ItemKinds itemKind, bool isCollection, string structuredRef)
 {
     ItemDefs.Add(new ItemDefinition {
         Id = id, ItemKind = itemKind, IsCollection = isCollection, StructureRef = structuredRef
     });
     return(this);
 }
        protected override async Task ExecuteCoreAsync()
        {
            if (NodeContainer == null)
            {
                await InformRequestCannotBeProcessedAsync();

                return;
            }
            var kindNames  = GetKinds().Select(kind => ItemKindNames[kind]).ToArray();
            var chosenName = await QueryUserForItemKind(kindNames);

            if (!ItemKinds.ContainsKey(chosenName))
            {
                return;
            }
            var chosenKind = ItemKinds[chosenName];
            var item       = CreateItem(chosenKind);

            if (item == null)
            {
                return;
            }
            if (OpenConditionItemCommand.CanExecute(item))
            {
                OpenConditionItemCommand.Execute(item);
                return;
            }
            await
            DialogService.ShowDialogAsync("Cannot navigate", "There was an error and the item could not be opened.",
                                          "cancel");
        }
示例#3
0
        protected override async Task ExecuteCoreAsync()
        {
            if (CreateItemAsync == null || GetConfiguredKindsFunc == null)
            {
                await InformRequestCannotBeProcessedAsync();

                return;
            }
            var configuredKinds     = GetConfiguredKindsFunc();
            var configuredKindNames = configuredKinds.Select(kind => ItemKindNames[kind]).ToArray();
            var chosenKindName      = await QueryUserForItemKind(configuredKindNames);

            if (!ItemKinds.ContainsKey(chosenKindName))
            {
                return;
            }
            var chosenKind = ItemKinds[chosenKindName];
            var item       = await CreateItemAsync(chosenKind);

            if (item == null)
            {
                return;
            }
            ConfigureItemName(item, chosenKindName);
            if (OpenCatalogueItemCommand.CanExecute(item))
            {
                OpenCatalogueItemCommand.Execute(item);
                return;
            }
            await
            DialogService.ShowDialogAsync("Cannot navigate", "There was an error and the item could not be opened.",
                                          "cancel");
        }
 public BuildingRec(int name, SysCreature owner, ItemKinds wares,
                    byte minCount, byte maxCount, byte maxDoors, byte minSize, byte maxSize)
 {
     Name       = name;
     Owner      = owner;
     WaresKinds = wares;
     MinCount   = minCount;
     MaxCount   = maxCount;
     MaxDoors   = maxDoors;
     MinSize    = minSize;
     MaxSize    = maxSize;
 }
        public static BuildingRec Create(int name, SysCreature owner, ItemKinds wares,
                                         byte minCount, byte maxCount, byte maxDoors, byte minSize, byte maxSize)
        {
            BuildingRec result = new BuildingRec();

            result.Name       = name;
            result.Owner      = owner;
            result.WaresKinds = wares;
            result.MinCount   = minCount;
            result.MaxCount   = maxCount;
            result.MaxDoors   = maxDoors;
            result.MinSize    = minSize;
            result.MaxSize    = maxSize;
            return(result);
        }