本文整理汇总了C#中DataType.Phrases方法的典型用法代码示例。如果您正苦于以下问题:C# DataType.Phrases方法的具体用法?C# DataType.Phrases怎么用?C# DataType.Phrases使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataType
的用法示例。
在下文中一共展示了DataType.Phrases方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Edit
// For Editing:
// RDdetail = need to know what is selected (if anything yet)
public string Edit()
{
string prompt="",html="", js="", phraseselect="";
string[] phrases;
DataType datatype = new DataType();
UIFS.Form_Output FormOut = new Form_Output();
FormControl.Checkbox Ctrl_Checkbox;
FormControl.DateTime Ctrl_DateTime;
FormControl.Number Ctrl_Number;
FormControl.Percentage Ctrl_Percentage;
FormControl.List Ctrl_List;
FormControl.Range Ctrl_Range;
FormControl.Textbox Ctrl_Textbox;
// Load Phrases for this datatype, if phrase selection data does not exist ... set to default
phrases = datatype.Phrases(detail.type).Split(new char[] { ',' });
if (RDdetail == null)
{
RDdetail = new ReportDefinition.Detail();
RDdetail.lang = phrases[0]; // first language phrase
}
prompt = "<span class=\"name\">" + detail.name + "</span> ";
// Language selection
//: currently based on datatype
prompt = prompt + "<select id=\""+this.id.ToString()+"_phrase\" onchange=\"Option_Redraw('"+this.id.ToString()+"'); \">";
foreach (string phrase in phrases)
{
if (RDdetail.lang == phrase) { phraseselect = " selected=\"1\" "; } else { phraseselect = ""; }
prompt = prompt + "<option value=\"" + phrase + "\" " + phraseselect + ">" + phrase + "</option>";
}
prompt = prompt + "</select>";
// --[ Builds a dynamic UIFS.FormControl we use to get input needed to build form ]
// entry type...based on language, then datatype
string CtrlEntryType = datatype.FormEntryType(detail.type, RDdetail.lang);
switch (CtrlEntryType)
{
// possibly have two different methods
// 1: for getting data specific to UIFS.Form (this way we can mirror our control properties)
// 2: for generic Subject-Detail
case "id":
case "list_id":
// GLOBAL identifiers are user defined formlinks to id lists of this Subject type...
//. Use a list control
if (detail.name.StartsWith("[global]")) {
Ctrl_List = new FormControl.List();
Ctrl_List.id = this.id;
Ctrl_List.prompt = prompt;
Ctrl_List.tip = "Please choose your Subject";
Ctrl_List.type = FormControl.List.listtype.dropdown;
Ctrl_List.Items = PossibleValues;
FormOut.HTML_FormControl(ControlType.List, Ctrl_List, ref html, ref js);
Control = Ctrl_List; Control_type = ControlType.List;
}
break;
case "checkbox":
if (UIFSFormControl) {
Ctrl_Checkbox = (FormControl.Checkbox)UIFSControl;
Ctrl_Checkbox.hasinput = false; // we do not want this
}
else {
Ctrl_Checkbox = new FormControl.Checkbox(); }
Ctrl_Checkbox.id = this.id;
Ctrl_Checkbox.prompt = prompt; //TEST: we want to use this as part of our Control div if possible
Ctrl_Checkbox.tip = "Choose one or the other";
FormOut.HTML_FormControl(ControlType.Checkbox, Ctrl_Checkbox, ref html, ref js); // builds html for control
Control = Ctrl_Checkbox; Control_type = ControlType.Checkbox;
break;
case "number":
if (UIFSFormControl){Ctrl_Number = (FormControl.Number)UIFSControl; }
else { Ctrl_Number = new FormControl.Number(); }
Ctrl_Number.id = this.id; Ctrl_Number.prompt = prompt;
Ctrl_Number.tip = "Please choose a number between: " + Ctrl_Number.min.ToString() + " AND " + Ctrl_Number.max.ToString();
FormOut.HTML_FormControl(ControlType.Number, Ctrl_Number, ref html, ref js);
Control = Ctrl_Number; Control_type = ControlType.Number;
break;
case "datetime":
case "date":
case "time":
if (UIFSFormControl) {Ctrl_DateTime = (FormControl.DateTime)UIFSControl; }
else { Ctrl_DateTime = new FormControl.DateTime();}
Ctrl_DateTime.id = this.id;
Ctrl_DateTime.prompt = prompt;
Ctrl_DateTime.tip = "Please select a date/time";
switch (CtrlEntryType)
{
case "datetime":
Ctrl_DateTime.type = FormControl.DateTime.datetimetype.datetime;
break;
case "date":
Ctrl_DateTime.type = FormControl.DateTime.datetimetype.date;
break;
case "time":
Ctrl_DateTime.type = FormControl.DateTime.datetimetype.time;
break;
}
//.........这里部分代码省略.........