Esempio n. 1
0
        public static NeoStorageKey New(NeoVersionedAppUser vau, byte[] domain, byte[] className)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(NeoStorageKey.Null());
            }

            NeoStorageKey nsk = new NeoStorageKey();

            nsk._app   = NeoVersionedAppUser.GetAppNameAsByteArray(vau);
            nsk._major = NeoVersionedAppUser.GetMajor(vau);
            nsk._minor = NeoVersionedAppUser.GetMinor(vau);
            nsk._build = NeoVersionedAppUser.GetBuild(vau);
            //nsk._revision = NeoVersionedAppUser.GetRevision(vau);
            nsk._userScriptHash = NeoVersionedAppUser.GetUserScriptHash(vau);
            nsk._domain         = domain;
            nsk._className      = className;
            nsk._index          = 0;
            nsk._fieldName      = NeoEntityModel.NullByteArray;
            nsk._state          = NeoEntityModel.EntityState.INIT;
            if (NeoTrace.RUNTIME)
            {
                LogExt("New(vau,bc)", nsk);
            }
            return(nsk);
        }
Esempio n. 2
0
        /// <summary>
        /// News the specified vau.
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="className">class name</param>
        /// <returns>NeoStorageKey</returns>
        public static NeoStorageKey New(NeoVersionedAppUser vau, string className)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(NeoStorageKey.Null());
            }

            NeoStorageKey nsk = new NeoStorageKey();

            nsk._app   = NeoVersionedAppUser.GetAppNameAsByteArray(vau);
            nsk._major = NeoVersionedAppUser.GetMajor(vau);
            nsk._minor = NeoVersionedAppUser.GetMinor(vau);
            nsk._build = NeoVersionedAppUser.GetBuild(vau);
            //nsk._revision = NeoVersionedAppUser.GetRevision(vau);
            nsk._userScriptHash = NeoVersionedAppUser.GetUserScriptHash(vau);
            nsk._className      = className.AsByteArray();
            nsk._index          = 0;
            nsk._fieldName      = "";
            nsk._state          = NeoEntityModel.EntityState.INIT;
            LogExt("New(vau,sc).nsk", nsk);
            return(nsk);
        }