• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Choice类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Choice的典型用法代码示例。如果您正苦于以下问题:C# Choice类的具体用法?C# Choice怎么用?C# Choice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Choice类属于命名空间,在下文中一共展示了Choice类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: SwipeRight

    public static Choice SwipeRight(string key, string label)
    {
        var c = new Choice();
        c.key = key;
        c.label = label;
        c.direction = Direction.Right;

        return c;
    }
开发者ID:britg,项目名称:ptq,代码行数:9,代码来源:Choice.cs


示例17: GetWinner

        public static Choice GetWinner(Choice probablePlayerChoice)
        {
            if (probablePlayerChoice == Choice.scissors)
              {
            return Choice.rock;
              }

              return probablePlayerChoice + 1;
        }
开发者ID:jtmach,项目名称:ProblemOtd,代码行数:9,代码来源:Program.cs


示例18: Submit

	public void Submit(string choice)
	{
		if (choices.ContainsKey(choice))
		{
			ChoiceMade = choices[choice];
			GameToolBox.Instance.uiGameObject.multipleChoiceTrigger.GetComponent<MultipleChoicesUI>().Enable(false);
			ExecutePostTriggerObject();
		}
	}
开发者ID:jodoudou,项目名称:BROU_SVPRA,代码行数:9,代码来源:MultipleChoiceTrigger.cs


示例19: Question_CanHaveOneChoice

 public void Question_CanHaveOneChoice()
 {
     var question = new Question() { QuestionText = "Question Text", QuestionCategory = "Category" };
     var choice = new Choice() { Label = "label", Value = -1 };
     var questionchoice = new QuestionChoice() { Question = question, Choice = choice, SortOrder = 1 };
     db.Questions.InsertOnSubmit(question);
     db.Choices.InsertOnSubmit(choice);
     db.QuestionChoices.InsertOnSubmit(questionchoice);
     Assert.AreEqual(1, question.QuestionChoices.Count);
 }
开发者ID:pragmaticpat,项目名称:EdwardsFoundation,代码行数:10,代码来源:QuestionChoicesTests.cs


示例20: AboutSettings

        public AboutSettings()
        {
            System.Resources.ResourceManager RM = new System.Resources.ResourceManager("Library.Resources",System.Reflection.Assembly.GetExecutingAssembly());
            string creditsString = (string)RM.GetObject("Credits");
            byte[] byteArray = Encoding.ASCII.GetBytes(creditsString);
            MemoryStream stream = new MemoryStream(byteArray);
            //XmlTextReader reader = new XmlTextReader(stream);
            XmlDocument xDoc = new XmlDocument();
            xDoc.Load(stream);
            XPathNavigator nav = xDoc.CreateNavigator();
            XPathNodeIterator it = nav.Select("Credits/Developers/Person");

            this.CreditsText = "DEVELOPMENT TEAM:";
            while (it.MoveNext())
            {
                this.CreditsText += "\n" + it.Current.Value;
            }
            this.CreditsText += "\n\n";
            it = nav.Select("Credits/Contributors/Person");

            this.CreditsText += "COMPANIES AND INDIVIDUALS:";
            while (it.MoveNext())
            {
                this.CreditsText += "\n" + it.Current.Value;
            }
            this.CreditsText += "\n\n";
            it = nav.Select("Credits/Special/Person");

            this.CreditsText += "SPECIAL THANKS:";
            while (it.MoveNext())
            {
                this.CreditsText += "\n" + it.Current.Value;
            }

            string version=Assembly.GetExecutingAssembly().GetName().Version.ToString();

            this.AboutText = "Open Media Library (replace with image)\n\nVersion: " + version + " (Revision: " + OMLApplication.Current.RevisionNumber+")";
            this.AboutText += "\nCopyright © 2008, GNU General Public License v3";

            this.radioCommands = new Choice(this);
            ArrayListDataSet radioSet = new ArrayListDataSet();

            Command aboutCmd=new Command(this);
            aboutCmd.Description="About";
            radioSet.Add(aboutCmd);

            Command creditsCmd = new Command(this);
            creditsCmd.Description = "Credits";
            radioSet.Add(creditsCmd);

            //this.CreditsText = "this is a credit";

            this.radioCommands.Options = radioSet;
            this.radioCommands.ChosenChanged += new EventHandler(radioCommands_ChosenChanged);
        }
开发者ID:peeboo,项目名称:open-media-library,代码行数:55,代码来源:AboutSettings.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Choices类代码示例发布时间:2022-05-24
下一篇:
C# ChocolateyConfiguration类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap