Esempio n. 1
0
 public ToastSettings()
 {
     GetInfoView    = (m, t) => InfoTemplate?.GetToastView(m, t);
     GetWarningView = (m, t) => WarningTemplate?.GetToastView(m, t);
     GetSuccessView = (m, t) => SuccessTemplate?.GetToastView(m, t);
     GetErrorView   = (m, t) => ErrorTemplate?.GetToastView(m, t);
 }
Esempio n. 2
0
 /// <summary>
 /// Инстанциация контролов
 /// </summary>
 private void InstantiateControls()
 {
     if (FilterLeftColumnTemplateControls != null)
     {
         FilterLeftColumnTemplateControls.InstantiateIn(LeftColumn);
     }
     if (FilterRightColumnTemplateControls != null)
     {
         FilterRightColumnTemplateControls.InstantiateIn(RightColumn);
     }
     if (ButtonsTemplate != null)
     {
         ButtonControls.Controls.Clear();
         ButtonsTemplate.InstantiateIn(ButtonControls);
     }
     if (TopInfoTemplate != null)
     {
         TopInfoControls.Controls.Clear();
         TopInfoTemplate.InstantiateIn(TopInfoControls);
     }
     TopInfoDiv.Visible = TopInfoControls.HasControls();
     if (InfoTemplate != null)
     {
         InfoControls.Controls.Clear();
         InfoTemplate.InstantiateIn(InfoControls);
     }
     if (InfoRightTemplate != null)
     {
         InfoRightControls.Controls.Clear();
         InfoRightTemplate.InstantiateIn(InfoRightControls);
     }
 }
        public void RunStarted(object automationObject,
                               Dictionary <string, string> replacementsDictionary,
                               WizardRunKind runKind, object[] customParams)
        {
            try {
                WizardForm form = new WizardForm();
                DTE        dte  = automationObject as DTE;

                var solItems = dte.Solution.Projects.Cast <Project>().FirstOrDefault(p => p.Name == "Solution Items" || p.Kind == EnvDTE.Constants.vsProjectItemKindSolutionItems);
                if (solItems != null)
                {
                    form.HideSolutionOptions();
                }

                form.ShowDialog();

                if (form.Cancelled)
                {
                    throw new WizardBackoutException();
                }

                templateParameters = new Dictionary <string, object> {
                    { "UseModMenu", form.UseModMenu.IsChecked ?? false },
                    { "ModSettings", form.ModSettings.IsChecked ?? false },
                    { "AddModComponent", (form.UseModMenu.IsChecked ?? false) && (form.AddModComponent.IsChecked ?? false) },
                    { "UMMSettingsGUI", (form.ModSettings.IsChecked ?? false) && (form.UMMSettingsGUI.IsChecked ?? false) },
                    { "ModMenuExampleCode", (form.UseModMenu.IsChecked ?? false) && (form.ModMenuSampleCode.IsChecked ?? false) },
                    { "ModNamespace", replacementsDictionary["$safeprojectname$"] },
                    { "AuthorID", form.AuthorID.Text },
                    { "AuthorName", form.AuthorName.Text },
                    { "DisplayName", form.DisplayName.Text },
                    { "ModHomepage", form.ModHomepage.Text },
                    { "ModRepo", form.ModRepo.Text },
                    { "GameDirectory", form.GameDirectory.Text.Replace(@"\", @"\\") },
                    { "SteamExecutable", form.SteamExecutable.Text.Replace(@"\", @"\\") }
                };

                outputModComponent  = (form.UseModMenu.IsChecked ?? false) && (form.AddModComponent.IsChecked ?? false);
                outputPatchExamples = form.PatchSampleCode.IsChecked ?? false;
                outputRepoFile      = form.AddRepoFile.IsChecked ?? false;

                replacementsDictionary.Add("$outputModComponent$", outputModComponent.ToString());
                replacementsDictionary.Add("$outputPatchExamples$", outputPatchExamples.ToString());
                replacementsDictionary.Add("$useModMenu$", (form.UseModMenu.IsChecked ?? false).ToString());

                MainTemplate mainTemplate = new MainTemplate {
                    Session = templateParameters
                };
                mainTemplate.Initialize();
                string mainContent = mainTemplate.TransformText();
                replacementsDictionary.Add("$maincontent$", mainContent);

                ModComponentTemplate modComponentTemplate = new ModComponentTemplate {
                    Session = templateParameters
                };
                modComponentTemplate.Initialize();
                string modComponentContent = modComponentTemplate.TransformText();
                replacementsDictionary.Add("$modcomponentcontent$", modComponentContent);

                InfoTemplate infoTemplate = new InfoTemplate {
                    Session = templateParameters
                };
                infoTemplate.Initialize();
                string infoContent = infoTemplate.TransformText();
                replacementsDictionary.Add("$infocontent$", infoContent);

                PatchExamplesTemplate patchExamplesTemplate = new PatchExamplesTemplate {
                    Session = templateParameters
                };
                patchExamplesTemplate.Initialize();
                string patchExamplesContent = patchExamplesTemplate.TransformText();
                replacementsDictionary.Add("$patchexamplescontent$", patchExamplesContent);
            }
            catch (Exception ex) {
                String destinationDirectory = replacementsDictionary["$destinationdirectory$"];
                if (Directory.Exists(destinationDirectory))
                {
                    Directory.Delete(destinationDirectory, true);

                    try {
                        Directory.GetParent(destinationDirectory).Delete();
                    } catch {}
                }

                Console.WriteLine(ex);

                throw ex;
            }
        }
Esempio n. 4
0
        private void getWidgetsAsync_runCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            int indexWidget = 0;

            foreach (var item in ReadyWidgets)
            {
                if (item.WidgetType == "Informatie")
                {
                    var newPanel = new InfoTemplate
                    {
                        Name             = "Panel" + indexWidget,
                        Tag              = indexWidget.ToString(),
                        TitleWidgetLabel = { Text = item.WidgetName },
                        CommandName      = { Text = item.WidgetCommand }
                    };
                    newPanel.CloseWidgetPicturebox.Click += new EventHandler(RemoveWidget);
                    newPanel.MaxWidgetPicturebox.Click   += new EventHandler(MaximizeWidget);

                    if (item.WidgetUseSelection == true)
                    {
                        string finalString = Responses.GetStringFromResponse(item.WidgetOutput, item.WidgetEnterCountBeforeString, item.WidgetEnterCountInString);
                        newPanel.Outputbox.Text = finalString;
                    }
                    else
                    {
                        newPanel.Outputbox.Text = item.WidgetOutput;
                    }
                    MainTableLayoutPanel.Controls.Add(newPanel);
                }

                else //execute widget
                {
                    var newPanel = new ExecuteTemplate
                    {
                        Name             = "Panel" + indexWidget,
                        Tag              = indexWidget.ToString(),
                        TitleWidgetLabel = { Text = item.WidgetName },
                        CommandName      = { Text = item.WidgetCommand }
                    };
                    newPanel.CloseWidgetPicturebox.Click += new EventHandler(RemoveWidget);
                    newPanel.RunButton.Click             += new EventHandler(RunCommand);
                    newPanel.MaxWidgetPicturebox.Click   += new EventHandler(MaximizeWidget);
                    newPanel.RunButton.Text = "Uitvoeren";
                    MainTableLayoutPanel.Controls.Add(newPanel);
                }
                indexWidget++;
            }
            if ((bool)e.Result == true)
            {
                PictureBox addButton = new PictureBox
                {
                    Size      = new Size(100, 100),
                    BackColor = Color.Transparent,
                    Image     = Properties.Resources.add_1,
                    SizeMode  = PictureBoxSizeMode.Zoom,
                    Anchor    = AnchorStyles.None
                };
                addButton.Click += new EventHandler(AddButtonClick);
                MainTableLayoutPanel.Controls.Add(addButton);
                MainTableLayoutPanel.Enabled = true;
            }
        }
Esempio n. 5
0
        private void getWidgetPageInfo_runCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            List <Widget> widgets     = Json.ReadJson();
            int           indexWidget = 0;

            if (_listOfWidgetItems[0].WidgetOutput == null && _listOfWidgetItems[1].WidgetOutput == null)// check if command received timeout
            {
                MessageBox.Show("Er vond een timeout plaats - controleer de gegevens en probeer het opnieuw");
                Log.Info("A timeout has occured while trying to get widgets - check router details");
            }
            else
            {
                foreach (var item in _listOfWidgetItems)
                {
                    if (item.WidgetTag == "PID")
                    {
                        string totalOutput = item.WidgetOutput;
                        string pid         = TelnetConnection.FindPid(totalOutput);
                        routerType.Text = pid;
                    }
                    else if (item.WidgetTag == "showRun")
                    {
                        runningConfigOutputField.Text = item.WidgetOutput;
                    }
                    else
                    {
                        int index = Int32.Parse(item.WidgetTag);
                        if (widgets[index].WidgetType == "Informatie")
                        {
                            var newPanel = new InfoTemplate
                            {
                                Name             = "Panel" + indexWidget.ToString(),
                                Tag              = indexWidget.ToString(),
                                TitleWidgetLabel = { Text = widgets[indexWidget].WidgetName },
                                CommandName      = { Text = widgets[indexWidget].WidgetCommand }
                            };
                            newPanel.CloseWidgetPicturebox.Click += new EventHandler(RemoveWidget);
                            newPanel.MaxWidgetPicturebox.Click   += new EventHandler(MaximizeWidget);

                            if (widgets[indexWidget].WidgetUseSelection == true)
                            {
                                string finalString = Responses.GetStringFromResponse(item.WidgetOutput, widgets[indexWidget].WidgetEnterCountBeforeString, widgets[indexWidget].WidgetEnterCountInString);
                                newPanel.Outputbox.Text = finalString;
                            }
                            else
                            {
                                newPanel.Outputbox.Text = item.WidgetOutput;
                            }


                            MainTableLayoutPanel.Controls.Add(newPanel);
                        }

                        else //execute widget
                        {
                            var newPanel = new ExecuteTemplate
                            {
                                Name             = "Panel" + indexWidget.ToString(),
                                Tag              = indexWidget.ToString(),
                                TitleWidgetLabel = { Text = widgets[indexWidget].WidgetName },
                                CommandName      = { Text = widgets[indexWidget].WidgetCommand }
                            };
                            newPanel.CloseWidgetPicturebox.Click += new EventHandler(RemoveWidget);
                            newPanel.RunButton.Click             += new EventHandler(RunCommand);
                            newPanel.MaxWidgetPicturebox.Click   += new EventHandler(MaximizeWidget);
                            newPanel.RunButton.Text = "Uitvoeren";
                            MainTableLayoutPanel.Controls.Add(newPanel);
                        }
                        indexWidget++;
                    }
                }
                PictureBox addButton = new PictureBox
                {
                    Size      = new Size(100, 100),
                    BackColor = Color.Transparent,
                    Image     = Properties.Resources.add_1,
                    SizeMode  = PictureBoxSizeMode.Zoom,
                    Anchor    = AnchorStyles.None
                };
                addButton.Click += new EventHandler(AddButtonClick);
                MainTableLayoutPanel.Controls.Add(addButton);
                MainTableLayoutPanel.Enabled = true;
            }
        }
Esempio n. 6
0
        static RJInfo()
        {
            localTemplates[0] = new InfoTemplate("RJ Outline(ja_JP)");
            localTemplates[0].TemplateList.Add("名前", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].TemplateList.Add("サークル名", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].TemplateList.Add("画像", BaseInfoType.InfoType.InfoGroup);
            localTemplates[0].TemplateList.Add("販売日", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].TemplateList.Add("年齢指定", BaseInfoType.InfoType.RichText);
            localTemplates[0].TemplateList.Add("作品形式", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].TemplateList.Add("ファイル形式", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].TemplateList.Add("ジャンル", BaseInfoType.InfoType.Tag);
            localTemplates[0].TemplateList.Add("ファイル容量", BaseInfoType.InfoType.LiteralText);

            localTemplates[0].OptionalList.Add("シリーズ名", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].OptionalList.Add("最終更新日", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].OptionalList.Add("作者", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].OptionalList.Add("シナリオ", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].OptionalList.Add("イラスト", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].OptionalList.Add("声優", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].OptionalList.Add("対応言語", BaseInfoType.InfoType.LiteralText);
            localTemplates[0].OptionalList.Add("作品内容", BaseInfoType.InfoType.LiteralText);  //显示时转成html,结合CSS常量
            localTemplates[0].OptionalList.Add("評価", BaseInfoType.InfoType.LiteralText);


            localTemplates[1] = new InfoTemplate("RJ Outline(en_US)");
            localTemplates[1].TemplateList.Add("WorkName", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].TemplateList.Add("Circle", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].TemplateList.Add("Image", BaseInfoType.InfoType.InfoGroup);
            localTemplates[1].TemplateList.Add("Release date", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].TemplateList.Add("Age", BaseInfoType.InfoType.RichText);
            localTemplates[1].TemplateList.Add("Product format", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].TemplateList.Add("File format", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].TemplateList.Add("Genre", BaseInfoType.InfoType.Tag);
            localTemplates[1].TemplateList.Add("File size", BaseInfoType.InfoType.LiteralText);

            localTemplates[1].OptionalList.Add("Series name", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].OptionalList.Add("Last updated", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].OptionalList.Add("Author", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].OptionalList.Add("Scenario", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].OptionalList.Add("Illustration", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].OptionalList.Add("Voice Actor", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].OptionalList.Add("Supported languages", BaseInfoType.InfoType.LiteralText);
            localTemplates[1].OptionalList.Add("Product summary", BaseInfoType.InfoType.LiteralText);  //显示时转成html,结合CSS常量
            localTemplates[1].OptionalList.Add("Rating", BaseInfoType.InfoType.LiteralText);


            localTemplates[2] = new InfoTemplate("RJ Outline(zh_CN)");
            localTemplates[2].TemplateList.Add("作品名", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].TemplateList.Add("社团名", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].TemplateList.Add("封面图", BaseInfoType.InfoType.InfoGroup);
            localTemplates[2].TemplateList.Add("贩卖日", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].TemplateList.Add("年龄指定", BaseInfoType.InfoType.RichText);
            localTemplates[2].TemplateList.Add("作品类型", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].TemplateList.Add("文件形式", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].TemplateList.Add("分类", BaseInfoType.InfoType.Tag);
            localTemplates[2].TemplateList.Add("文件容量", BaseInfoType.InfoType.LiteralText);

            localTemplates[2].OptionalList.Add("系列名", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].OptionalList.Add("最终更新日", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].OptionalList.Add("作者", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].OptionalList.Add("剧情", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].OptionalList.Add("插画", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].OptionalList.Add("声优", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].OptionalList.Add("对应语言", BaseInfoType.InfoType.LiteralText);
            localTemplates[2].OptionalList.Add("作品内容", BaseInfoType.InfoType.LiteralText);  //显示时转成html,结合CSS常量
            localTemplates[2].OptionalList.Add("评价", BaseInfoType.InfoType.LiteralText);


            localTemplates[3] = new InfoTemplate("RJ Outline(zh_TW)");
            localTemplates[3].TemplateList.Add("作品名", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].TemplateList.Add("社團名", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].TemplateList.Add("封面圖", BaseInfoType.InfoType.InfoGroup);
            localTemplates[3].TemplateList.Add("販賣日", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].TemplateList.Add("年齡指定", BaseInfoType.InfoType.RichText);
            localTemplates[3].TemplateList.Add("作品形式", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].TemplateList.Add("檔案形式", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].TemplateList.Add("分類", BaseInfoType.InfoType.Tag);
            localTemplates[3].TemplateList.Add("檔案容量", BaseInfoType.InfoType.LiteralText);

            localTemplates[3].OptionalList.Add("系列名", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].OptionalList.Add("最終更新日", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].OptionalList.Add("作者", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].OptionalList.Add("劇本", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].OptionalList.Add("插畫", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].OptionalList.Add("聲優", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].OptionalList.Add("對應語言", BaseInfoType.InfoType.LiteralText);
            localTemplates[3].OptionalList.Add("作品內容", BaseInfoType.InfoType.LiteralText);  //显示时转成html,结合CSS常量
            localTemplates[3].OptionalList.Add("評價", BaseInfoType.InfoType.LiteralText);


            localTemplates[4] = new InfoTemplate("RJ Outline(ko_KR)");
            localTemplates[4].TemplateList.Add("이름", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].TemplateList.Add("서클명", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].TemplateList.Add("영상", BaseInfoType.InfoType.InfoGroup);
            localTemplates[4].TemplateList.Add("판매일", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].TemplateList.Add("연령 지정", BaseInfoType.InfoType.RichText);
            localTemplates[4].TemplateList.Add("작품 형식", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].TemplateList.Add("파일 형식", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].TemplateList.Add("장르", BaseInfoType.InfoType.Tag);
            localTemplates[4].TemplateList.Add("파일 용량", BaseInfoType.InfoType.LiteralText);

            localTemplates[4].OptionalList.Add("시리즈명", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].OptionalList.Add("최종 갱신일", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].OptionalList.Add("저자", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].OptionalList.Add("시나리오", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].OptionalList.Add("일러스트", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].OptionalList.Add("성우", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].OptionalList.Add("대응 언어", BaseInfoType.InfoType.LiteralText);
            localTemplates[4].OptionalList.Add("작품 내용", BaseInfoType.InfoType.LiteralText);  //显示时转成html,结合CSS常量
            localTemplates[4].OptionalList.Add("평가", BaseInfoType.InfoType.LiteralText);
        }
Esempio n. 7
0
        ////////////////////////////////////////////////////////////////////////////

        private static LayoutTemplate CreateLayoutTemplate(Container container, string name, string description = "", string author = "")
        {
            LayoutTemplate lt = new LayoutTemplate();

            InfoTemplate it = new InfoTemplate();

            it.Name = name;
            it.Author = author;
            it.Description = description;
            it.Version = "0.7";

            lt.Info = it;

            lt.Controls = new List<ControlTemplate> { ControlTemplate.FromControl(container) };

            return lt;
        }