private void DisplayContent(Webresource resource) { if (resource == null) { return; } var existingContent = dpMain.Contents.OfType <BaseContentForm>().FirstOrDefault(c => c.Resource == resource); if (existingContent != null) { existingContent.Show(dpMain, existingContent.DockState); return; } BaseContentForm content = null; switch (resource.Type) { case (int)WebresourceType.Gif: case (int)WebresourceType.Jpg: case (int)WebresourceType.Png: case (int)WebresourceType.Vector: { content = new ImageContentForm(this, resource); } break; case (int)WebresourceType.Resx: { content = new ResxContentForm(this, resource); } break; case (int)WebresourceType.Data: case (int)WebresourceType.Xsl: case (int)WebresourceType.Css: case (int)WebresourceType.Script: case (int)WebresourceType.WebPage: { content = new CodeEditorForm(this, resource); } break; case (int)WebresourceType.Ico: case (int)WebresourceType.Silverlight: { MessageBox.Show(this, @"No visualization available for this webresource type", @"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } break; } if (content != null) { content.TabPageContextMenuStrip = cmsTabs; content.Show(dpMain, DockState.Document); } }
public override void InitState() { SUI = new UI(); var code_bg = new ImageForm().Set(0, 0, AppInfo.W, AppInfo.H, "").SetImage(new Texture2D("data/ui/codebg1.jpg", LoadMethod.Single, false)); EditWin = (CodeEditorForm) new CodeEditorForm().Set(10, 50, AppInfo.W - 20, AppInfo.H - 60, "Fusion - Code Editor"); code_bg.Add(EditWin); SUI.Root.Add(code_bg); script.Scripts.ScanMods(); base.InitState(); }
private void DisplayContentForm(Webresource resource) { BaseContentForm content = null; switch (resource.Type) { case (int)WebresourceType.Gif: case (int)WebresourceType.Jpg: case (int)WebresourceType.Png: case (int)WebresourceType.Vector: { content = new ImageContentForm(this, resource); } break; case (int)WebresourceType.Resx: { content = new ResxContentForm(this, resource); } break; case (int)WebresourceType.Data: case (int)WebresourceType.Xsl: case (int)WebresourceType.Css: case (int)WebresourceType.Script: case (int)WebresourceType.WebPage: { content = new CodeEditorForm(this, resource); } break; case (int)WebresourceType.Ico: case (int)WebresourceType.Silverlight: { MessageBox.Show(this, @"No visualization available for this webresource type", @"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } break; } if (content != null) { content.Settings = settings; content.TabPageContextMenuStrip = cmsTabs; content.Show(dpMain, DockState.Document); } }
private void Ctvf_PortalItemSelected(object sender, PortalItemSelectedEventArgs e) { if (e.Item != null) { var content = dpMain.Contents.OfType <CodeEditorForm>().FirstOrDefault(c => c.Item == e.Item); if (content == null) { content = new CodeEditorForm(e.Item, mySettings, Service); content.UpdateRequested += Content_UpdateRequested; content.TabPageContextMenuStrip = cmsTab; content.Show(dpMain, DockState.Document); } else { content.Show(dpMain, content.DockState); } } }
public void CodeEditorActivated(CodeEditorForm codeEditor) { int index = ActiveCodeEditors.IndexOf(codeEditor); if (index >= 0) { ActiveCodeEditors.RemoveAt(index); ActiveCodeEditors.Insert(0, codeEditor); } }