Beispiel #1
0
        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            ProcessMenuItemsForPlugin();

            if (tabControl1.SelectedIndex == 0)
            {
                tstxtFilterPlugin.Focus();
            }
            else
            {
                var control = (IXrmToolBoxPluginControl)tabControl1.SelectedTab.Controls[0];
                ((UserControl)control).Focus();
                var currentPluginStatus = pluginControlStatuses.FirstOrDefault(pcs => pcs.Control == control);
                if (currentPluginStatus == null)
                {
                    ccsb.SetMessage(null);
                    ccsb.SetProgress(null);
                }
                else
                {
                    ccsb.SetMessage(currentPluginStatus.Message);
                    ccsb.SetProgress(currentPluginStatus.Percentage);
                }
            }
        }
Beispiel #2
0
        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            ProcessMenuItemsForPlugin();

            if (tabControl1.SelectedIndex == 0)
            {
                tstxtFilterPlugin.Focus();
            }
            else
            {
                var control = tabControl1.SelectedTab.GetPlugin();
                if (control == null)
                {
                    return;
                }

                ((UserControl)control).Focus();
                var currentPluginStatus = pluginControlStatuses.FirstOrDefault(pcs => pcs.Control == control);
                if (currentPluginStatus == null)
                {
                    ccsb.SetMessage(null);
                    ccsb.SetProgress(null);
                }
                else
                {
                    ccsb.SetMessage(currentPluginStatus.Message);
                    ccsb.SetProgress(currentPluginStatus.Percentage);
                }

                var openOrgVisible = pluginConnections.ContainsKey(tabControl1.SelectedIndex) &&
                                     pluginConnections[tabControl1.SelectedIndex] != null;
                tssOpenOrg.Visible = openOrgVisible;
                tsbOpenOrg.Visible = openOrgVisible;
            }
        }
Beispiel #3
0
        private void WhoAmI()
        {
            int i = 0;

            do
            {
                //WhoAmIRequest request = new WhoAmIRequest();
                //WhoAmIResponse response = (WhoAmIResponse)this.service.Execute(request);

                var user = this.service.RetrieveMultiple(new QueryExpression("systemuser")
                {
                    ColumnSet = new ColumnSet("fullname"),

                    Criteria = new FilterExpression
                    {
                        Conditions =
                        {
                            new ConditionExpression("systemuserid", ConditionOperator.EqualUserId)
                        }
                    }
                }).Entities.First();

                i++;

                ccsb.SetMessage("Doing...");
                ccsb.SetProgress(i * 10);

                lbLogs.Items.Add($"Hello {user.GetAttributeValue<string>("fullname")},Your ID is: {user.Id:B}");
            } while (i < 1);

            ccsb.SetMessage("Done");
            ccsb.SetProgress(null);
        }
        private void WhoAmI()
        {
            int i = 0;

            do
            {
                WhoAmIRequest  request  = new WhoAmIRequest();
                WhoAmIResponse response = (WhoAmIResponse)this.service.Execute(request);

                i++;

                ccsb.SetMessage("Doing...");
                ccsb.SetProgress(i * 10);

                MessageBox.Show(this, "Your ID is: " + response.UserId.ToString("B"));
            } while (i < 1);

            ccsb.SetMessage("Done");
            ccsb.SetProgress(null);
        }