Пример #1
0
        // TO DO - add image, renewaldate
        protected override string GetExtraData()
        {
            string extraData = base.GetExtraData();

            extraData += Ticker + "|";
            extraData += DomainName + "|";
            extraData += ContractType + "|";
            extraData += DateTimeToString(RenewalDate) + "|";
            extraData += Edition.ToString() + "|";
            extraData += Description + "|";
            extraData += Precision.ToString() + "|";
            extraData += IsFinalSupply.ToString() + "|";
            extraData += IsNonFungible.ToString() + "|";
            extraData += NonFungibleType.ToString() + "|";
            extraData += NonFungibleKey + "|";
            extraData += Owner + "|";
            extraData += Address + "|";
            extraData += Currency + "|";
            extraData += Icon + "|";
            extraData += Image + "|";
            extraData += Custom1 + "|";
            extraData += Custom2 + "|";
            extraData += Custom3 + "|";
            return(extraData);
        }
Пример #2
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("databaseName");
     writer.WriteStringValue(DatabaseName);
     writer.WritePropertyName("edition");
     writer.WriteStringValue(Edition.ToString());
     writer.WritePropertyName("serviceObjectiveName");
     writer.WriteStringValue(ServiceObjectiveName.ToString());
     writer.WritePropertyName("maxSizeBytes");
     writer.WriteStringValue(MaxSizeBytes);
     writer.WritePropertyName("storageKeyType");
     writer.WriteStringValue(StorageKeyType.ToSerialString());
     writer.WritePropertyName("storageKey");
     writer.WriteStringValue(StorageKey);
     writer.WritePropertyName("storageUri");
     writer.WriteStringValue(StorageUri);
     writer.WritePropertyName("administratorLogin");
     writer.WriteStringValue(AdministratorLogin);
     writer.WritePropertyName("administratorLoginPassword");
     writer.WriteStringValue(AdministratorLoginPassword);
     if (Optional.IsDefined(AuthenticationType))
     {
         writer.WritePropertyName("authenticationType");
         writer.WriteStringValue(AuthenticationType.Value.ToSerialString());
     }
     writer.WriteEndObject();
 }
Пример #3
0
        public override string Print()
        {
            string result = base.Print();

            result += $"Ticker: {Ticker}\n";
            result += $"DomainName: {DomainName}\n";
            result += $"ContractType: {ContractType.ToString()}\n";
            result += $"RenewalDate: {DateTimeToString(RenewalDate)}\n";
            result += $"Edition: {Edition.ToString()}\n";
            result += $"Description: {Description}\n";
            result += $"Precision: {Precision.ToString()}\n";
            result += $"IsFinalSupply: {IsFinalSupply.ToString()}\n";
            result += $"IsNonFungible: {IsNonFungible.ToString()}\n";
            result += $"NonFungibleType: {NonFungibleType.ToString()}\n";
            result += $"NonFungibleKey: {NonFungibleKey}\n";
            result += $"Owner: {Owner}\n";
            result += $"Address: {Address}\n";
            result += $"Currency: {Currency}\n";
            result += $"Icon: {Icon}\n";
            result += $"Image: {Image}\n";
            result += $"Custom1: {Custom1}\n";
            result += $"Custom2: {Custom2}\n";
            result += $"Custom3: {Custom3}\n";
            return(result);
        }
Пример #4
0
        public TestCollections(int count)
        {
            Editions        = new List <Edition>();
            Text            = new List <string>();
            EdMagDictionary = new Dictionary <Edition, Magazine>();
            StMagDictionary = new Dictionary <string, Magazine>();

            for (int i = 0; i < count; i++)
            {
                Magazine magazine = GetMegazine(i);
                Edition  edition  = magazine.Edition;

                Editions.Add(edition);
                Text.Add(edition.ToString());
                EdMagDictionary.Add(edition, magazine);
                StMagDictionary.Add(edition.ToString(), magazine);
            }
        }
Пример #5
0
 public override void DumpBody(XmlWriter writer)
 {
     writer.WriteElementString("product-id", ProductId.ToString());
     writer.WriteElementString("edition", Edition.ToString());
     writer.WriteElementString("major-version", MajorVersion.ToString());
     writer.WriteElementString("minor-version", MinorVersion.ToString());
     writer.WriteElementString("build-number", BuildNumber.ToString());
     writer.WriteElementString("build-date", BuildDate.ToString());
 }
