Beispiel #1
0
        public OverlayManager(OverlayWindow myOverlay)
        {
            cancelToken = token.Token;
            //Initialize logging for components
            GW2APIComponent.BaseComponents.BaseComponent.logging += BaseComponent_logging;

            //setOverlayParent;
            overlay = myOverlay;

            InitializeComponent();

            // AddComponents
            list        = gw2InformationObject.AddComponent <ItemListComponent>(null);
            recipe      = gw2InformationObject.AddComponent <RecipeRequestComponent>(null);
            list.onAdd += list_onAdd;
            // start backgroundworkers
            itemListFetcher.RunWorkerAsync();
            AddItemWorker.RunWorkerAsync();

            //set sorting algorithm for the itemNameList
            Disposed += OverlayManager_Disposed;

            itemProjectList.Items.AddRange(overlay.OverlayInfo.getItemProjectNames().ToArray());
            editProject = newProject;
        }
Beispiel #2
0
 private void Overlay_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (e.CloseReason == CloseReason.UserClosing)
     {
         e.Cancel     = true;
         this.Visible = false;
         return;
     }
     if (itemListFetcher.IsBusy)
     {
         itemListFetcher.CancelAsync();
     }
     if (AddItemWorker.IsBusy)
     {
         AddItemWorker.CancelAsync();
     }
 }