public bool ShowViewer(IUserControl uc, ChitinKey ckey, ResourceClass.IResource irFile) { this.uc = uc; // -1 == bad load so close formresource // 0 == bad load but keep formresource open // 1 == good load if (uc.SetResourceParams(ckey, irFile) < 0) { return(false); } this.TabText = ResourceStruct.ResourceFileExt(ckey.resourceType) + ":" + ckey.name; this.Text = this.TabText; if ((!isCommon) || ((this.viewUControl == null) && (this.editUControl == null))) { ReloadViewer(uc); //ReloadEditor(uc); } this.Show(ApplicationRuntime.DockPanel); return(true); }
public bool ShowViewer(IUserControl uc, ChitinKey ckey, ResourceClass.IResource irFile, bool closeResourceOnError) { if (!this.ResourceForm.ShowViewer(uc, ckey, irFile)) { if (closeResourceOnError) { this.ResourceForm.Hide(); } return(false); } return(true); }
public void ReloadEditor(IUserControl uc) { if (this.editUControl == null) { this.editUControl = uc; this.tabEditor.Controls.Add(this.editUControl); } else { this.tabEditor.Controls.Remove(this.editUControl); this.editUControl = uc; this.tabEditor.Controls.Add(this.editUControl); } }
private void ReloadViewer(IUserControl uc) { if (this.viewUControl == null) { this.viewUControl = uc; this.tabViewer.Controls.Add(this.viewUControl); } else { this.tabViewer.Controls.Remove(this.viewUControl); this.viewUControl = uc; this.tabViewer.Controls.Add(this.viewUControl); } }