public async Task CreateCollectionEmitsEvent()
        {
            var collectionName        = "1111";
            var collectionDescription = "1111";
            var tokenPrefix           = "1111";
            var mode = new CollectionMode(new Nft(200));

            var collectionCreatedTask = new TaskCompletionSource <Created>();
            var createCollection      = new CreateCollection(collectionName, collectionDescription, tokenPrefix, mode);

            using var blockClient = CreateClient();
            blockClient.CollectionManagement.CollectionCreated += (sender, @event) =>
            {
                if (AddressUtils.GetAddrFromPublicKey(@event.Account).Equals(Configuration.Alice.Address))
                {
                    collectionCreatedTask.SetResult(@event);
                }
            };

            using var client = CreateClient();
            client.CollectionManagement.CreateCollection(createCollection, new Address(Configuration.Alice.Address), Configuration.Alice.PrivateKey);

            await collectionCreatedTask.Task
            .WithTimeout(TimeSpan.FromMinutes(1));

            var created = collectionCreatedTask.Task.Result;

            Assert.NotNull(created);
            Output.WriteLine($"Created collection with id: {created.Id}");
        }
Example #2
0
        private void RadioButton_Checked(object sender, RoutedEventArgs e)
        {
            var button = sender as RadioButton;

            if (button.Content.ToString().CompareTo("Web") == 0)
            {
                this.cbService.IsEnabled               = false;
                this.cbAppPools.IsEnabled              = true;
                this.txtExecutablePath.IsEnabled       = false;
                this.btnBrowseExecutablePath.IsEnabled = false;
                this.txtCommandLine.IsEnabled          = false;
                collectionMode = CollectionMode.Web;
            }
            else if (button.Content.ToString().CompareTo("Windows Service") == 0)
            {
                this.cbService.IsEnabled               = true;
                this.cbAppPools.IsEnabled              = false;
                this.txtExecutablePath.IsEnabled       = false;
                this.btnBrowseExecutablePath.IsEnabled = false;
                this.txtCommandLine.IsEnabled          = false;
                collectionMode = CollectionMode.Service;
            }
            else
            {
                this.cbService.IsEnabled               = false;
                this.cbAppPools.IsEnabled              = false;
                this.txtExecutablePath.IsEnabled       = true;
                this.btnBrowseExecutablePath.IsEnabled = true;
                this.txtCommandLine.IsEnabled          = true;
                collectionMode = CollectionMode.Executable;
            }
        }
Example #3
0
        public static void ChangeColorTheme(CollectionMode mode)
        {
            switch (mode)
            {
            case CollectionMode.Boardgame:
                SetTheme(BOARDGAME_MAIN_BACK, BOARDGAME_MAIN_FORE, BOARDGAME_ALTERNATING_BACK, BOARDGAME_ALTERNATING_FORE, BOARDGAME_HIGHLIGHTING_BACK, BOARDGAME_HIGHLIGHTING_FORE);
                break;

            case CollectionMode.Videogame:
                SetTheme(VIDEOGAME_MAIN_BACK, VIDEOGAME_MAIN_FORE, VIDEOGAME_ALTERNATING_BACK, VIDEOGAME_ALTERNATING_FORE, VIDEOGAME_HIGHLIGHTING_BACK, VIDEOGAME_HIGHLIGHTING_FORE);
                break;

            case CollectionMode.CD:
                break;

            case CollectionMode.DVD:
                break;

            case CollectionMode.Book:
                break;

            default:
                SetTheme(DEFAULT_MAIN_BACK, DEFAULT_MAIN_FORE, DEFAULT_ALTERNATING_BACK, DEFAULT_ALTERNATING_FORE, DEFAULT_HIGHLIGHTING_BACK, DEFAULT_HIGHLIGHTING_FORE);
                break;
            }
        }
