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); } }
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); } }