public SmartScriptBase(ISmartFactory smartFactory,
                               ISmartDataManager smartDataManager,
                               IMessageBoxService messageBoxService)
        {
            this.smartFactory      = smartFactory;
            this.smartDataManager  = smartDataManager;
            this.messageBoxService = messageBoxService;
            Events          = new ObservableCollection <SmartEvent>();
            selectionHelper = new SmartSelectionHelper(this);
            selectionHelper.ScriptSelectedChanged += CallScriptSelectedChanged;
            selectionHelper.EventChanged          += (e, a, mask) =>
            {
                RenumerateEvents();
                EventChanged?.Invoke(e, a, mask);
            };
            AllSmartObjectsFlat = selectionHelper.AllSmartObjectsFlat;
            AllActions          = selectionHelper.AllActions;

            Events.ToStream()
            .Subscribe((e) =>
            {
                if (e.Type == CollectionEventType.Add)
                {
                    e.Item.Parent = this;
                }
            });
        }
Exemple #2
0
 private void OnEventChanged(object sender, EventArgs e)
 {
     OnPropertyChanged(nameof(ID));
     OnPropertyChanged(nameof(Name));
     OnPropertyChanged(nameof(Repeat));
     EventChanged?.Invoke(this, e);
 }
 internal void Update(uint amount)
 {
     if (amount != Amount)
     {
         Amount = amount;
         EventChanged?.Invoke();
     }
 }
Exemple #4
0
        /// <summary>
        /// Смотри <see cref="IDatasetItem.EventChanged"/>
        /// </summary>
        public void Set(string key, string value)
        {
            _kvQuickTable[key] = value;

            EventChanged?.Invoke(this);
        }
Exemple #5
0
 public void OnEventChanged()
 {
     EventChanged?.Invoke(this, EventArgs.Empty);
 }
Exemple #6
0
 // Handler
 protected virtual void OnEventChanged(EventEventArgs e)
 {
     EventChanged?.Invoke(this, e);
 }