コード例 #1
0
        private void ListviewMarkdownHtml_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            RenderingSettingsItemContent.Children.Clear();

            var item = (RenderModel)((ListView)sender).SelectedItem;

            switch (item)
            {
            case CoreRenderModel coreRenderModel:
                var coreControl = new CoreControl();
                coreControl.Init(coreRenderModel);
                RenderingSettingsItemContent.Children.Add(coreControl);
                break;

            case EmphasisExtraRenderModel emphasisExtraModel:
                var emphasisExtraControl = new EmphasisExtraControl();
                emphasisExtraControl.Init(emphasisExtraModel);
                RenderingSettingsItemContent.Children.Add(emphasisExtraControl);
                break;

            case TableRenderModel tableModel:
                var tableControl = new TableControl();
                tableControl.Init(tableModel);
                RenderingSettingsItemContent.Children.Add(tableControl);
                break;

            case ListRenderModel listModel:
                var listControl = new ListControl();
                listControl.Init(listModel);
                RenderingSettingsItemContent.Children.Add(listControl);
                break;

            case MathRenderModel mathModel:
                var mathControl = new MathControl();
                mathControl.Init(mathModel);
                RenderingSettingsItemContent.Children.Add(mathControl);
                break;

            case SyntaxHighlightingRenderModel syntaxHighlightingModel:
                var syntaxHighlightingControl = new SyntaxHighlightingControl();
                syntaxHighlightingControl.Init(syntaxHighlightingModel);
                RenderingSettingsItemContent.Children.Add(syntaxHighlightingControl);
                break;

            case DiagramRenderModel diagramModel:
                var diagramControl = new DiagramControl();
                diagramControl.Init(diagramModel);
                RenderingSettingsItemContent.Children.Add(diagramControl);
                break;

            default:
                // TODO Error UI model does not exist
                // TODO Analytics
                break;
            }
        }
コード例 #2
0
        public ActionResult Index()
        {
            string model       = Server.MapPath("~/Arquivo/Template.docx");                                    //Utilizamos o modelo para prencher os valores --Aqui passar o tipo dependendo da pratica do parceiro
            string newDocument = Server.MapPath(string.Format("~/Arquivo/Bonus-{0}.docx", "NomeFuncionario")); //Cria a cópia no local Indicado

            if (System.IO.File.Exists(model))
            {
                CoreControl.ProcessDocuments(model, newDocument);
            }
            return(View());
        }
コード例 #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            pc = new PortControl(0);
            pc.AnalogPortConfigurationIn();
            pc.AnalogPortConfigurationOut();
            pc.DigitalConfigurationOut();
            pc.ClearALLDigitalPort();
            positionForEverySequence    = new List <List <float> >();
            torqueForEverySequence      = new List <List <float> >();
            RightOrLeftForEverySequence = new List <List <int> >();
            cc = new CoreControl();
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
            SetStyle(ControlStyles.DoubleBuffer, true);         // 双缓冲
            StreamReader sR     = File.OpenText(Application.StartupPath + "\\set-1.txt");
            int          length = int.Parse(sR.ReadLine());

            for (int i = 0; i != length; i++)
            {
                string temp = sR.ReadLine();
                if (temp == "Train")
                {
                    trainOrTest_1.Add(true);
                    experimentTime_1.Add(int.Parse(sR.ReadLine()));
                    lbExpSequence_1.Items.Add(trainOrTest_1.Count.ToString("00") + "   " + "Train  " + experimentTime_1[i] + "s");
                }
                else
                {
                    trainOrTest_1.Add(false);
                    experimentTime_1.Add(int.Parse(sR.ReadLine()));
                    lbExpSequence_1.Items.Add(trainOrTest_1.Count.ToString("00") + "   " + "Test   " + experimentTime_1[i] + "s");
                }
            }
            sR.Close();


            StreamReader sR2     = File.OpenText(Application.StartupPath + "\\set-2.txt");
            int          length2 = int.Parse(sR2.ReadLine());

            for (int i = 0; i != length2; i++)
            {
                string temp = sR2.ReadLine();
                if (temp == "Train")
                {
                    trainOrTest_2.Add(true);
                    experimentTime_2.Add(int.Parse(sR2.ReadLine()));
                    lbExpSequence_2.Items.Add(trainOrTest_2.Count.ToString("00") + "   " + "Train  " + experimentTime_2[i] + "s");
                }
                else
                {
                    trainOrTest_2.Add(false);
                    experimentTime_2.Add(int.Parse(sR2.ReadLine()));
                    lbExpSequence_2.Items.Add(trainOrTest_2.Count.ToString("00") + "   " + "Test   " + experimentTime_2[i] + "s");
                }
            }
            sR2.Close();

            StreamReader sR3     = File.OpenText(Application.StartupPath + "\\set-2.txt");
            int          length3 = int.Parse(sR3.ReadLine());

            for (int i = 0; i != length3; i++)
            {
                string temp = sR3.ReadLine();
                if (temp == "Train")
                {
                    trainOrTest_3.Add(true);
                    experimentTime_3.Add(int.Parse(sR3.ReadLine()));
                    lbExpSequence_3.Items.Add(trainOrTest_3.Count.ToString("00") + "   " + "Train  " + experimentTime_3[i] + "s");
                }
                else
                {
                    trainOrTest_3.Add(false);
                    experimentTime_3.Add(int.Parse(sR3.ReadLine()));
                    lbExpSequence_3.Items.Add(trainOrTest_3.Count.ToString("00") + "   " + "Test   " + experimentTime_3[i] + "s");
                }
            }
            sR3.Close();



            v = new visionStimulation();
            v.Show();

            timer1.Interval = 10;
            timer2.Interval = 100;
        }