Class responsible to execute csom calls in a background thread without impacting UI
コード例 #1
0
        private void LoadLookupTables()
        {
            BackgroundExecutorWithStatus bgeLookupTables = new BackgroundExecutorWithStatus(TB_Status, "Querying for Enterprise LookupTables");

            _bgws.Add(bgeLookupTables);
            bgeLookupTables.ExecuteWorker(LoadLookupTablesList);
        }
コード例 #2
0
        private void LoadCustomFields()
        {
            BackgroundExecutorWithStatus bgeCustomFields = new BackgroundExecutorWithStatus(TB_Status, "Querying for Enterprise Custom Fields");

            _bgws.Add(bgeCustomFields);
            bgeCustomFields.ExecuteWorker(LoadCustomFieldsList);
        }
コード例 #3
0
 private void BTN_ChangeOwner_Click(object sender, EventArgs e)
 {
     if (LV_Projects.SelectedItems.Count <= 0 || LV_EnterpiseResources.SelectedItems.Count <= 0) return;
     _bgeProject = new BackgroundExecutorWithStatus(TB_Status, "Updating Project owner of the selected project");
     _bgws.Add(_bgeProject);
     _bgeProject.ExecuteWorker(UpdateProjectOwner);
 }
コード例 #4
0
        private void CheckInCheckOutSelectedProjects()
        {
            string statusText = _checkin ? "Checking in Enterprise Projects" : "Checking out Enterprise Projects";

            _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, statusText);
            _backgroundExecutorWithStatus.ExecuteWorker(CheckInCheckoutProjects);
        }
コード例 #5
0
 private void CB_ProjectList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (CB_ProjectList.SelectedIndex == 0)
     {
         DGV_Tasks.Columns.Clear();
         DGV_Tasks.DataSource         = null;
         DGV_Tasks.AllowUserToAddRows = false;
         DGV_Assignments.Columns.Clear();
         DGV_Assignments.DataSource         = null;
         DGV_Assignments.AllowUserToAddRows = false;
         DGV_Resources.Columns.Clear();
         DGV_Resources.DataSource         = null;
         DGV_Resources.AllowUserToAddRows = false;
         DGV_Project.Columns.Clear();
         DGV_Project.DataSource         = null;
         DGV_Project.AllowUserToAddRows = false;
         TP_Tasks.Text       = "Tasks";
         TP_Assignments.Text = "Assignments";
         TP_Resources.Text   = "Resources";
     }
     else
     {
         _beProjectLoad = new BackgroundExecutorWithStatus(TB_Status, "Querying for Project info");
         _beProjectLoad.ExecuteWorker(LoadProjectInfo);
     }
 }
コード例 #6
0
 private void BTN_Publish_Click(object sender, EventArgs e)
 {
     if (_publishedProject == null)
     {
         return;
     }
     _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Publishing project " + _publishedProject.Draft.Name);
     _backgroundExecutorWithStatus.ExecuteWorker(PublishProject);
 }
コード例 #7
0
 private void BTN_AddResources_Click(object sender, EventArgs e)
 {
     if (LV_Projects.SelectedItems.Count <= 0)
     {
         return;
     }
     _bgeAddResourcesToProject = new BackgroundExecutorWithStatus(TB_Status, "Adding Enterprise resources to the selected project");
     _bgws.Add(_bgeAddResourcesToProject);
     _bgeAddResourcesToProject.ExecuteWorker(AddResourcesToProject);
 }
コード例 #8
0
 private void BTN_RemoveResources_Click(object sender, EventArgs e)
 {
     if (LV_Projects.SelectedItems.Count <= 0 || LV_ProjectResources.SelectedItems.Count <= 0)
     {
         return;
     }
     _bgeRemoveProjectResources = new BackgroundExecutorWithStatus(TB_Status, "Removing Project Resources on the selected Project");
     _bgws.Add(_bgeRemoveProjectResources);
     _bgeRemoveProjectResources.ExecuteWorker(RemoveResources);
 }
コード例 #9
0
 private void BTN_ChangeOwner_Click(object sender, EventArgs e)
 {
     if (LV_Projects.SelectedItems.Count <= 0 || LV_EnterpiseResources.SelectedItems.Count <= 0)
     {
         return;
     }
     _bgeProject = new BackgroundExecutorWithStatus(TB_Status, "Updating Project owner of the selected project");
     _bgws.Add(_bgeProject);
     _bgeProject.ExecuteWorker(UpdateProjectOwner);
 }
コード例 #10
0
        private void Btn_Login_Click(object sender, EventArgs e)
        {
            Settings.Default.Url      = TB_Url.Text;
            Settings.Default.UserName = TB_UserName.Text;
            Settings.Default.WindowsAuthenticationMode = RB_Windows.Checked;
            Settings.Default.ProjectOnLine             = CB_Online.Checked;
            Settings.Default.Save();

            _bge = new BackgroundExecutorWithStatus(LBL_Status, "Authenticating");
            _bge.ExecuteWorker(LoginProjectServer);
        }
