string.ToUpper()

Here are the examples of the csharp api string.ToUpper() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4325 Examples 7

19 Source : ConsultaSintegraGO.cs
with MIT License
from ACBrNet

private static ACBrEmpresa ProcessResponse(string retorno)
        {
            var result = new ACBrEmpresa();
            var dadosRetorno = ProcessTableHtml(retorno);
            try
            {
                result.CNPJ = LerCampo(dadosRetorno, "CNPJ:");
                result.InscricaoEstadual = LerCampo(dadosRetorno, "Inscrição Estadual - CCE :");
                result.RazaoSocial = LerCampo(dadosRetorno, "Nome Empresarial:");
                result.Logradouro = LerCampo(dadosRetorno, "Logradouro:");
                result.Numero = LerCampo(dadosRetorno, "Número:");
                result.Complemento = LerCampo(dadosRetorno, "Complemento:");

                var dadosRetorno2 = new List<string>();
                dadosRetorno2.AddText(WebUtility.HtmlDecode(retorno.StripHtml().Replace(" ", Environment.NewLine)).Trim());
                dadosRetorno2.RemoveEmptyLines();
                result.Bairro = LerCampo(dadosRetorno2, "Bairro:");
                dadosRetorno2 = null;

                result.Municipio = LerCampo(dadosRetorno, "Município:");
                result.UF = (ConsultaUF)Enum.Parse(typeof(ConsultaUF), LerCampo(dadosRetorno, "UF:").ToUpper());
                result.CEP = LerCampo(dadosRetorno, "CEP:").FormataCEP();
                result.Telefone = LerCampo(dadosRetorno, "Telefone:");
                result.AtividadeEconomica = LerCampo(dadosRetorno, "Atividade Principal");
                result.DataAbertura = LerCampo(dadosRetorno, "Data de Cadastramento:").ToData();
                result.Situacao = LerCampo(dadosRetorno, "Situação Cadastral Vigente:");
                result.DataSituacao = LerCampo(dadosRetorno, "Data desta Situação Cadastral:").ToData();
                result.RegimeApuracao = LerCampo(dadosRetorno, "Regime de Apuração:");
                result.DataEmitenteNFe = LerCampo(dadosRetorno, "Emitente de NFe desde:").ToData();
            }
            catch (Exception exception)
            {
                throw new ACBrException(exception, "Erro ao processar retorno.");
            }

            return result;
        }

19 Source : ConsultaSintegraMS.cs
with MIT License
from ACBrNet

private static ACBrEmpresa ProcessResponse(string retorno)
        {
            var result = new ACBrEmpresa();

            try
            {
                var dadosRetorno = new List<string>();
                dadosRetorno.AddText(retorno.StripHtml());
                dadosRetorno.RemoveEmptyLines();

                result.InscricaoEstadual = LerCampo(dadosRetorno, "Inscri��o Estadual");
                result.DataAbertura = LerCampo(dadosRetorno, "Data de In�cio da Atividade").ToData();
                result.CNPJ = LerCampo(dadosRetorno, "CNPJ");
                result.RazaoSocial = LerCampo(dadosRetorno, "Raz�o Social/Nome");
                result.Logradouro = LerCampo(dadosRetorno, "Logradouro");
                result.Numero = LerCampo(dadosRetorno, "Numero");
                result.Complemento = LerCampo(dadosRetorno, "Complemento");
                result.CEP = LerCampo(dadosRetorno, "CEP").FormataCEP();
                result.Bairro = LerCampo(dadosRetorno, "Bairro");
                result.Municipio = LerCampo(dadosRetorno, "Munic�pio");
                result.UF = (ConsultaUF)Enum.Parse(typeof(ConsultaUF), LerCampo(dadosRetorno, "UF").ToUpper());
                result.Situacao = LerCampo(dadosRetorno, "Situa��o Cadastral");
                result.DataSituacao = LerCampo(dadosRetorno, "Data da �ltima Atualiza��o").ToData();
                result.MotivoSituacao = LerCampo(dadosRetorno, "Motivo da Situa��o");
            }
            catch (Exception exception)
            {
                throw new ACBrException(exception, "Erro ao processar retorno.");
            }

            return result;
        }

19 Source : ConsultaSintegraMT.cs
with MIT License
from ACBrNet

private static ACBrEmpresa ProcessResponse(string retorno)
        {
            var result = new ACBrEmpresa();

            try
            {
                var dadosRetorno = new List<string>();
                retorno = HttpUtility.HtmlDecode(retorno);
                retorno = retorno.StripHtml();
                dadosRetorno.AddText(retorno.Replace(" ", Environment.NewLine));
                dadosRetorno.RemoveEmptyLines();

                result.CNPJ = LerCampo(dadosRetorno, "CPF/CNPJ:");
                result.InscricaoEstadual = LerCampo(dadosRetorno, "Inscri��o estadual:");
                result.RazaoSocial = LerCampo(dadosRetorno, "Raz�o social:").Replace("amp;", string.Empty);
                result.Logradouro = LerCampo(dadosRetorno, "Logradouro:");
                result.Numero = LerCampo(dadosRetorno, "N�mero:");
                result.Complemento = LerCampo(dadosRetorno, "Complemento:");
                result.Bairro = LerCampo(dadosRetorno, "Bairro:");
                result.Municipio = LerCampo(dadosRetorno, "Munic�pio/UF:");
                result.UF = (ConsultaUF)Enum.Parse(typeof(ConsultaUF), LerCampo(dadosRetorno, result.Municipio).ToUpper());
                result.Municipio = result.Municipio.Substring(0, result.Municipio.Length - 2);
                result.CEP = LerCampo(dadosRetorno, "CEP:").FormataCEP();
                result.Telefone = LerCampo(dadosRetorno, "Telefone:");
                result.AtividadeEconomica = LerCampo(dadosRetorno, "Atividade Econ�mica:");
                result.DataAbertura = LerCampo(dadosRetorno, "Data de in�cio no Simples Nacional:").ToData();
                result.Situacao = LerCampo(dadosRetorno, "Situa��o cadastral atual:");
                result.DataSituacao = LerCampo(dadosRetorno, "Data desta situa��o cadastral:").ToData();
                result.RegimeApuracao = LerCampo(dadosRetorno, "Data desta situa��o cadastral:");
                result.DataEmitenteNFe = LerCampo(dadosRetorno, "Emitente de NFe desde:").ToData();

                result.CNAE1 = LerCampo(dadosRetorno, "CNAE Fiscal:");
                var cnae = LerCampo(dadosRetorno, result.CNAE1);
                if (cnae != "CNAE Secund�rio:") result.CNAE1 += $" {cnae}";

                var listCnae2 = new List<string>();
                var aux = LerCampo(dadosRetorno, "CNAE Secund�rio:");
                if (!aux.IsEmpty()) listCnae2.Add(aux);

                do
                {
                    aux = LerCampo(dadosRetorno, aux);
                    if (aux == "Credenciado de of�cio como emissor de NF-e:") break;

                    if (!aux.IsEmpty() && char.IsDigit(aux, 0))
                    {
                        listCnae2.Add(aux);
                    }
                    else
                    {
                        listCnae2[listCnae2.Count - 1] += $" {aux}";
                    }
                } while (!aux.IsEmpty());

                result.CNAE2 = listCnae2.ToArray();
            }
            catch (Exception exception)
            {
                throw new ACBrException(exception, "Erro ao processar retorno.");
            }

            return result;
        }

19 Source : ConsultaSintegraSP.cs
with MIT License
from ACBrNet

private static ACBrEmpresa ProcessResponse(string retorno)
        {
            var result = new ACBrEmpresa();

            try
            {
                var dadosRetorno = new List<string>();
                dadosRetorno.AddText(WebUtility.HtmlDecode(retorno.StripHtml().Replace(" ", Environment.NewLine)));
                dadosRetorno.RemoveEmptyLines();

                result.CNPJ = LerCampo(dadosRetorno, "CNPJ:");
                result.InscricaoEstadual = LerCampo(dadosRetorno, "Inscri��o Estadual:");
                result.RazaoSocial = LerCampo(dadosRetorno, "Raz�o Social:");
                result.Logradouro = LerCampo(dadosRetorno, "Logradouro:");
                result.Numero = LerCampo(dadosRetorno, "N�mero:");
                result.Complemento = LerCampo(dadosRetorno, "Complemento:");
                result.Bairro = LerCampo(dadosRetorno, "Bairro:");
                result.Municipio = LerCampo(dadosRetorno, "Munic�pio:");
                result.UF = (ConsultaUF)Enum.Parse(typeof(ConsultaUF), LerCampo(dadosRetorno, "UF:").ToUpper());
                result.CEP = LerCampo(dadosRetorno, "CEP:").FormataCEP();

                result.Telefone = LerCampo(dadosRetorno, "Telefone:");
                result.AtividadeEconomica = LerCampo(dadosRetorno, "Atividade Econ�mica:");
                result.DataAbertura = LerCampo(dadosRetorno, "Data de Inicio de Atividade:").ToData();
                result.Situacao = LerCampo(dadosRetorno, "Situa��o Cadastral Vigente:");
                result.DataSituacao = LerCampo(dadosRetorno, "Data desta Situa��o Cadastral:").ToData();
                result.RegimeApuracao = LerCampo(dadosRetorno, "Regime de Apura��o:");
                result.DataEmitenteNFe = LerCampo(dadosRetorno, "Emitente de NFe desde:").ToData();
            }
            catch (Exception exception)
            {
                throw new ACBrException(exception, "Erro ao processar retorno.");
            }

            return result;
        }

19 Source : Print.cs
with MIT License
from Accelerider

