public SetterAction(UITriggerBase argTrigger, string argTargetElement, string argBindProperty, string argValue) : base(argTrigger) { Debug.Assert(!string.IsNullOrEmpty(argTargetElement) && !string.IsNullOrEmpty(argBindProperty)); m_targetElement = argTargetElement; m_bindProperty = argBindProperty; m_newValue = ((string)argValue).Trim(); if (m_newValue.StartsWith(s_varLeftSymbol) && m_newValue.EndsWith(s_varRightSymbol)) { m_newValue = m_newValue.Trim(s_LeftFlag, s_RightFlag); m_needLoadResource = true; } else if (m_newValue.StartsWith(s_dataLeftSymbol) && m_newValue.EndsWith(s_dataRightSymbol)) { m_newValue = m_newValue.Trim(s_dataLeftFlag, s_dataRightFlag); m_needLoadDataCache = true; } else { m_needLoadResource = false; m_needLoadDataCache = false; } NeedUndo = false; }
public BeginStoryboardAction(UITriggerBase argTrigger, string argStoryboardName) : base(argTrigger) { Debug.Assert(!string.IsNullOrEmpty(argStoryboardName)); m_storyboardName = argStoryboardName; }
private ActionBase LoadSetterAction(UITriggerBase argTrigger, XmlNode argNode) { Debug.Assert(null != argTrigger && null != argNode); XmlAttribute targetAttri = argNode.Attributes[UIServiceCfgDefines.s_TargetAttri]; XmlAttribute propertyAttri = argNode.Attributes[UIServiceCfgDefines.s_PropertyAttri]; XmlAttribute valueAttri = argNode.Attributes[UIServiceCfgDefines.s_ValueAttri]; if (null == targetAttri || null == propertyAttri || null == valueAttri) { return(null); } if (string.IsNullOrEmpty(targetAttri.Value) || string.IsNullOrEmpty(propertyAttri.Value) || string.IsNullOrEmpty(valueAttri.Value)) { return(null); } SetterAction action = new SetterAction(argTrigger, targetAttri.Value, propertyAttri.Value, valueAttri.Value) { ResourceManagerInterface = this.ResouceManager }; return(action); }
public void RemoveTrigger(UITriggerBase objTrigger) { Debug.Assert(null != objTrigger); TriggerCollection.Remove(objTrigger); objTrigger.Exit(); objTrigger = null; }
protected void LoadAllActions(UITriggerBase argTrigger, XmlNode argNode) { Debug.Assert(null != argTrigger && null != argNode); ActionBase action = null; foreach (XmlNode node in argNode.ChildNodes) { if (node.NodeType != XmlNodeType.Element) { continue; } switch (node.Name) { case UIServiceCfgDefines.s_SetterActNode: { action = LoadSetterAction(argTrigger, node); } break; case UIServiceCfgDefines.s_BeginStoryboardActNode: { action = LoadBeginStoryboardAction(argTrigger, node); } break; case UIServiceCfgDefines.s_removeStoryboardActNode: { action = LoadRemoveStoryboardAction(argTrigger, node); } break; case UIServiceCfgDefines.s_playSoundNode: { action = LoadPlaySoundAction(argTrigger, node); } break; default: { } break; } if (null != action) { argTrigger.AddAction(action); } } }
private ActionBase LoadRemoveStoryboardAction(UITriggerBase argTrigger, XmlNode argNode) { Debug.Assert(null != argTrigger && null != argNode); //load name attribute XmlAttribute nameAttri = argNode.Attributes[UIServiceCfgDefines.s_nameAttri]; if (null != nameAttri || string.IsNullOrEmpty(nameAttri.Value)) { return(null); } return(null); }
private ActionBase LoadPlaySoundAction(UITriggerBase argTrigger, XmlNode argNode) { Debug.Assert(null != argTrigger && null != argNode); XmlAttribute sourceAttri = argNode.Attributes[UIServiceCfgDefines.s_sourceAttri]; if (null == sourceAttri || string.IsNullOrEmpty(sourceAttri.Value)) { return(null); } //string soundfile = AppDomain.CurrentDomain.BaseDirectory + sourceAttri.Value; //if ( !File.Exists(soundfile) ) //{ // return null; //} XmlAttribute loopAttri = argNode.Attributes[UIServiceCfgDefines.s_loopAttri]; int loop = 0; if (null != loopAttri) { if (!int.TryParse(loopAttri.Value, out loop)) { loop = 0; } } XmlAttribute skipEnableAttri = argNode.Attributes[UIServiceCfgDefines.s_skipEnableAttri]; int skipEnable = 0; if (null != skipEnableAttri) { if (!int.TryParse(skipEnableAttri.Value, out skipEnable)) { skipEnable = 0; } } return(new PlaySoundAction(argTrigger, sourceAttri.Value) { Loop = loop == 0 ? false : true, ResourceManagerInterface = this.ResouceManager, SkipEnable = skipEnable == 0 ? false : true }); }
public PlaySoundAction(UITriggerBase argTrigger, string argSource) : base(argTrigger) { Debug.Assert(!string.IsNullOrEmpty(argSource)); m_source = argSource.Trim(); if (m_source.StartsWith(s_varLeftSymbol) && m_source.EndsWith(s_varRightSymbol)) { m_source = m_source.Trim(s_LeftFlag, s_RightFlag); m_needLoadResource = true; } else { m_needLoadResource = false; m_source = AppDomain.CurrentDomain.BaseDirectory + m_source; } }
public RemoveStoryboardAction(UITriggerBase argTrigger, string argName) : base(argTrigger) { m_storyboardName = argName; }
public ActionBase(UITriggerBase argTrigger) { Debug.Assert(null != argTrigger); m_trigger = argTrigger; }
public void AddTrigger(UITriggerBase objTrigger) { Debug.Assert(null != objTrigger); TriggerCollection.Add(objTrigger); }