Example #4
0
        public mainform()
        {
            InitializeComponent();
            UpdateAppearance();

            mode = CollectionMode.Boardgame;
            InitializeDatabase();
            ToggleView();
        }
Example #5
0
        private void SelectVideogameMode()
        {
            mode = CollectionMode.Videogame;

            StyleManager.ChangeColorTheme(mode);
            UpdateAppearance();
            InitializeDatabase();
            UpdateListViews();
        }
 internal static void ProcessGenericType(GenericInstanceType type, InflatedCollectionCollector generics, GenericInstanceMethod contextMethod, CollectionMode mode)
 {
     bool flag = generics.TypeDeclarations.Add(type);
     if (((mode != CollectionMode.Types) || flag) && ((mode != CollectionMode.MethodsAndTypes) || generics.TypeMethodDeclarations.Add(type)))
     {
         GenericContext genericContext = new GenericContext(type, contextMethod);
         Unity.Cecil.Visitor.Extensions.Accept(type.ElementType.Resolve(), new GenericContextAwareDeclarationOnlyVisitor(generics, genericContext, CollectionMode.Types));
         foreach (GenericInstanceType type2 in Enumerable.OfType<GenericInstanceType>(type.GenericArguments))
         {
             ProcessGenericType(Inflater.InflateType(genericContext, type2), generics, null, mode);
         }
     }
 }
Example #7
0
 public Collection(PublicKey owner, string name, string description, string tokenPrefix, uint customDataSize, PublicKey sponsor, PublicKey unconfirmedSponsor, CollectionMode collectionMode, AccessMode accessMode, uint decimalPoints, string offChainSchema)
 {
     Owner              = owner;
     Name               = name;
     Description        = description;
     TokenPrefix        = tokenPrefix;
     CustomDataSize     = customDataSize;
     Sponsor            = sponsor;
     UnconfirmedSponsor = unconfirmedSponsor;
     CollectionMode     = collectionMode;
     AccessMode         = accessMode;
     DecimalPoints      = decimalPoints;
     OffChainSchema     = offChainSchema;
 }
Example #8
0
        internal static void ProcessGenericType(GenericInstanceType type, InflatedCollectionCollector generics, GenericInstanceMethod contextMethod, CollectionMode mode)
        {
            bool flag = generics.TypeDeclarations.Add(type);

            if (((mode != CollectionMode.Types) || flag) && ((mode != CollectionMode.MethodsAndTypes) || generics.TypeMethodDeclarations.Add(type)))
            {
                GenericContext genericContext = new GenericContext(type, contextMethod);
                type.ElementType.Resolve().Accept(new GenericContextAwareDeclarationOnlyVisitor(generics, genericContext, CollectionMode.Types));
                foreach (GenericInstanceType type2 in type.GenericArguments.OfType <GenericInstanceType>())
                {
                    ProcessGenericType(Inflater.InflateType(genericContext, type2), generics, null, mode);
                }
            }
        }
Example #9
0
 public GenericContextAwareDeclarationOnlyVisitor(InflatedCollectionCollector generics, GenericContext genericContext, CollectionMode mode = 0)
 {
     this._generics       = generics;
     this._genericContext = genericContext;
     this._mode           = mode;
 }
Example #10
0
 public static void PerformCollection(int gen = -1, CollectionMode mode = CollectionMode.Default)
 {
     EnsureInitialized();
     garbageCollector !.PerformCollectionInternal(gen, mode);
 }
 public ObjectRestrictionAttribute(Type restriction, SearchForm searchForm, CollectionMode collectionMode)
 {
     SearchForm     = searchForm;
     Restriction    = restriction;
     CollectionMode = collectionMode;
 }
 public GenericContextAwareDeclarationOnlyVisitor(InflatedCollectionCollector generics, GenericContext genericContext, [Optional, DefaultParameterValue(0)] CollectionMode mode)
 {
     this._generics = generics;
     this._genericContext = genericContext;
     this._mode = mode;
 }