コード例 #11
0
        private void Btn_Login_Click(object sender, EventArgs e)
        {
            Settings.Default.Url = TB_Url.Text;
            Settings.Default.UserName = TB_UserName.Text;
            Settings.Default.WindowsAuthenticationMode = RB_Windows.Checked;
            Settings.Default.ProjectOnLine = CB_Online.Checked;
            Settings.Default.Save();

            _bge = new BackgroundExecutorWithStatus(LBL_Status, "Authenticating");
            _bge.ExecuteWorker(LoginProjectServer);
        }
コード例 #12
0
        private void LV_Projects_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LV_Projects.SelectedItems.Count <= 0)
            {
                return;
            }
            BackgroundExecutorWithStatus bgeProjectResources = new BackgroundExecutorWithStatus(TB_Status, "Querying for Project Resources on the selected Project");

            _bgws.Add(bgeProjectResources);
            bgeProjectResources.ExecuteWorker(GetDraftTeamForSelectedProject);
        }
コード例 #13
0
        private void LoadProjectsAndResources()
        {
            BackgroundExecutorWithStatus bgeProject  = new BackgroundExecutorWithStatus(TB_Status, "Querying for all projects");
            BackgroundExecutorWithStatus bgeResource = new BackgroundExecutorWithStatus(TB_Status, "Querying for all Enterprise Resources");

            _bgws.Add(bgeProject);
            _bgws.Add(bgeResource);

            bgeProject.ExecuteWorker(GetDraftProjectsList);
            bgeResource.ExecuteWorker(GetEnterpriseResourcesList);
            Log.WriteVerbose(new SourceInfo(), "Loading Projects and Enterprise resources.");
        }
コード例 #14
0
 private static void UpdateUiTextbox(BackgroundExecutorWithStatus bgws, TextBox textbox, string msg, params object[] args)
 {
     if (args.Length != 0)
     {
         msg = string.Format(msg, args);
     }
     if (bgws != null)
     {
         bgws.AnimateText = msg;
     }
     else
     {
         textbox.InvokeIfRequired(s =>
         {
             s.Text += Environment.NewLine + msg;
         });
     }
 }
コード例 #15
0
        private void CustomFieldsCreation_Load(object sender, EventArgs e)
        {
            CB_Type.DataSource   = Enum.GetValues(typeof(CustomFieldType));
            CB_Type.SelectedItem = CustomFieldType.TEXT;

            Dictionary <string, EntityType> entityType = new Dictionary <string, EntityType>
            {
                { "Task", ProjContext.EntityTypes.TaskEntity },
                { "Resource", ProjContext.EntityTypes.ResourceEntity },
                { "Project", ProjContext.EntityTypes.ProjectEntity }
            };

            CB_EntityType.DataSource    = new BindingSource(entityType, null);
            CB_EntityType.DisplayMember = "Key";
            CB_EntityType.ValueMember   = "Value";
            CB_EntityType.SelectedIndex = 2;

            _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Loading LookupTables");
            _backgroundExecutorWithStatus.ExecuteWorker(LoadLookupTables);
        }
コード例 #16
0
 private void DeleteSelectedProjects()
 {
     _bgeProjectsDelete = new BackgroundExecutorWithStatus(TB_Status, "Deleting Enterprise Projects");
     _bgws.Add(_bgeProjectsDelete);
     _bgeProjectsDelete.ExecuteWorker(DeleteProjects);
 }
コード例 #17
0
 private void DeleteSelectedCalendars()
 {
     _bgeCalendarsDelete = new BackgroundExecutorWithStatus(TB_Status, "Deleting Enterprise Calendars");
     _bgws.Add(_bgeCalendarsDelete);
     _bgeCalendarsDelete.ExecuteWorker(DeleteCalendars);
 }
コード例 #18
0
 private void PublishSelectedProjects()
 {
     _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Publishing Enterprise Projects");
     _backgroundExecutorWithStatus.ExecuteWorker(PublishProjects);
 }
コード例 #19
0
 private void DeleteSelectedCustomFields()
 {
     _bgeCustomFieldsDelete = new BackgroundExecutorWithStatus(TB_Status, "Deleting Enterprise Custom Fields");
     _bgws.Add(_bgeCustomFieldsDelete);
     _bgeCustomFieldsDelete.ExecuteWorker(DeleteCustomFields);
 }
コード例 #20
0
 private void LoadCalendars()
 {
     _bgeCalendars = new BackgroundExecutorWithStatus(TB_Status, "Querying for Enterprise Calendars");
     _bgws.Add(_bgeCalendars);
     _bgeCalendars.ExecuteWorker(LoadCalendarsList);
 }
