public Browser(EditorMainForm editorForm, DirectoryInfo startDir) { Initialize(); //this.toolStripComboBox1.SelectedIndex = 1; this.editorForm = editorForm; this.startDir = startDir; this.treeBrowser = new TreeBrowser(); TreeNode startNode = new TreeNode(startDir.Name); startNode.Tag = startDir; startNode.Expand(); this.treeView1.Nodes.Add(startNode); makeTreeNodes(this.treeView1.Nodes); this.treeView1.AfterSelect += new TreeViewEventHandler(treeView1_AfterSelect); this.graphics = this.panel1.CreateGraphics(); }
public WorkSpace(EditorMainForm mainForm) { Initialize(); this.mainForm = mainForm; if (File.Exists("dotNetStiEditor.exe.config")) { this.tempFolder = System.Configuration.ConfigurationManager.AppSettings.Get("EditorTempDir"); } if (this.tempFolder == null) { this.tempFolder = Path.Combine(Application.StartupPath, String.Format("C:\\WINDOWS\\Temp\\dotNetStiEditorTemp{0:yyyyMMddHHmm}-{1}", DateTime.Now, Guid.NewGuid().ToString().Replace("-", ""))); } for (int i = 0; i < 500; i++) { DataGridViewImageColumn column = new DataGridViewImageColumn(); column.HeaderText = i.ToString(); column.Width = 20; this.workDataGridView.Columns.Add(column); } for (var i = 0; i < this.workSpace.Length; i++) { this.workSpace[i] = new List <ExtendedBitmap>(); } this.workDataGridView.Rows.Add(); this.workDataGridView.Rows.Add(); this.workDataGridView.Rows.Add(); this.workDataGridView.Rows.Add(); this.workDataGridView.Rows.Add(); this.workDataGridView.Rows.Add(); string paletteFile = Path.Combine(Application.StartupPath, "palettes.xml"); Stream palStream; XmlSerializer serializer = new XmlSerializer(typeof(PaletteRecord[])); List <PaletteRecord> records = new List <PaletteRecord>(); if (File.Exists(paletteFile)) { palStream = new FileStream(paletteFile, FileMode.Open, FileAccess.Read); } else { palStream = new MemoryStream(Properties.Resources.palettes); } //MessageBox.Show( String.Format( // "{0} palettes.xml.",Resources.GetString("NoFile")), // Resources.GetString("Attention"), MessageBoxButtons.OK, MessageBoxIcon.Warning); using (palStream) { PaletteRecord[] palRecords = (PaletteRecord[])serializer.Deserialize(palStream); records = new List <PaletteRecord>(palRecords); } foreach (PaletteRecord record in records) { addPaletteRecord(record); } }