Beispiel #1
0
 public ListData(string name, ListsCache <CompanyData> dataCache, ListsCache <string> settingsCache, ListsCache <string> propertiesCache)
 {
     Name                 = name;
     this.dataCache       = dataCache;
     this.settingsCache   = settingsCache;
     this.propertiesCache = propertiesCache;
 }
        //private ListsCache<CompanyData> CompaniesCache { get; }


        /*public MarkersList Markers { get; set; }
         * public CompanyList Companies { get; set; }*/

        public MainWindow(FocusKeyManager manager)
        {
            FocusManager = manager;
            var CompaniesCache = new ListsCache <CompanyData>("CompanyLists");

            var factory       = FocusManager.CreateCompanyFactory();
            var SettingsCache = new ListsCache <string>("SettingsLists");

            InitializeComponent();
            CheckFocusKey(manager);

            isMonAvailable = FocusManager.GetAvailableMethods().Contains(ApiMethod.mon);

            CheckButton.Content = "Проверить список";//= isMonAvailable ? "Включить автопроверку." : "Проверить список";

            //CheckButton.Visibility = manager.IsBaseMode() ? Visibility.Hidden : Visibility.Visible;

            //MarkersControl.Manager = FocusManager;
            MarkersControl.IsBaseMode = manager.IsBaseMode();

            CompanyControl.CompanyFactory = factory;
            CompanyControl.Manager        = FocusManager;//TODO Attepmpt to remove it
            CompanyControl.markersList    = MarkersControl;
            CompanyControl.FocusKeyUsed  += (o, a) => CheckFocusKey(manager);

            CompanyListsControl.Manager     = FocusManager;
            CompanyListsControl.CompanyList = CompanyControl;
            CompanyListsControl.ListFactory = new ListFactory(CompaniesCache, SettingsCache, new ListsCache <string>("PropertiesCache"));
            CompanyListsControl.Excel       = new ExcelExporter(SettingsCache, CompaniesCache, factory);
            //CompanyListsControl.FocusKeyUsed += (o, a) => CheckFocusKey(manager);
        }
Beispiel #3
0
 public ListFactory(ListsCache <CompanyData> dataCache,
                    ListsCache <string> settingsCache,
                    ListsCache <string> propertiesCache)
 {
     this.dataCache       = dataCache;
     this.settingsCache   = settingsCache;
     this.propertiesCache = propertiesCache;
 }