コード例 #21
0
 private void BTN_RemoveResources_Click(object sender, EventArgs e)
 {
     if (LV_Projects.SelectedItems.Count <= 0 || LV_ProjectResources.SelectedItems.Count <= 0) return;
     _bgeRemoveProjectResources = new BackgroundExecutorWithStatus(TB_Status, "Removing Project Resources on the selected Project");
     _bgws.Add(_bgeRemoveProjectResources);
     _bgeRemoveProjectResources.ExecuteWorker(RemoveResources);
 }
コード例 #22
0
 private void LV_Projects_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (LV_Projects.SelectedItems.Count <= 0) return;
     BackgroundExecutorWithStatus bgeProjectResources = new BackgroundExecutorWithStatus(TB_Status, "Querying for Project Resources on the selected Project");
     _bgws.Add(bgeProjectResources);
     bgeProjectResources.ExecuteWorker(GetDraftTeamForSelectedProject);
 }
コード例 #23
0
 private void LoadCustomFields()
 {
     BackgroundExecutorWithStatus bgeCustomFields = new BackgroundExecutorWithStatus(TB_Status, "Querying for Enterprise Custom Fields");
     _bgws.Add(bgeCustomFields);
     bgeCustomFields.ExecuteWorker(LoadCustomFieldsList);
 }
コード例 #24
0
 private void LoadCalendars()
 {
     _bgeCalendars = new BackgroundExecutorWithStatus(TB_Status, "Querying for Enterprise Calendars");
     _bgws.Add(_bgeCalendars);
     _bgeCalendars.ExecuteWorker(LoadCalendarsList);
 }
コード例 #25
0
 private void BTN_Create_Click(object sender, EventArgs e)
 {
     _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Creating Text LookupTables");
     _backgroundExecutorWithStatus.ExecuteWorker(CreateLookupTables);
 }
コード例 #26
0
 private void LoadProjects()
 {
     _bgeProjects = new BackgroundExecutorWithStatus(TB_Status, "Querying for all Enterprise projects");
     _bgws.Add(_bgeProjects);
     _bgeProjects.ExecuteWorker(LoadProjectsList);
 }
コード例 #27
0
 private void LoadLookupTables()
 {
     BackgroundExecutorWithStatus bgeLookupTables = new BackgroundExecutorWithStatus(TB_Status, "Querying for Enterprise LookupTables");
     _bgws.Add(bgeLookupTables);
     bgeLookupTables.ExecuteWorker(LoadLookupTablesList);
 }
コード例 #28
0
 private void CheckInSelectedResources()
 {
     _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Checking in Enterprise Resources");
     _backgroundExecutorWithStatus.ExecuteWorker(CheckInResources);
 }
コード例 #29
0
 private void LoadProjects()
 {
     _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Querying for all Enterprise projects");
     _backgroundExecutorWithStatus.ExecuteWorker(LoadProjectsList);
 }
コード例 #30
0
 private void BTN_Create_Click(object sender, EventArgs e)
 {
     BackgroundExecutorWithStatus bews = new BackgroundExecutorWithStatus(TB_Status, "Creating CustomFields");
     bews.ExecuteWorker(CreateCustomFields);
 }
コード例 #31
0
 private void DeleteSelectedResources()
 {
     _bgeResourcesDelete = new BackgroundExecutorWithStatus(TB_Status, "Deleting Enterprise Resources");
     _bgws.Add(_bgeResourcesDelete);
     _bgeResourcesDelete.ExecuteWorker(DeleteResources);
 }
コード例 #32
0
        private void CustomFieldsCreation_Load(object sender, EventArgs e)
        {
            CB_Type.DataSource = Enum.GetValues(typeof(CustomFieldType));
            CB_Type.SelectedItem = CustomFieldType.TEXT;

            Dictionary<string, EntityType> entityType = new Dictionary<string, EntityType>
            {
                {"Task", ProjContext.EntityTypes.TaskEntity},
                {"Resource", ProjContext.EntityTypes.ResourceEntity},
                {"Project", ProjContext.EntityTypes.ProjectEntity}
            };
            CB_EntityType.DataSource = new BindingSource(entityType, null);
            CB_EntityType.DisplayMember = "Key";
            CB_EntityType.ValueMember = "Value";
            CB_EntityType.SelectedIndex = 2;

            _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Loading LookupTables");
            _backgroundExecutorWithStatus.ExecuteWorker(LoadLookupTables);
        }
コード例 #33
0
 public static void WriteInformation(SourceInfo logSourceInfo, TextBox textbox, BackgroundExecutorWithStatus bgws, string msg, params object[] args)
 {
     LogInternal(logSourceInfo, TraceEventType.Information, msg, args);
     UpdateUiTextbox(bgws, textbox, msg, args);
 }