Пример #6
0
        /// <summary>
        /// Returns representation of book, including <see cref="formatProvider"/>
        /// <list type="bullet">
        /// <item>
        /// <term>"V"</term>
        /// <description>Returns representation of book, including Author,Title,Year,PublishingHouse</description>
        /// </item>
        /// <item>
        /// <term>"B"</term>
        /// <description>Returns representation of book, including Author,Title,Year</description>
        /// </item>
        /// <item>
        /// <term>"S"</term>
        /// <description>Returns representation of book, including Author,Title</description>
        /// </item>
        /// <item>
        /// <term>"L"</term>
        /// <description>Returns representation of book, including Title,Year,PublishingHouse</description>
        /// </item>
        /// <item>
        /// <term>"A"</term>
        /// <description>Returns representation of book, including only Author</description>
        /// </item>
        /// <item>
        /// <term>"T"</term>
        /// <description>Returns representation of book, including only Title</description>
        /// </item>
        /// <item>
        /// <term>"Y"</term>
        /// <description>Returns representation of book, including only Year</description>
        /// </item>
        /// <item>
        /// <term>"H"</term>
        /// <description>Returns representation of book, including only PublishingHouse</description>
        /// </item>
        /// <item>
        /// <term>"E"</term>
        /// <description>Returns representation of book, including only Edition</description>
        /// </item>
        /// <item>
        /// <term>"P"</term>
        /// <description>Returns representation of book, including only Pages</description>
        /// </item>
        /// </list>
        /// </summary>
        public string ToString(string format, IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
            {
                format = "V";
            }

            if (formatProvider == null)
            {
                formatProvider = CultureInfo.CurrentCulture;
            }

            switch (format.ToUpperInvariant())
            {
            case "A":
                return(Author?.ToString(formatProvider) ?? string.Empty);

            case "T":
                return(Title?.ToString(formatProvider) ?? string.Empty);

            case "Y":
                return(Year.ToString(formatProvider));

            case "H":
                return(PublishingHouse?.ToString(formatProvider) ?? string.Empty);

            case "E":
                return(Edition.ToString(formatProvider));

            case "P":
                return(Pages.ToString(formatProvider));

            case "V":
                return("Book record: " + Author?.ToString(formatProvider) + ", " + Title?.ToString(formatProvider) + ", "
                       + Year.ToString(formatProvider) + ", " + PublishingHouse?.ToString(formatProvider));

            case "B":
                return("Book record: " + Author?.ToString(formatProvider) + ", " + Title?.ToString(formatProvider) + ", "
                       + Year.ToString(formatProvider));

            case "S":
                return("Book record: " + Author?.ToString(formatProvider) + ", " + Title?.ToString(formatProvider));

            case "L":
                return("Book record: " + Title?.ToString(formatProvider) + ", " + Year.ToString(formatProvider) + ", "
                       + PublishingHouse?.ToString(formatProvider));

            case string str when !str.Except(new[] { 'T', 'Y', 'H', 'E', 'P', 'A' }).Any():
                return(string.Join(", ", format.Select(c => this.ToString(c.ToString(), formatProvider))));

            default:
                throw new FormatException($"The {format} format string is not supported.");
            }
        }
Пример #7
0
        public TestCollections(int quantity)
        {
            editionList = new List <Edition>();
            stringList  = new List <string>();
            dict1       = new Dictionary <Edition, Magazine>();
            dict2       = new Dictionary <string, Magazine>();

            for (int i = 0; i < quantity; i++)
            {
                Edition e = new Edition();
                e.Title = e.Title + "-" + i;
                editionList.Add(e);
                stringList.Add(e.ToString());

                Magazine m = CollectionsGenerator(i);
                m.EditionProp = e;
                dict1.Add(e, m);
                dict2.Add(e.ToString(), m);
            }
        }
Пример #8
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("Header:" + Header.ToString());
            sb.AppendLine("Edition:" + Edition.ToString());
            sb.AppendLine("Trial/Features byte:" + _FeatureTrialBits.ToString());
            sb.AppendLine("Expiry Date:" + this.ExpiryDate.ToString());
            sb.AppendLine("Serial Number:" + this.SerialNumber);
            sb.AppendLine("Product Code:" + this.ProductCode);
            return(sb.ToString());
        }
Пример #9
0
        public Tuple <int, int, int, int> SearchingTime(Edition ed)
        {
            int time, res1, res2, res3, res4;

            time = Environment.TickCount;
            for (int i = 0; i < 100; i++)
            {
                this.editionList.Find(item => item == ed);
            }

            res1 = Environment.TickCount - time;
            string s = ed.ToString();

            time = Environment.TickCount;

            for (int i = 0; i < 100; i++)
            {
                this.stringList.Find(item => item == s);
            }
            res2 = Environment.TickCount - time;


            Magazine value = new Magazine();

            time = Environment.TickCount;
            for (int i = 0; i < 100; i++)
            {
                this.dict1.TryGetValue(ed, out value);
            }
            res3 = Environment.TickCount - time;


            value = new Magazine();
            time  = Environment.TickCount;
            for (int i = 0; i < 100; i++)
            {
                this.dict2.TryGetValue(s, out value);
            }
            res4 = Environment.TickCount - time;

            return(Tuple.Create(res1, res2, res3, res4));
        }
