Example #1
0
        private void RefreshUSDConfigurationDataTree()
        {
            WorkAsync(new WorkAsyncInfo
            {
                Message = "Retrieving USD Configuration...",
                Work    = (w, e) =>
                {
                    Helpers.GlobalProperties.WebApplicationUrl = ConnectionDetail.WebApplicationUrl;

                    usdConfigData = new USDConfigurationData();

                    w.ReportProgress(0, "Retrieving Hosted Controls");
                    usdConfigData.HostedControls = HostedControlRepository.GetHostedControls(Service);

                    w.ReportProgress(0, "Retrieving Events");
                    usdConfigData.Events = EventRepository.GetEvents(Service);

                    w.ReportProgress(0, "Retrieving Actions");
                    usdConfigData.Actions = ActionRepository.GetActions(Service);

                    w.ReportProgress(0, "Retrieving Event-Action Connections");
                    usdConfigData.EventActionConnections = EventActionConnectionRepository.GetEventActionConnections(Service);

                    w.ReportProgress(0, "Retrieving Action-SubAction Connections");
                    usdConfigData.ActionSubActionConnections = ActionSubActionRepository.GetActionSubActionConnections(Service);

                    w.ReportProgress(0, "Drawing Tree");
                    DrawTreeView(usdConfigData);

                    tabControl1.Invoke((MethodInvoker) delegate { tabControl1.Enabled = true; });

                    e.Result = "Done";
                },
                ProgressChanged = e =>
                {
                    SetWorkingMessage(e.UserState.ToString());
                },
                PostWorkCallBack = e =>
                {
                    //MessageBox.Show($"You are { e.Result}");
                },
                AsyncArgument = null,
                IsCancelable  = true,
                MessageWidth  = 340,
                MessageHeight = 150
            });
        }
Example #2
0
        public static void Main(string[] args)
        {
            try
            {
                IOrganizationService Service = CreateIOrganizationService(@"*****@*****.**", @"-HXIAA#S0a#k!m\P", @"https://bdlabx-lmes-25-dev.api.crm4.dynamics.com/XRMServices/2011/Organization.svc");

                var usdConfigData = new USDConfigurationData();

                usdConfigData.HostedControls             = HostedControlRepository.GetHostedControls(Service);
                usdConfigData.Events                     = EventRepository.GetEvents(Service);
                usdConfigData.Actions                    = ActionRepository.GetActions(Service);
                usdConfigData.EventActionConnections     = EventActionConnectionRepository.GetEventActionConnections(Service);
                usdConfigData.ActionSubActionConnections = ActionSubActionRepository.GetActionSubActionConnections(Service);

                var usdTree = USDTree.GenerateUSDTree(usdConfigData);
                PrintUSDTree(usdTree);
                Console.ReadKey();
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                throw;
            }
        }