示例#1
0
        void BtnView_Click(object sender, RoutedEventArgs e)
        {
            if (DaGr.SelectedItems == null)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            if (DaGr.SelectedItems.Count == 0)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            T_OA_AGENTSET ent = DaGr.SelectedItems[0] as T_OA_AGENTSET;

            ProxySettingsForm AddWin  = new ProxySettingsForm(FormTypes.Browse, ent.AGENTSETID);
            EntityBrowser     browser = new EntityBrowser(AddWin);

            browser.FormType         = FormTypes.Browse;
            browser.MinWidth         = 500;
            browser.MinHeight        = 300;
            browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
            browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
        }
示例#2
0
        void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            string strLeaveTypeSetID = string.Empty;

            if (DaGr.SelectedItems == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTDATAALERT"));
                return;
            }

            if (DaGr.SelectedItems.Count == 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTDATAALERT"));
                return;
            }

            T_OA_AGENTSET ent = DaGr.SelectedItems[0] as T_OA_AGENTSET;

            ProxySettingsForm AddWin  = new ProxySettingsForm(FormTypes.Edit, ent.AGENTSETID);
            EntityBrowser     browser = new EntityBrowser(AddWin);

            browser.FormType         = FormTypes.Edit;
            browser.MinWidth         = 600;
            browser.MinHeight        = 180;
            browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
            browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
        }
示例#3
0
        void btnNew_Click(object sender, RoutedEventArgs e)
        {
            ProxySettingsForm AddWin  = new ProxySettingsForm(FormTypes.New, "");
            EntityBrowser     browser = new EntityBrowser(AddWin);

            browser.MinWidth         = 600;
            browser.MinHeight        = 180;
            browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
            browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
        }
示例#4
0
        public static void registerSettings(Form parentForm)
        {
            ProxySettingsForm frmProxy = new ProxySettingsForm
            {
                StartPosition = FormStartPosition.CenterParent
            };

            var settings = NuGet.Settings.LoadDefaultSettings(null, null, null);

            string proxyInfos = settings.GetValue(SECTION_CONFIG, KEY_HTTP_PROXY, false);

            if (proxyInfos == null)
            {
                proxyInfos = "";
            }


            Match m = Regex.Match(proxyInfos, @"http://(.*)?:(.*)", RegexOptions.IgnoreCase);

            if (m.Success)
            {
                frmProxy.UseCustomProxy = true;

                frmProxy.proxyAddress = m.Groups[1].Value;

                frmProxy.proxyPort = m.Groups[2].Value;
            }
            else
            {
                frmProxy.UseCustomProxy = false;

                frmProxy.proxyAddress = "";

                frmProxy.proxyPort = "";
            }

            if (frmProxy.ShowDialog(parentForm) == DialogResult.OK)
            {
                if (frmProxy.UseCustomProxy)
                {
                    settings.SetValue(SECTION_CONFIG, KEY_HTTP_PROXY, string.Format("http://{0}:{1}", frmProxy.proxyAddress, frmProxy.proxyPort));
                }
                else
                {
                    settings.DeleteValue(SECTION_CONFIG, KEY_HTTP_PROXY);
                    settings.DeleteValue(SECTION_CONFIG, KEY_HTTP_PROXY_USER);
                    settings.DeleteValue(SECTION_CONFIG, KEY_HTTP_PROXY_PASSWORD);
                }
                MessageBox.Show("You need to restart XrmToolbox for changes to take effect");
            }
        }