Пример #10
0
        public MinecraftData(Edition edition, String version)
        {
            var asm = typeof(MinecraftData).GetTypeInfo().Assembly;

            foreach (String str in asm.GetManifestResourceNames())
            {
                Console.WriteLine(str);
            }

            using (Stream stream =
                       asm.GetManifestResourceStream("dotnet_minecraft_data.minecraft_data.data.dataPaths.json"))
            {
                byte[] bufferDataPathJson = new byte[stream.Length];
                stream.Read(bufferDataPathJson);

                using (JsonDocument dataPathDocument = JsonDocument.Parse(Encoding.UTF8.GetString(bufferDataPathJson)))
                {
                    JsonElement versionPathElement = dataPathDocument.RootElement.GetProperty(edition.ToString().ToLower()).GetProperty(version);

                    foreach (JsonProperty pathProperty in versionPathElement.EnumerateObject())
                    {
                        JsonElement element = pathProperty.Value;
                        String      asmPath =
                            $"dotnet_minecraft_data.minecraft_data.data.{element.GetString().Replace(".", "._").Replace("/", "._")}.{pathProperty.Name}.json";
                        using (Stream dataStream =
                                   asm.GetManifestResourceStream(asmPath))
                        {
                            Console.WriteLine($"Reading {asmPath}");
                            byte[] fileBuffer = new byte[dataStream.Length];
                            dataStream.Read(fileBuffer);

                            JsonDocument dataDocument = JsonDocument.Parse(Encoding.UTF8.GetString(fileBuffer));
                            switch (pathProperty.Name)
                            {
                            case "biomes":
                            {
                                Biomes = dataDocument;
                                break;
                            }

                            case "blocks":
                            {
                                Blocks = dataDocument;
                                break;
                            }

                            case "items":
                            {
                                Items = dataDocument;
                                break;
                            }

                            case "foods":
                            {
                                Foods = dataDocument;
                                break;
                            }

                            case "recipies":
                            {
                                Recipes = dataDocument;
                                break;
                            }

                            case "instruments":
                            {
                                Instruments = dataDocument;
                                break;
                            }

                            case "materials":
                            {
                                Materials = dataDocument;
                                break;
                            }

                            case "entities":
                            {
                                Entities = dataDocument;
                                break;
                            }

                            case "enchantments":
                            {
                                Enchantments = dataDocument;
                                break;
                            }

                            case "protocol":
                            {
                                Protocol = dataDocument;
                                break;
                            }

                            case "windows":
                            {
                                Windows = dataDocument;
                                break;
                            }

                            case "version":
                            {
                                Version = dataDocument;
                                break;
                            }

                            case "effects":
                            {
                                Effects = dataDocument;
                                break;
                            }

                            case "particles":
                            {
                                Particles = dataDocument;
                                break;
                            }

                            case "entityLoot":
                            {
                                EntityLoot = dataDocument;
                                break;
                            }

                            case "blockLoot":
                            {
                                BlockLoot = dataDocument;
                                break;
                            }

                            case "language":
                            {
                                Language = dataDocument;
                                break;
                            }

                            default:
                            {
                                Console.WriteLine("Missing " + pathProperty.Name);
                                break;
                            }
                            }
                        }
                    }
                }
            }
        }
Пример #11
0
        public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound)
        {
            switch (strPropertyName.ToLower())
            {
            case "moduleid": // Int
                return(ModuleId.ToString(strFormat, formatProvider));

            case "topic": // VarChar
                return(PropertyAccess.FormatString(Topic, strFormat));

            case "locale": // VarChar
                return(PropertyAccess.FormatString(Locale, strFormat));

            case "edition": // Int
                return(Edition.ToString(strFormat, formatProvider));

            case "version": // VarChar
                return(PropertyAccess.FormatString(Version, strFormat));

            case "title": // NVarChar
                return(PropertyAccess.FormatString(Title, strFormat));

            case "parenttopic": // VarChar
                if (ParentTopic == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(ParentTopic, strFormat));

            case "previoustopic": // VarChar
                if (PreviousTopic == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(PreviousTopic, strFormat));

            case "nexttopic": // VarChar
                if (NextTopic == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(NextTopic, strFormat));

            case "contents": // NVarCharMax
                if (Contents == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(Contents, strFormat));

            default:
                propertyNotFound = true;
                break;
            }

            return(Null.NullString);
        }
Пример #12
0
 public void SetEdition(Edition edition)
 {
     PlayerPrefs.SetString("edition", edition.ToString());
 }