private static void WriteToConsole(string message, OutType outType = OutType.Info)
        {
            var backupBackground = Console.BackgroundColor;
            var backupForeground = Console.ForegroundColor;

            Console.BackgroundColor = OutColors[outType];
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write($"[{outType.ToString().ToUpper()}]");
            Console.BackgroundColor = backupBackground;

            Console.ForegroundColor = OutColors[outType];
            var spaces = Enumerable.Repeat(" ", 8 - outType.ToString().Length).Aggregate((acc, item) => acc + item);
            Console.WriteLine($"{spaces}{message}");
            Console.ForegroundColor = backupForeground;
        }

19 Source : ConsultaSintegraDF.cs
with MIT License
from ACBrNet

private static ACBrEmpresa ProcessResponse(string retorno)
        {
            const string tableExpression = "<table.*?>(.*?)</table>";
            const string trPattern = "<tr(.*?)</tr>";
            const string tdPattern = "<td.*?>(.*?)</td>";

            var result = new ACBrEmpresa();
            try
            {
                var dadosRetorno = new List<string>();
                var tableContents = GetContents(retorno, tableExpression);
                foreach (var tableContent in tableContents)
                {
                    var trContents = GetContents(tableContent, trPattern);
                    foreach (var trContent in trContents)
                    {
                        var tdContents = GetContents(trContent, tdPattern);
                        foreach (var item in tdContents)
                        {
                            dadosRetorno.AddText((Regex.Replace(item, "<.*?>", string.Empty).Trim()));
                        }
                    }
                }
                result.CNPJ = LerCampo(dadosRetorno, "CNPJ/CPF");
                result.InscricaoEstadual = LerCampo(dadosRetorno, "CF/DF");
                result.RazaoSocial = LerCampo(dadosRetorno, "RAZÃO SOCIAL");
                result.Logradouro = LerCampo(dadosRetorno, "LOGRADOURO");
                result.Numero = LerCampo(dadosRetorno, "Número:");
                result.Complemento = LerCampo(dadosRetorno, "Complemento:");
                result.Bairro = LerCampo(dadosRetorno, "BAIRRO");
                result.Municipio = LerCampo(dadosRetorno, "MUNICÍPIO");
                result.UF = (ConsultaUF)Enum.Parse(typeof(ConsultaUF), LerCampo(dadosRetorno, "UF").ToUpper());
                result.CEP = LerCampo(dadosRetorno, "CEP").FormataCEP();
                result.Telefone = LerCampo(dadosRetorno, "Telefone");
                result.AtividadeEconomica = LerCampo(dadosRetorno, "ATIVIDADE PRINCIPAL");
                result.DataAbertura = LerCampo(dadosRetorno, "DATA DESSA SITUAÇÃO CADASTRAL").ToData();
                result.Situacao = LerCampo(dadosRetorno, "SITUAÇÃO CADASTRAL");
                result.DataSituacao = LerCampo(dadosRetorno, "DATA DESSA SITUAÇÃO CADASTRAL").ToData();
                result.RegimeApuracao = LerCampo(dadosRetorno, "REGIME DE APURAÇÃO");
                result.DataEmitenteNFe = LerCampo(dadosRetorno, "Emitente de NFe desde:").ToData();
            }
            catch (Exception exception)
            {
                throw new ACBrException(exception, "Erro ao processar retorno.");
            }

            return result;
        }

19 Source : DefaultLogger.cs
with MIT License
from Accelerider

private void Write(string category, string message, Exception e)
        {
            message = $"{message}{Environment.NewLine}";

            if (e != null)
            {
                message = $"{message}{e.Message}{Environment.NewLine}" +
                          $"{e.StackTrace}{Environment.NewLine}";
            }

            message = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} " +
                      $"[{Thread.CurrentThread.ManagedThreadId}] " +
                      $"{category.ToUpper()} " +
                      $"{_type.FullName}{Environment.NewLine}" +
                      $"{message}{Environment.NewLine}";

            System.Diagnostics.Debug.Write(message);
            File.WriteAllText(
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "accelerider.windows.log"),
                message);
        }

19 Source : SpellComponentsTable.cs
with GNU Affero General Public License v3.0
from ACEmulator

public static string GetSpellWords(SpellComponentsTable comps, List<uint> formula)
        {
            string firstSpellWord = "";
            string secondSpellWord = "";
            string thirdSpellWord = "";

            if (formula == null) return "";

            // Locate the herb component in the Spell formula
            for (int i = 0; i < formula.Count; i++)
            {
                if (comps.SpellComponents[formula[i]].Type == (uint)Type.Herb)
                    firstSpellWord = comps.SpellComponents[formula[i]].Text;
            }

            // Locate the powder component in the Spell formula
            for (int i = 0; i < formula.Count; i++)
            {
                if (comps.SpellComponents[formula[i]].Type == (uint)Type.Powder)
                    secondSpellWord = comps.SpellComponents[formula[i]].Text;
            }

            // Locate the potion component in the Spell formula
            for (int i = 0; i < formula.Count; i++)
            {
                if (comps.SpellComponents[formula[i]].Type == (uint)Type.Potion)
                    thirdSpellWord = comps.SpellComponents[formula[i]].Text;
            }

            // We need to make sure our second spell word, if any, is capitalized
            // Some spell words have no "secondSpellWord", so we're basically making sure the third word is capitalized.
            string secondSpellWordSet = (secondSpellWord + thirdSpellWord.ToLower());
            if(secondSpellWordSet != "")
            {
                string firstLetter = secondSpellWordSet.Substring(0, 1).ToUpper();
                secondSpellWordSet = firstLetter + secondSpellWordSet.Substring(1);

            }

            string result = $"{firstSpellWord} {secondSpellWordSet}";
            return result.Trim();
        }

19 Source : PlayerCommands.cs
with GNU Affero General Public License v3.0
from ACEmulator

[CommandHandler("reportbug", AccessLevel.Player, CommandHandlerFlag.RequiresWorld, 2,
            "Generate a Bug Report",
            "<category> <description>\n" +
            "This command generates a URL for you to copy and paste into your web browser to submit for review by server operators and developers.\n" +
            "Category can be the following:\n" +
            "Creature\n" +
            "NPC\n" +
            "Item\n" +
            "Quest\n" +
            "Recipe\n" +
            "Landblock\n" +
            "Mechanic\n" +
            "Code\n" +
            "Other\n" +
            "For the first three options, the bug report will include identifiers for what you currently have selected/targeted.\n" +
            "After category, please include a brief description of the issue, which you can further detail in the report on the website.\n" +
            "Examples:\n" +
            "/reportbug creature Drudge Prowler is over powered\n" +
            "/reportbug npc Ulgrim doesn't know what to do with Sake\n" +
            "/reportbug quest I can't enter the portal to the Lost City of Frore\n" +
            "/reportbug recipe I cannot combine Bundle of Arrowheads with Bundle of Arrowshafts\n" +
            "/reportbug code I was killed by a Non-Player Killer\n"
            )]
        public static void HandleReportbug(Session session, params string[] parameters)
        {
            if (!PropertyManager.GetBool("reportbug_enabled").Item)
            {
                session.Network.EnqueueSend(new GameMessageSystemChat("The command \"reportbug\" is not currently enabled on this server.", ChatMessageType.Broadcast));
                return;
            }

            var category = parameters[0];
            var description = "";

            for (var i = 1; i < parameters.Length; i++)
                description += parameters[i] + " ";

            description.Trim();

            switch (category.ToLower())
            {
                case "creature":
                case "npc":
                case "quest":
                case "item":
                case "recipe":
                case "landblock":
                case "mechanic":
                case "code":
                case "other":
                    break;
                default:
                    category = "Other";
                    break;
            }

            var sn = ConfigManager.Config.Server.WorldName;
            var c = session.Player.Name;

            var st = "ACE";

            //var versions = ServerBuildInfo.GetVersionInfo();
            var databaseVersion = DatabaseManager.World.GetVersion();
            var sv = ServerBuildInfo.FullVersion;
            var pv = databaseVersion.PatchVersion;

            //var ct = PropertyManager.GetString("reportbug_content_type").Item;
            var cg = category.ToLower();

            var w = "";
            var g = "";

            if (cg == "creature" || cg == "npc"|| cg == "item" || cg == "item")
            {
                var objectId = new ObjectGuid();
                if (session.Player.HealthQueryTarget.HasValue || session.Player.ManaQueryTarget.HasValue || session.Player.CurrentAppraisalTarget.HasValue)
                {
                    if (session.Player.HealthQueryTarget.HasValue)
                        objectId = new ObjectGuid((uint)session.Player.HealthQueryTarget);
                    else if (session.Player.ManaQueryTarget.HasValue)
                        objectId = new ObjectGuid((uint)session.Player.ManaQueryTarget);
                    else
                        objectId = new ObjectGuid((uint)session.Player.CurrentAppraisalTarget);

                    //var wo = session.Player.CurrentLandblock?.GetObject(objectId);

                    var wo = session.Player.FindObject(objectId.Full, Player.SearchLocations.Everywhere);

                    if (wo != null)
                    {
                        w = $"{wo.WeenieClreplacedId}";
                        g = $"0x{wo.Guid:X8}";
                    }
                }
            }

            var l = session.Player.Location.ToLOCString();

            var issue = description;

            var urlbase = $"https://www.accpp.net/bug?";

            var url = urlbase;
            if (sn.Length > 0)
                url += $"sn={Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(sn))}";
            if (c.Length > 0)
                url += $"&c={Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(c))}";
            if (st.Length > 0)
                url += $"&st={Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(st))}";
            if (sv.Length > 0)
                url += $"&sv={Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(sv))}";
            if (pv.Length > 0)
                url += $"&pv={Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(pv))}";
            //if (ct.Length > 0)
            //    url += $"&ct={Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(ct))}";
            if (cg.Length > 0)
            {
                if (cg == "npc")
                    cg = cg.ToUpper();
                else
                    cg = char.ToUpper(cg[0]) + cg.Substring(1);
                url += $"&cg={Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(cg))}";
            }
            if (w.Length > 0)
                url += $"&w={Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(w))}";
            if (g.Length > 0)
                url += $"&g={Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(g))}";
            if (l.Length > 0)
                url += $"&l={Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(l))}";
            if (issue.Length > 0)
                url += $"&i={Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(issue))}";

            var msg = "\n\n\n\n";
            msg += "Bug Report - Copy and Paste the following URL into your browser to submit a bug report\n";
            msg += "-=-\n";
            msg += $"{url}\n";
            msg += "-=-\n";
            msg += "\n\n\n\n";

            session.Network.EnqueueSend(new GameMessageSystemChat(msg, ChatMessageType.AdminTell));
        }

