Skip to content

Commit 882bc91

Browse files
Update WebForms.cs
1 parent cf425eb commit 882bc91

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

class/WebForms.cs

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ public class WebForms
77
{
88
private NameValueCollection WebFormsData = new NameValueCollection();
99

10+
// For Extension
11+
public void AddLine(string Name, string Value) => WebFormsData.Add(Name, Value);
12+
1013
// Add
1114
public void AddId(string InputPlace, string Id) => WebFormsData.Add("ai" + InputPlace, Id);
1215
public void AddName(string InputPlace, string Name) => WebFormsData.Add("an" + InputPlace, Name);
@@ -70,6 +73,8 @@ public class WebForms
7073
public void DeleteText(string InputPlace) => WebFormsData.Add("dt" + InputPlace, "1");
7174
public void DeleteAttribute(string InputPlace, string Attribute) => WebFormsData.Add("da" + InputPlace, Attribute);
7275
public void Delete(string InputPlace) => WebFormsData.Add("de" + InputPlace, "1");
76+
public void DeleteParent(string InputPlace) => WebFormsData.Add("dp" + InputPlace, "1");
77+
7378

7479
// Other
7580
public void SetBackgroundColor(string InputPlace, string Color) => WebFormsData.Add("bc" + InputPlace, Color);
@@ -204,13 +209,22 @@ public void AssignIntervalChange(float Second, int Index = -1)
204209
WebFormsData.ChangeNameByIndex(Index, "(" + Second + ")" + CurrentName);
205210
}
206211

212+
// Index
213+
public void StartIndex(string Name) => WebFormsData.Add("#", Name);
214+
public void StartIndex() => StartIndex("");
215+
207216
// Get
208217
public string GetFormsActionData()
209218
{
210219
string ReturnValue = "";
211220

212221
foreach (NameValue nv in WebFormsData.GetList())
213-
ReturnValue += Environment.NewLine + nv.Name + "=" + nv.Value;
222+
{
223+
ReturnValue += Environment.NewLine + nv.Name;
224+
225+
if (!string.IsNullOrEmpty(nv.Value))
226+
ReturnValue += "=" + nv.Value;
227+
}
214228

215229
return ReturnValue;
216230
}
@@ -235,7 +249,15 @@ public string GetFormsActionDataLineBreak()
235249

236250
int i = WebFormsDataList.Count;
237251
foreach (NameValue nv in WebFormsData.GetList())
238-
ReturnValue += nv.Name + "=" + nv.Value.Replace("\"", "$[dq];") + ((i-- > 1) ? "$[sln];" : "");
252+
{
253+
ReturnValue += nv.Name;
254+
255+
if (!string.IsNullOrEmpty(nv.Value))
256+
ReturnValue += "=" + nv.Value.Replace("\"", "$[dq];");
257+
258+
if (i-- > 1)
259+
ReturnValue += "$[sln];";
260+
}
239261

240262
return ReturnValue;
241263
}
@@ -314,6 +336,7 @@ public class Fetch
314336
public static string Dateinutes = "@di";
315337
public static string DateSeconds = "@ds";
316338
public static string DateMilliseconds = "@dl";
339+
public static string Cookie(string Key) => "@co" + Key;
317340
public static string Session(string Key) => "@cs" + Key;
318341
public static string Session(string Key, string ReplaceValue) => "@cs" + Key + "," + ReplaceValue;
319342
public static string SessionAndRemove(string Key) => "@cl" + Key;
@@ -500,6 +523,11 @@ public static string AppendPlace(this string Text, string Value)
500523
return Text + "|" + Value;
501524
}
502525

526+
public static string AppendParrent(this string Text)
527+
{
528+
return "/" + Text;
529+
}
530+
503531
public static string ExportToWebFormsTag(this string src)
504532
{
505533
return "<web-forms src=\"" + src + "\"></web-forms>";

0 commit comments

Comments
 (0)