Esempio n. 1
0
        public ProjectElementList(GetFilePath getFilePath, Func <string, bool> fileLocationOk, Func <IEnumerable <Tuple <Id <FileInProject>, DocumentPath> >, IEnumerable <TElement> > loader, Func <DirectoryInfo, TElement> makeEmpty)
        {
            m_getFilePath    = getFilePath;
            m_data           = new CallbackDictionary <Id <FileInProject>, TElement>();
            m_data.Removing += (key, element) => { element.Removed(); };
            m_data.Clearing += () => { m_data.Values.ForAll(element => { element.Removed(); }); };
            m_loader         = loader;
            m_makeEmpty      = makeEmpty;
            m_fileLocationOk = fileLocationOk;

            m_suppressibleGotChanged = new SuppressibleAction(() => { GotChanged.Execute(); });
            Added   += a => m_suppressibleGotChanged.TryExecute();
            Removed += a => m_suppressibleGotChanged.TryExecute();
        }
Esempio n. 2
0
 public VehiclePipe()
 {
     _callbacks = new CallbackDictionary();
     _thread    = new Thread(Runner);
 }