public static void InsertConnector(List <HierarchicalDetail> data)
 {
     foreach (HierarchicalDetail hdata in data)
     {
         DiagramContext.HierarchicalDetails.InsertOnSubmit(hdata);
         DiagramContext.SubmitChanges();
     }
 }
 public static void InsertShape(List <HierarchicalData> data)
 {
     foreach (HierarchicalData hdata in data)
     {
         DiagramContext.HierarchicalDatas.InsertOnSubmit(hdata);
         DiagramContext.SubmitChanges();
     }
 }
 public static void DeleteConnector(List <HierarchicalDetail> data)
 {
     foreach (HierarchicalDetail hdata in data)
     {
         HierarchicalDetail originalData = DiagramContext.HierarchicalDetails.Single(h => h.Name == hdata.Name);
         DiagramContext.HierarchicalDetails.DeleteOnSubmit(originalData);
         DiagramContext.SubmitChanges();
     }
 }
 public static void DeleteShape(List <HierarchicalData> data)
 {
     foreach (HierarchicalData hdata in data)
     {
         HierarchicalData originalData = DiagramContext.HierarchicalDatas.Single(h => h.Name == hdata.Name);
         DiagramContext.HierarchicalDatas.DeleteOnSubmit(originalData);
         DiagramContext.SubmitChanges();
     }
 }
 public static void UpdateConnector(List <HierarchicalDetail> data)
 {
     foreach (HierarchicalDetail hdata in data)
     {
         HierarchicalDetail originalData = DiagramContext.HierarchicalDetails.Single(h => h.Name == hdata.Name);
         originalData.SourceNode = hdata.SourceNode;
         originalData.TargetNode = hdata.TargetNode;
         DiagramContext.SubmitChanges();
     }
 }
 public static void UpdateShape(List <HierarchicalData> data)
 {
     foreach (HierarchicalData hdata in data)
     {
         HierarchicalData originalData = DiagramContext.HierarchicalDatas.Single(h => h.Name == hdata.Name);
         originalData.Description = hdata.Description;
         originalData.Color       = hdata.Color;
         DiagramContext.SubmitChanges();
     }
 }