コード例 #1
0
 private void btnOpen_Click(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         string    strJSON = File.ReadAllText(openFileDialog1.FileName);
         PKBoxItem item    = PKStorage.Deserialize(strJSON);
         pkExtDesigner.SetAppPage(item as PKControl);
     }
 }
コード例 #2
0
 private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (this.ControlSelected != null && listView1.SelectedItems.Count > 0)
     {
         var selectedControl = listView1.SelectedItems[0].Tag as PKControl;
         var copyControl     = PKStorage.Deserialize(PKStorage.Serialize(selectedControl)) as PKControl;
         copyControl.IsComponent       = true;
         copyControl.ComponentFileName = selectedControl.ComponentFileName;
         this.ControlSelected(copyControl);
     }
 }
コード例 #3
0
 /// <summary>
 /// Ctrl - Y
 /// </summary>
 public void ReDo()
 {
     working = true;
     if (redoBuffers.Count > 0)
     {
         string str = redoBuffers.Pop();
         if (str != null)
         {
             currentPage.SetAppPage(PKStorage.Deserialize(str) as PKControl);
             undoBuffers.Push(str);
         }
     }
     working = false;
 }
コード例 #4
0
 private void PasteSelected()
 {
     try
     {
         string tempObject = Clipboard.GetText();
         if (tempObject != null)
         {
             PKBoxItem obj = PKStorage.Deserialize(tempObject, true);
             pkExtDesigner.AddItem(obj);
         }
     }
     catch
     {
     }
 }