19 Source : ConversionModule.cs
with MIT License
from acid-chicken

[Command(""), Summary("現在のレートで通貨を換算します。")]
        public async Task ConvertAsync([Summary("換算元の通貨")] string before, [Summary("換算先の通貨")] string after, [Summary("換算額")] decimal volume = decimal.One, [Remainder] string comment = null)
        {
            var result = volume;
            var route = string.Empty;
            var afterL = after.ToLower();
            var beforeL = before.ToLower();
            var afterU = after.ToUpper();
            var beforeU = before.ToUpper();
            var isAfterBTC = afterL == "bitcoin" || afterU == "BTC";
            var isAfterUSD = afterU == UnitedStatesDollar;
            var isAfterC = Convertable.Contains(afterU);
            var isBeforeUSD = beforeU == UnitedStatesDollar;
            var isBeforeC = Convertable.Contains(beforeU);
            if (isAfterUSD)
            {
                if (isBeforeUSD)
                {
                    route = "USD > USD";
                }
                else if (isBeforeC)
                {
                    var beforeD = await ApiManager.GetTickerAsDictionaryAsync("bitcoin", beforeU).ConfigureAwait(false);
                    result *= decimal.Parse(beforeD[$"price_usd"]) / decimal.Parse(beforeD[$"price_{beforeL}"]);
                    route = $"{beforeU} > BTC > USD";
                }
                else
                {
                    var afterDs = await ApiManager.GetTickersAsDictionaryAsync().ConfigureAwait(false);
                    var afterBD = afterDs.First(x => x["id"] == beforeL || x["name"] == before || x["symbol"] == beforeU);
                    result *= decimal.Parse(afterBD[$"price_usd"]);
                    route = $"{beforeU} > USD";
                }
            }
            else if (isAfterC)
            {
                if (isBeforeUSD)
                {
                    var afterD = await ApiManager.GetTickerAsDictionaryAsync("bitcoin", afterU).ConfigureAwait(false);
                    result *= decimal.Parse(afterD[$"price_{afterL}"]) / decimal.Parse(afterD[$"price_usd"]);
                    route = $"USD > BTC > {afterU}";
                }
                else if (isBeforeC)
                {
                    var afterD = await ApiManager.GetTickerAsDictionaryAsync("bitcoin", afterU).ConfigureAwait(false);
                    var beforeD = await ApiManager.GetTickerAsDictionaryAsync("bitcoin", beforeU).ConfigureAwait(false);
                    result *= decimal.Parse(afterD[$"price_{afterL}"]) / decimal.Parse(beforeD[$"price_{beforeL}"]);
                    route = $"{beforeU} > BTC > {afterU}";
                }
                else
                {
                    var afterDs = await ApiManager.GetTickersAsDictionaryAsync(afterU).ConfigureAwait(false);
                    var afterBD = afterDs.First(x => x["id"] == beforeL || x["name"] == before || x["symbol"] == beforeU);
                    result *= decimal.Parse(afterBD[$"price_{afterL}"]);
                    route = $"{beforeU} > {afterU}";
                }
            }
            else
            {
                if (isBeforeUSD)
                {
                    var beforeDs = await ApiManager.GetTickersAsDictionaryAsync().ConfigureAwait(false);
                    var beforeBD = beforeDs.First(x => x["id"] == afterL || x["name"] == after || x["symbol"] == afterU);
                    result /= decimal.Parse(beforeBD[$"price_usd"]);
                    route = $"USD > {afterU}";
                }
                else if (isBeforeC)
                {
                    var beforeDs = await ApiManager.GetTickersAsDictionaryAsync(beforeU).ConfigureAwait(false);
                    var beforeBD = beforeDs.First(x => x["id"] == afterL || x["name"] == after || x["symbol"] == afterU);
                    result /= decimal.Parse(beforeBD[$"price_{beforeL}"]);
                    route = $"{beforeU} > {afterU}";
                }
                else
                {
                    var afterDs = await ApiManager.GetTickersAsDictionaryAsync().ConfigureAwait(false);
                    var afterBD = afterDs.First(x => x["id"] == beforeL || x["name"] == before || x["symbol"] == beforeU);
                    if (isAfterBTC)
                    {
                        result *= decimal.Parse(afterBD["price_btc"]);
                        route = $"{beforeU} > BTC";
                    }
                    else
                    {
                        var beforeDs = await ApiManager.GetTickersAsDictionaryAsync().ConfigureAwait(false);
                        var beforeBD = beforeDs.First(x => x["id"] == afterL || x["name"] == after || x["symbol"] == afterU);
                        result *= decimal.Parse(afterBD["price_usd"]) / decimal.Parse(beforeBD["price_usd"]);
                        route = $"{beforeU} > BTC > {afterU}";
                    }
                }
            }
            await ReplyAsync
            (
                message: Context.User.Mention,
                embed:
                    new EmbedBuilder()
                        .Withreplacedle("換算結果")
                        .WithDescription(route)
                        .WithCurrentTimestamp()
                        .WithColor(Colors.Blue)
                        .WithFooter(EmbedManager.CurrentFooter)
                        .WithAuthor(Context.User)
                        .AddInlineField("換算前", $"{volume} {beforeU}")
                        .AddInlineField("換算後", $"{result} {afterU}")
            ).ConfigureAwait(false);
        }

19 Source : UppercaseConverter.cs
with MIT License
from Actipro

public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
		#endif
			string stringValue = value as string;
			if(stringValue != null) {
				return stringValue.ToUpper();
			}

			return value;
		}

19 Source : ForbiddenWordsInNameViewRule.cs
with GNU General Public License v3.0
from Acumatica

public sealed override bool SatisfyRule(PrimaryDacFinder dacFinder, ISymbol view, INamedTypeSymbol viewType)
		{
			if (view == null)
				return false;

			string viewName = _useCaseSensitiveComparison
				? view.Name
				: view.Name.ToUpper();

			return _forbiddenWords.Any(word => viewName.Contains(word));
		}

19 Source : SquareFinder.cs
with GNU General Public License v3.0
from AdamWhiteHat

public override string ToString()
		{
			StringBuilder result = new StringBuilder();

			result.AppendLine($"IsRationalIrreducible  ? {IsRationalIrreducible}");
			result.AppendLine($"IsAlgebraicIrreducible ? {IsAlgebraicIrreducible}");

			result.AppendLine("Square finder, Rational:");
			result.AppendLine($"γ² = √(  Sᵣ(m)  *  ƒ'(m)²  )");
			result.AppendLine($"γ² = √( {RationalProduct} * {PolynomialDerivativeSquared} )");
			result.AppendLine($"γ² = √( {RationalSquare} )");
			result.AppendLine($"γ  =    {RationalSquareRootResidue} mod N"); // δ mod N 

			result.AppendLine();
			result.AppendLine();
			result.AppendLine("Square finder, Algebraic:");
			result.AppendLine($"    Sₐ(m) * ƒ'(m)  =  {AlgebraicProduct} * {PolynomialDerivative}");
			result.AppendLine($"    Sₐ(m) * ƒ'(m)  =  {AlgebraicSquare}");
			result.AppendLine($"χ = Sₐ(m) * ƒ'(m) mod N = {AlgebraicSquareRootResidue}");


			result.AppendLine($"γ = {RationalSquareRootResidue}");
			result.AppendLine($"χ = {AlgebraicSquareRootResidue}");

			result.AppendLine($"IsRationalSquare  ? {IsRationalSquare}");
			result.AppendLine($"IsAlgebraicSquare ? {IsAlgebraicSquare}");

			BigInteger min = BigInteger.Min(RationalSquareRootResidue, AlgebraicSquareRootResidue);
			BigInteger max = BigInteger.Max(RationalSquareRootResidue, AlgebraicSquareRootResidue);

			BigInteger add = max + min;
			BigInteger sub = max - min;

			BigInteger gcdAdd = GCD.FindGCD(N, add);
			BigInteger gcdSub = GCD.FindGCD(N, sub);

			BigInteger answer = BigInteger.Max(gcdAdd, gcdSub);


			result.AppendLine();
			result.AppendLine($"GCD(N, γ+χ) = {gcdAdd}");
			result.AppendLine($"GCD(N, γ-χ) = {gcdSub}");
			result.AppendLine();
			result.AppendLine($"Solution? {(answer != 1).ToString().ToUpper()}");

			if (answer != 1)
			{
				result.AppendLine();
				result.AppendLine();
				result.AppendLine("*********************");
				result.AppendLine();
				result.AppendLine($" SOLUTION = {answer} ");
				result.AppendLine();
				result.AppendLine("*********************");
				result.AppendLine();
				result.AppendLine();
			}

			result.AppendLine();

			return result.ToString();
		}

19 Source : SharePointDataAdapter.cs
with MIT License
from Adoxio

