public void ProcessRequest(HttpContext context) { System.Text.StringBuilder result = new System.Text.StringBuilder(); context.Response.ContentType = "application/json"; try { int id; bool parsed = int.TryParse(context.Request.QueryString["id"], out id); if (!parsed) { result.Append("{success: false, msg: '非法的标识'}"); context.Response.Write(result.ToString()); return; } CY.GeneralPrivilege.Core.Business.PermissionsList pl = CY.GeneralPrivilege.Core.Business.PermissionsList.Load(id); if (pl != null) { pl.DeleteOnSave(); pl.Save(); } result.Append("{success: true}"); } catch (Exception ex) { result = new System.Text.StringBuilder(); result.Append("{success: false, msg: '删除失败'}"); } context.Response.Write(result.ToString()); }
protected void gvAnn_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("editRecord")) { dt = new DataTable(); int index = Convert.ToInt32(e.CommandArgument); System.Text.StringBuilder sb = new System.Text.StringBuilder(); dt = ann.getAnnById((int)(gvAnn.DataKeys[index].Value)); lblRowId.Text = dt.Rows[0]["Id"].ToString(); ddlEditType.SelectedItem.Text = dt.Rows[0]["Type"].ToString(); txtEditTitle.Text = dt.Rows[0]["Title"].ToString(); txtEditContent.Text = dt.Rows[0]["Content"].ToString(); sb.Append(@"<script type='text/javascript'>"); sb.Append("$('#updateModal').modal('show');"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditShowModalScript", sb.ToString(), false); } else if (e.CommandName.Equals("deleteRecord")) { int index = Convert.ToInt32(e.CommandArgument); string rowId = ((Label)gvAnn.Rows[index].FindControl("lblRowId")).Text; hfDeleteId.Value = rowId; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"<script type='text/javascript'>"); sb.Append("$('#deleteModal').modal('show');"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "DeleteShowModalScript", sb.ToString(), false); } }
/// <summary> /// Ensures that if the identifier contains a hyphen or other special characters that it will be escaped by tick (`) characters. /// </summary> /// <param name="identifier">The identifier to format</param> /// <returns>An escaped identifier, if escaping was required. Otherwise the original identifier.</returns> public static string EscapeIdentifier(string identifier) { if (identifier == null) { throw new ArgumentNullException("identifier"); } bool containsSpecialChar = false; for (var i = 0; i < identifier.Length; i++) { if (!Char.IsLetterOrDigit(identifier[i])) { containsSpecialChar = true; break; } } if (!containsSpecialChar) { return identifier; } else { var sb = new System.Text.StringBuilder(identifier.Length + 2); sb.Append('`'); sb.Append(identifier.Replace("`", "``")); sb.Append('`'); return sb.ToString(); } }
public override void Collect(int doc, float score) { try { int op = order[(opidx[0]++) % order.Length]; //System.out.println(op==skip_op ? "skip("+(sdoc[0]+1)+")":"next()"); bool more = op == skip_op?scorer.SkipTo(sdoc[0] + 1):scorer.Next(); sdoc[0] = scorer.Doc(); float scorerScore = scorer.Score(); float scorerScore2 = scorer.Score(); float scoreDiff = System.Math.Abs(score - scorerScore); float scorerDiff = System.Math.Abs(scorerScore2 - scorerScore); if (!more || doc != sdoc[0] || scoreDiff > maxDiff || scorerDiff > maxDiff) { System.Text.StringBuilder sbord = new System.Text.StringBuilder(); for (int i = 0; i < order.Length; i++) sbord.Append(order[i] == skip_op?" skip()":" next()"); throw new System.SystemException("ERROR matching docs:" + "\n\t" + (doc != sdoc[0]?"--> ":"") + "doc=" + sdoc[0] + "\n\t" + (!more?"--> ":"") + "tscorer.more=" + more + "\n\t" + (scoreDiff > maxDiff?"--> ":"") + "scorerScore=" + scorerScore + " scoreDiff=" + scoreDiff + " maxDiff=" + maxDiff + "\n\t" + (scorerDiff > maxDiff?"--> ":"") + "scorerScore2=" + scorerScore2 + " scorerDiff=" + scorerDiff + "\n\thitCollector.doc=" + doc + " score=" + score + "\n\t Scorer=" + scorer + "\n\t Query=" + q + " " + q.GetType().FullName + "\n\t Searcher=" + s + "\n\t Order=" + sbord + "\n\t Op=" + (op == skip_op?" skip()":" next()")); } } catch (System.IO.IOException e) { throw new System.Exception("", e); } }
public override string ToString() { var sb = new System.Text.StringBuilder(); sb.AppendLine(string.Format("{0}: {1}", "X", X)); sb.AppendLine(string.Format("{0}: {1}", "Y", Y)); return sb.ToString(); }
/// <summary> /// /// </summary> /// <param name="writer"></param> public override void WriteDescriptionTo(NUnitCtr.MessageWriter writer) { var sb = new System.Text.StringBuilder(); sb.AppendLine("Execution of the query is slower than expected"); sb.AppendFormat("Maximum expected was {0}ms", maxTimeMilliSeconds); writer.WritePredicate(sb.ToString()); }
public string getMD516(string str) { //类型转换 byte[] myByte = System.Text.Encoding.ASCII.GetBytes(str); sbyte[] mySByte = new sbyte[myByte.Length]; for (int i = 0; i < myByte.Length; i++) { if (myByte[i] > 127) mySByte[i] = (sbyte)(myByte[i] - 256); else mySByte[i] = (sbyte)myByte[i]; } md5Init(); md5Update(mySByte, str.Length); md5Final(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); for (int i = 0; i < 8; i++) { sb.Append(byteHEX(digest[i])); } return sb.ToString(); }
/// <summary></summary> /// <returns></returns> public override string ToString() { /* function<out Function func> = (. func = new Function(); Expression exp = null; .) ident (. func.Name = t.val; .) '(' expr<out exp> (. func.Expression = exp; .) ')' . */ System.Text.StringBuilder txt = new System.Text.StringBuilder(); txt.AppendFormat("{0}(", name); if (expression != null) { bool first = true; foreach (Term t in expression.Terms) { //if (t.Value.EndsWith("=")) { if (first) { first = false; } else if (t.Value != null && !t.Value.EndsWith("=")) { txt.Append(", "); } bool quoteMe = false; if (t.Type == TermType.String && !t.Value.EndsWith("=")) { quoteMe = true; } if (quoteMe) { txt.Append("'"); } txt.Append(t.ToString()); if (quoteMe) { txt.Append("'"); } } } txt.Append(")"); return txt.ToString(); }
/// <summary> /// Converts a number to System.String. /// </summary> /// <param name="number"></param> /// <returns></returns> public static System.String ToString(long number) { System.Text.StringBuilder s = new System.Text.StringBuilder(); if (number == 0) { s.Append("0"); } else { if (number < 0) { s.Append("-"); number = -number; } while (number > 0) { char c = digits[(int)number % 36]; s.Insert(0, c); number = number / 36; } } return s.ToString(); }
/// <summary> /// Creates the XML open tag string for an XElement. /// </summary> /// <param name="element">The element.</param> /// <returns>The XML open tag. In case of an element without value, the tag is self-closing.</returns> internal static string CreateXmlOpenTag(System.Xml.Linq.XElement element) { var builder = new System.Text.StringBuilder(); builder.Append("<"); var name = element.Name.LocalName; builder.Append(Settings.Default.Formatting_CommentXmlTagsToLowerCase ? name.ToLowerInvariant() : name); if (element.HasAttributes) { foreach (var attr in element.Attributes()) { builder.Append(Spacer); builder.Append(attr); } } if (element.IsEmpty) { if (Settings.Default.Formatting_CommentXmlSpaceSingleTags) { builder.Append(Spacer); } builder.Append("/"); } builder.Append(">"); var result = builder.ToString(); return Settings.Default.Formatting_CommentXmlKeepTagsTogether ? SpaceToFake(result) : result; }
public static System.String Encode(System.String s) { int length = s.Length; System.Text.StringBuilder buffer = new System.Text.StringBuilder(length * 2); for (int i = 0; i < length; i++) { char c = s[i]; int j = (int) c; if (j < 0x100 && encoder[j] != null) { buffer.Append(encoder[j]); // have a named encoding buffer.Append(';'); } else if (j < 0x80) { buffer.Append(c); // use ASCII value } else { buffer.Append("&#"); // use numeric encoding buffer.Append((int) c); buffer.Append(';'); } } return buffer.ToString(); }
private static string GetHidimHeader(string filename, int height) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("hidim is torrents!"); sb.AppendFormat("i{0}e", height); sb.AppendFormat("{0}:{1}", Path.GetFileName(filename).Length, Path.GetFileName(filename)); try { using (FileStream fs = File.OpenRead(filename)) { byte[] hash = new System.Security.Cryptography.SHA1Managed().ComputeHash(fs); string sha1 = BitConverter.ToString(hash).Replace("-", ""); sb.AppendFormat("{0}:{1}", sha1.Length, sha1); } } catch (Exception) { sb.AppendFormat("{0}:{1}", 40, "deadbeefdeadbeefdeadbeefdeadbeebadcoffee"); } sb.AppendFormat("i{0}e", new FileInfo(filename).Length); return sb.ToString(); }
protected string HandlerAddSimulationRequest() { System.Text.StringBuilder sbResult = new System.Text.StringBuilder(); try { string strId = string.Empty; int Id = default(int); if (CY.Utility.Common.RequestUtility.IsGet) { strId = CY.Utility.Common.RequestUtility.GetQueryString("Id"); } else if (CY.Utility.Common.RequestUtility.IsPost) { strId = CY.Utility.Common.RequestUtility.GetFormString("Id"); } if (string.IsNullOrEmpty(strId) || !CY.Utility.Common.ParseUtility.TryParseInt32(strId, out Id)) { return sbResult.Append("{success:false,action:'none',status:'none',msg:'参数错误!'}").ToString(); } CY.CSTS.Core.Business.StimulationType type = new CY.CSTS.Core.Business.StimulationType(); } catch (Exception ex) { throw ex; } finally { } return string.Empty; }
protected void Page_Load(object sender, EventArgs e) { if ( LRegistro.ExisteSesion( Session ) ) { if ( !IsPostBack ) { // Si utilizamos using System.Text no hace falta invocar con System.Text.StringBuilder() System.Text.StringBuilder sbMiSaludo = new System.Text.StringBuilder(); sbMiSaludo.AppendFormat("Hola {0}", LRegistro.NombreUsuario(Session)); liSaludo.Text = sbMiSaludo.ToString(); System.Text.StringBuilder sbMiSaludo2 = new System.Text.StringBuilder(); sbMiSaludo2.Append("Hola "); sbMiSaludo2.Append(LRegistro.NombreUsuario(Session)); // sbMiSaludo2.Append("Hola " + LRegistro.NombreUsuario(Session)); } // IsPosBack } else { // Si no hay sessión le expulso Response.Redirect("index.aspx"); } }
/// <summary>Returns the next token in the stream, or null at EOS. /// <p>Removes <tt>'s</tt> from the end of words. /// <p>Removes dots from acronyms. /// </summary> public override Monodoc.Lucene.Net.Analysis.Token Next() { Monodoc.Lucene.Net.Analysis.Token t = input.Next(); if (t == null) return null; System.String text = t.TermText(); System.String type = t.Type(); if ((System.Object) type == (System.Object) APOSTROPHE_TYPE && (text.EndsWith("'s") || text.EndsWith("'S"))) { return new Monodoc.Lucene.Net.Analysis.Token(text.Substring(0, (text.Length - 2) - (0)), t.StartOffset(), t.EndOffset(), type); } else if ((System.Object) type == (System.Object) ACRONYM_TYPE) { // remove dots System.Text.StringBuilder trimmed = new System.Text.StringBuilder(); for (int i = 0; i < text.Length; i++) { char c = text[i]; if (c != '.') trimmed.Append(c); } return new Monodoc.Lucene.Net.Analysis.Token(trimmed.ToString(), t.StartOffset(), t.EndOffset(), type); } else { return t; } }
public SelectModel GetCashSelectModel(int pageIndex, int pageSize, string orderStr, int pledgeApplyId) { NFMT.Common.SelectModel select = new NFMT.Common.SelectModel(); select.PageIndex = pageIndex; select.PageSize = pageSize; if (string.IsNullOrEmpty(orderStr)) select.OrderStr = "psd.ContractNo desc"; else select.OrderStr = orderStr; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(" psd.ContractNo as StockContractNo,psd.Deadline,SUM(Hands) as Hands,bank.BankName as AccountName "); select.ColumnName = sb.ToString(); sb.Clear(); sb.Append(" dbo.Fin_PledgeApply pa "); sb.AppendFormat(" inner join dbo.Fin_PledgeApplyStockDetail psd on pa.PledgeApplyId = psd.PledgeApplyId and psd.DetailStatus ={0} ", (int)Common.StatusEnum.已生效); sb.Append(" left join NFMT_Basic..Bank bank on pa.FinancingBankId = bank.BankId "); select.TableName = sb.ToString(); sb.Clear(); sb.AppendFormat(" pa.PledgeApplyId ={0} group by psd.ContractNo,psd.Deadline,bank.BankName ", pledgeApplyId); select.WhereStr = sb.ToString(); return select; }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/json";// string ClassId = context.Request.QueryString["ClassId"].ToString();//班级Id ClassInfo classInfo = ClassInfo.Load(Convert.ToInt32(ClassId)); if (classInfo != null) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("{success: true, classInfo: ["); sb.Append("{ ID:'" + classInfo.Id + "'} ,"); sb.Append("{ Name:'" + classInfo.Name + "'} ,"); sb.Append("{ PersonsNum:'" + classInfo.PersonsNum + "'} ,"); sb.Append("{ MajorId:'" + classInfo.MajorId + "'} ,"); sb.Append("{ DateCreated:'" + classInfo.DateCreated + "'} ,"); sb.Append("{ GradeId:'" + classInfo.GradeId + "'} ,"); sb.Append("{ GradeYear:'" + classInfo.GradeYear + "'}"); sb.Append("]}"); context.Response.Write(sb.ToString());//返回数组 } else { context.Response.Write("{success:false,msg:'班级不存在,或已删除。'}"); } }
static string TicksInfo() { System.Text.StringBuilder ticksInfoBuilder = new System.Text.StringBuilder("\r\n\r\n"); ticksInfoBuilder.AppendLine("Ticks Info"); ticksInfoBuilder.AppendLine("--------------------------------------------------------------"); const string numberFmt = "{0,-22}{1,18:N0}"; const string timeFmt = "{0,-22}{1,26}"; ticksInfoBuilder.AppendLine(System.String.Format(numberFmt, "Field", "Value")); ticksInfoBuilder.AppendLine(System.String.Format(numberFmt, "-----", "-----")); // Display the maximum, minimum, and zero TimeSpan values. ticksInfoBuilder.AppendLine(System.String.Format(timeFmt, "Maximum TimeSpan", Align(System.TimeSpan.MaxValue))); ticksInfoBuilder.AppendLine(System.String.Format(timeFmt, "Minimum TimeSpan", Align(System.TimeSpan.MinValue))); ticksInfoBuilder.AppendLine(System.String.Format(timeFmt, "Zero TimeSpan", Align(System.TimeSpan.Zero))); ticksInfoBuilder.AppendLine(); // Display the ticks-per-time-unit fields. ticksInfoBuilder.AppendLine(System.String.Format(numberFmt, "Ticks per day", System.TimeSpan.TicksPerDay)); ticksInfoBuilder.AppendLine(System.String.Format(numberFmt, "Ticks per hour", System.TimeSpan.TicksPerHour)); ticksInfoBuilder.AppendLine(System.String.Format(numberFmt, "Ticks per minute", System.TimeSpan.TicksPerMinute)); ticksInfoBuilder.AppendLine(System.String.Format(numberFmt, "Ticks per second", System.TimeSpan.TicksPerSecond)); ticksInfoBuilder.AppendLine(System.String.Format(numberFmt, "Ticks per millisecond", System.TimeSpan.TicksPerMillisecond)); ticksInfoBuilder.AppendLine("--------------------------------------------------------------"); return ticksInfoBuilder.ToString(); }
private static async Task<Document> RemoveTrailingWhiteSpaceAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) { var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); var trivia = root.FindTrivia(diagnostic.Location.SourceSpan.End - 1); SyntaxNode newRoot; if (trivia.IsKind(SyntaxKind.WhitespaceTrivia)) { newRoot = root.ReplaceTrivia(trivia, new SyntaxTrivia[] { }); } else if (trivia.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia, SyntaxKind.MultiLineDocumentationCommentTrivia)) { var commentText = trivia.ToFullString(); var commentLines = commentText.Split(new[] { Environment.NewLine }, StringSplitOptions.None); var newComment = ""; var builder = new System.Text.StringBuilder(); builder.Append(newComment); for (int i = 0; i < commentLines.Length; i++) { var commentLine = commentLines[i]; builder.Append(Regex.Replace(commentLine, @"\s+$", "")); if (i < commentLines.Length - 1) builder.Append(Environment.NewLine); } newComment = builder.ToString(); newRoot = root.ReplaceTrivia(trivia, SyntaxFactory.SyntaxTrivia(SyntaxKind.DocumentationCommentExteriorTrivia, newComment)); } else { var triviaNoTrailingWhiteSpace = Regex.Replace(trivia.ToFullString(), @"\s+$", ""); newRoot = root.ReplaceTrivia(trivia, SyntaxFactory.ParseTrailingTrivia(triviaNoTrailingWhiteSpace)); } return document.WithSyntaxRoot(newRoot); }
/// <summary> /// Logs a message to the console. /// </summary> /// <param name="style"> A style which influences the icon and text color. </param> /// <param name="objects"> The objects to output to the console. These can be strings or /// ObjectInstances. </param> public void Log(FirebugConsoleMessageStyle style, object[] objects) { #if !SILVERLIGHT var original = Console.ForegroundColor; switch (style) { case FirebugConsoleMessageStyle.Information: Console.ForegroundColor = ConsoleColor.White; break; case FirebugConsoleMessageStyle.Warning: Console.ForegroundColor = ConsoleColor.Yellow; break; case FirebugConsoleMessageStyle.Error: Console.ForegroundColor = ConsoleColor.Red; break; } #endif // Convert the objects to a string. var message = new System.Text.StringBuilder(); for (int i = 0; i < objects.Length; i++) { message.Append(' '); message.Append(TypeConverter.ToString(objects[i])); } // Output the message to the console. Console.WriteLine(message.ToString()); #if !SILVERLIGHT if (style != FirebugConsoleMessageStyle.Regular) Console.ForegroundColor = original; #endif }
/// <summary> /// Creates a new TestSuite instance. /// </summary> /// <param name="openFile"> A callback that can open a file for reading. </param> public TestSuite(Func<string, Stream> openFile) { if (openFile == null) throw new ArgumentNullException("openFile"); // Init collection. this.IncludedTests = new List<string>(); // Open the excludelist.xml file to generate a list of skipped file names. var reader = System.Xml.XmlReader.Create(openFile(@"config\excludeList.xml")); reader.ReadStartElement("excludeList"); do { if (reader.Depth == 1 && reader.NodeType == System.Xml.XmlNodeType.Element && reader.Name == "test") this.skippedTestNames.Add(reader.GetAttribute("id")); } while (reader.Read()); // Read the include files. var includeBuilder = new System.Text.StringBuilder(); includeBuilder.AppendLine(ReadInclude(openFile, "cth.js")); includeBuilder.AppendLine(ReadInclude(openFile, "sta.js")); includeBuilder.AppendLine(ReadInclude(openFile, "ed.js")); this.includes = includeBuilder.ToString(); this.zipStream = openFile(@"suite\2012-05-18.zip"); this.zipFile = new ZipFile(this.zipStream); this.ApproximateTotalTestCount = (int)this.zipFile.Count; }
protected void btnSave_Click(object sender, EventArgs e) { contact.addContact( Guid.Parse(hfUserId.Value), txtAddAddress.Text, txtAddHomeAddress.Text, txtAddCity.Text, txtAddProvince.Text, txtAddZipCode.Text, txtAddCountry.Text, txtAddPhoneNumber.Text, txtAddEmail.Text, txtAddGuardianName.Text, txtAddRelationship.Text, txtAddGuardianAddress.Text, txtAddGuardianPhone.Text); BindData(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"<script type='text/javascript'>"); sb.Append("$('#addModal').modal('hide');"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "HideShowModalScript", sb.ToString(), false); }
protected string DetermineRecipientCount() { string strCounties = (AllCounties.Checked) ? "All" : Session["Criteria-County"].ToString(); string strSchools = (AllSchools.Checked) ? "All" : Session["Criteria-School"].ToString(); string strGrades = (AllGrades.Checked) ? "All" : Session["Criteria-Grade"].ToString(); string strCareers = (AllCareers.Checked) ? "All" : Session["Criteria-Career"].ToString(); string strClusters = (AllClusters.Checked) ? "All" : Session["Criteria-Cluster"].ToString(); string strGender = Session["GenderChoice"].ToString(); System.Text.StringBuilder sbSQL = new System.Text.StringBuilder(); sbSQL.Append("select count(portfolioid) from PortfolioUserInfo where active=1 and ConSysID=" + ConSysID); if (strGender != "All") sbSQL.Append(" and GenderID in (" + strGender + ")"); if (strGrades != "All") sbSQL.Append(" and GradeNumber in (" + strGrades + ")"); if (strSchools != "All") sbSQL.Append(" and SchoolID in (" + strSchools + ")"); if (strCounties != "All") sbSQL.Append(" and CountyID in (" + strCounties + ")"); if (strCareers != "All") sbSQL.Append(" and PortfolioID in (Select PortfolioID from Port_SavedCareers where OccNumber in (" + strCareers + "))"); if (strClusters != "All") sbSQL.Append(" and PortfolioID in (Select PortfolioID from Port_ClusterInterests where ClusterID in (" + strClusters + "))"); return CCLib.Common.DataAccess.GetValue(sbSQL.ToString()).ToString(); }
protected void Page_Load(object sender, EventArgs e) { try { string title = "Error Sesión Expirada", message = "Su sesión ha expirado.", actualPage = Request.QueryString["aspxerrorpath"]; string currentPage = this.Session["CurrentPage"] as string; System.Text.StringBuilder errorMessage = new System.Text.StringBuilder(); errorMessage.AppendFormat("{0}. La sesión de usuario expiró. URL: (aspxerrorpath) = {1} - (session) = {2}.", title, actualPage, currentPage); log.Warn(errorMessage.ToString()); Session.RemoveAll(); Session.Abandon(); Ext.Net.X.Msg.Show(new Ext.Net.MessageBoxConfig { Closable = false, Title = title, Message = message, Buttons = Ext.Net.MessageBox.Button.OK, Handler = "window.parent.location = 'Default.aspx'" }); } catch (Exception ex) { log.Fatal("Error fatal al cargar pagina de sesion expirada.", ex); } }
/// <summary> Replaces unprintable characters by their espaced (or unicode escaped) /// equivalents in the given string /// </summary> protected internal static System.String AddEscapes(System.String str) { System.Text.StringBuilder retval = new System.Text.StringBuilder(); char ch; for (int i = 0; i < str.Length; i++) { switch (str[i]) { case (char) (0): continue; case '\b': retval.Append("\\b"); continue; case '\t': retval.Append("\\t"); continue; case '\n': retval.Append("\\n"); continue; case '\f': retval.Append("\\f"); continue; case '\r': retval.Append("\\r"); continue; case '\"': retval.Append("\\\""); continue; case '\'': retval.Append("\\\'"); continue; case '\\': retval.Append("\\\\"); continue; default: if ((ch = str[i]) < 0x20 || ch > 0x7e) { System.String s = "0000" + System.Convert.ToString(ch, 16); retval.Append("\\u" + s.Substring(s.Length - 4, (s.Length) - (s.Length - 4))); } else { retval.Append(ch); } continue; } } return retval.ToString(); }
public static void Main(string[] args) { System.IO.StreamReader reader = OpenInput(args); while (!reader.EndOfStream) { string line = reader.ReadLine(); if (line == null) continue; int[] romanValues = new int[] { 1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000 }; string[] romanStrings = new string[] { "I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M" }; int num = System.Int32.Parse(line.Trim()); System.Text.StringBuilder output = new System.Text.StringBuilder(); while(num > 0) { for(int i = romanValues.Length - 1; i >= 0; --i) { if (romanValues[i] <= num) { num -= romanValues[i]; output.Append(romanStrings[i]); break; } } } System.Console.WriteLine(output.ToString()); } }
private void SendForgotLoginEmail(DataTable dtUserInfo, string PortTypeID) { System.Text.StringBuilder sbMessage = new System.Text.StringBuilder(); string strEmailSubject = CCLib.Common.Strings.GenerateLanguageText(5386, "English", false, PortTypeID); if (dtUserInfo.Rows.Count > 1) { sbMessage.AppendLine("We have found more than one " + CCLib.Common.Strings.GenerateLanguageText(5386, "English", false, PortTypeID) + " account in our database with your email address."); sbMessage.AppendLine(); sbMessage.Append("The access information for each of these accounts appears below:"); } else { sbMessage.AppendLine("To login to your " + CCLib.Common.Strings.GenerateLanguageText(5386, "English", false, PortTypeID) + " account, please use the following:"); } sbMessage.AppendLine(); sbMessage.AppendLine("http://www.careercruising.com/" + CCLib.Common.Strings.GenerateLanguageText(8917, "English", false, PortTypeID)); sbMessage.AppendLine(); for (int c = 0; c < dtUserInfo.Rows.Count; c++) { sbMessage.AppendLine("Institution Name: " + dtUserInfo.Rows[c]["InstitutionName"].ToString()); sbMessage.AppendLine("Username: "******"Username"].ToString()); sbMessage.AppendLine("Password: "******"Password"].ToString()); sbMessage.AppendLine("Advisor Password: "******"AdminPassword"].ToString()); sbMessage.AppendLine(); } sbMessage.AppendLine("Sincerely,"); sbMessage.AppendLine("The Career Cruising Support Team"); CCLib.Common.Email.SendEmail("*****@*****.**", dtUserInfo.Rows[0]["Email"].ToString(), strEmailSubject, sbMessage.ToString()); }
protected void Page_Load(object sender, EventArgs e) { try { Session["MainUrl"].ToString(); } catch (NullReferenceException) { Response.Redirect("~/"); return; } Debug.WriteLine(">>>> CodeQuality"); this.sitemap = (List<string>)Session["selectedSites"]; var ths = new ThreadStart(TestCodeQuality); var th = new Thread(ths); th.Start(); th.Join(); var sb = new System.Text.StringBuilder(); CodeQualitySession.RenderControl(new System.Web.UI.HtmlTextWriter(new System.IO.StringWriter(sb))); string htmlstring = sb.ToString(); Session["CodeQuality"] = htmlstring; }
protected void ddlDestino_SelectedIndexChanged(object sender, EventArgs e) { SqlDataAdapter da; DataSet ds; try { System.Data.SqlClient.SqlConnection conn; System.Text.StringBuilder sb = new System.Text.StringBuilder(); conn = new System.Data.SqlClient.SqlConnection(); conn.ConnectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString; //Set the DataAdapter's query. da = new SqlDataAdapter("Select '0' as 'Id', 'DESTINO' as 'Descripcion' union select IdDestino as 'Id', UPPER(Descripcion) as 'Descripcion' from Destinos order by 'Id'", conn); ds = new DataSet(); da.Fill(ds); ddlDestino.DataSource = ds; ddlDestino.DataValueField = "Id"; ddlDestino.DataTextField = "Descripcion"; ddlDestino.DataBind(); ds.Dispose(); conn.Close(); } catch (Exception ex) { } }
public MainMenu(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces) : base(pagedata, moduleparams, pagenamespaces) { menulist = new System.Text.StringBuilder(); sm = new SessionManagement(); ActiveNetworkRelationshipTypes.ClassURI = ""; }
public static unsafe void StringBuilderToUnicodeString(System.Text.StringBuilder stringBuilder, ushort *destination) { stringBuilder.UnsafeCopyTo((char *)destination); }
private void DrawDecorativeHUD(SpriteBatch spriteBatch, Rectangle rect) { spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, GameMain.ScissorTestEnable); if (generationParams.ShowOverlay) { Vector2 mapCenter = rect.Center.ToVector2() + (new Vector2(size, size) / 2 + drawOffset + drawOffsetNoise) * zoom; Vector2 centerDiff = CurrentLocation.MapPosition - new Vector2(size) / 2; int currentZone = (int)Math.Floor((centerDiff.Length() / (size * 0.5f) * generationParams.DifficultyZones)); for (int i = 0; i < generationParams.DifficultyZones; i++) { float radius = size / 2 * ((i + 1.0f) / generationParams.DifficultyZones); float textureSize = (radius / (generationParams.MapCircle.size.X / 2) * zoom); generationParams.MapCircle.Draw(spriteBatch, mapCenter, i == currentZone || i == currentZone - 1 ? Color.White * 0.5f : Color.White * 0.2f, i * 0.4f + (float)Timing.TotalTime * 0.01f, textureSize); } } float animPulsate = (float)Math.Sin(Timing.TotalTime * 2.0f) * 0.1f; Vector2 frameSize = generationParams.DecorativeGraphSprite.FrameSize.ToVector2(); generationParams.DecorativeGraphSprite.Draw(spriteBatch, (int)((cameraNoiseStrength + animPulsate) * hudOpenState * generationParams.DecorativeGraphSprite.FrameCount), new Vector2(rect.Right, rect.Bottom), Color.White, frameSize, 0, Vector2.Divide(new Vector2(rect.Width / 4, rect.Height / 10), frameSize)); frameSize = generationParams.DecorativeMapSprite.FrameSize.ToVector2(); generationParams.DecorativeMapSprite.Draw(spriteBatch, (int)((cameraNoiseStrength + animPulsate) * hudOpenState * generationParams.DecorativeMapSprite.FrameCount), new Vector2(rect.X, rect.Y), Color.White, new Vector2(0, frameSize.Y * 0.2f), 0, Vector2.Divide(new Vector2(rect.Width / 3, rect.Height / 5), frameSize), spriteEffect: SpriteEffects.FlipVertically); GUI.DrawString(spriteBatch, new Vector2(rect.X + rect.Width / 15, rect.Y + rect.Height / 11), "JOVIAN FLUX " + ((cameraNoiseStrength + Rand.Range(-0.02f, 0.02f)) * 500), Color.White * hudOpenState, font: GUI.SmallFont); GUI.DrawString(spriteBatch, new Vector2(rect.X + rect.Width * 0.27f, rect.Y + rect.Height * 0.93f), "LAT " + (-drawOffset.Y / 100.0f) + " LON " + (-drawOffset.X / 100.0f), Color.White * hudOpenState, font: GUI.SmallFont); System.Text.StringBuilder sb = new System.Text.StringBuilder("GEST F "); for (int i = 0; i < 20; i++) { sb.Append(Rand.Range(0.0f, 1.0f) < cameraNoiseStrength ? ToolBox.RandomSeed(1) : "0"); } GUI.DrawString(spriteBatch, new Vector2(rect.X + rect.Width * 0.8f, rect.Y + rect.Height * 0.96f), sb.ToString(), Color.White * hudOpenState, font: GUI.SmallFont); frameSize = generationParams.DecorativeLineTop.FrameSize.ToVector2(); generationParams.DecorativeLineTop.Draw(spriteBatch, (int)(hudOpenState * generationParams.DecorativeLineTop.FrameCount), new Vector2(rect.Right, rect.Y), Color.White, new Vector2(frameSize.X, frameSize.Y * 0.2f), 0, Vector2.Divide(new Vector2(rect.Width * 0.72f, rect.Height / 9), frameSize)); frameSize = generationParams.DecorativeLineBottom.FrameSize.ToVector2(); generationParams.DecorativeLineBottom.Draw(spriteBatch, (int)(hudOpenState * generationParams.DecorativeLineBottom.FrameCount), new Vector2(rect.X, rect.Bottom), Color.White, new Vector2(0, frameSize.Y * 0.6f), 0, Vector2.Divide(new Vector2(rect.Width * 0.72f, rect.Height / 9), frameSize)); frameSize = generationParams.DecorativeLineCorner.FrameSize.ToVector2(); generationParams.DecorativeLineCorner.Draw(spriteBatch, (int)((hudOpenState + animPulsate) * generationParams.DecorativeLineCorner.FrameCount), new Vector2(rect.Right - rect.Width / 8, rect.Bottom), Color.White, frameSize * 0.8f, 0, Vector2.Divide(new Vector2(rect.Width / 4, rect.Height / 4), frameSize), spriteEffect: SpriteEffects.FlipVertically); generationParams.DecorativeLineCorner.Draw(spriteBatch, (int)((hudOpenState + animPulsate) * generationParams.DecorativeLineCorner.FrameCount), new Vector2(rect.X + rect.Width / 8, rect.Y), Color.White, frameSize * 0.1f, 0, Vector2.Divide(new Vector2(rect.Width / 4, rect.Height / 4), frameSize), spriteEffect: SpriteEffects.FlipHorizontally); //reticles generationParams.ReticleLarge.Draw(spriteBatch, (int)(subReticleAnimState * generationParams.ReticleLarge.FrameCount), rect.Center.ToVector2() + (subReticlePosition + drawOffset - drawOffsetNoise * 2) * zoom, Color.White, generationParams.ReticleLarge.Origin, 0, Vector2.One * (float)Math.Sqrt(zoom) * 0.4f); generationParams.ReticleMedium.Draw(spriteBatch, (int)(subReticleAnimState * generationParams.ReticleMedium.FrameCount), rect.Center.ToVector2() + (subReticlePosition + drawOffset - drawOffsetNoise) * zoom, Color.White, generationParams.ReticleMedium.Origin, 0, new Vector2(1.0f, 0.7f) * (float)Math.Sqrt(zoom) * 0.4f); if (selectedLocation != null) { generationParams.ReticleSmall.Draw(spriteBatch, (int)(targetReticleAnimState * generationParams.ReticleSmall.FrameCount), rect.Center.ToVector2() + (selectedLocation.MapPosition + drawOffset + drawOffsetNoise * 2) * zoom, Color.White, generationParams.ReticleSmall.Origin, 0, new Vector2(1.0f, 0.7f) * (float)Math.Sqrt(zoom) * 0.4f); } spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, GameMain.ScissorTestEnable); }
/// <summary> /// Read the data from the database. /// </summary> /// <param name="transaction"> /// The current <see cref="NpgsqlTransaction"/> to the database. /// </param> /// <param name="partition"> /// The database partition (schema) where the requested resource is stored. /// </param> /// <param name="ids"> /// Ids to retrieve from the database. /// </param> /// <param name="isCachedDtoReadEnabledAndInstant"> /// The value indicating whether to get cached last state of Dto from revision history. /// </param> /// <returns> /// List of instances of <see cref="CDP4Common.DTO.RuleVerificationList"/>. /// </returns> public virtual IEnumerable <CDP4Common.DTO.RuleVerificationList> Read(NpgsqlTransaction transaction, string partition, IEnumerable <Guid> ids = null, bool isCachedDtoReadEnabledAndInstant = false) { using (var command = new NpgsqlCommand()) { var sqlBuilder = new System.Text.StringBuilder(); if (isCachedDtoReadEnabledAndInstant) { sqlBuilder.AppendFormat("SELECT \"Jsonb\" FROM \"{0}\".\"RuleVerificationList_Cache\"", partition); if (ids != null && ids.Any()) { sqlBuilder.Append(" WHERE \"Iid\" = ANY(:ids)"); command.Parameters.Add("ids", NpgsqlDbType.Array | NpgsqlDbType.Uuid).Value = ids; } sqlBuilder.Append(";"); command.Connection = transaction.Connection; command.Transaction = transaction; command.CommandText = sqlBuilder.ToString(); // log the sql command this.LogCommand(command); using (var reader = command.ExecuteReader()) { while (reader.Read()) { var thing = this.MapJsonbToDto(reader); if (thing != null) { yield return(thing as RuleVerificationList); } } } } else { sqlBuilder.AppendFormat("SELECT * FROM \"{0}\".\"RuleVerificationList_View\"", partition); if (ids != null && ids.Any()) { sqlBuilder.Append(" WHERE \"Iid\" = ANY(:ids)"); command.Parameters.Add("ids", NpgsqlDbType.Array | NpgsqlDbType.Uuid).Value = ids; } sqlBuilder.Append(";"); command.Connection = transaction.Connection; command.Transaction = transaction; command.CommandText = sqlBuilder.ToString(); // log the sql command this.LogCommand(command); using (var reader = command.ExecuteReader()) { while (reader.Read()) { yield return(this.MapToDto(reader)); } } } } }
/*! * Summarizes the information contained in this object in English. * \param[in] verbose Determines whether or not detailed information about large areas of data will be printed cs. * \return A string containing a summary of the information within the object in English. This is the function that Niflyze calls to generate its analysis, so the output is the same. */ public override string AsString(bool verbose = false) { var s = new System.Text.StringBuilder(); var array_output_count = 0U; s.Append(base.AsString()); numProperties = (uint)properties.Count; s.AppendLine($" Flags: {flags}"); s.AppendLine($" Translation: {translation}"); s.AppendLine($" Rotation: {rotation}"); s.AppendLine($" Scale: {scale}"); s.AppendLine($" Velocity: {velocity}"); s.AppendLine($" Num Properties: {numProperties}"); array_output_count = 0; for (var i3 = 0; i3 < properties.Count; i3++) { if (!verbose && (array_output_count > Nif.MAXARRAYDUMP)) { s.AppendLine("<Data Truncated. Use verbose mode to see complete listing.>"); break; } if (!verbose && (array_output_count > Nif.MAXARRAYDUMP)) { break; } s.AppendLine($" Properties[{i3}]: {properties[i3]}"); array_output_count++; } array_output_count = 0; for (var i3 = 0; i3 < 4; i3++) { if (!verbose && (array_output_count > Nif.MAXARRAYDUMP)) { s.AppendLine("<Data Truncated. Use verbose mode to see complete listing.>"); break; } if (!verbose && (array_output_count > Nif.MAXARRAYDUMP)) { break; } s.AppendLine($" Unknown 1[{i3}]: {unknown1[i3]}"); array_output_count++; } s.AppendLine($" Unknown 2: {unknown2}"); s.AppendLine($" Has Bounding Volume: {hasBoundingVolume}"); if (hasBoundingVolume) { s.AppendLine($" Collision Type: {boundingVolume.collisionType}"); if ((boundingVolume.collisionType == 0)) { s.AppendLine($" Center: {boundingVolume.sphere.center}"); s.AppendLine($" Radius: {boundingVolume.sphere.radius}"); } if ((boundingVolume.collisionType == 1)) { s.AppendLine($" Center: {boundingVolume.box.center}"); array_output_count = 0; for (var i5 = 0; i5 < 3; i5++) { if (!verbose && (array_output_count > Nif.MAXARRAYDUMP)) { s.AppendLine("<Data Truncated. Use verbose mode to see complete listing.>"); break; } if (!verbose && (array_output_count > Nif.MAXARRAYDUMP)) { break; } s.AppendLine($" Axis[{i5}]: {boundingVolume.box.axis[i5]}"); array_output_count++; } s.AppendLine($" Extent: {boundingVolume.box.extent}"); } if ((boundingVolume.collisionType == 2)) { s.AppendLine($" Center: {boundingVolume.capsule.center}"); s.AppendLine($" Origin: {boundingVolume.capsule.origin}"); s.AppendLine($" Extent: {boundingVolume.capsule.extent}"); s.AppendLine($" Radius: {boundingVolume.capsule.radius}"); } if ((boundingVolume.collisionType == 5)) { s.AppendLine($" Normal: {boundingVolume.halfSpace.plane.normal}"); s.AppendLine($" Constant: {boundingVolume.halfSpace.plane.constant}"); s.AppendLine($" Center: {boundingVolume.halfSpace.center}"); } } s.AppendLine($" Collision Object: {collisionObject}"); return(s.ToString()); }
/// <summary> Tcl_GetIndexFromObj -> get /// /// Gets the index into the table of the object. Generate an error /// it it doesn't occur. This also converts the object to an index /// which should catch the lookup for speed improvement. /// /// </summary> /// <param name="interp">the interperter or null /// </param> /// <param name="tobj">the object to operate on. /// @paran table the list of commands /// @paran msg used as part of any error messages /// @paran flags may be TCL.EXACT. /// </param> public static int get(Interp interp, TclObject tobj, string[] table, string msg, int flags) { InternalRep rep = tobj.InternalRep; if (rep is TclIndex) { if (((TclIndex)rep).table == table) { return(((TclIndex)rep).index); } } string str = tobj.ToString(); int strLen = str.Length; int tableLen = table.Length; int index = -1; int numAbbrev = 0; { if (strLen > 0) { for (int i = 0; i < tableLen; i++) { string option = table[i]; if (((flags & TCL.EXACT) == TCL.EXACT) && (option.Length != strLen)) { continue; } if (option.Equals(str)) { // Found an exact match already. Return it. index = i; goto checking_brk; } if (option.StartsWith(str)) { numAbbrev++; index = i; } } } if (numAbbrev != 1) { System.Text.StringBuilder sbuf = new System.Text.StringBuilder(); if (numAbbrev > 1) { sbuf.Append("ambiguous "); } else { sbuf.Append("bad "); } sbuf.Append(msg); sbuf.Append(" \""); sbuf.Append(str); sbuf.Append("\""); sbuf.Append(": must be "); sbuf.Append(table[0]); for (int i = 1; i < tableLen; i++) { if (i == (tableLen - 1)) { sbuf.Append((i > 1)?", or ":" or "); } else { sbuf.Append(", "); } sbuf.Append(table[i]); } throw new TclException(interp, sbuf.ToString()); } } checking_brk :; // Create a new index object. tobj.InternalRep = new TclIndex(index, table); return(index); }
public override int DivideUpDictionaryRange(CharacterIterator inText, int startPos, int endPos, DequeI foundBreaks) { if (startPos >= endPos) { return(0); } inText.SetIndex(startPos); int inputLength = endPos - startPos; int[] charPositions = new int[inputLength + 1]; StringBuffer s = new StringBuffer(""); inText.SetIndex(startPos); while (inText.Index < endPos) { s.Append(inText.Current); inText.Next(); } string prenormstr = s.ToString(); #pragma warning disable 612, 618 bool isNormalized = Normalizer.QuickCheck(prenormstr, NormalizerMode.NFKC) == QuickCheckResult.Yes || Normalizer.IsNormalized(prenormstr, NormalizerMode.NFKC, 0); #pragma warning restore 612, 618 CharacterIterator text; int numChars = 0; if (isNormalized) { text = new StringCharacterIterator(prenormstr); int index = 0; charPositions[0] = 0; while (index < prenormstr.Length) { int codepoint = prenormstr.CodePointAt(index); index += Character.CharCount(codepoint); numChars++; charPositions[numChars] = index; } } else { #pragma warning disable 612, 618 string normStr = Normalizer.Normalize(prenormstr, NormalizerMode.NFKC); text = new StringCharacterIterator(normStr); charPositions = new int[normStr.Length + 1]; Normalizer normalizer = new Normalizer(prenormstr, NormalizerMode.NFKC, 0); int index = 0; charPositions[0] = 0; while (index < normalizer.EndIndex) { normalizer.Next(); numChars++; index = normalizer.Index; charPositions[numChars] = index; } #pragma warning restore 612, 618 } // From here on out, do the algorithm. Note that our indices // refer to indices within the normalized string. int[] bestSnlp = new int[numChars + 1]; bestSnlp[0] = 0; for (int i = 1; i <= numChars; i++) { bestSnlp[i] = kint32max; } int[] prev = new int[numChars + 1]; for (int i = 0; i <= numChars; i++) { prev[i] = -1; } int maxWordSize = 20; int[] values = new int[numChars]; int[] lengths = new int[numChars]; // dynamic programming to find the best segmentation bool is_prev_katakana = false; for (int i = 0; i < numChars; i++) { text.SetIndex(i); if (bestSnlp[i] == kint32max) { continue; } int maxSearchLength = (i + maxWordSize < numChars) ? maxWordSize : (numChars - i); int[] count_ = new int[1]; fDictionary.Matches(text, maxSearchLength, lengths, count_, maxSearchLength, values); int count = count_[0]; // if there are no single character matches found in the dictionary // starting with this character, treat character as a 1-character word // with the highest value possible (i.e. the least likely to occur). // Exclude Korean characters from this treatment, as they should be // left together by default. text.SetIndex(i); // fDictionary.matches() advances the text position; undo that. if ((count == 0 || lengths[0] != 1) && CharacterIteration.Current32(text) != CharacterIteration.Done32 && !fHangulWordSet.Contains(CharacterIteration.Current32(text))) { values[count] = maxSnlp; lengths[count] = 1; count++; } for (int j = 0; j < count; j++) { int newSnlp = bestSnlp[i] + values[j]; if (newSnlp < bestSnlp[lengths[j] + i]) { bestSnlp[lengths[j] + i] = newSnlp; prev[lengths[j] + i] = i; } } // In Japanese, single-character Katakana words are pretty rare. // So we apply the following heuristic to Katakana: any continuous // run of Katakana characters is considered a candidate word with // a default cost specified in the katakanaCost table according // to its length. bool is_katakana = IsKatakana(CharacterIteration.Current32(text)); if (!is_prev_katakana && is_katakana) { int j = i + 1; CharacterIteration.Next32(text); while (j < numChars && (j - i) < kMaxKatakanaGroupLength && IsKatakana(CharacterIteration.Current32(text))) { CharacterIteration.Next32(text); ++j; } if ((j - i) < kMaxKatakanaGroupLength) { int newSnlp = bestSnlp[i] + GetKatakanaCost(j - i); if (newSnlp < bestSnlp[j]) { bestSnlp[j] = newSnlp; prev[j] = i; } } } is_prev_katakana = is_katakana; } int[] t_boundary = new int[numChars + 1]; int numBreaks = 0; if (bestSnlp[numChars] == kint32max) { t_boundary[numBreaks] = numChars; numBreaks++; } else { for (int i = numChars; i > 0; i = prev[i]) { t_boundary[numBreaks] = i; numBreaks++; } Assert.Assrt(prev[t_boundary[numBreaks - 1]] == 0); } if (foundBreaks.Count == 0 || foundBreaks.Peek() < startPos) { t_boundary[numBreaks++] = 0; } int correctedNumBreaks = 0; for (int i = numBreaks - 1; i >= 0; i--) { int pos = charPositions[t_boundary[i]] + startPos; if (!(foundBreaks.Contains(pos) || pos == startPos)) { foundBreaks.Push(charPositions[t_boundary[i]] + startPos); correctedNumBreaks++; } } if (!foundBreaks.IsEmpty && foundBreaks.Peek() == endPos) { foundBreaks.Pop(); correctedNumBreaks--; } if (!foundBreaks.IsEmpty) { inText.SetIndex(foundBreaks.Peek()); } return(correctedNumBreaks); }
public static unsafe void UnicodeStringToStringBuilder(ushort *newBuffer, System.Text.StringBuilder stringBuilder) { stringBuilder.ReplaceBuffer((char *)newBuffer); }
// // GET: /WorkFlow/SelectDict/ public ActionResult Index() { Next.WorkFlow.BLL.DictBLL Dict = new Next.WorkFlow.BLL.DictBLL(); string values = Request.QueryString["values"] ?? ""; string rootid = Request.QueryString["rootid"]; string datasource = Request.QueryString["datasource"]; string sql = Request.QueryString["sql"]; DataTable SqlDataTable = new DataTable(); if ("1" == datasource) { string dbconn = Request.QueryString["dbconn"]; Next.WorkFlow.BLL.DBConnectionBLL conn = new Next.WorkFlow.BLL.DBConnectionBLL(); var conn1 = conn.FindByID(dbconn.ToGuid()); SqlDataTable = conn.GetDataTable(conn1, sql.UrlDecode().ReplaceSelectSql()); } System.Text.StringBuilder defautlSB = new System.Text.StringBuilder(); foreach (string value in values.Split(',')) { switch (datasource) { case "0": default: string id; if (!value.IsGuid(out id)) { continue; } defautlSB.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", value); defautlSB.Append(Dict.FindByID(id).Title); defautlSB.Append("</div>"); break; case "1": //SQL string title1 = string.Empty; foreach (DataRow dr in SqlDataTable.Rows) { if (value == dr[0].ToString()) { title1 = SqlDataTable.Columns.Count > 1 ? dr[1].ToString() : value; break; } } defautlSB.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", value); defautlSB.Append(title1); defautlSB.Append("</div>"); break; case "2": //url string url2 = Request.QueryString["url2"]; if (!url2.IsNullOrEmpty()) { url2 = url2.IndexOf('?') >= 0 ? url2 + "&values=" + value : url2 + "?values=" + value; System.Text.StringBuilder sb = new System.Text.StringBuilder(); try { System.IO.TextWriter tw = new System.IO.StringWriter(sb); Server.Execute(url2, tw); } catch { } defautlSB.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", value); defautlSB.Append(sb.ToString()); defautlSB.Append("</div>"); } break; case "3": //table string dbconn = Request.QueryString["dbconn"]; string dbtable = Request.QueryString["dbtable"]; string valuefield = Request.QueryString["valuefield"]; string titlefield = Request.QueryString["titlefield"]; string parentfield = Request.QueryString["parentfield"]; string where = Request.QueryString["where1"]; Next.WorkFlow.BLL.DBConnectionBLL bdbconn = new Next.WorkFlow.BLL.DBConnectionBLL(); var conn = bdbconn.FindByID(dbconn.ToGuid()); string sql2 = "select " + titlefield + " from " + dbtable + " where " + valuefield + "='" + value + "'"; DataTable dt = bdbconn.GetDataTable(conn, sql2.ReplaceSelectSql()); string title3 = string.Empty; if (dt.Rows.Count > 0) { title3 = dt.Rows[0][0].ToString(); } defautlSB.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", value); defautlSB.Append(title3); defautlSB.Append("</div>"); ViewBag.where = where.UrlEncode(); break; } } ViewBag.defaultValuesString = defautlSB.ToString(); return(View()); }
/// <summary> /// Executes the task - generates the NuSpec file based on the input parameters /// </summary> /// <returns>True</returns> public override bool Execute() { if (DebugTasks) { //Wait for debugger Log.LogMessage( MessageImportance.High, $"Debugging task {GetType().Name}, set the breakpoint and attach debugger to process with PID = {System.Diagnostics.Process.GetCurrentProcess().Id}"); while (!System.Diagnostics.Debugger.IsAttached) { Thread.Sleep(1000); } } var title = !string.IsNullOrEmpty(Title) ? Title : PackageId; var sb = new System.Text.StringBuilder(); //TODO refactor to LINQ XML sb.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); sb.AppendLine($"<package xmlns=\"http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd\">"); sb.AppendLine($" <metadata>"); sb.AppendLine($" <id>{PackageId}</id>"); sb.AppendLine($" <version>{PackageVersionFull}</version>"); sb.AppendLine($" <authors>{Authors}</authors>"); sb.AppendLine($" <title>{title}</title>"); sb.AppendLine($" <owners>{Authors}</owners>"); sb.AppendLine($" <requireLicenseAcceptance>{PackageRequireLicenseAcceptance}</requireLicenseAcceptance>"); // ReSharper disable once ConvertIfStatementToConditionalTernaryExpression if (!string.IsNullOrEmpty(PackageLicense)) { sb.AppendLine($" <license type=\"expression\">{PackageLicense}</license>"); } else { sb.AppendLine($" <licenseUrl>{PackageLicenseUrl}</licenseUrl>"); } sb.AppendLine($" <projectUrl>{PackageProjectUrl}</projectUrl>"); sb.AppendLine($" <iconUrl>{PackageIconUrl}</iconUrl>"); sb.AppendLine($" <description>{Description}</description>"); sb.AppendLine($" <releaseNotes>{PackageReleaseNotes}</releaseNotes>"); sb.AppendLine($" <copyright>{Copyright}</copyright>"); sb.AppendLine($" <tags>{PackageTags}</tags>"); sb.AppendLine( $" <repository url=\"{RepositoryUrl}\" type=\"git\" branch=\"{GitBranch}\" commit=\"{GitCommit}\" />"); sb.AppendLine($" <dependencies>"); sb.AppendLine($" <group targetFramework=\"{TargetFramework}\">"); if (PackageReferences != null) { foreach (var r in PackageReferences) { var item = r.ItemSpec; if (item != "NETStandard.Library") { sb.AppendLine( $" <dependency id=\"{r.ItemSpec}\" version=\"{r.GetMetadata("Version")}\" exclude=\"Build,Analyzers\" />"); } } } var resolvedProjectReferences = new List <string>(); //project references that has been resolved as NuGet packages if (ProjectReferences != null) { foreach (var src in ProjectReferences) { var refPackageDependencyFile = Path.Combine(src.GetMetadata("RelativeDir"), IntermediateOutputPath, Configuration, "package_dependency.txt"); if (!File.Exists(refPackageDependencyFile)) { continue; } var refPackageDependency = File.ReadAllText(refPackageDependencyFile); resolvedProjectReferences.Add(refPackageDependency); sb.AppendLine(refPackageDependency); } } sb.AppendLine($" </group>"); sb.AppendLine($" </dependencies>"); sb.AppendLine($" </metadata>"); sb.AppendLine($" <files>"); var dllFile = Path.Combine(ProjectDirectory, OutputPath, $"{AssemblyName}.dll"); sb.AppendLine($@" <file src=""{dllFile}"" target=""lib\{TargetFramework}\{AssemblyName}.dll"" />"); var pdbFile = Path.Combine(ProjectDirectory, OutputPath, $"{AssemblyName}.pdb"); if (File.Exists(pdbFile)) { sb.AppendLine($@" <file src=""{pdbFile}"" target=""lib\{TargetFramework}\{AssemblyName}.pdb"" />"); } var xmlDocFile = Path.Combine(ProjectDirectory, OutputPath, $"{AssemblyName}.xml"); if (File.Exists(xmlDocFile)) { sb.AppendLine( $@" <file src=""{xmlDocFile}"" target=""lib\{TargetFramework}\{AssemblyName}.xml"" />"); } if (SourceFiles != null && Configuration.ToLower() != "release") { sb.AppendLine(""); foreach (var src in SourceFiles) { var srcFileOriginal = src.GetMetadata("OriginalItemSpec"); var srcFileRel = srcFileOriginal.Replace($@"{ProjectDirectory}\", ""); if (Path.IsPathRooted(srcFileRel)) { continue; //not a project file (probably source-only package) - project files have the relative path in srcFileRel, non project files have full path in srcFileRel } var targetFile = Path.Combine("src", ProjectName, srcFileRel); sb.AppendLine($@" <file src=""{src}"" target=""{targetFile}"" />"); } } //include project references that has NOT been resolved as NuGet packages if (ProjectReferences != null && ReferenceCopyLocalPaths != null) { foreach (var rf in ReferenceCopyLocalPaths) { if (rf.GetMetadata("ReferenceSourceTarget") == "ProjectReference") { var fileName = rf.GetMetadata("FileName"); if (!resolvedProjectReferences.Exists(s => s.Contains($"id=\"{fileName}\""))) { sb.AppendLine( $@" <file src=""{rf.GetMetadata("FullPath")}"" target=""lib\{TargetFramework}\{rf.GetMetadata("FileName")}{rf.GetMetadata("Extension")}"" />"); } } } } sb.AppendLine($" </files>"); sb.AppendLine($"</package> "); //Write NuSpec file to /obj directory NuSpecFile = Path.Combine(ProjectDirectory, IntermediateOutputPath, Configuration, PackageVersionShort + ".nuspec"); File.WriteAllText(NuSpecFile, sb.ToString()); Log.LogMessage(sb.ToString()); //Create dependency file for package in /obj directory var dep = $@"<dependency id=""{PackageId}"" version=""{PackageVersionFull}"" exclude=""Build,Analyzers"" />"; var dependencyFile = Path.Combine(ProjectDirectory, IntermediateOutputPath, Configuration, "package_dependency.txt"); File.WriteAllText(dependencyFile, dep); return(true); }
public static string GetCommandLine(IRunnerData data) { var backup = data.Backup; var options = ApplyOptions(backup, data.Operation, GetCommonOptions(backup, data.Operation)); if (data.ExtraOptions != null) { foreach (var k in data.ExtraOptions) { options[k.Key] = k.Value; } } var cf = Program.DataConnection.Filters; var bf = backup.Filters; var sources = (from n in backup.Sources let p = SpecialFolders.ExpandEnvironmentVariables(n) where !string.IsNullOrWhiteSpace(p) select p).ToArray(); var cmd = new System.Text.StringBuilder(); var exe = System.IO.Path.Combine( Library.AutoUpdater.UpdaterManager.InstalledBaseDir, System.IO.Path.GetFileName( typeof(Duplicati.CommandLine.Commands).Assembly.Location ) ); Func <string, string> appendBackslash = x => x.EndsWith("\\") ? x + "\\" : x; exe = "\"" + appendBackslash(exe) + "\""; if (Library.Utility.Utility.IsMono) { exe = "mono " + exe; } cmd.Append(exe); cmd.Append(" backup"); cmd.AppendFormat(" \"{0}\"", appendBackslash(backup.TargetURL)); cmd.Append(" \"" + string.Join("\" \"", sources.Select(x => appendBackslash(x))) + "\""); foreach (var opt in options) { cmd.AppendFormat(" --{0}={1}", opt.Key, string.IsNullOrWhiteSpace(opt.Value) ? "" : "\"" + appendBackslash(opt.Value) + "\""); } if (cf != null) { foreach (var f in cf) { cmd.AppendFormat(" --{0}=\"{1}\"", f.Include ? "include" : "exclude", appendBackslash(f.Expression)); } } if (bf != null) { foreach (var f in cf) { cmd.AppendFormat(" --{0}=\"{1}\"", f.Include ? "include" : "exclude", appendBackslash(f.Expression)); } } return(cmd.ToString()); }
public static extern sbyte *av_make_error_string(System.Text.StringBuilder errbuf, global::System.UIntPtr errbuf_size, int errnum);
/// <summary> /// This does the real work of the plugin - uploading to TwitPic.com. /// </summary> /// /// <remarks> /// First upload the image, and then place the raw /// image URL onto the clipboard for easy reference/paste. // Optionally, post a Tweet to Twitter. /// </remarks> private void UploadImage() { Tracing.Trace("TwitPic::{0:X8}::UploadImage", this.GetHashCode()); if (!VerifyAuthentication()) { return; } try { oauth["token"] = PluginSettings.AccessToken; oauth["token_secret"] = PluginSettings.AccessSecret; var authzHeader = oauth.GenerateCredsHeader(OAuthConstants.URL_VERIFY_CREDS, "GET", OAuthConstants.AUTHENTICATION_REALM); string tweet = GetTweet(); // prepare the upload POST request var request = (HttpWebRequest)WebRequest.Create(TwitPicSettings.URL_UPLOAD); request.Method = "POST"; request.PreAuthenticate = true; request.AllowWriteStreamBuffering = true; var boundary = "xxx" + Guid.NewGuid().ToString().Substring(12).Replace("-", ""); request.ContentType = string.Format("multipart/form-data; boundary={0}", boundary); request.Headers.Add("X-Auth-Service-Provider", OAuthConstants.URL_VERIFY_CREDS); request.Headers.Add("X-Verify-Credentials-Authorization", authzHeader); // prepare the payload var separator = "--" + boundary; var footer = separator + "--"; var contents = new System.Text.StringBuilder(); contents.AppendLine(separator); contents.AppendLine("Content-Disposition: form-data; name=\"key\""); contents.AppendLine(); contents.AppendLine(TwitPicSettings.TWITPIC_API_KEY); contents.AppendLine(separator); // THE TWITPIC DOC SAYS that the message parameter is required; // it is not. We'll send it anyway. Keep in mind that posting // this message to TwitPic does not "tweet" the message. // Apparently the OAuth implementation is not developed enough // to do that, yet. // contents.AppendLine("Content-Disposition: form-data; name=\"message\""); contents.AppendLine(); contents.AppendLine(String.Format("{0} at {1}", tweet, DateTime.Now.ToString("G"))); contents.AppendLine(separator); string shortFileName = Path.GetFileName(this._fileName); string fileContentType = GetMimeType(shortFileName); string fileHeader = string.Format("Content-Disposition: file; " + "name=\"media\"; filename=\"{0}\"", shortFileName); // TODO: make this so I don't have to store // all the image data in a single buffer. One option is // to do it chunked transfer. need to do the proper encoding in // any case. var encoding = System.Text.Encoding.GetEncoding("iso-8859-1"); string fileData = encoding .GetString(File.ReadAllBytes(this._fileName)); contents.AppendLine(fileHeader); contents.AppendLine(string.Format("Content-Type: {0}", fileContentType)); contents.AppendLine(); contents.AppendLine(fileData); contents.AppendLine(footer); byte[] bytes = encoding.GetBytes(contents.ToString()); request.ContentLength = bytes.Length; // actually send the request using (var s = request.GetRequestStream()) { s.Write(bytes, 0, bytes.Length); using (var r = (HttpWebResponse)request.GetResponse()) { using (var reader = new StreamReader(r.GetResponseStream())) { var responseText = reader.ReadToEnd(); var s1 = new XmlSerializer(typeof(TwitPicUploadResponse)); var sr = new System.IO.StringReader(responseText); var tpur = (TwitPicUploadResponse)s1.Deserialize(new System.Xml.XmlTextReader(sr)); if (PluginSettings.PopBrowser) { System.Diagnostics.Process.Start(tpur.url); } Clipboard.SetDataObject(tpur.url, true); if (PluginSettings.Tweet) { Tweet(tweet, tpur.url); } } } } Tracing.Trace("all done."); Tracing.Trace("---------------------------------"); } catch (Exception exception2) { Tracing.Trace("Exception."); Tracing.Trace("---------------------------------"); MessageBox.Show("There's been an exception uploading your image:" + Environment.NewLine + exception2.Message + Environment.NewLine + Environment.NewLine + "You will have to upload this file manually: " + Environment.NewLine + this._fileName, "Failed to upload to TwitPic", MessageBoxButtons.OK, MessageBoxIcon.Error); } return; }
private static string ParseName(string directoryName) { try { string simpleName = null; string version = "0.0.0.0"; string publicKeyToken = "null"; string culture = "neutral"; System.Text.StringBuilder sb = new System.Text.StringBuilder(); int part = 0; for (int i = 0; i <= directoryName.Length; i++) { if (i == directoryName.Length || directoryName[i] == '_') { if (i < directoryName.Length - 1 && directoryName[i + 1] == '!') { sb.Append('_'); i++; } else if (i == directoryName.Length || directoryName[i + 1] == '_') { switch (part++) { case 0: simpleName = sb.ToString(); break; case 1: version = sb.ToString(); break; case 2: publicKeyToken = sb.ToString(); break; case 3: culture = sb.ToString(); break; case 4: return(null); } sb.Length = 0; i++; } else { int start = i + 1; int end = start; while ('0' <= directoryName[end] && directoryName[end] <= '9') { end++; } int repeatCount; if (directoryName[end] != '_' || !Int32.TryParse(directoryName.Substring(start, end - start), out repeatCount)) { return(null); } sb.Append('_', repeatCount); i = end; } } else { sb.Append(directoryName[i]); } } sb.Length = 0; sb.Append(simpleName).Append(", Version=").Append(version).Append(", Culture=").Append(culture).Append(", PublicKeyToken=").Append(publicKeyToken); return(sb.ToString()); } catch { return(null); } }
/// <summary> Returns source code for an accessor method for a particular Structure. </summary> public static System.String makeAccessor(GroupDef group, int structure) { System.Text.StringBuilder source = new System.Text.StringBuilder(); StructureDef def = group.Structures[structure]; System.String name = def.Name; System.String indexName = group.getIndexName(name); System.String getterName = indexName; if (def is GroupDef) { System.String unqualifiedName = ((GroupDef)def).UnqualifiedName; getterName = group.getIndexName(unqualifiedName); } //make accessor for first (or only) rep ... source.Append("\t/**\r\n"); source.Append("\t * Returns "); if (def.Repeating) { source.Append(" first repetition of "); } source.Append(indexName); source.Append(" ("); source.Append(def.Description); source.Append(") - creates it if necessary\r\n"); source.Append("\t */\r\n"); source.Append("\tpublic "); source.Append(def.Name); source.Append(" "); if (def.Repeating) { source.Append("get"); source.Append(getterName); source.Append("() {\r\n"); } else { source.Append(getterName); source.Append(" { \r\n"); source.Append("get{\r\n"); } source.Append("\t "); source.Append(def.Name); source.Append(" ret = null;\r\n"); source.Append("\t try {\r\n"); source.Append("\t ret = ("); source.Append(def.Name); source.Append(")this.get_Renamed(\""); source.Append(getterName); source.Append("\");\r\n"); source.Append("\t } catch(HL7Exception e) {\r\n"); source.Append("\t HapiLogFactory.getHapiLog(GetType()).error(\"Unexpected error accessing data - this is probably a bug in the source code generator.\", e);\r\n"); source.Append("\t throw new System.Exception(\"An unexpected error ocurred\",e);\r\n"); source.Append("\t }\r\n"); source.Append("\t return ret;\r\n"); if (!def.Repeating) { source.Append("\t}\r\n"); } source.Append("\t}\r\n\r\n"); if (def.Repeating) { //make accessor for specific rep ... source.Append("\t/**\r\n"); source.Append("\t * Returns a specific repetition of "); source.Append(indexName); source.Append("\r\n"); source.Append("\t * ("); source.Append(def.Description); source.Append(") - creates it if necessary\r\n"); source.Append("\t * throws HL7Exception if the repetition requested is more than one \r\n"); source.Append("\t * greater than the number of existing repetitions.\r\n"); source.Append("\t */\r\n"); source.Append("\tpublic "); source.Append(def.Name); source.Append(" get"); source.Append(getterName); source.Append("(int rep) { \r\n"); source.Append("\t return ("); source.Append(def.Name); source.Append(")this.get_Renamed(\""); source.Append(getterName); source.Append("\", rep);\r\n"); source.Append("\t}\r\n\r\n"); //make accessor for number of reps source.Append("\t/** \r\n"); source.Append("\t * Returns the number of existing repetitions of "); source.Append(indexName); source.Append(" \r\n"); source.Append("\t */ \r\n"); source.Append("\tpublic int "); source.Append(getterName); source.Append("Reps { \r\n"); source.Append("get{\r\n"); source.Append("\t int reps = -1; \r\n"); source.Append("\t try { \r\n"); source.Append("\t reps = this.getAll(\""); source.Append(getterName); source.Append("\").Length; \r\n"); source.Append("\t } catch (HL7Exception e) { \r\n"); source.Append("\t string message = \"Unexpected error accessing data - this is probably a bug in the source code generator.\"; \r\n"); source.Append("\t HapiLogFactory.getHapiLog(GetType()).error(message, e); \r\n"); source.Append("\t throw new System.Exception(message);\r\n"); source.Append("\t } \r\n"); source.Append("\t return reps; \r\n"); source.Append("\t}\r\n"); source.Append("\t} \r\n\r\n"); } return(source.ToString()); }
public static string URLFriendly(string title) { if (title == null ) return "" ; const int maxlen = 80; int len = title.Length; bool prevdash = false ; var sb = new System.Text.StringBuilder(len); char c; for ( int i = 0; i < len; i++) { c = title[i]; if ((c >= 'a' && c <= 'z' ) || (c >= '0' && c <= '9' )) { sb.Append(c); prevdash = false ; } else if (c >= 'A' && c <= 'Z' ) { // tricky way to convert to lowercase sb.Append(( char )(c | 32)); prevdash = false ; } else if (c == ' ' || c == ',' || c == '.' || c == '/' || c == '\\' || c == '-' || c == '_' || c == '=' ) { if (!prevdash && sb.Length > 0) { sb.Append( '-' ); prevdash = true ; } } else if (c == '#' ) { if (i > 0) if (title[i - 1] == 'C' || title[i - 1] == 'F' ) sb.Append( "-sharp" ); } else if (c == '+' ) { sb.Append( "-plus" ); } else if (( int )c >= 128) { int prevlen = sb.Length; sb.Append(RemapInternationalCharToAscii(c)); if (prevlen != sb.Length) prevdash = false ; } if (sb.Length == maxlen) break ; } if (prevdash) return sb.ToString().Substring(0, sb.Length - 1); else return sb.ToString(); }
public static extern int av_strerror(int errnum, System.Text.StringBuilder errbuf, global::System.UIntPtr errbuf_size);
public static void GetInheritanceAsString(PackedMemorySnapshot snapshot, int managedTypesArrayIndex, System.Text.StringBuilder target) { var depth = 0; var loopguard = 0; while (managedTypesArrayIndex != -1) { for (var n = 0; n < depth; ++n) { target.Append(" "); } target.AppendFormat("{0}\n", snapshot.managedTypes[managedTypesArrayIndex].name); depth++; managedTypesArrayIndex = snapshot.managedTypes[managedTypesArrayIndex].baseOrElementTypeIndex; if (++loopguard > 64) { break; } } }
/// <summary> Output a string representing this object tag.</summary> /// <returns> A string showing the contents of the object tag. /// </returns> public override System.String ToString() { System.Collections.Hashtable parameters; System.Collections.IEnumerator params_Renamed; System.String paramName; System.String paramValue; bool found; INode node; System.Text.StringBuilder ret; ret = new System.Text.StringBuilder(500); ret.Append("Object Tag\n"); ret.Append("**********\n"); ret.Append("ClassId = "); ret.Append(ObjectClassId); ret.Append("\n"); ret.Append("CodeBase = "); ret.Append(ObjectCodeBase); ret.Append("\n"); ret.Append("CodeType = "); ret.Append(ObjectCodeType); ret.Append("\n"); ret.Append("Data = "); ret.Append(ObjectData); ret.Append("\n"); ret.Append("Height = "); ret.Append(ObjectHeight); ret.Append("\n"); ret.Append("Standby = "); ret.Append(ObjectStandby); ret.Append("\n"); ret.Append("Type = "); ret.Append(ObjectType); ret.Append("\n"); ret.Append("Width = "); ret.Append(ObjectWidth); ret.Append("\n"); parameters = ObjectParams; params_Renamed = parameters.Keys.GetEnumerator(); if (null == params_Renamed) { ret.Append("No Params found.\n"); } else { //UPGRADE_TODO: Method 'java.util.Enumeration.hasMoreElements' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationhasMoreElements'" for (int cnt = 0; params_Renamed.MoveNext(); cnt++) { //UPGRADE_TODO: Method 'java.util.Enumeration.nextElement' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationnextElement'" paramName = ((System.String)params_Renamed.Current); paramValue = ((System.String)parameters[paramName]); ret.Append(cnt); ret.Append(": Parameter name = "); ret.Append(paramName); ret.Append(", Parameter value = "); ret.Append(paramValue); ret.Append("\n"); } } found = false; for (ISimpleNodeIterator e = GetChildren(); e.HasMoreNodes();) { node = e.NextNode(); if (node is ITag) { if (((ITag)node).TagName.Equals("PARAM")) { continue; } } if (!found) { ret.Append("Miscellaneous items :\n"); } else { ret.Append(" "); } found = true; ret.Append(node.ToString()); } if (found) { ret.Append("\n"); } ret.Append("End of Object Tag\n"); ret.Append("*****************\n"); return(ret.ToString()); }
partial void PrepareRequest(HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
public static void AutoCode(List <string> classes) { // 自动生成所有需要委托 Dictionary <string, Funs> allfuns = new Dictionary <string, Funs>(); // 所有的需要导出的函数原形列表 var flag = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.IgnoreCase | BindingFlags.DeclaredOnly; var alls = new List <System.Type>(); HashSet <int> ObjectsParamCount = new HashSet <int>(); HashSet <string> exports = new HashSet <string>(classes); foreach (var ator in System.AppDomain.CurrentDomain.GetAssemblies()) { if (ator.FullName.StartsWith("System")) { continue; } foreach (var type in ator.GetTypes()) { if (exports.Contains(type.FullName.Replace('+', '/')) || type.GetCustomAttributes(typeof(HotfixAttribute), false).Length != 0) { //wxb.L.LogFormat("type:{0}", type.FullName); if (type.IsGenericType) { continue; } foreach (var method in type.GetMethods(flag)) { if (method.IsGenericMethod) { continue; } if (IsEditorAttribute(method)) { continue; } Funs fun = new Funs(method, method.IsStatic ? false : true); if (!fun.isExport) { continue; } string key = fun.oid; Funs rs; if (allfuns.TryGetValue(key, out rs)) { rs.methods.Add(method); continue; } allfuns.Add(key, fun); } // MonoBehaviour类型不重载构造函数 if (IsUnityObjectType(type)) { continue; } foreach (var ctor in type.GetConstructors(flag)) { if (ctor.IsGenericMethod) { continue; } if (IsEditorAttribute(ctor)) { continue; } Funs fun = new Funs(ctor, ctor.IsStatic ? false : true); if (!fun.isExport) { continue; } string key = fun.oid; Funs rs; if (allfuns.TryGetValue(key, out rs)) { rs.methods.Add(ctor); continue; } allfuns.Add(key, fun); } } } } string marco, suffix; AutoRegILType.GetPlatform(out marco, out suffix); string file = string.Format("Assets/XIL/Auto/GenDelegateBridge_{0}.cs", suffix); System.IO.Directory.CreateDirectory(file.Substring(0, file.LastIndexOf('/'))); System.Text.StringBuilder sb = new System.Text.StringBuilder(); string name = "__Gen_Delegate_Imp"; int index = 0; foreach (var ator in allfuns) { ator.Value.toInfo(" ", sb); int paramCount = 0; sb.AppendFormat(" {0}", ator.Value.toString(name + (++index), out paramCount)); sb.AppendLine(); if (paramCount != 0) { ObjectsParamCount.Add(paramCount); } } System.IO.File.WriteAllText(file, string.Format(file_format + "#endif", marco, sb.ToString())); wxb.L.LogFormat("count:{0}", allfuns.Count); sb.Length = 0; sb.AppendLine(string.Format("countType:{0}", classes.Count)); foreach (var ator in classes) { sb.AppendLine(ator); } wxb.L.LogFormat(sb.ToString()); GeneratorObjects.Gen(ObjectsParamCount); AssetDatabase.Refresh(); }
/// < summary> /// 动态调用web服务 /// < /summary> /// < param name="url">WSDL服务地址< /param> /// < param name="classname">类名< /param> /// < param name="methodname">方法名< /param> /// < param name="args">参数< /param> /// < returns>< /returns> public static object InvokeWebService(string url, string classname, string methodname, object[] args) { string @namespace = "IRFixIncomeSystemApprovement"; if ((classname == null) || (classname == "")) { classname = GetWsClassName(url); } try { //获取WSDL WebClient wc = new WebClient(); Stream stream = wc.OpenRead(url + "" + args[0]); ServiceDescription sd = ServiceDescription.Read(stream); ServiceDescriptionImporter sdi = new ServiceDescriptionImporter(); sdi.AddServiceDescription(sd, "", ""); CodeNamespace cn = new CodeNamespace(@namespace); //生成客户端代理类代码 CodeCompileUnit ccu = new CodeCompileUnit(); ccu.Namespaces.Add(cn); sdi.Import(cn, ccu); CSharpCodeProvider icc = new CSharpCodeProvider(); //设定编译参数 CompilerParameters cplist = new CompilerParameters(); cplist.GenerateExecutable = false; cplist.GenerateInMemory = true; cplist.ReferencedAssemblies.Add("System.dll"); cplist.ReferencedAssemblies.Add("System.XML.dll"); cplist.ReferencedAssemblies.Add("System.Web.Services.dll"); cplist.ReferencedAssemblies.Add("System.Data.dll"); //编译代理类 CompilerResults cr = icc.CompileAssemblyFromDom(cplist, ccu); if (true == cr.Errors.HasErrors) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (System.CodeDom.Compiler.CompilerError ce in cr.Errors) { sb.Append(ce.ToString()); sb.Append(System.Environment.NewLine); } throw new Exception(sb.ToString()); } //生成代理实例,并调用方法 System.Reflection.Assembly assembly = cr.CompiledAssembly; Type t = assembly.GetType(@namespace + "." + classname, true, true); object obj = Activator.CreateInstance(t); System.Reflection.MethodInfo mi = t.GetMethod(methodname); return(mi.Invoke(obj, args)); /* * PropertyInfo propertyInfo = type.GetProperty(propertyname); * return propertyInfo.GetValue(obj, null); */ } catch (Exception ex) { throw new Exception(ex.InnerException.Message, new Exception(ex.InnerException.StackTrace)); } }
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> /// <summary>Получить детали рассчитанного кредита</summary> /// <exception cref="ApiException">A server side error occurred.</exception> public async System.Threading.Tasks.Task <OutputDataCredit> GetOutputCreditDetailsAsync(InputDataCredit inputDataCredit, System.Threading.CancellationToken cancellationToken) { if (inputDataCredit == null) { throw new System.ArgumentNullException("inputDataCredit"); } var urlBuilder_ = new System.Text.StringBuilder(); urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/DataCredit/creditdetails"); var client_ = new HttpClient(); var disposeClient_ = true; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(inputDataCredit, _settings.Value)); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("GET"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) { headers_[item_.Key] = item_.Value; } } ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync <OutputDataCredit>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } return(objectResponse_.Object); } else { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { if (disposeResponse_) { response_.Dispose(); } } } } finally { if (disposeClient_) { client_.Dispose(); } } }
public IVisio.Document DrawInteropEnumDocumentation() { var cmdtarget = this._client.GetCommandTargetApplication(); var formdoc = new VisioAutomation.Models.Documents.Forms.FormDocument(); var helpstr = new System.Text.StringBuilder(); int chunksize = 70; var interop_enums = VisioScripting.Helpers.InteropHelper.GetEnums(); foreach (var enum_ in interop_enums) { int chunkcount = 0; var values = enum_.Values.OrderBy(i => i.Name).ToList(); foreach (var chunk in DeveloperCommands._chunk(values, chunksize)) { helpstr.Length = 0; foreach (var val in chunk) { helpstr.AppendFormat("0x{0}\t{1}\n", val.Value.ToString("x"), val.Name); } var formpage = new VisioAutomation.Models.Documents.Forms.FormPage(); formpage.Size = new VisioAutomation.Geometry.Size(8.5, 11); formpage.PageMargin = new PageMargin(0.5, 0.5, 0.5, 0.5); formpage.Title = enum_.Name; formpage.Body = helpstr.ToString(); if (chunkcount == 0) { formpage.Name = string.Format("{0}", enum_.Name); } else { formpage.Name = string.Format("{0} ({1})", enum_.Name, chunkcount + 1); } //docbuilder.BodyParaSpacingAfter = 2.0; formpage.BodyTextSize = 8.0; formdoc.Pages.Add(formpage); var tabstops = new[] { new VisioAutomation.Text.TabStop(1.5, VisioAutomation.Text.TabStopAlignment.Left) }; //VA.Text.TextFormat.SetTabStops(docpage.VisioBodyShape, tabstops); chunkcount++; } } formdoc.Subject = "Visio Interop Enum Documenation"; formdoc.Title = "Visio Interop Enum Documenation"; formdoc.Creator = ""; formdoc.Company = ""; //hide_ui_stuff(docbuilder.VisioDocument); var application = cmdtarget.Application; var doc = formdoc.Render(application); return(doc); }
/// <summary> /// Display the contents of the dictionary in the debugger. This is intentionally private, it is called /// only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar /// format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. /// </summary> /// <returns>The string representation of the items in the collection, similar in format to ToString().</returns> new internal string DebuggerDisplayString() { const int MAXLENGTH = 250; bool firstItem = true; System.Text.StringBuilder builder = new System.Text.StringBuilder(); builder.Append("{"); // Call ToString on each item and put it in. foreach (KeyValuePair <TKey, ICollection <TValue> > pair in this) { if (builder.Length >= MAXLENGTH) { builder.Append(", ..."); break; } if (!firstItem) { builder.Append(", "); } if (pair.Key == null) { builder.Append("null"); } else { builder.Append(pair.Key.ToString()); } builder.Append("->"); // Put all values in a parenthesized list. builder.Append('('); bool firstValue = true; foreach (TValue val in pair.Value) { if (!firstValue) { builder.Append(","); } if (val == null) { builder.Append("null"); } else { builder.Append(val.ToString()); } firstValue = false; } builder.Append(')'); firstItem = false; } builder.Append("}"); return(builder.ToString()); }
/// <summary> /// Returns a copy of the given string with text replaced using a regular expression. /// </summary> /// <param name="input"> The string on which to perform the search. </param> /// <param name="replaceText"> A string containing the text to replace for every successful match. </param> /// <returns> A copy of the given string with text replaced using a regular expression. </returns> public string Replace(string input, string replaceText) { // Check if the replacement string contains any patterns. bool replaceTextContainsPattern = replaceText.IndexOf('$') >= 0; // Replace the input string with replaceText, recording the last match found. Match lastMatch = null; string result = this.value.Replace(input, match => { lastMatch = match; // If there is no pattern, replace the pattern as is. if (replaceTextContainsPattern == false) { return(replaceText); } // Patterns // $$ Inserts a "$". // $& Inserts the matched substring. // $` Inserts the portion of the string that precedes the matched substring. // $' Inserts the portion of the string that follows the matched substring. // $n or $nn Where n or nn are decimal digits, inserts the nth parenthesized submatch string, provided the first argument was a RegExp object. var replacementBuilder = new System.Text.StringBuilder(); for (int i = 0; i < replaceText.Length; i++) { char c = replaceText[i]; if (c == '$' && i < replaceText.Length - 1) { c = replaceText[++i]; if (c == '$') { replacementBuilder.Append('$'); } else if (c == '&') { replacementBuilder.Append(match.Value); } else if (c == '`') { replacementBuilder.Append(input.Substring(0, match.Index)); } else if (c == '\'') { replacementBuilder.Append(input.Substring(match.Index + match.Length)); } else if (c >= '0' && c <= '9') { int matchNumber1 = c - '0'; // The match number can be one or two digits long. int matchNumber2 = 0; if (i < replaceText.Length - 1 && replaceText[i + 1] >= '0' && replaceText[i + 1] <= '9') { matchNumber2 = matchNumber1 * 10 + (replaceText[i + 1] - '0'); } // Try the two digit capture first. if (matchNumber2 > 0 && matchNumber2 < match.Groups.Count) { // Two digit capture replacement. replacementBuilder.Append(match.Groups[matchNumber2].Value); i++; } else if (matchNumber1 > 0 && matchNumber1 < match.Groups.Count) { // Single digit capture replacement. replacementBuilder.Append(match.Groups[matchNumber1].Value); } else { // Capture does not exist. replacementBuilder.Append('$'); i--; } } else { // Unknown replacement pattern. replacementBuilder.Append('$'); replacementBuilder.Append(c); } } else { replacementBuilder.Append(c); } } return(replacementBuilder.ToString()); }, this.Global == true ? -1 : 1); // Set the deprecated RegExp properties if at least one match was found. if (lastMatch != null) { this.Engine.RegExp.SetDeprecatedProperties(input, lastMatch); } return(result); }
public IVisio.Document DrawScriptingDocumentation() { var cmdtarget = this._client.GetCommandTargetApplication(); var formdoc = new VisioAutomation.Models.Documents.Forms.FormDocument(); formdoc.Subject = "VisioAutomation.Scripting Documenation"; formdoc.Title = "VisioAutomation.Scripting Documenation"; formdoc.Creator = ""; formdoc.Company = ""; //docbuilder.BodyParaSpacingAfter = 6.0; var lines = new List <string>(); var cmdst_props = Client.GetProperties().OrderBy(i => i.Name).ToList(); var sb = new System.Text.StringBuilder(); var helpstr = new System.Text.StringBuilder(); foreach (var cmdset_prop in cmdst_props) { var cmdset_type = cmdset_prop.PropertyType; var commands = CommandSet.GetCommands(cmdset_type); lines.Clear(); foreach (var command in commands) { sb.Length = 0; var cmdparams = command.GetParameters(); var cmdparam_strings = cmdparams.Select(p => string.Format("{0} {1}", p.TypeDisplayName, p.Name)); VisioScripting.Helpers.TextHelper.Join(sb, ", ", cmdparam_strings); if (command.ReturnsValue) { string line = string.Format("{0}({1}) -> {2}", command.Name, sb, command.ReturnTypeDisplayName); lines.Add(line); } else { string line = string.Format("{0}({1})", command.Name, sb); lines.Add(line); } } lines.Sort(); helpstr.Length = 0; VisioScripting.Helpers.TextHelper.Join(helpstr, "\r\n", lines); var formpage = new VisioAutomation.Models.Documents.Forms.FormPage(); formpage.Title = cmdset_prop.Name + " commands"; formpage.Body = helpstr.ToString(); formpage.Name = cmdset_prop.Name + " commands"; formpage.Size = new VisioAutomation.Geometry.Size(8.5, 11); formpage.PageMargin = new PageMargin(0.5, 0.5, 0.5, 0.5); formdoc.Pages.Add(formpage); } //hide_ui_stuff(docbuilder.VisioDocument); var app = cmdtarget.Application; var doc = formdoc.Render(app); return(doc); }
public QueuedTextWrite(string text, TextTag tag) { Text = new System.Text.StringBuilder(text); Tag = tag; }
void report(object o, EventArgs e) { CrashReport.Report(PROGRAM, string.Empty, string.Empty, _dmsg.ToString(), null, null, false); _dmsg = new System.Text.StringBuilder(); }
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> /// <exception cref="SwaggerException">A server side error occurred.</exception> public async System.Threading.Tasks.Task <System.Collections.ObjectModel.ObservableCollection <WeatherForecast> > WeatherForecastsAsync(System.Threading.CancellationToken cancellationToken) { var urlBuilder_ = new System.Text.StringBuilder(); urlBuilder_.Append(BaseUrl).Append("/api/SampleData/WeatherForecasts"); var client_ = new System.Net.Http.HttpClient(); try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("GET"); request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); foreach (var item_ in response_.Content.Headers) { headers_[item_.Key] = item_.Value; } ProcessResponse(client_, response_); var status_ = ((int)response_.StatusCode).ToString(); if (status_ == "200") { var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); var result_ = default(System.Collections.ObjectModel.ObservableCollection <WeatherForecast>); try { result_ = Newtonsoft.Json.JsonConvert.DeserializeObject <System.Collections.ObjectModel.ObservableCollection <WeatherForecast> >(responseData_, _settings.Value); return(result_); } catch (System.Exception exception) { throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); } } else if (status_ != "200" && status_ != "204") { var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); } return(default(System.Collections.ObjectModel.ObservableCollection <WeatherForecast>)); } finally { if (response_ != null) { response_.Dispose(); } } } } finally { if (client_ != null) { client_.Dispose(); } } }
private static void MenuItem_CreateVersionManagerSetting() { string[] t_text_list = new string[] { "", "", "/**", " Copyright (c) blueback", " Released under the MIT License", " @brief 設定。", "*/", "", "", "/** Editor", "*/", "#if(UNITY_EDITOR)", "namespace Editor", "{", " /** VersionManagerSetting", " */", " [UnityEditor.InitializeOnLoad]", " public static class VersionManagerSetting", " {", " /** VersionManagerSetting", " */", " static VersionManagerSetting()", " {", " //Object_RootUssUxml", " BlueBack.VersionManager.Editor.Object_RootUssUxml.Save(false);", "", " //projectparam", " BlueBack.VersionManager.Editor.Object_Setting.s_projectparam = BlueBack.VersionManager.Editor.ProjectParam.Load();", "", " //s_object_root_readme_md", " BlueBack.VersionManager.Editor.Object_Setting.s_object_root_readme_md = new BlueBack.VersionManager.Editor.Object_Setting.Creator_Type[]{", "", " //概要。", " (in BlueBack.VersionManager.Editor.Object_Setting.Creator_Argument a_argument) => {", " System.Collections.Generic.List<string> t_list = new System.Collections.Generic.List<string>();", " t_list.Add(\"# \" + BlueBack.VersionManager.Editor.Object_Setting.s_projectparam.namespace_author + \".\" + BlueBack.VersionManager.Editor.Object_Setting.s_projectparam.namespace_package);", " t_list.AddRange(BlueBack.VersionManager.Editor.Object_Setting.Create_RootReadMd_Overview(a_argument));", " return t_list.ToArray();", " },", "", " //ライセンス。", " (in BlueBack.VersionManager.Editor.Object_Setting.Creator_Argument a_argument) => {", " return new string[]{", " \"## ライセンス\",", " \"MIT License\",", " \"* \" + BlueBack.VersionManager.Editor.Object_Setting.s_projectparam.git_url + \"/blob/main/LICENSE\",", " };", " },", "", " //依存。", " (in BlueBack.VersionManager.Editor.Object_Setting.Creator_Argument a_argument) => {", " System.Collections.Generic.List<string> t_list = new System.Collections.Generic.List<string>();", " t_list.Add(\"## 依存 / 使用ライセンス等\");", " t_list.AddRange(BlueBack.VersionManager.Editor.Object_Setting.Create_RootReadMd_Asmdef_Dependence(a_argument));", " return t_list.ToArray();", " },", "", " //動作確認。", " (in BlueBack.VersionManager.Editor.Object_Setting.Creator_Argument a_argument) => {", " return new string[]{", " \"## 動作確認\",", " \"Unity \" + UnityEngine.Application.unityVersion,", " };", " },", "", " //UPM。", " (in BlueBack.VersionManager.Editor.Object_Setting.Creator_Argument a_argument) => {", " return new string[]{", " \"## UPM\",", " \"### 最新\",", " \"* \" + BlueBack.VersionManager.Editor.Object_Setting.s_projectparam.git_url + \".git?path=\" + BlueBack.VersionManager.Editor.Object_Setting.s_projectparam.git_path + \"#\" + a_argument.version,", " \"### 開発\",", " \"* \" + BlueBack.VersionManager.Editor.Object_Setting.s_projectparam.git_url + \".git?path=\" + BlueBack.VersionManager.Editor.Object_Setting.s_projectparam.git_path,", " };", " },", "", " //インストール。 ", " (in BlueBack.VersionManager.Editor.Object_Setting.Creator_Argument a_argument) => {", " return new string[]{", " \"## Unityへの追加方法\",", " \"* Unity起動\",", " \"* メニュー選択:「Window->Package Manager」\",", " \"* ボタン選択:「左上の+ボタン」\",", " \"* リスト選択:「Add package from git URL...」\",", " \"* 上記UPMのURLを追加「 https://github.com/~~/UPM#バージョン 」\",", " \"### 注\",", " \"Gitクライアントがインストールされている必要がある。\",", " \"* https://docs.unity3d.com/ja/current/Manual/upm-git.html\",", " \"* https://git-scm.com/\",", " };", " },", "", " //例。", " (in BlueBack.VersionManager.Editor.Object_Setting.Creator_Argument a_argument) => {", " System.Collections.Generic.List<string> t_list = new System.Collections.Generic.List<string>();", " t_list.AddRange(BlueBack.VersionManager.Editor.Object_Setting.Create_RootReadMd_Exsample(a_argument));", " return t_list.ToArray();", " },", " };", " }", " }", "}", "#endif", "", }; //projectparam BlueBack.VersionManager.Editor.ProjectParam t_projectparam = BlueBack.VersionManager.Editor.ProjectParam.Load(); //replace_list System.Collections.Generic.Dictionary <string, string> t_replace_list = new System.Collections.Generic.Dictionary <string, string>(); { } System.Text.StringBuilder t_stringbuilder = new System.Text.StringBuilder(); { for (int ii = 0; ii < t_text_list.Length; ii++) { string t_text = t_text_list[ii]; foreach (System.Collections.Generic.KeyValuePair <string, string> t_pair in t_replace_list) { t_text = t_text.Replace(t_pair.Key, t_pair.Value); } t_stringbuilder.Append(t_text); t_stringbuilder.Append('\n'); } } { //path string t_path = "Editor/VersionManagerSetting.cs"; BlueBack.AssetLib.Editor.CreateDirectoryWithAssetsPath.Create(System.IO.Path.GetDirectoryName(t_path)); BlueBack.AssetLib.Editor.SaveTextWithAssetsPath.SaveNoBomUtf8(t_stringbuilder.ToString(), "Editor/VersionManagerSetting.cs", BlueBack.AssetLib.LineFeedOption.CRLF); BlueBack.AssetLib.Editor.RefreshAssetDatabase.Refresh(); } }