Пример #1
0
 public override Object Clone()
 {
     var result = new FlashProperty();
     result.InitProperty();
     Copy(result);
     return result;
 }
Пример #2
0
 public static List<PageControl> RecursiveCreatePageControl(XmlElement root)
 {
     var result = new List<PageControl>();
     var nodeList = root.SelectNodes("Children/Child");
     if (nodeList.Count <= 0)
     {
         nodeList = root.SelectNodes("Child");
     }
     foreach (XmlNode node in nodeList)
     {
         var element = node as XmlElement;
         var control = new PageControl();
         control.Id = XmlUtility.GetAttrValue(element, "Id");
         control.Type = XmlUtility.GetAttrValue(element, "Type");
         var dynamicProperty = new DynamicProperty();
         dynamicProperty.InitProperty();
         var flashProperty = new FlashProperty();
         flashProperty.InitProperty();
         EvaluateProperty(element, control, dynamicProperty, flashProperty);
         EvaluateEvent(element, control, dynamicProperty, flashProperty);
         if (dynamicProperty.FlashEvents.Count > 0
             || dynamicProperty.FlashPropertys.Count > 0)
         {
             control.Properties.Add(new Property()
             {
                 Name = PropertyUtility.DYNAMICNAME,
                 Type = PropertyValueType.str.ToString(),
                 Value = dynamicProperty.ToXml()
             });
         }
         control.Children = RecursiveCreatePageControl(element);
         result.Add(control);
     }
     return result;
 }
Пример #3
0
 public override void OnMouseDown(IToolDrawArea drawArea, MouseEventArgs e)
 {
     var property = new FlashProperty();
     property.InitProperty();
     property.Size = "1,1";
     property.Location = String.Format("{0},{1}", e.X, e.Y);
     var draw = new DrawFlash(property);
     drawArea.AddNewDrawObject(draw);
 }
Пример #4
0
 public override IDrawObject CreateDrawObject(PageControl control)
 {
     var property = new FlashProperty();
     InitDrawObjectFromPageControl(control, property);
     return new DrawFlash(property);
 }
Пример #5
0
 private static void EvaluateEvent(XmlElement element, PageControl control,
     DynamicProperty dynamicProperty, FlashProperty flashProperty)
 {
     var nodeEvents = element.SelectNodes("Events/Event");
     foreach (XmlNode nodeEvent in nodeEvents)
     {
         var events = new Event();
         events.Name = XmlUtility.GetAttrValue(nodeEvent as XmlElement, "Name");
         events.Value = XmlUtility.GetElementCDataValue(nodeEvent as XmlElement);
         if (control.Type != ToolBoxType.Flash.ToString())
         {
             control.Events.Add(events);
         }
         else
         {
             if (flashProperty.Properties.Any(p => p.Name == events.Name))
             {
                 control.Events.Add(events);
             }
             else if (control.Type == ToolBoxType.Flash.ToString())
             {
                 var tempProperty = new FlashControlDynamicProperty();
                 tempProperty.Name = XmlUtility.GetAttrValue(nodeEvent as XmlElement, "Name");
                 tempProperty.Description = XmlUtility.GetAttrValue(nodeEvent as XmlElement, "Description");
                 tempProperty.Value = XmlUtility.GetElementCDataValue(nodeEvent as XmlElement);
                 if (!dynamicProperty.FlashEvents.ContainsKey(tempProperty.Name))
                     dynamicProperty.FlashEvents.Add(tempProperty.Name, tempProperty);
             }
         }
     }
 }
Пример #6
0
 private static void EvaluateProperty(XmlElement element, PageControl control,
     DynamicProperty dynamicProperty, FlashProperty flashProperty)
 {
     var nodeProperties = element.SelectNodes("Properties/Property");
     foreach (XmlNode nodeProperty in nodeProperties)
     {
         var property = new Property();
         property.Name = XmlUtility.GetAttrValue(nodeProperty as XmlElement, "Name");
         property.Type = XmlUtility.GetAttrValue(nodeProperty as XmlElement, "Type");
         property.Value = XmlUtility.GetElementCDataValue(nodeProperty as XmlElement);
         if (control.Type != ToolBoxType.Flash.ToString())
         {
             control.Properties.Add(property);
         }
         else
         {
             if (flashProperty.Properties.Any(p => p.Name == property.Name))
             {
                 control.Properties.Add(property);
             }
             else if (control.Type == ToolBoxType.Flash.ToString())
             {
                 var tempProperty = new FlashControlDynamicProperty();
                 tempProperty.Name = XmlUtility.GetAttrValue(nodeProperty as XmlElement, "Name");
                 tempProperty.Type = XmlUtility.GetAttrValue(nodeProperty as XmlElement, "Type");
                 tempProperty.Description = XmlUtility.GetAttrValue(nodeProperty as XmlElement, "Description");
                 tempProperty.DefaultValue = XmlUtility.GetAttrValue(nodeProperty as XmlElement, "DefaultValue");
                 tempProperty.Value = XmlUtility.GetElementCDataValue(nodeProperty as XmlElement);
                 if (!dynamicProperty.FlashPropertys.ContainsKey(tempProperty.Name))
                     dynamicProperty.FlashPropertys.Add(tempProperty.Name, tempProperty);
             }
         }
     }
 }
Пример #7
0
 public DrawFlash(FlashProperty property)
     : base(property)
 {
 }