private static Enreplacedy GetDoreplacedentLocation(OrganizationServiceContext context, Enreplacedy enreplacedy, EnreplacedyMetadata enreplacedyMetadata, Enreplacedy spSite)
		{
			var locations = context.CreateQuery(SharePointDoreplacedentLocationLogicalName)
				.Where(docLoc => docLoc.GetAttributeValue<EnreplacedyReference>("regardingobjectid").Id == enreplacedy.Id && docLoc.GetAttributeValue<int>("statecode") == 0)
				.OrderBy(docLoc => docLoc.GetAttributeValue<DateTime>("createdon"))
				.ToArray();

			Enreplacedy location;

			if (locations.Count() > 1)
			{
				// Multiple doc locations found, choose the first created.
				location = locations.First();
			}
			else if (locations.Count() == 1)
			{
				location = locations.First();
			}
			else
			{
				// No doreplacedent locations found, create an auto-generated one.
				var autoGeneratedRelativeUrl = "{0}_{1}".FormatWith(
					enreplacedy.GetAttributeValue<string>(enreplacedyMetadata.PrimaryNameAttribute),
					enreplacedy.Id.ToString("N").ToUpper());

				location = context.AddOrGetExistingDoreplacedentLocationAndSave<Enreplacedy>(spSite, enreplacedy, autoGeneratedRelativeUrl);
			}

			if (location == null)
			{
				throw new Exception("A doreplacedent location couldn't be found or created for the enreplacedy.");
			}

			return location;
		}

19 Source : SharePointDocumentListDrop.cs
with MIT License
from Adoxio

private Enreplacedy GetDoreplacedentLocation(OrganizationServiceContext context, EnreplacedyMetadata metadata, Guid enreplacedyId)
		{
			var response = (RetrieveResponse)context.Execute(new RetrieveRequest
			{
				Target = new EnreplacedyReference(LogicalName, enreplacedyId),
				ColumnSet = new ColumnSet(metadata.PrimaryNameAttribute),
			});

			var regarding = response.Enreplacedy;

			if (regarding == null)
			{
				return null;
			}

			return GetDoreplacedentLocation(context, regarding,
				"{0}_{1}".FormatWith(regarding.GetAttributeValue<string>(metadata.PrimaryNameAttribute),
					regarding.Id.ToString("N").ToUpper()));
		}

19 Source : FederationAuthenticationHandler.cs
with MIT License
from Adoxio

protected virtual Enreplacedy CreateNewConfirmationContact(
			HttpContext context,
			WSFederationAuthenticationModule fam,
			IDictionary<string, string> signInContext,
			OrganizationServiceContext serviceContext,
			string idenreplacedyProvider,
			string userName,
			string email,
			string displayName)
		{
			// verify that an email address is provided in the signInContext

			if (!signInContext.ContainsKey(AttributeMapEmail))
			{
				return null;
			}

			var invitationCode = Guid.NewGuid().ToString().Replace("-", string.Empty).ToUpper();
			var now = DateTime.UtcNow.Floor(RoundTo.Second);
			var invitationCodeExpiryDate = RegistrationSettings.InvitationCodeDuration != null
				? now + RegistrationSettings.InvitationCodeDuration
				: null;

			return CreateNewConfirmationContact(context, fam, signInContext, serviceContext, idenreplacedyProvider, userName, email, displayName, invitationCode, invitationCodeExpiryDate);
		}

19 Source : AbstractLogger.cs
with MIT License
from adrianmteo

public void Log(LogLevel level, string format, params object[] args)
        {
            if (level >= MinimumLevel && level <= MaximumLevel)
            {
                string date = DateTime.Now.ToString(DateFormat);
                string log = string.Format(format, args);

                string[] lines = log.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);

                foreach (string line in lines)
                {
                    string message = MessageFormat
                        .Replace(LogMessageToken.Date, date)
                        .Replace(LogMessageToken.Level, level.ToString().ToUpper())
                        .Replace(LogMessageToken.Message, line)
                        .Replace(LogMessageToken.Tag, Tag);

                    WriteMessage(message);
                }
            }
        }

19 Source : SwimUtils.cs
with GNU General Public License v3.0
from aedenthorn

public static async void SeaMonsterSay(string speech)
        {
            foreach (char c in speech)
            {
                string s = c.ToString().ToUpper();
                if (seaMonsterSounds.ContainsKey(s))
                {
                    Game1.playSoundPitched("junimoMeep1", (seaMonsterSounds.Keys.ToList().IndexOf(s) / 26) * 2 - 1);
                }
                await Task.Delay(100);
            }
        }

19 Source : DiscordManager.cs
with GNU General Public License v3.0
from aelariane

public static void UpdateStatus()
        {
            if (!canUpdate)
            {
                return;
            }
            if (!PhotonNetwork.inRoom)
            {
                if (PhotonNetwork.InsideLobby)
                {
                    _presence.state = "In lobby: " + Regex.Replace(PhotonNetwork.ServerAddress, "app\\-|\\.exitgamescloud\\.com|\\:\\d+", "").ToUpper().Replace("WS://", "").Replace("WSS://", "");

                    switch (PhotonNetwork.ServerAddress.Split(':')[0])
                    {
                        case "142.44.242.29":
                            _presence.state = "In lobby: USA";
                            break;

                        case "135.125.239.180":
                            _presence.state = "In lobby: Europe";
                            break;

                        case "51.79.164.137":
                            _presence.state = "In lobby: Asia";
                            break;

                        case "172.107.193.233":
                            _presence.state = "In lobby: South America";
                            break;

                        default:
                            break;
                    }

                    _presence.partySize = 0;
                    _presence.partyMax = 0;
                    _presence.largeImageKey = "anarchyicon";
                }
                else if (IN_GAME_MAIN_CAMERA.GameType != GameType.Stop)
                {
                    _presence.state = "Solo: " + FengGameManagerMKII.Level.Name;
                    _presence.partySize = 0;
                    _presence.partyMax = 0;
                    _presence.largeImageKey = FengGameManagerMKII.Level.DiscordName;
                    _presence.largeImageText = FengGameManagerMKII.Level.Name;
                }
                else
                {
                    _presence.state = "In menu";
                    _presence.partySize = 0;
                    _presence.partyMax = 0;
                    _presence.largeImageKey = "anarchyicon";
                }
            }
            else
            {
                var text = PhotonNetwork.room.Name.Split('`')[0].RemoveHex();
                _presence.state = "Multiplayer: " + ((text.Length > 30) ? (text.Remove(27) + "...") : text);
                _presence.partySize = PhotonNetwork.room.PlayerCount;
                _presence.partyMax = PhotonNetwork.room.MaxPlayers;
                _presence.largeImageKey = FengGameManagerMKII.Level.DiscordName;
                _presence.largeImageText = FengGameManagerMKII.Level.Name;
            }
            DiscordRPC.UpdatePresence(_presence);
        }

19 Source : DiscordSDK.cs
with GNU General Public License v3.0
from aelariane

public void UpdateStatus()
        {
            if (!PhotonNetwork.inRoom)
            {
                if (PhotonNetwork.InsideLobby)
                {
                    _Activity.State = "In lobby: " + Regex.Replace(PhotonNetwork.ServerAddress, "app\\-|\\.exitgamescloud\\.com|\\:\\d+", "").ToUpper().Replace("WS://", "").Replace("WSS://", "");
                    _Activity.Party.Size.CurrentSize = 0;
                    _Activity.Party.Size.MaxSize = 0;
                    _Activity.replacedets.LargeImage = "anarchyicon";
                }
                else if (IN_GAME_MAIN_CAMERA.GameType != GameType.Stop)
                {
                    _Activity.State = "Solo: " + FengGameManagerMKII.Level.Name;
                    _Activity.Party.Size.CurrentSize = 0;
                    _Activity.Party.Size.MaxSize = 0;
                    _Activity.replacedets.LargeImage = FengGameManagerMKII.Level.DiscordName;
                    _Activity.replacedets.LargeText = FengGameManagerMKII.Level.Name;
                }
                else
                {
                    _Activity.State = "In menu";
                    _Activity.Party.Size.CurrentSize = 0;
                    _Activity.Party.Size.MaxSize = 0;
                    _Activity.replacedets.LargeImage = "anarchyicon";
                }
            }
            else
            {
                var text = PhotonNetwork.room.Name.Split('`')[0].RemoveHex();
                _Activity.State = "Multiplayer: " + ((text.Length > 30) ? (text.Remove(27) + "...") : text);
                _Activity.Party.Size.CurrentSize = PhotonNetwork.room.PlayerCount;
                _Activity.Party.Size.MaxSize = PhotonNetwork.room.MaxPlayers;
                _Activity.replacedets.LargeImage = FengGameManagerMKII.Level.DiscordName;
                _Activity.replacedets.LargeText = FengGameManagerMKII.Level.Name;
            }

            _ActivityManager.UpdateActivity(_Activity, (result) =>
            {
                if (result != SDK.Result.Ok)
                {
                    Debug.Log("Failed to update Activity.");
                }
            });
        }

19 Source : CharacterSelectionPanel.cs
with GNU General Public License v3.0
from aelariane

