public void LoadSerializedDataBinding(string s)
        {
            s = s.Replace("\n", "\r\n");
            XmlSerializer ser = new XmlSerializer(typeof(ExecutionUnitDataBinding));
            MemoryStream  ms  = new MemoryStream();
            TextWriter    tw  = new StreamWriter(ms);

            tw.Write(s);
            tw.Flush();
            //tw.Close();
            ms.Position = 0;
            TextReader tr = new StreamReader(ms);
            ExecutionUnitDataBinding tmp = (ExecutionUnitDataBinding)ser.Deserialize(tr);

            this.DataBinding = tmp;
            ms.Close();
            ms.Dispose();
        }
 public FlowComponentXML(FlowComponent fc)
 {
     this.left = (fc as Control).Left;
     this.top  = (fc as Control).Top;
     this.data = (ExecutionUnitDataBinding)fc.GetDataBinding();
     if (fc is FlowStart)
     {
         this.type = 1;
     }
     if (fc is FlowStop)
     {
         this.type = 2;
     }
     if (fc is FlowProcessing)
     {
         this.type = 3;
     }
     if (fc is FlowDecision)
     {
         this.type = 4;
     }
     if (this.type == 4)
     {
         //avem doi copii
         if (fc.GetDefaultNextControl() != null)
         {
             next1 = new FlowComponentXML(fc.GetDefaultNextControl());
         }
         if ((fc as FlowDecision).GetNegationNextControl() != null)
         {
             next2 = new FlowComponentXML((fc as FlowDecision).GetNegationNextControl() as FlowComponent);
         }
     }
     else
     {
         //avem un singur copil
         if (fc.GetDefaultNextControl() != null)
         {
             next1 = new FlowComponentXML(fc.GetDefaultNextControl());
         }
     }
 }
 void DesignerItem_Loaded(object sender, RoutedEventArgs e)
 {
     if (base.Template != null)
     {
         //var tmp = (ControlTemplate)FindResource("DesignerItem");
         this.Caption    = (Label)Template.FindName("lblCaption", this);
         Caption.Content = "N/A";
         if (this.DataBinding != null)
         {
             this.DataBinding.SetMyLabel(this.Caption);
             this.DataBinding.Name = this.DataBinding.Caption;
             this.Caption.Content  = this.DataBinding.Name;
         }
         else
         {
             DataBinding = new ExecutionUnitDataBinding(Caption);
         }
         ContentPresenter contentPresenter =
             this.Template.FindName("PART_ContentPresenter", this) as ContentPresenter;
         if (contentPresenter != null)
         {
             UIElement contentVisual = VisualTreeHelper.GetChild(contentPresenter, 0) as UIElement;
             if (contentVisual != null)
             {
                 DragThumb thumb = this.Template.FindName("PART_DragThumb", this) as DragThumb;
                 if (thumb != null)
                 {
                     ControlTemplate template =
                         DesignerItem.GetDragThumbTemplate(contentVisual) as ControlTemplate;
                     if (template != null)
                     {
                         thumb.Template = template;
                     }
                 }
             }
         }
     }
 }
 public DecisionUnit(ExecutionUnitDataBinding db) : base(db)
 {
 }
 public ProcessingUnit(ExecutionUnitDataBinding db) : base(db)
 {
 }
 public ExecutionBlock(ExecutionUnitDataBinding db)
 {
     this.DataBinding = db;
 }