コード例 #34
0
        private void LoadProjectsAndResources()
        {
            BackgroundExecutorWithStatus bgeProject = new BackgroundExecutorWithStatus(TB_Status, "Querying for all projects");
            BackgroundExecutorWithStatus bgeResource = new BackgroundExecutorWithStatus(TB_Status, "Querying for all Enterprise Resources");

            _bgws.Add(bgeProject);
            _bgws.Add(bgeResource);

            bgeProject.ExecuteWorker(GetDraftProjectsList);
            bgeResource.ExecuteWorker(GetEnterpriseResourcesList);
            Log.WriteVerbose(new SourceInfo(), "Loading Projects and Enterprise resources.");
        }
コード例 #35
0
 private void BTN_Create_Click(object sender, EventArgs e)
 {
     _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Creating Enterprise Resources");
     _backgroundExecutorWithStatus.ExecuteWorker(CreateResources);
 }
コード例 #36
0
 private void BTN_AddResources_Click(object sender, EventArgs e)
 {
     if (LV_Projects.SelectedItems.Count <= 0) return;
     _bgeAddResourcesToProject = new BackgroundExecutorWithStatus(TB_Status, "Adding Enterprise resources to the selected project");
     _bgws.Add(_bgeAddResourcesToProject);
     _bgeAddResourcesToProject.ExecuteWorker(AddResourcesToProject);
 }
コード例 #37
0
 private void BTN_Create_Click(object sender, EventArgs e)
 {
     _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Creating Enterprise Resources");
     _backgroundExecutorWithStatus.ExecuteWorker(CreateResources);
 }
コード例 #38
0
 private void LoadProjectList()
 {
     _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Querying for all Enterprise projects");
     _backgroundExecutorWithStatus.ExecuteWorker(LoadProjects);
 }
コード例 #39
0
 private static void UpdateUiTextbox(BackgroundExecutorWithStatus bgws, TextBox textbox, string msg, params object[] args)
 {
     if (args.Length != 0)
     {
         msg = string.Format(msg, args);
     }
     if (bgws != null)
     {
         bgws.AnimateText = msg;
     }
     else
     {
         textbox.InvokeIfRequired(s =>
         {
             s.Text += Environment.NewLine + msg;
         });
     }
 }
コード例 #40
0
 private void LoadResources()
 {
     _bgeResource = new BackgroundExecutorWithStatus(TB_Status, "Querying for all Enterprise Resources");
     _bgws.Add(_bgeResource);
     _bgeResource.ExecuteWorker(LoadResourcesList);
 }
コード例 #41
0
 public static void WriteCritical(SourceInfo logSourceInfo, TextBox textbox, BackgroundExecutorWithStatus bgws, string msg, params object[] args)
 {
     LogInternal(logSourceInfo, TraceEventType.Critical, msg, args);
     UpdateUiTextbox(bgws, textbox, msg, args);
 }
コード例 #42
0
 private void DeleteSelectedResources()
 {
     _bgeResourcesDelete = new BackgroundExecutorWithStatus(TB_Status, "Deleting Enterprise Resources");
     _bgws.Add(_bgeResourcesDelete);
     _bgeResourcesDelete.ExecuteWorker(DeleteResources);
 }
コード例 #43
0
 private void LoadResources()
 {
     _bgeResource = new BackgroundExecutorWithStatus(TB_Status, "Querying for all Enterprise Resources");
     _bgws.Add(_bgeResource);
     _bgeResource.ExecuteWorker(LoadResourcesList);
 }
コード例 #44
0
 private void DeleteSelectedProjects()
 {
     _bgeProjectsDelete = new BackgroundExecutorWithStatus(TB_Status, "Deleting Enterprise Projects");
     _bgws.Add(_bgeProjectsDelete);
     _bgeProjectsDelete.ExecuteWorker(DeleteProjects);
 }
コード例 #45
0
        private void BTN_Create_Click(object sender, EventArgs e)
        {
            BackgroundExecutorWithStatus bews = new BackgroundExecutorWithStatus(TB_Status, "Creating CustomFields");

            bews.ExecuteWorker(CreateCustomFields);
        }
コード例 #46
0
 private void BTN_Create_Click(object sender, EventArgs e)
 {
     _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Creating Text LookupTables");
     _backgroundExecutorWithStatus.ExecuteWorker(CreateLookupTables);
 }
コード例 #47
0
 private void PublishSelectedProjects()
 {
     _backgroundExecutorWithStatus = new BackgroundExecutorWithStatus(TB_Status, "Publishing Enterprise Projects");
     _backgroundExecutorWithStatus.ExecuteWorker(PublishProjects);
 }