protected override void DrawMainPart()
        {
            left.Reset();
            LabelCenter(left, locale["character"], true);
            SelectionGrid(left, costumeSelection, costumeList, 3, true);
            bool updateChar = avatar == null;
            int oldChar = characterSelection.Value;
            SelectionGrid(left, characterSelection, characterList, 1, true);
            if (oldChar != characterSelection.Value)
            {
                updateChar = true;
            }
            character = charactersList[characterSelection].ToUpper();
            var set = CostumeConeveter.LocalDataToHeroCostume(character);
            stats = character.Contains("SET") ? (set == null ? new HeroStat() : set.stat) : HeroStat.getInfo(character);

            LabelCenter(left, locale["camera"], true);
            SelectionGrid(left, Settings.CameraMode, cameraList, cameraList.Length, true);
            float height = Style.Height * (FengGameManagerMKII.Level.PVPEnabled ? 3f : 2f) + (Style.VerticalMargin * (FengGameManagerMKII.Level.PVPEnabled ? 2f : 1f)) + (Style.Height + Style.VerticalMargin);
            left.MoveToEndY(WindowPosition, height);
            if (Button(left, locale["humanStart"], true))
            {
                SpawnHero();
                DisableImmediate();
                return;
            }

            if (FengGameManagerMKII.Level.Teamreplacedan && IN_GAME_MAIN_CAMERA.GameMode != GameMode.PvpAhss)
            {
                if (Button(left, locale["replacedanStart"], true))
                {
                    Spawnreplacedan();
                    DisableImmediate();
                    return;
                }
            }
            if (FengGameManagerMKII.Level.PVPEnabled)
            {
                if (Button(left, locale["ahssStart"], true))
                {
                    SpawnAHSS();
                    DisableImmediate();
                    return;
                }
            }
            if (Button(left, locale["back"], true))
            {
                Screen.lockCursor = true;
                Screen.showCursor = true;
                IN_GAME_MAIN_CAMERA.SpecMov.disable = false;
                IN_GAME_MAIN_CAMERA.Look.disable = false;
                Disable();
                return;
            }
            right.Reset();
            LabelCenter(right, locale["avatar"], true);
            right.height = right.width;
            if (updateChar)
            {
                avatar = LoadTexture(character.Contains("SET") ? "CUSTOM" : character, "png");
            }
            DrawTexture(right, avatar, true);
            right.height = Style.Height;
            LabelCenter(right, locale["stats"], true);
            Label(right, locale.Format("speed", stats.Spd.ToString()), true);
            Label(right, locale.Format("acceleration", stats.Acl.ToString()), true);
            Label(right, locale.Format("gas", stats.Gas.ToString()), true);
            Label(right, locale.Format("blade", stats.Bla.ToString()), true);
        }

19 Source : SinglePanel.cs
with GNU General Public License v3.0
from aelariane

private void OnButtonStartClick()
        {
            IN_GAME_MAIN_CAMERA.Difficulty = difficulitySelection;
            IN_GAME_MAIN_CAMERA.GameType = GameType.Single;
            IN_GAME_MAIN_CAMERA.singleCharacter = new string[] { "Mikasa", "Levi", "Armin", "Marco", "Jean", "Eren", "replacedAN_EREN", "Petra", "Sasha", "Set 1", "Set 2", "Set 3" }[characterSelection.ToValue()].ToUpper();
            IN_GAME_MAIN_CAMERA.CameraMode = (CameraType)Settings.CameraMode.ToValue();
            IN_GAME_MAIN_CAMERA.DayLight = (DayLight)dayLightSelection.ToValue();
            Screen.lockCursor = IN_GAME_MAIN_CAMERA.CameraMode >= CameraType.TPS;
            Screen.showCursor = false;
            CheckBoxCostume.costumeSet = costumeSelection.ToValue() + 1;
            string map = mapList[mapSelection.ToValue()];
            FengGameManagerMKII.Level = LevelInfo.GetInfo(map);
            Application.LoadLevel(FengGameManagerMKII.Level.MapName);
        }

19 Source : ServerListPanel.cs
with GNU General Public License v3.0
from aelariane

private bool CheckRoomFilters(RoomInfo room)
        {
            if (string.IsNullOrEmpty(nameFilter))
            {
                return true;
            }

            return room.Name.ToUpper().Contains(nameFilter.ToUpper());
        }

19 Source : CostumeConeveter.cs
with GNU General Public License v3.0
from aelariane

public static void HeroCostumeToLocalData(HeroCostume costume, string slot)
    {
        slot = slot.ToUpper();
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.sex, CostumeConeveter.SexToInt(costume.sex));
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.costumeId, costume.costumeId);
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.heroCostumeId, costume.id);
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.cape, (!costume.cape) ? 0 : 1);
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.hairInfo, costume.hairInfo.id);
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.eye_texture_id, costume.eye_texture_id);
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.beard_texture_id, costume.beard_texture_id);
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.glreplaced_texture_id, costume.glreplaced_texture_id);
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.skin_color, costume.skin_color);
        PlayerPrefs.SetFloat(slot + PhotonPlayerProperty.hair_color1, costume.hair_color.r);
        PlayerPrefs.SetFloat(slot + PhotonPlayerProperty.hair_color2, costume.hair_color.g);
        PlayerPrefs.SetFloat(slot + PhotonPlayerProperty.hair_color3, costume.hair_color.b);
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.division, CostumeConeveter.DivisionToInt(costume.division));
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.statSPD, costume.stat.Spd);
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.statGAS, costume.stat.Gas);
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.statBLA, costume.stat.Bla);
        PlayerPrefs.SetInt(slot + PhotonPlayerProperty.statACL, costume.stat.Acl);
        PlayerPrefs.SetString(slot + PhotonPlayerProperty.statSKILL, costume.stat.skillID);
    }

19 Source : CostumeConeveter.cs
with GNU General Public License v3.0
from aelariane

public static HeroCostume LocalDataToHeroCostume(string slot)
    {
        slot = slot.ToUpper();
        if (!PlayerPrefs.HasKey(slot + PhotonPlayerProperty.sex))
        {
            return HeroCostume.costume[0];
        }
        HeroCostume heroCostume = new HeroCostume();
        heroCostume.sex = IntToSex(PlayerPrefs.GetInt(slot + PhotonPlayerProperty.sex));
        heroCostume.id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.heroCostumeId);
        heroCostume.costumeId = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.costumeId);
        heroCostume.cape = (PlayerPrefs.GetInt(slot + PhotonPlayerProperty.cape) == 1);
        heroCostume.hairInfo = ((heroCostume.sex != Sex.Male) ? CostumeHair.hairsF[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)] : CostumeHair.hairsM[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)]);
        heroCostume.eye_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.eye_texture_id);
        heroCostume.beard_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.beard_texture_id);
        heroCostume.glreplaced_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.glreplaced_texture_id);
        heroCostume.skin_color = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.skin_color);
        heroCostume.hair_color = new Color(PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color1), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color2), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color3));
        heroCostume.division = CostumeConeveter.IntToDivision(PlayerPrefs.GetInt(slot + PhotonPlayerProperty.division));
        heroCostume.stat = new HeroStat();
        heroCostume.stat.Spd = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statSPD);
        heroCostume.stat.Gas = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statGAS);
        heroCostume.stat.Bla = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statBLA);
        heroCostume.stat.Acl = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statACL);
        heroCostume.stat.skillID = PlayerPrefs.GetString(slot + PhotonPlayerProperty.statSKILL);
        heroCostume.setBodyByCostumeId(-1);
        heroCostume.setMesh();
        heroCostume.setTexture();
        return heroCostume;
    }

19 Source : FengPhotonCalls.cs
with GNU General Public License v3.0
from aelariane

public void OnPhotonPlayerPropertiesChanged(AOTEventArgs args)
    {
        PlayerList?.Update();
        if (args.Player.IsLocal)
        {
            return;
        }
        var hash = args.Hashtable;

        int? bla = hash[PhotonPlayerProperty.statBLA] as int?;
        int? spd = hash[PhotonPlayerProperty.statSPD] as int?;
        int? acl = hash[PhotonPlayerProperty.statACL] as int?;
        int? gas = hash[PhotonPlayerProperty.statGAS] as int?;
        if (hash[PhotonPlayerProperty.character] != null)
        {
            if (hash[PhotonPlayerProperty.character] is string set)
            {
                if (set.ToUpper().Contains("SET"))
                {
                    if ((bla.HasValue && (bla.Value > 125 || bla.Value < 75))
                        || (spd.HasValue && (spd.Value > 125 || spd.Value < 75))
                        || (acl.HasValue && (acl.Value > 125 || acl.Value < 75))
                        || (gas.HasValue && (gas.Value > 125 || gas.Value < 75)))
                    {
                        if (!args.Player.AbuseInformation.CharacterUnusualStats)
                        {
                            args.Player.AbuseInformation.CharacterUnusualStats = true;
                        }
                    }
                }
            }
        }
        if (bla + spd + acl + gas > 455)
        {
            Anarchy.Network.Antis.Kick(args.Player, true, "Excessive stats");
        }
    }

19 Source : FengGameManagerMKII.cs
with GNU General Public License v3.0
from aelariane

public void NotSpawnNonAireplacedan(string id)
    {
        myLastHero = id.ToUpper();
        PhotonNetwork.player.Dead = true;
        PhotonNetwork.player.Isreplacedan = true;
        Screen.lockCursor = IN_GAME_MAIN_CAMERA.CameraMode >= CameraType.TPS;
        Screen.showCursor = true;
        ShowHUDInfoCenter(
            "the game has started for 60 seconds.\n please wait for next round.\n Click Right Mouse Key to Enter or Exit the Spectator Mode.");
        IN_GAME_MAIN_CAMERA.MainCamera.enabled = true;
        IN_GAME_MAIN_CAMERA.MainCamera.SetMainObject(null);
        IN_GAME_MAIN_CAMERA.MainCamera.setSpectorMode(true);
        IN_GAME_MAIN_CAMERA.MainCamera.gameOver = true;
    }

19 Source : FengGameManagerMKII.cs
with GNU General Public License v3.0
from aelariane

public void NotSpawnPlayer(string id)
    {
        myLastHero = id.ToUpper();
        PhotonNetwork.player.Dead = true;
        PhotonNetwork.player.Isreplacedan = false;
        Screen.lockCursor = IN_GAME_MAIN_CAMERA.CameraMode >= CameraType.TPS;
        Screen.showCursor = false;
        IN_GAME_MAIN_CAMERA.MainCamera.enabled = true;
        IN_GAME_MAIN_CAMERA.MainCamera.SetMainObject(null);
        IN_GAME_MAIN_CAMERA.MainCamera.setSpectorMode(true);
        IN_GAME_MAIN_CAMERA.MainCamera.gameOver = true;
    }