Пример #13
0
        protected void RenderBrowserMode(ComponentController paComponentController)
        {
            IncludeExternalLinkFiles(paComponentController);

            clReceiptList = ApplicationFrame.GetInstance().ActiveFormInfoManager.RunRetrieveQuery();

            paComponentController.AddElementType(ComponentController.ElementType.Control);
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Template, ctTPLEditReceipt);
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_LowerBound, GetLowerBoundDays().ToString());
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_UpperBound, GetUpperBoundDays().ToString());
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Edition, clEdition.ToString().ToLower());
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Filter, ctDefaultType);
            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSWidControlPOSReceiptList);
            paComponentController.RenderBeginTag(HtmlTag.Div);

            RenderTitleBar(paComponentController);
            RenderHeaderBar(paComponentController);
            SCI_ParentForm.RenderToolBar(paComponentController);
            RenderReceiptContainer(paComponentController);
            RenderSummaryBar(paComponentController);
            RenderNoReceiptDiv(paComponentController);

            paComponentController.RenderEndTag();

            RenderExternalComponentsContainer(paComponentController);
        }
Пример #14
0
 public override string ToString()
 {
     return($"{Author}, {Name} {Edition.ToString()} edition, {Year}, {Publisher}");
 }
Пример #15
0
 void SetEdition()
 {
     editionManager.SetEdition(edition);
     buildVersion.text = edition.ToString().ToLower() + "-" + version;
 }
Пример #16
0
        public void TestValidToString()
        {
            string expected = "Humanitas | year 2019 | 100 pages | 2 to library + 8 to loan = 10 total ";

            Assert.AreEqual(expected, edition.ToString());
        }
Пример #17
0
        protected void RenderBrowserMode(ComponentController paComponentController)
        {
            String lcBase64TransactionSettingStr;
            String lcBase64SystemConfigStr;
            String lcBase64StaffPermissionStr;
            String lcBase64RegionalConfigStr;

            lcBase64SystemConfigStr       = General.Base64Encode(clSettingManager.SystemConfigStr);
            lcBase64RegionalConfigStr     = General.Base64Encode(clSettingManager.RegionalConfigStr);
            lcBase64StaffPermissionStr    = General.Base64Encode(clSettingManager.GetSettingValue(ctSETStaffPermissionSetting, "{}"));
            lcBase64TransactionSettingStr = General.Base64Encode(clSettingManager.GetSettingValue(ctSETTransactionSetting, "{}"));

            IncludeExternalLinkFiles(paComponentController);
            CreateReceiptManager();

            paComponentController.AddElementType(ComponentController.ElementType.Control);
            paComponentController.AddBareAttribute(ctSETSytemConfig, lcBase64SystemConfigStr);
            paComponentController.AddBareAttribute(ctSETRegionalConfig, lcBase64RegionalConfigStr);
            paComponentController.AddBareAttribute(ctSETTransactionSetting, lcBase64TransactionSettingStr);
            paComponentController.AddBareAttribute(ctSETStaffPermissionSetting, lcBase64StaffPermissionStr);

            // paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_TaxApplicable, clTaxApplicable.ToString().ToLower());
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_TransactionState, clTransactionState.ToString().ToLower());
            // paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_MultiPaymentMode, clMultiPaymentMode.ToString().ToLower());
            // paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_ReceiptPrintMode, clReceiptPrintMode.ToString().ToLower());

            // paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_AllowShortSell, General.ParseBoolean(clSettingManager.SystemConfig.GetData(ctKEYAllowShortSell), false).ToString().ToLower());
            // paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_TaxInclusive, clReceiptManager.ActiveRow.TaxInclusive.ToString().ToLower());
            // paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_TaxPercent, clReceiptManager.ActiveRow.TaxPercent.ToString());
            // paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_LowerBound, GetLowerBoundDays().ToString());
            // paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_UpperBound, GetUpperBoundDays().ToString());
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_AdminMode, clAdminUser ? "true" : null);
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Mode, clMode.ToString().ToLower());
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_DataID, clReceiptManager.ActiveRow.ReceiptID.ToString());
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Edition, clEdition.ToString().ToLower());
            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSWidControlPOSTransaction);
            paComponentController.RenderBeginTag(HtmlTag.Div);
            RenderTitleBar(paComponentController);
            RenderHeaderBar(paComponentController);
            RenderFields(paComponentController);

            RenderTransactionList(paComponentController);

            RenderKeyPad(paComponentController);

            paComponentController.RenderEndTag();

            RenderExternalComponentsContainer(paComponentController);


            // RenderPopUp(paComponentController, ctTIDReceiptDateInfo, ctIIGReceiptDateInfo);
            // RenderPopUp(paComponentController, ctTIDPaymentInfo, ctIIGPaymentInfo);
        }