Example #1
0
 void Diagram_DragDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent("Syncfusion.Windows.Forms.Diagram.Samples.DiagramTool.SymbolPaletteInfo"))
     {
         object obj = e.Data.GetData("Syncfusion.Windows.Forms.Diagram.Samples.DiagramTool.SymbolPaletteInfo");
         if (obj != null)
         {
             SymbolPaletteInfo sInfo = obj as SymbolPaletteInfo;
             if (!CheckAssociatedSymbolPaletteInfo(sInfo))
             {
                 //prompt dialog to add the symbol palette to the associated list
                 DialogResult dr = MessageBoxAdv.Show("The SymbolPalette " + sInfo.SymbolPaletteName + " is not present in your Associated lists of Palette's. Click OK to add it", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                 if (dr == DialogResult.OK)
                 {
                     AssociatedSymbolPaletteInfo aInfo = GetAssociatedSymbolPaletteInfo();
                     if (aInfo == null)
                     {
                         aInfo             = new AssociatedSymbolPaletteInfo();
                         aInfo.EDDFileName = this.fileName;
                         symbolPaletteInfo.Add(aInfo);
                     }
                     aInfo.SymbolPaletteInfo.Add(sInfo);
                     this.MDIParentForm.UpdateAssociatedSymbolsList();
                 }
             }
         }
     }
 }
Example #2
0
        private AssociatedSymbolPaletteInfo GetAssociatedSymbolPaletteInfo()
        {
            AssociatedSymbolPaletteInfo aInfo = null;

            foreach (AssociatedSymbolPaletteInfo info in this.symbolPaletteInfo)
            {
                if (info.EDDFileName == this.FileName)
                {
                    aInfo = info;
                    break;
                }
            }
            return(aInfo);
        }