19 Source : FengGameManagerMKII.cs
with GNU General Public License v3.0
from aelariane

public void SpawnPlayerAt(string id, string find = "")
    {
        if (!CustomLevel.logicLoaded || !CustomLevel.customLevelLoaded)
        {
            NotSpawnPlayer(id);
            return;
        }

        myLastRespawnTag = find;
        Vector3 pos;
        var rot = Quaternion.idenreplacedy;
        if (find != string.Empty)
        {
            var positions = GameObject.FindGameObjectsWithTag(find);
            if (positions.Length > 0)
            {
                pos = positions[Random.Range(0, positions.Length)].transform.position;
            }
            else
            {
                pos = RespawnPositions.RandomHeroPos;
            }
        }
        else if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
        {
            pos = checkpoint.transform.position;
        }
        else if (RCManager.racingSpawnPointSet)
        {
            pos = RCManager.racingSpawnPoint;
            rot = RCManager.racingSpawnPointRotation;
        }
        else if (Level.Name.StartsWith("Custom"))
        {
            var list = new List<Vector3>();
            switch (PhotonNetwork.player.RCteam)
            {
                case 0:
                    for (var i = 0; i < 2; i++)
                    {
                        var type = i == 0 ? "C" : "M";
                        foreach (var vec in CustomLevel.spawnPositions["Player" + type])
                        {
                            list.Add(vec);
                        }
                    }

                    break;

                case 1:
                    using (var enumerator = CustomLevel.spawnPositions["PlayerC"].GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            var vec2 = enumerator.Current;
                            list.Add(vec2);
                        }
                    }

                    break;

                case 2:
                    using (var enumerator = CustomLevel.spawnPositions["PlayerM"].GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            var vec2 = enumerator.Current;
                            list.Add(vec2);
                        }
                    }

                    break;

                default:
                    foreach (var vec3 in CustomLevel.spawnPositions["PlayerM"])
                    {
                        list.Add(vec3);
                    }

                    break;
            }

            if (list.Count > 0)
            {
                pos = list[Random.Range(0, list.Count)];
            }
            else
            {
                pos = RespawnPositions.RandomHeroPos;
            }
        }
        else
        {
            pos = RespawnPositions.RandomHeroPos;
        }

        var component = IN_GAME_MAIN_CAMERA.MainCamera;
        myLastHero = id.ToUpper();
        if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
        {
            if (IN_GAME_MAIN_CAMERA.singleCharacter == "replacedAN_EREN")
            {
                component.SetMainObject(
                    ((GameObject)Instantiate(CacheResources.Load("replacedAN_EREN"), pos, Quaternion.idenreplacedy))
                    .GetComponent<replacedAN_EREN>());
            }
            else
            {
                component.SetMainObject(((GameObject)Instantiate(CacheResources.Load("AOTTG_HERO 1"), pos, rot))
                    .GetComponent<HERO>());
                if (IN_GAME_MAIN_CAMERA.singleCharacter == "SET 1" || IN_GAME_MAIN_CAMERA.singleCharacter == "SET 2" ||
                    IN_GAME_MAIN_CAMERA.singleCharacter == "SET 3")
                {
                    var heroCostume = CostumeConeveter.LocalDataToHeroCostume(IN_GAME_MAIN_CAMERA.singleCharacter);
                    heroCostume.Checkstat();
                    CostumeConeveter.HeroCostumeToLocalData(heroCostume, IN_GAME_MAIN_CAMERA.singleCharacter);
                    IN_GAME_MAIN_CAMERA.MainHERO.Setup.Init();

                    IN_GAME_MAIN_CAMERA.MainHERO.Setup.myCostume = heroCostume;
                    IN_GAME_MAIN_CAMERA.MainHERO.Setup.myCostume.stat = heroCostume.stat;

                    IN_GAME_MAIN_CAMERA.MainHERO.Setup.SetCharacterComponent();
                    IN_GAME_MAIN_CAMERA.MainHERO.SetStat();
                    IN_GAME_MAIN_CAMERA.MainHERO.SetSkillHudPosition();
                }
                else
                {
                    for (var i = 0; i < HeroCostume.costume.Length; i++)
                    {
                        if (HeroCostume.costume[i].name.ToUpper() == IN_GAME_MAIN_CAMERA.singleCharacter.ToUpper())
                        {
                            var num = HeroCostume.costume[i].id + CheckBoxCostume.costumeSet - 1;
                            if (HeroCostume.costume[num].name != HeroCostume.costume[i].name)
                            {
                                num = HeroCostume.costume[i].id + 1;
                            }

                            IN_GAME_MAIN_CAMERA.MainHERO.Setup.Init();
                            IN_GAME_MAIN_CAMERA.MainHERO.Setup.myCostume = HeroCostume.costume[num];
                            IN_GAME_MAIN_CAMERA.MainHERO.Setup.myCostume.stat =
                                HeroStat.getInfo(HeroCostume.costume[num].name.ToUpper());
                            IN_GAME_MAIN_CAMERA.MainHERO.Setup.SetCharacterComponent();
                            IN_GAME_MAIN_CAMERA.MainHERO.SetStat();
                            IN_GAME_MAIN_CAMERA.MainHERO.SetSkillHudPosition();
                            break;
                        }
                    }
                }
            }
        }
        else
        {
            var hero = Pool.NetworkEnable("AOTTG_HERO 1", pos, Quaternion.idenreplacedy).GetComponent<HERO>();
            component.SetMainObject(hero);
            id = id.ToUpper();
            if (id == "SET 1" || id == "SET 2" || id == "SET 3")
            {
                var heroCostume2 = CostumeConeveter.LocalDataToHeroCostume(id);
                heroCostume2.Checkstat();
                CostumeConeveter.HeroCostumeToLocalData(heroCostume2, id);
                IN_GAME_MAIN_CAMERA.MainHERO.Setup.Init();

                IN_GAME_MAIN_CAMERA.MainHERO.Setup.myCostume = heroCostume2;
                IN_GAME_MAIN_CAMERA.MainHERO.Setup.myCostume.stat = heroCostume2.stat;

                IN_GAME_MAIN_CAMERA.MainHERO.Setup.SetCharacterComponent();
                IN_GAME_MAIN_CAMERA.MainHERO.SetStat();
                IN_GAME_MAIN_CAMERA.MainHERO.SetSkillHudPosition();
            }
            else
            {
                for (var j = 0; j < HeroCostume.costume.Length; j++)
                {
                    if (HeroCostume.costume[j].name.ToUpper() == id.ToUpper())
                    {
                        var num2 = HeroCostume.costume[j].id;
                        if (id.ToUpper() != "AHSS")
                        {
                            num2 += CheckBoxCostume.costumeSet - 1;
                        }

                        if (HeroCostume.costume[num2].name != HeroCostume.costume[j].name)
                        {
                            num2 = HeroCostume.costume[j].id + 1;
                        }

                        IN_GAME_MAIN_CAMERA.MainHERO.Setup.Init();
                        IN_GAME_MAIN_CAMERA.MainHERO.Setup.myCostume = HeroCostume.costume[num2];
                        IN_GAME_MAIN_CAMERA.MainHERO.Setup.myCostume.stat =
                            HeroStat.getInfo(HeroCostume.costume[num2].name.ToUpper());
                        IN_GAME_MAIN_CAMERA.MainHERO.Setup.SetCharacterComponent();
                        IN_GAME_MAIN_CAMERA.MainHERO.SetStat();
                        IN_GAME_MAIN_CAMERA.MainHERO.SetSkillHudPosition();
                        break;
                    }
                }
            }

            CostumeConeveter.HeroCostumeToPhotonData(IN_GAME_MAIN_CAMERA.MainHERO.Setup.myCostume,
                PhotonNetwork.player);
            if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
            {
                IN_GAME_MAIN_CAMERA.MainT.position += new Vector3(Random.Range(-20, 20), 2f, Random.Range(-20, 20));
            }

            PhotonNetwork.player.Dead = false;
            PhotonNetwork.player.Isreplacedan = false;
        }

        component.enabled = true;

        IN_GAME_MAIN_CAMERA.MainCamera.setHUDposition();
        IN_GAME_MAIN_CAMERA.SpecMov.disable = true;
        IN_GAME_MAIN_CAMERA.Look.disable = true;
        component.gameOver = false;
        Screen.lockCursor = IN_GAME_MAIN_CAMERA.CameraMode >= CameraType.TPS;
        Screen.showCursor = false;
        ShowHUDInfoCenter(string.Empty);
    }

19 Source : FengGameManagerMKII.cs
with GNU General Public License v3.0
from aelariane

