本文整理汇总了C#中Choice类的典型用法代码示例。如果您正苦于以下问题:C# Choice类的具体用法?C# Choice怎么用?C# Choice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Choice类属于命名空间,在下文中一共展示了Choice类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BackgroundSettings
public BackgroundSettings()
{
this.commands = new ArrayListDataSet(this);
//save command
Command saveCmd = new Command();
saveCmd.Description = "Save";
saveCmd.Invoked += new EventHandler(saveCmd_Invoked);
this.commands.Add(saveCmd);
//cancel command
Command cancelCmd = new Command();
cancelCmd.Description = "Cancel";
cancelCmd.Invoked += new EventHandler(cancelCmd_Invoked);
this.commands.Add(cancelCmd);
this.transparancyOptions = new Choice(this);
this.SetupTransparancyOptions();
this.transparancyOptions.ChosenChanged += new EventHandler(transparancyOptions_ChosenChanged);
this.rotationOptions = new Choice(this);
this.SetupRotationOptions();
this.enableCustomBackground = new BooleanChoice(this);
this.enableCustomBackground.Description = "Enable Custom Background";
this.enableCustomBackground.Value = Properties.Settings.Default.EnableMainPageBackDrop;
}
示例2: ExtenderSettings
public ExtenderSettings()
{
this.commands = new ArrayListDataSet(this);
//save command
Command saveCmd = new Command();
saveCmd.Description = "Save";
saveCmd.Invoked += new EventHandler(saveCmd_Invoked);
this.commands.Add(saveCmd);
//cancel command
Command cancelCmd = new Command();
cancelCmd.Description = "Cancel";
cancelCmd.Invoked += new EventHandler(cancelCmd_Invoked);
this.commands.Add(cancelCmd);
this.goToImpersonation = new Command();
this.goToImpersonation.Description = "Impersonation";
this.goToImpersonation.Invoked += new EventHandler(goToImpersonation_Invoked);
this.goToTranscode = new Command();
this.goToTranscode.Description = "Transcoding";
this.goToTranscode.Invoked += new EventHandler(goToTranscode_Invoked);
this.transcodingDelays = new Choice(this);
this.SetupTranscodingOptions();
this.SetupImpersonation();
this.SetupTranscodingDelays();
}
示例3: Temp
Temp()
{
topic = new List<DialogueNode>();
topic.Add(new DialogueLine(0, "Hello"));
topic.Add(new DialogueLine(1, "Mornin'"));
topic.Add(new DialogueLine(0, "Who stole the cookie from the cookie jar?"));
topic.Add(new DialogueLine(1, "You stole the cookie from the cookie jar.")); // id = 3
topic.Add(new DialogueLine(0, "Who me?"));
topic.Add(new DialogueLine(1, "Yes, you!"));
topic.Add(new DialogueLine(0, "Couldn't be!"));
topic.Add(new DialogueLine(1, "Then who?"));
DialogueChoice dc = new DialogueChoice();
Choice c = new Choice();
c.SetText("No idea.");
c.AddOutcome(new OutcomeJump(3));
dc.AddChoice(c);
c = new Choice();
c.AddOutcome(new OutcomeMood(0, -10));
c.SetText("I lied, it was me actually."); // Choices CAN have no outcome, dialogue continues from next line
dc.AddChoice(c);
c = new Choice();
c.AddOutcome(new OutcomeEnd());
c.SetText("*Run Away*");
dc.AddChoice(c);
topic.Add(dc);
topic.Add(new DialogueLine(1, "As expected, I'll be a master detective in no time."));
topic.Add(new DialogueLine(0, "A master without cookies that is."));
}
示例4: EditChoice
public static bool EditChoice(Dictionary<string, object> arguments)
{
Choice choice = new Choice();
try
{
choice.choice = arguments["choice"].ToString();
choice.Id = Convert.ToInt32(arguments["choice_id"]);
}
catch (Exception)
{
return false;
}
int surveyID = Convert.ToInt32(arguments["surveyID"]);
int pollID = Convert.ToInt32(arguments["poll_id"]);
(HttpContext.Current.Session["survey_" + surveyID] as Survey).Polls
.Find(delegate(Poll curPoll) { return curPoll.Id == pollID; }).Choices
.ForEach(delegate(Choice curChoice)
{
if (curChoice.Id == choice.Id)
{
curChoice.choice = choice.choice;
}
});
return true;
}
示例5: OptimizationSettings
public OptimizationSettings()
{
this.commands = new ArrayListDataSet(this);
//save command
Command saveCmd = new Command();
saveCmd.Description = "Save";
saveCmd.Invoked += new EventHandler(saveCmd_Invoked);
this.commands.Add(saveCmd);
//cancel command
Command cancelCmd = new Command();
cancelCmd.Description = "Cancel";
cancelCmd.Invoked += new EventHandler(cancelCmd_Invoked);
this.commands.Add(cancelCmd);
this.aMPM = new Choice(this);
List<string> ampmlist = new List<string>();
ampmlist.Add("AM");
ampmlist.Add("PM");
this.aMPM.Options = ampmlist;
this.enableOptimization = new BooleanChoice(this);
this.enableOptimization.Description = "Perform Optimization";
this.enableOptimization.Value = true;
this.optimizeNow = new Command();
this.optimizeNow.Description = "Optimize Now";
this.optimizationHour = new EditableText(this);
this.optimizationHour.Value = "4";
this.optimizationMinute = new EditableText(this);
this.optimizationMinute.Value = "00";
}
示例6: ReturnResult
public void ReturnResult(Choice c, Result expected)
{
Game newGame = new Game();
AlwaysPaperPlayer p1 = new AlwaysPaperPlayer("Paperboy");
Player p2;
switch (c)
{
case Choice.Paper:
p2 = new AlwaysPaperPlayer("Pboy2");
break;
case Choice.Rock:
p2 = new AlwaysRockPlayer("Rockboy");
break;
default:
p2 = new AlwaysScissorsPlayer("Edward");
break;
}
Result result = newGame.PlayRound(p1, p2);
Assert.AreEqual(expected, result);
}
示例7: DisplayChoiceData
public DisplayChoiceData(ChoiceData choiceData, Choice? usersChoice)
{
Choice = choiceData.Choice;
Text = choiceData.Text;
IsCorrect = choiceData.IsCorrect;
UsersChoice = usersChoice;
}
示例8: Setup
public Setup()
{
LoadPlugins();
AllTitlesProcessed = false;
CurrentTitle = null;
CurrentTitleIndex = 0;
current = this;
//_titleCollection.loadTitleCollection();
_ImporterSelection = new Choice();
List<string> _Importers = new List<string>();
foreach (OMLPlugin _plugin in availablePlugins) {
OMLApplication.DebugLine("[Setup] Adding " + _plugin.Name + " to the list of Importers");
_Importers.Add(_plugin.Description);
}
_ImporterSelection.Options = _Importers;
_ImporterSelection.ChosenChanged += delegate(object sender, EventArgs e)
{
OMLApplication.ExecuteSafe(delegate
{
Choice c = (Choice)sender;
ImporterDescription = @"Notice: " + GetPlugin().SetupDescription();
OMLApplication.DebugLine("Item Chosed: " + c.Options[c.ChosenIndex]);
});
};
}
示例9: ChoiceMadeEvent
public ChoiceMadeEvent(Guid gameId, int round, string playerId, Choice choice)
{
GameId = gameId;
Round = round;
PlayerId = playerId;
Choice = choice;
}
示例10: Choice_WhenCreated_OneChoiceInTheTable
public void Choice_WhenCreated_OneChoiceInTheTable()
{
var choice = new Choice() { Label = "label", Value = 10};
db.Choices.InsertOnSubmit(choice);
db.SubmitChanges();
Assert.AreEqual(1, db.Choices.Count());
}
示例11: Task
public static Task Task(this string task, Choice? correct = null)
{
var rawProblem = task.Split(new[] { " A. " }, StringSplitOptions.RemoveEmptyEntries).First();
var rawSolution = " A. " + task.Split(new[] { " A. " }, StringSplitOptions.RemoveEmptyEntries).Last();
var rawSolutionTexts = rawSolution
.Split(new[] { " A. ", " B. ", " C. ", " D. ", " E. " }, StringSplitOptions.RemoveEmptyEntries)
.Where(text => !String.IsNullOrWhiteSpace(text))
.ToArray();
var rawSolutionChoices = Regex.Matches(rawSolution, @"[A-E]{1}\.\ ");
var tmp = (from Match rawSolutionChoice in rawSolutionChoices select rawSolutionChoice.Value.ParseChoice()).ToList().Distinct().ToList();
var choiceDictionary = new Dictionary<Choice, string>();
for (var i = 0; i < rawSolutionTexts.Length; i++)
{
choiceDictionary.Add(tmp[i], rawSolutionTexts[i]);
}
return new Task
{
Category = Category.NotSet,
Number = task.TaskNumber(),
Problem = new Problem { Text = Regex.Replace(rawProblem, @"^[0-9]+\.\ +", "") },
Solution = new SelectableSolution
{
Choices = choiceDictionary,
Correct = new[] { correct ?? Choice.A }.ToList() }
};
}
示例12: AssignChoice
void AssignChoice(Choice choice)
{
if (choice.direction == Choice.Direction.Left) {
leftChoice = choice;
} else {
rightChoice = choice;
}
}
示例13: Copy
public void Copy(Choice original)
{
wording = original.wording;
lineReference = original.lineReference;
actions = original.actions;
reputations = original.reputations;
conversation = original.conversation;
}
示例14: Awake
void Awake(){
paragraph = Game_Controller.a.getParagraph();
PRG_Controller = gameObject.GetComponentInChildren<Question> ();
PRG_STSC = gameObject.GetComponentInChildren<Choice> ();
textCheck = (Typing_Input)FindObjectOfType (typeof(Typing_Input));
realStatus (Game_Controller.gameDiff);
textTyping = GetComponentsInChildren<TextMesh> ();
}
示例15: Awake
void Awake(){
setOfQuiz = Game_Controller.a.getQuestionAndAns();
QnTPn = gameObject.GetComponentInChildren<Question> ();
QnTPnC = gameObject.GetComponentInChildren<Choice> ();
textCheck = (Typing_Input)FindObjectOfType (typeof(Typing_Input));
realStatus (Game_Controller.gameDiff);
textTyping = GetComponentsInChildren<TextMesh> ();
}