예제 #1
0
 internal void SetSource(ScriptView view, DTObject source)
 {
     this.Id       = source.GetValue <string>("id", string.Empty);
     this.Name     = source.GetValue <string>("name", string.Empty);
     this.Metadata = source.GetObject("metadata");
     this.View     = view;
 }
예제 #2
0
        public static T Create <T>(ScriptView view, DTObject element) where T : ScriptElement
        {
            var se = Activator.CreateInstance(typeof(T)) as ScriptElement;

            se.SetSource(view, element);
            return((T)se);
        }
        public void On(ViewEvent evt, Action <ScriptView> action)
        {
            if (_data == null)
            {
                _data = new Dictionary <ViewEvent, ScriptView>();
            }
            ScriptView view = null;

            if (!_data.TryGetValue(evt, out view))
            {
                view = new ScriptView();
                _data.Add(evt, view);
            }
            action(view);
        }
예제 #4
0
 internal ScriptViewSession(ScriptView owner, DTObject data)
 {
     _owner = owner;
     _data  = data;
 }