public void SpawnNonAireplacedan(string id, string find = "replacedanRespawn")
    {
        var array = GameObject.FindGameObjectsWithTag(find);
        var go = array[Random.Range(0, array.Length)];
        myLastHero = id.ToUpper();
        GameObject gameObject2;
        if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
        {
            gameObject2 = Pool.NetworkEnable("replacedAN_VER3.1",
                checkpoint.transform.position + new Vector3(Random.Range(-20, 20), 2f, Random.Range(-20, 20)),
                checkpoint.transform.rotation);
        }
        else
        {
            gameObject2 = Pool.NetworkEnable("replacedAN_VER3.1", go.transform.position,
                go.transform.rotation);
        }

        IN_GAME_MAIN_CAMERA.MainCamera.SetMainObject(gameObject2.GetComponent<replacedAN>());
        gameObject2.GetComponent<replacedAN>().nonAI = true;
        gameObject2.GetComponent<replacedAN>().speed = 30f;
        gameObject2.GetComponent<replacedAN_CONTROLLER>().enabled = true;
        if (id == "RANDOM" && Random.Range(0, 100) < 7)
        {
            gameObject2.GetComponent<replacedAN>().SetAbnormalType(AbnormalType.Crawler, true);
        }

        IN_GAME_MAIN_CAMERA.MainCamera.enabled = true;
        IN_GAME_MAIN_CAMERA.SpecMov.disable = true;
        IN_GAME_MAIN_CAMERA.Look.disable = true;
        IN_GAME_MAIN_CAMERA.MainCamera.gameOver = false;
        PhotonNetwork.player.Dead = false;
        PhotonNetwork.player.Isreplacedan = true;
        Screen.lockCursor = IN_GAME_MAIN_CAMERA.CameraMode >= CameraType.TPS;
        Screen.showCursor = true;
        ShowHUDInfoCenter(string.Empty);
    }

19 Source : UIFont.cs
with GNU General Public License v3.0
from aelariane

public string WrapText(string text, float maxWidth, int maxLineCount, bool encoding, UIFont.SymbolStyle symbolStyle)
    {
        if (this.mReplacement != null)
        {
            return this.mReplacement.WrapText(text, maxWidth, maxLineCount, encoding, symbolStyle);
        }
        int num = Mathf.RoundToInt(maxWidth * (float)this.size);
        if (num < 1)
        {
            return text;
        }
        StringBuilder stringBuilder = new StringBuilder();
        int length = text.Length;
        int num2 = num;
        int num3 = 0;
        int num4 = 0;
        int i = 0;
        bool flag = true;
        bool flag2 = maxLineCount != 1;
        int num5 = 1;
        bool flag3 = encoding && symbolStyle != UIFont.SymbolStyle.None && this.hreplacedymbols;
        bool isDynamic = this.isDynamic;
        if (isDynamic)
        {
            this.mDynamicFont.textureRebuildCallback = new Font.FontTextureRebuildCallback(this.OnFontChanged);
            this.mDynamicFont.RequestCharactersInTexture(text, this.mDynamicFontSize, this.mDynamicFontStyle);
            this.mDynamicFont.textureRebuildCallback = null;
        }
        while (i < length)
        {
            char c = text[i];
            if (c == '\n')
            {
                if (!flag2 || num5 == maxLineCount)
                {
                    break;
                }
                num2 = num;
                if (num4 < i)
                {
                    stringBuilder.Append(text.Substring(num4, i - num4 + 1));
                }
                else
                {
                    stringBuilder.Append(c);
                }
                flag = true;
                num5++;
                num4 = i + 1;
                num3 = 0;
            }
            else
            {
                if (c == ' ' && num3 != 32 && num4 < i)
                {
                    stringBuilder.Append(text.Substring(num4, i - num4 + 1));
                    flag = false;
                    num4 = i + 1;
                    num3 = (int)c;
                }
                if (encoding && c == '[' && i + 2 < length)
                {
                    if (text[i + 1] == '-' && text[i + 2] == ']')
                    {
                        i += 2;
                        goto IL_3E7;
                    }
                    if (i + 7 < length && text[i + 7] == ']' && NGUITools.EncodeColor(NGUITools.ParseColor(text, i + 1)) == text.Substring(i + 1, 6).ToUpper())
                    {
                        i += 7;
                        goto IL_3E7;
                    }
                }
                BMSymbol bmsymbol = (!flag3) ? null : this.MatchSymbol(text, i, length);
                int num6 = this.mSpacingX;
                if (!isDynamic)
                {
                    if (bmsymbol != null)
                    {
                        num6 += bmsymbol.advance;
                    }
                    else
                    {
                        BMGlyph bmglyph = (bmsymbol != null) ? null : this.mFont.GetGlyph((int)c);
                        if (bmglyph == null)
                        {
                            goto IL_3E7;
                        }
                        num6 += ((num3 == 0) ? bmglyph.advance : (bmglyph.advance + bmglyph.GetKerning(num3)));
                    }
                }
                else if (this.mDynamicFont.GetCharacterInfo(c, out UIFont.mChar, this.mDynamicFontSize, this.mDynamicFontStyle))
                {
                    num6 += Mathf.RoundToInt(UIFont.mChar.width);
                }
                num2 -= num6;
                if (num2 < 0)
                {
                    if (flag || !flag2 || num5 == maxLineCount)
                    {
                        stringBuilder.Append(text.Substring(num4, Mathf.Max(0, i - num4)));
                        if (!flag2 || num5 == maxLineCount)
                        {
                            num4 = i;
                            break;
                        }
                        UIFont.EndLine(ref stringBuilder);
                        flag = true;
                        num5++;
                        if (c == ' ')
                        {
                            num4 = i + 1;
                            num2 = num;
                        }
                        else
                        {
                            num4 = i;
                            num2 = num - num6;
                        }
                        num3 = 0;
                    }
                    else
                    {
                        while (num4 < length && text[num4] == ' ')
                        {
                            num4++;
                        }
                        flag = true;
                        num2 = num;
                        i = num4 - 1;
                        num3 = 0;
                        if (!flag2 || num5 == maxLineCount)
                        {
                            break;
                        }
                        num5++;
                        UIFont.EndLine(ref stringBuilder);
                        goto IL_3E7;
                    }
                }
                else
                {
                    num3 = (int)c;
                }
                if (!isDynamic && bmsymbol != null)
                {
                    i += bmsymbol.length - 1;
                    num3 = 0;
                }
            }
            IL_3E7:
            i++;
        }
        if (num4 < i)
        {
            stringBuilder.Append(text.Substring(num4, i - num4));
        }
        return stringBuilder.ToString();
    }

19 Source : BTN_START_SINGLE_GAMEPLAY.cs
with GNU General Public License v3.0
from aelariane

private void OnClick()
    {
        string selection = CacheGameObject.Find("PopupListMap").GetComponent<UIPopupList>().selection;
        string selection2 = CacheGameObject.Find("PopupListCharacter").GetComponent<UIPopupList>().selection;
        int difficulty = (!CacheGameObject.Find("CheckboxHard").GetComponent<UICheckbox>().isChecked) ? ((!CacheGameObject.Find("CheckboxAbnormal").GetComponent<UICheckbox>().isChecked) ? 0 : 2) : 1;
        IN_GAME_MAIN_CAMERA.Difficulty = difficulty;
        IN_GAME_MAIN_CAMERA.GameType = GameType.Single;
        IN_GAME_MAIN_CAMERA.singleCharacter = selection2.ToUpper();
        if (IN_GAME_MAIN_CAMERA.CameraMode == CameraType.TPS)
        {
            Screen.lockCursor = true;
        }
        Screen.showCursor = false;
        if (selection == "trainning_0")
        {
            IN_GAME_MAIN_CAMERA.Difficulty = -1;
        }
        FengGameManagerMKII.Level = LevelInfo.GetInfo(selection);
        Application.LoadLevel(LevelInfo.GetInfo(selection).MapName);
    }

19 Source : PanelMultiJoin.cs
with GNU General Public License v3.0
from aelariane

private void updateFilterRooms()
    {
        this.filterRoom = new ArrayList();
        if (this.filter == string.Empty)
        {
            return;
        }
        foreach (RoomInfo roomInfo in PhotonNetwork.GetRoomList())
        {
            if (roomInfo.Name.ToUpper().Contains(this.filter.ToUpper()))
            {
                this.filterRoom.Add(roomInfo);
            }
        }
    }

19 Source : NGUITools.cs
with GNU General Public License v3.0
from aelariane

public static int ParseSymbol(string text, int index, List<Color> colors, bool premultiply)
    {
        int length = text.Length;
        if (index + 2 < length)
        {
            if (text[index + 1] == '-')
            {
                if (text[index + 2] == ']')
                {
                    if (colors != null && colors.Count > 1)
                    {
                        colors.RemoveAt(colors.Count - 1);
                    }
                    return 3;
                }
            }
            else if (index + 7 < length && text[index + 7] == ']')
            {
                if (colors != null)
                {
                    Color color = NGUITools.ParseColor(text, index + 1);
                    if (NGUITools.EncodeColor(color) != text.Substring(index + 1, 6).ToUpper())
                    {
                        return 0;
                    }
                    color.a = colors[colors.Count - 1].a;
                    if (premultiply && color.a != 1f)
                    {
                        color = Color.Lerp(NGUITools.mInvisible, color, color.a);
                    }
                    colors.Add(color);
                }
                return 8;
            }
        }
        return 0;
    }

19 Source : PopuplistCharacterSelection.cs
with GNU General Public License v3.0
from aelariane

private void onCharacterChange()
    {
        string selection = base.GetComponent<UIPopupList>().selection;
        HeroStat heroStat;
        if (selection == "Set 1" || selection == "Set 2" || selection == "Set 3")
        {
            HeroCostume heroCostume = CostumeConeveter.LocalDataToHeroCostume(selection.ToUpper());
            if (heroCostume == null)
            {
                heroStat = new HeroStat();
            }
            else
            {
                heroStat = heroCostume.stat;
            }
        }
        else
        {
            heroStat = HeroStat.getInfo(base.GetComponent<UIPopupList>().selection);
        }
        this.SPD.transform.localScale = new Vector3((float)heroStat.Spd, 20f, 0f);
        this.GAS.transform.localScale = new Vector3((float)heroStat.Gas, 20f, 0f);
        this.BLA.transform.localScale = new Vector3((float)heroStat.Bla, 20f, 0f);
        this.ACL.transform.localScale = new Vector3((float)heroStat.Acl, 20f, 0f);
    }

19 Source : CheckBoxCamera.cs
with GNU General Public License v3.0
from aelariane

