当前位置: 首页>>代码示例>>C#>>正文


C# Choice类代码示例

本文整理汇总了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;
        }
开发者ID:peeboo,项目名称:open-media-library,代码行数:27,代码来源:BackgroundSettings.cs

示例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();
        }
开发者ID:peeboo,项目名称:open-media-library,代码行数:30,代码来源:ExtenderSettings.cs

示例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."));
    }
开发者ID:ChasmGamesProject,项目名称:UnityGameRepository,代码行数:32,代码来源:Temp.cs

示例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;
    }
开发者ID:itproto,项目名称:ilsrep,代码行数:29,代码来源:PollEditor.aspx.cs

示例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";
        }
开发者ID:peeboo,项目名称:open-media-library,代码行数:33,代码来源:OptimizationSettings.cs

示例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);
        }
开发者ID:thombeau,项目名称:RPSCode,代码行数:26,代码来源:RPSTests.cs

示例7: DisplayChoiceData

 public DisplayChoiceData(ChoiceData choiceData, Choice? usersChoice)
 {
     Choice = choiceData.Choice;
     Text = choiceData.Text;
     IsCorrect = choiceData.IsCorrect;
     UsersChoice = usersChoice;
 }
开发者ID:3-n,项目名称:saq,代码行数:7,代码来源:Questions.cs

示例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]);
                });
            };
        }
开发者ID:peeboo,项目名称:open-media-library,代码行数:26,代码来源:Setup.cs

示例9: ChoiceMadeEvent

 public ChoiceMadeEvent(Guid gameId, int round, string playerId, Choice choice)
 {
     GameId = gameId;
     Round = round;
     PlayerId = playerId;
     Choice = choice;
 }
开发者ID:perokvist,项目名称:rock-paper-scissors-ES,代码行数:7,代码来源:ChoiceMadeEvent.cs

示例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());
 }
开发者ID:pragmaticpat,项目名称:EdwardsFoundation,代码行数:7,代码来源:ChoiceTests.cs

示例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() }
            };
        }
开发者ID:3-n,项目名称:saq,代码行数:31,代码来源:DocumentParsingExtensions.cs

示例12: AssignChoice

 void AssignChoice(Choice choice)
 {
     if (choice.direction == Choice.Direction.Left) {
       leftChoice = choice;
     } else {
       rightChoice = choice;
     }
 }
开发者ID:britg,项目名称:ptq,代码行数:8,代码来源:EventChoiceView.cs

示例13: Copy

 public void Copy(Choice original)
 {
     wording = original.wording;
     lineReference = original.lineReference;
     actions = original.actions;
     reputations  = original.reputations;
     conversation  = original.conversation;
 }
开发者ID:Jonanory,项目名称:Reputations,代码行数:8,代码来源:Choice.cs

示例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> ();
	}
开发者ID:godfavornoone,项目名称:TWTW-Lasttry,代码行数:8,代码来源:Paragraph.cs

示例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> ();
	}
开发者ID:godfavornoone,项目名称:TWTW-Lasttry,代码行数:8,代码来源:QnT.cs


注:本文中的Choice类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。