private void Start()
    {
        if (PlayerPrefs.HasKey("cameraType"))
        {
            if (this.camera.ToString().ToUpper() == PlayerPrefs.GetString("cameraType").ToUpper())
            {
                base.GetComponent<UICheckbox>().isChecked = true;
            }
            else
            {
                base.GetComponent<UICheckbox>().isChecked = false;
            }
        }
    }

19 Source : FieldFactory.cs
with MIT License
from afaniuolo

private string GenerateValue(string valueType)
		{
			var value = string.Empty;
			switch (valueType.ToLower())
			{
				case "system.datetime":
					value = DateTime.UtcNow.ToString("yyyyMMddThhmmssZ");
					break;
				case "system.guid":
					value = Guid.NewGuid().ToString();
					break;
				case "system.guid.tostring":
					value = Guid.NewGuid().ToString("N").ToUpper();
					break;
				default:
					value = string.Empty;
					break;
			}

			return value;
		}

19 Source : AnalysisReporter.cs
with MIT License
from afaniuolo

public void AddUnmappedItemField(SCField field, Guid itemId)
		{
			AddReportingRecord(new ReportingRecord()
			{
				ItemId = itemId.ToString("B").ToUpper(),
				ItemName = _sourceMasterRepository.GetSitecoreItemName(itemId),
				ItemPath = _sourceMasterRepository.GereplacedemPath(itemId),
				ItemVersion = field.Version,
				ItemLanguage = field.Language,
				ItemTemplateId = _sourceMasterRepository.GereplacedemTemplateId(itemId).ToString("B").ToUpper(),
				ItemTemplateName = _sourceMasterRepository.GetSitecoreItemName(_sourceMasterRepository.GereplacedemTemplateId(itemId)),
				FieldId = field.FieldId.ToString("B").ToUpper(),
				FieldName = _sourceMasterRepository.GetSitecoreItemName(field.FieldId),
				FieldType = field.Type.ToString(),
				FieldValue = field.Value,
				Message = "Source Field Not Mapped"
			});
		}

19 Source : AnalysisReporter.cs
with MIT License
from afaniuolo

public void AddUnmappedFormFieldItem(Guid itemId, string sourceMappingFieldValue)
		{
			var isNotEmpty = !string.IsNullOrEmpty(sourceMappingFieldValue);

			AddReportingRecord(new ReportingRecord()
			{
				ItemId = itemId.ToString("B").ToUpper(),
				ItemName = _sourceMasterRepository.GetSitecoreItemName(itemId),
				ItemPath = _sourceMasterRepository.GereplacedemPath(itemId),
				ItemTemplateId = _sourceMasterRepository.GereplacedemTemplateId(itemId).ToString("B").ToUpper(),
				ItemTemplateName = _sourceMasterRepository.GetSitecoreItemName(_sourceMasterRepository.GereplacedemTemplateId(itemId)),
				Message = $"Form Field Item Not Mapped - Form Field Type Name = {(isNotEmpty ? _sourceMasterRepository.GetSitecoreItemName(Guid.Parse(sourceMappingFieldValue)) : sourceMappingFieldValue)}"
			});
		}

19 Source : AnalysisReporter.cs
with MIT License
from afaniuolo

public void AddUnmappedSaveAction(SCField field, Guid itemId, Guid saveActionId)
		{
			AddReportingRecord(new ReportingRecord()
			{
				ItemId = itemId.ToString("B").ToUpper(),
				ItemName = _sourceMasterRepository.GetSitecoreItemName(itemId),
				ItemPath = _sourceMasterRepository.GereplacedemPath(itemId),
				ItemVersion = field.Version,
				ItemLanguage = field.Language,
				ItemTemplateId = _sourceMasterRepository.GereplacedemTemplateId(itemId).ToString("B").ToUpper(),
				ItemTemplateName = _sourceMasterRepository.GetSitecoreItemName(_sourceMasterRepository.GereplacedemTemplateId(itemId)),
				FieldId = field.FieldId.ToString("B").ToUpper(),
				FieldName = _sourceMasterRepository.GetSitecoreItemName(field.FieldId),
				FieldType = field.Type.ToString(),
				FieldValueReferencedItemId = saveActionId.ToString("B").ToUpper(),
				FieldValueReferencedItemName = _sourceMasterRepository.GetSitecoreItemName(saveActionId),
				Message = "Form Save Action Not Mapped"
			});
		}

19 Source : AnalysisReporter.cs
with MIT License
from afaniuolo

public void AddUnmappedValueElementSourceField(SCField field, Guid itemId, string sourceFieldValueElementName, string sourceFieldValueElementValue)
		{
			AddReportingRecord(new ReportingRecord()
			{
				ItemId = itemId.ToString("B").ToUpper(),
				ItemName = _sourceMasterRepository.GetSitecoreItemName(itemId),
				ItemPath = _sourceMasterRepository.GereplacedemPath(itemId),
				ItemVersion = field.Version,
				ItemLanguage = field.Language,
				ItemTemplateId = _sourceMasterRepository.GereplacedemTemplateId(itemId).ToString("B").ToUpper(),
				ItemTemplateName = _sourceMasterRepository.GetSitecoreItemName(_sourceMasterRepository.GereplacedemTemplateId(itemId)),
				FieldId = field.FieldId.ToString("B").ToUpper(),
				FieldName = _sourceMasterRepository.GetSitecoreItemName(field.FieldId),
				FieldType = field.Type.ToString(),
				FieldValueElementName = sourceFieldValueElementName,
				FieldValueElementValue = sourceFieldValueElementValue,
				Message = "Source Field Element Value Not Mapped"
			});
		}

19 Source : StringHelper.cs
with Mozilla Public License 2.0
from agebullhu

public static string ToWord(string word)
        {
            if (string.IsNullOrWhiteSpace(word))
            {
                return string.Empty;
            }
            return word.Length == 1
                           ? word.ToUpper()
                           : $"{ToUpper(word[0])}{word.Substring(1)}";
        }

19 Source : StringHelper.cs
with Mozilla Public License 2.0
from agebullhu

public static string ToUWord(this string word)
        {
            if (String.IsNullOrWhiteSpace(word))
            {
                return String.Empty;
            }
            return word.Length == 1
                           ? word.ToUpper()
                           : $"{ToUpper(word[0])}{word.Substring(1)}";
        }

19 Source : StringHelper.cs
with Mozilla Public License 2.0
from agebullhu

public static string ToLWord(this string word)
        {
            if (String.IsNullOrWhiteSpace(word))
            {
                return String.Empty;
            }
            return word.Length == 1
                           ? word.ToUpper()
                           : $"{ToLower(word[0])}{word.Substring(1)}";
        }

19 Source : UrlHelper.cs
with Mozilla Public License 2.0
from agebullhu

public static string MyUrlDeCode(string str, Encoding encoding)
        {
            if (encoding != null)
                return HttpUtility.UrlDecode(str, encoding);
            //首先用utf-8进行解码                     
            var code = HttpUtility.UrlDecode(str.ToUpper(), Encoding.UTF8);
            //将已经解码的字符再次进行编码.
            var encode = HttpUtility.UrlEncode(code, Encoding.UTF8)?.ToUpper();
            encoding = str == encode ? Encoding.UTF8 : Encoding.GetEncoding("gb2312");
            return HttpUtility.UrlDecode(str, encoding);
        }

19 Source : UrlHelper.cs
with Mozilla Public License 2.0
from agebullhu

public static string MyUrlDeCode(string str, Encoding encoding)
        {
            if (encoding != null)
                return HttpUtility.UrlDecode(str, encoding);
            var utf8 = Encoding.UTF8;
            //首先用utf-8进行解码                     
            var code = HttpUtility.UrlDecode(str.ToUpper(), utf8);
            //将已经解码的字符再次进行编码.
            var encode = HttpUtility.UrlEncode(code, utf8)?.ToUpper();
            encoding = str == encode ? Encoding.UTF8 : Encoding.GetEncoding("gb2312");
            return HttpUtility.UrlDecode(str, encoding);
        }

19 Source : BusinessContext.cs
with Mozilla Public License 2.0
from agebullhu

public static string GetCacheKey(Guid requestId)
        {
            return RedisKeyBuilder.ToSystemKey("api", "ctx", requestId.ToString().ToUpper());
        }

19 Source : BusinessContext.cs
with Mozilla Public License 2.0
from agebullhu

public static string GetCacheKey(string requestId)
        {
            return RedisKeyBuilder.ToSystemKey("api", "ctx", requestId.Trim('$').ToUpper());
        }

19 Source : UrlHelper.cs
with Mozilla Public License 2.0
from agebullhu

public static string MyUrlDeCode(string str, Encoding encoding)
        {
            if (encoding == null)
            {
                Encoding utf8 = Encoding.UTF8;
                //首先用utf-8进行解码                     
                string code = HttpUtility.UrlDecode(str.ToUpper(), utf8);
                //将已经解码的字符再次进行编码.
                string encode = HttpUtility.UrlEncode(code, utf8).ToUpper();
                if (str == encode)
                    encoding = Encoding.UTF8;
                else
                    encoding = Encoding.GetEncoding("gb2312");
            }
            return HttpUtility.UrlDecode(str, encoding);
        }

19 Source : WebNotify.cs
with Mozilla Public License 2.0
from agebullhu

void OnRouterReceiveReady(object sender, WsSocketEventArgs eventArgs)
        {
            var idenreplacedy = eventArgs.Socket.ReceiveFrameBytes();
            string message = eventArgs.Socket.ReceiveFrameString();

            eventArgs.Socket.SendMoreFrame(idenreplacedy).SendFrame("OK");

            _publisher.SendMoreFrame("chat").SendFrame(message.ToUpper());
        }

See More Examples