コード例 #1
0
ファイル: ActionHelper.cs プロジェクト: mcbodge/eidolon
 public ActionHelper()
 {
     actionHelperReference = this;
     ObjectInHand = null;
     HasObjectInHand = false;
     gameOverMenu = PlayerMenus.GetMenuWithName("GameOver");
 }
コード例 #2
0
ファイル: ObjectHolder.cs プロジェクト: mcbodge/eidolon
 // Use this for initialization
 void Start()
 {
     actionID = -1;
     rigidBody = GetComponent<Rigidbody>();
     actionManager = ActionHelper.GetManager();
     startPosition = transform.position;
     startRotation = transform.rotation;
 }
コード例 #3
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            if (ExternalIdentityProviderDto == null)
            {
                ExternalIdentityProviderDto = new ExternalIdentityProviderDto()
                {
                    NameIDFormats       = new List <string> (),
                    SubjectFormats      = new Dictionary <string, string> (),
                    SsoServices         = new List <ServiceEndpointDto> (),
                    SloServices         = new List <ServiceEndpointDto> (),
                    SigningCertificates = new CertificateChainDto {
                        Certificates = new List <CertificateDto> ()
                    }
                };
            }
            else
            {
                DtoToView();
            }

            // Name Id formats
            BtnAddNameIdFormat.Activated += (object sender, EventArgs e) => {
                if (string.IsNullOrEmpty(TxtNameIdFormat.StringValue))
                {
                    UIErrorHelper.ShowAlert("Name Id format cannot be empty", "Alert");
                    return;
                }
                ExternalIdentityProviderDto.NameIDFormats.Add(TxtNameIdFormat.StringValue);
                ReloadTableView(LstNameIdFormat, ExternalIdentityProviderDto.NameIDFormats);
                TxtNameIdFormat.StringValue = (NSString)string.Empty;
            };

            BtnRemoveNameIdFormat.Activated += (object sender, EventArgs e) => {
                if (LstNameIdFormat.SelectedRows.Count > 0)
                {
                    foreach (var row in LstNameIdFormat.SelectedRows)
                    {
                        ExternalIdentityProviderDto.NameIDFormats.RemoveAt((int)row);
                    }
                    ReloadTableView(LstNameIdFormat, ExternalIdentityProviderDto.NameIDFormats);
                }
            };
            ReloadTableView(LstNameIdFormat, ExternalIdentityProviderDto.NameIDFormats);

            // Subject formats
            BtnAddSubjectFormat.Activated += (object sender, EventArgs e) => {
                if (string.IsNullOrEmpty(TxtSubjectFormatName.StringValue))
                {
                    UIErrorHelper.ShowAlert("Subject format name cannot be empty", "Alert");
                    return;
                }
                if (string.IsNullOrEmpty(TxtSubjectFormatValue.StringValue))
                {
                    UIErrorHelper.ShowAlert("Subject format value cannot be empty", "Alert");
                    return;
                }
                if (ExternalIdentityProviderDto.SubjectFormats.ContainsKey(TxtSubjectFormatName.StringValue))
                {
                    UIErrorHelper.ShowAlert("Subject format name already exists", "Alert");
                    return;
                }
                ExternalIdentityProviderDto.SubjectFormats.Add(TxtSubjectFormatName.StringValue, TxtSubjectFormatValue.StringValue);
                ReloadTableView(LstSubjectFormat, ExternalIdentityProviderDto.SubjectFormats);
                TxtSubjectFormatName.StringValue  = (NSString)string.Empty;
                TxtSubjectFormatValue.StringValue = (NSString)string.Empty;
            };

            BtnRemoveSubjectFormat.Activated += (object sender, EventArgs e) => {
                if (LstSubjectFormat.SelectedRows.Count > 0)
                {
                    foreach (var row in LstSubjectFormat.SelectedRows)
                    {
                        var source = LstSubjectFormat.DataSource as DictionaryDataSource;
                        var name   = source.Entries[(int)row];
                        ExternalIdentityProviderDto.SubjectFormats.Remove(name);
                    }
                    ReloadTableView(LstSubjectFormat, ExternalIdentityProviderDto.SubjectFormats);
                }
            };
            ReloadTableView(LstSubjectFormat, ExternalIdentityProviderDto.SubjectFormats);

            // Certificates
            BtnAddCertificate.Activated += (object sender, EventArgs e) => {
                var openPanel = new NSOpenPanel();
                openPanel.ReleasedWhenClosed = true;
                openPanel.Prompt             = "Select file";

                var result = openPanel.RunModal();
                if (result == 1)
                {
                    var filePath = Uri.UnescapeDataString(openPanel.Url.AbsoluteString.Replace("file://", string.Empty));
                    var cert     = new X509Certificate2();
                    ActionHelper.Execute(delegate() {
                        cert.Import(filePath);
                        var certfificateDto = new CertificateDto {
                            Encoded = cert.ExportToPem(),
                        };
                        ExternalIdentityProviderDto.SigningCertificates.Certificates.Add(certfificateDto);
                        ReloadCertificates();
                    });
                }
            };

            BtnRemoveCertificate.Activated += (object sender, EventArgs e) => {
                if (LstCertificates.SelectedRows.Count > 0)
                {
                    foreach (var row in LstCertificates.SelectedRows)
                    {
                        ExternalIdentityProviderDto.SigningCertificates.Certificates.RemoveAt((int)row);
                    }
                    ReloadCertificates();
                }
            };
            ReloadCertificates();

            // Sso Services
            BtnAddSso.Activated    += OnAddSsoServices;
            BtnRemoveSso.Activated += OnRemoveSsoServices;
            InitializeSsoServices();

            // Slo Services
            BtnAddSlo.Activated    += OnAddSloServices;
            BtnRemoveSlo.Activated += OnRemoveSloServices;
            InitializeSloServices();

            this.BtnSave.Activated += (object sender, EventArgs e) => {
                if (string.IsNullOrEmpty(TxtUniqueId.StringValue))
                {
                    UIErrorHelper.ShowAlert("Please choose a Unique Id", "Alert");
                }
                else if (string.IsNullOrEmpty(TxtAlias.StringValue))
                {
                    UIErrorHelper.ShowAlert("Alias cannot be empty", "Alert");
                }
                else if (ExternalIdentityProviderDto.NameIDFormats.Count() < 1)
                {
                    UIErrorHelper.ShowAlert("Please choose a Name Id format", "Alert");
                }
                else if (ExternalIdentityProviderDto.SubjectFormats.Count() < 1)
                {
                    UIErrorHelper.ShowAlert("Please choose a Subject Id format", "Alert");
                }
                else if (ExternalIdentityProviderDto.SsoServices.Count() < 1)
                {
                    UIErrorHelper.ShowAlert("Please choose a Sso Service", "Alert");
                }
                else if (ExternalIdentityProviderDto.SloServices.Count() < 1)
                {
                    UIErrorHelper.ShowAlert("Please choose a Slo service", "Alert");
                }
                else if (ExternalIdentityProviderDto.SigningCertificates.Certificates.Count() < 1)
                {
                    UIErrorHelper.ShowAlert("Please choose a certificate", "Alert");
                }
                else
                {
                    ExternalIdentityProviderDto.EntityID   = TxtUniqueId.StringValue;
                    ExternalIdentityProviderDto.Alias      = TxtAlias.StringValue;
                    ExternalIdentityProviderDto.JitEnabled = ChkJit.StringValue == "1";

                    ActionHelper.Execute(delegate {
                        var auth = SnapInContext.Instance.AuthTokenManager.GetAuthToken(ServerDto.ServerName);
                        SnapInContext.Instance.ServiceGateway.MacExternalIdentityProviderService.Create(ServerDto, TenantName, ExternalIdentityProviderDto, auth.Token);
                        this.Close();
                        NSApplication.SharedApplication.StopModalWithCode(1);
                    });
                }
            };

            BtnClose.Activated += (object sender, EventArgs e) => {
                this.Close();
                NSApplication.SharedApplication.StopModalWithCode(0);
            };
            BtnViewCertificate.Activated += (object sender, EventArgs e) =>
            {
                if (LstCertificates.SelectedRows.Count > 0)
                {
                    var row         = LstCertificates.SelectedRows.First();
                    var encoded     = ExternalIdentityProviderDto.SigningCertificates.Certificates[(int)row].Encoded;
                    var bytes       = System.Text.Encoding.ASCII.GetBytes(encoded);
                    var certificate = new X509Certificate2(bytes);
                    CertificateService.DisplayX509Certificate2(this, certificate);
                }
            };
        }
コード例 #4
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            //Events
            this.BtnAcquireToken.Activated += OnClickAddButton;
            this.BtnClose.Activated        += (object sender, EventArgs e) => {
                this.Close();
                NSApplication.SharedApplication.StopModalWithCode(0);
            };
            this.BtnSelectCertificate.Activated += (object sender, EventArgs e) => {
                var openPanel = new NSOpenPanel();
                openPanel.ReleasedWhenClosed = true;
                openPanel.Prompt             = "Select file";

                var result = openPanel.RunModal();
                if (result == 1)
                {
                    var filePath = openPanel.Url.AbsoluteString.Replace("file://", string.Empty);
                    var cert1    = new X509Certificate2();
                    ActionHelper.Execute(delegate() {
                        cert1.Import(filePath);
                        TxtCertificate.StringValue = filePath;
                    });
                }
            };
            this.BtnSelectPrivateKey.Activated += (object sender, EventArgs e) => {
                var openPanel = new NSOpenPanel();
                openPanel.ReleasedWhenClosed = true;
                openPanel.Prompt             = "Select file";
                var result = openPanel.RunModal();
                if (result == 1)
                {
                    var filePath = openPanel.Url.AbsoluteString.Replace("file://", string.Empty);

                    ActionHelper.Execute(delegate() {
                        TxtPrivateKey.StringValue = filePath;
                    });
                }
            };
            this.BtnBrowseTokenFile.Activated += (object sender, EventArgs e) => {
                var openPanel = new NSOpenPanel();
                openPanel.ReleasedWhenClosed = true;
                openPanel.Prompt             = "Select file";
                var result = openPanel.RunModal();
                if (result == 1)
                {
                    var filePath = openPanel.Url.AbsoluteString.Replace("file://", string.Empty);
                    ActionHelper.Execute(delegate() {
                        TxtTokenFile.StringValue = filePath;
                    });
                }
            };
            this.CbSaml.Activated += (object sender, EventArgs e) => {
                var legacy = this.CbSaml.StringValue == "1";
                this.TxtStsUrl.Hidden = !legacy;
                this.LblStsUrl.Hidden = !legacy;
                SetUrl(this, EventArgs.Empty);
                PnlJwt.Hidden  = legacy;
                PnlSaml.Hidden = !legacy;
            };
            this.RdoTypeGroup.Activated += (object sender, EventArgs e) => {
                SetGroupControls();
            };
            this.TxtServer.Changed += SetUrl;
            this.TxtPort.Changed   += SetUrl;
            this.TxtStsUrl.Changed += SetUrl;
            this.TxtTenant.Changed += SetUrl;
            this.CbSsl.Activated   += SetUrl;
            var saml = false;

            this.RdoTypeGroup.SelectCellWithTag(1);
            SetGroupControls();

            if (ServerDto != null)
            {
                this.TxtServer.StringValue = ServerDto.ServerName;
                this.TxtStsUrl.StringValue = ServerDto.TokenType == TokenType.SAML ? (string.IsNullOrEmpty(ServerDto.StsUrl) ? "sts/STSService" : ServerDto.StsUrl) : "sts/STSService";
                this.TxtPort.StringValue   = ServerDto.Port;
                this.TxtTenant.StringValue = ServerDto.Tenant;
                saml = ServerDto.TokenType == TokenType.SAML;
                var auth = SnapInContext.Instance.AuthTokenManager.GetAuthToken(ServerDto.ServerName);
                if (auth != null && auth.Login != null)
                {
                    TxtUsername.StringValue    = auth.Login.User;
                    TxtDomain.StringValue      = auth.Login.DomainName;
                    this.TxtTenant.StringValue = auth.Login.DomainName;
                }
            }
            this.CbSaml.StringValue = saml ? "1" : "0";
            PnlJwt.Hidden           = saml;
            PnlSaml.Hidden          = !saml;
            TxtStsUrl.Hidden        = !saml;
            LblStsUrl.Hidden        = !saml;
            SetUrl(this, EventArgs.Empty);
        }
コード例 #5
0
 protected string GetPageViewLink(Page page)
 {
     return(ActionHelper.GetViewPagePath(this.ResolveUrlLC("Default.aspx"), HttpUtility.HtmlDecode(page.PageName)));
 }
コード例 #6
0
ファイル: ViewContext.cs プロジェクト: x335/WootzJs
 public ViewContext()
 {
     Action = new ActionHelper();
     Url = new UrlHelper();
 }
コード例 #7
0
ファイル: SignFormNew.cs プロジェクト: heng222/MyRepository
        private void DoLogin(SignInfo sign, string password)
        {
            //lblState.Text = "Is validating the user info......";
            //btnSave.Enabled = false;
            //txtServerName.Enabled = false;
            //txtConnectPWD.Enabled = false;
            if (string.IsNullOrEmpty(password) || password.Trim() == "")
            {
                password = "******";
            }

            connStatus.Login = sign.Controller.UserManager.Login("adm", "123", p =>
            {
                if (p.IsSuccessed)
                {
                    //sign.LoginInfomation.UserName = sign.LoginInfomation.UserName;
                    //sign.LoginInfomation.Password = password;
                    //UpdateSignInfo();

                    this.picSuccess.Image            = Resources.Resource.GetImage(Resources.Resource.Images.Pass);
                    System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
                    timer.Tick    += new EventHandler(timer_tick2);
                    timer.Interval = 200;
                    timer.Start();
                    Thread.Sleep(1000);
                    this.Result = true;
                    if (IsTreeList)
                    {
                        int h       = sign.Height;
                        int w       = sign.Width;
                        sign.Height = 10000;
                        sign.Width  = 10000;
                        LocalMessageBus.Send(this, new DataChangedMessage(PWDataType.Dashboard));
                        LocalMessageBus.Send(this, new ActiveChange(sign, false));

                        sign.Height = h;
                        sign.Width  = w;

                        ControlService.DashboardTree.DashboardTreeList.Cursor = Cursors.Default;
                        ControlService.DashboardTree.PopulateTree();
                        ControlService.DashboardTree.DashboardTreeList.FocusedNode = ControlService.DashboardTree.DashboardTreeList.FindNodeByFieldValue("Name", sign.Name);
                        var focusedNode = ControlService.DashboardTree.DashboardTreeList.FindNodeByFieldValue("Name", sign.Name);
                        if (focusedNode != null)
                        {
                            focusedNode.ImageIndex = 2;
                        }
                        ControlService.SignCombo.Current = sign;
                        ActionHelper.OnAfterLogin(sign.Controller.Connection.User);
                    }

                    //Close();
                }
                else
                {
                    Result                = false;
                    picError.Visible      = true;
                    lblError.Visible      = true;
                    this.btnRetry.Enabled = true;
                    this.Cursor           = Cursors.Default;
                    //picError.Image = Resources.Resource.GetImage(Resources.Resource.Images.Baffle);

                    Action successCallback = null;
                    Action failCallback    = null;
                    var action             = new LogoffAction(sign, successCallback, failCallback, false);
                    action.Perform();
                    OnLoginFailed(p.Packet);
                }
                connStatus = null;
            });
            if (IsTreeList)
            {
                ControlService.DashboardTree.DashboardTreeList.Cursor = Cursors.Default;
            }
        }
コード例 #8
0
 public void OnLoginUserClicked(object sender, EventArgs e)
 {
     ActionHelper.Execute(delegate() {
         NSNotificationCenter.DefaultCenter.PostNotificationName("LoginAsUser", this);
     });
 }
コード例 #9
0
        public override void Perform()
        {
            if (_isConfirm && MsgBox.Confirm("Confirm Sign Disconnect?") == System.Windows.Forms.DialogResult.No)
            {
                return;
            }
            var sign = _sign == null ? ControlService.SignCombo.Current : _sign;

            var controller = sign.Controller;
            var libFiles   = new List <UfeFile>();

            if (controller.Connection.State != System.Communication.ConnectionState.Opened)
            {
                return;
            }

            if (controller.Connection.User.Status == UserStatus.Online)
            {
                DataGate.Log.Info("Start logoff.");
                //Do Logoff
                controller.SendAsync(Commands.Logoff, p =>
                {
                    var closeTask = controller.Connection.Close();
                    if (!closeTask.IsCompleted)
                    {
                        closeTask.Wait();
                    }

                    if (closeTask.IsSuccessed)
                    {
                        DataGate.Log.Info("Logoff successed");
                        if (_successCallback != null)
                        {
                            _successCallback();
                        }
                    }
                    else
                    {
                        DataGate.Log.Error("Logoff failed. ");
                        if (_failCallback != null)
                        {
                            _failCallback();
                        }
                    };
                });
            }
            else
            {
                DataGate.Log.Info("Start disconnect.");
                var closeTask = controller.Connection.Close();
                if (!closeTask.IsCompleted)
                {
                    closeTask.Wait();
                }

                if (closeTask.IsSuccessed)
                {
                    DataGate.Log.Info("Disconnect successed");
                    if (_successCallback != null)
                    {
                        _successCallback();
                    }
                }
                else
                {
                    DataGate.Log.Error("Disconnect failed.");
                    if (_failCallback != null)
                    {
                        _failCallback();
                    }
                }
            }
            var focusedNode = ControlService.DashboardTree.FocusedNode;

            if (focusedNode != null)
            {
                focusedNode.ImageIndex = DashboardTree._.SignImageIndex;
            }
            sign.IsBlankSign = true;
            sign.IsConnected = "Disconnected";
            ActionHelper.OnDisconnected(false);
            ControlService.DashboardTree.PopulateTree();
        }
コード例 #10
0
        private string PrepereEmptyString(string format, bool isFile, bool isSearchResultExists)
        {
            commentList.Visible = false;
            var mainOptions         = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant;
            var rxLinkCreatePlace   = new Regex(@"{0([\s\S]+?)}", mainOptions);
            var rxLinkSearchResult  = new Regex(@"{1([\s\S]+?)}", mainOptions);
            var rxSearchResultParth = new Regex(@"\[\[([\s\S]+?)\]\]", mainOptions);
            var result = format;

            foreach (Match match in rxLinkCreatePlace.Matches(format))
            {
                if (isFile)
                {
                    if (CommunitySecurity.CheckPermissions(Common.Constants.Action_UploadFile) && !MobileDetector.IsMobile)
                    {
                        result = result.Replace(match.Value, string.Format(@"<a href=""{0}"">{1}</a>", ActionHelper.GetEditFilePath(this.ResolveUrlLC("Default.aspx"), PageNameUtil.Decode(WikiPage)), match.Groups[1].Value));
                    }
                }
                else
                {
                    if (CommunitySecurity.CheckPermissions(Common.Constants.Action_AddPage))
                    {
                        result = result.Replace(match.Value, string.Format(@"<a href=""{0}"">{1}</a>", ActionHelper.GetEditPagePath(this.ResolveUrlLC("Default.aspx"), PageNameUtil.Decode(WikiPage)), match.Groups[1].Value));
                    }
                    else
                    {
                        result = result.Replace(match.Value, match.Groups[1].Value);
                    }
                }
            }

            if (isSearchResultExists && !isFile)
            {
                result = rxSearchResultParth.Replace(result, SearchResultParthMatchEvaluator);

                foreach (Match match in rxLinkSearchResult.Matches(format))
                {
                    result = result.Replace(match.Value, string.Format(@"<a href=""{0}"">{1}</a>", this.ResolveUrlLC(string.Format("Search.aspx?Search={0}&pn=", HttpUtility.UrlEncode(PageNameUtil.Decode(WikiPage)))), match.Groups[1].Value));
                }
            }
            else
            {
                result = rxSearchResultParth.Replace(result, string.Empty);
            }

            return(result);
        }
コード例 #11
0
        protected void InitPageActionPanel()
        {
            var sb         = new StringBuilder();
            var canEdit    = false;
            var canDelete  = false;
            var subscribed = false;

            if (_wikiObjOwner != null)
            {
                var secObj = new WikiObjectsSecurityObject(_wikiObjOwner);
                canEdit   = CommunitySecurity.CheckPermissions(secObj, Common.Constants.Action_EditPage);
                canDelete = CommunitySecurity.CheckPermissions(secObj, Common.Constants.Action_RemovePage) &&
                            !string.IsNullOrEmpty(_wikiObjOwner.GetObjectId().ToString());
            }

            if (SecurityContext.IsAuthenticated && (Action.Equals(ActionOnPage.CategoryView) || Action.Equals(ActionOnPage.View)))
            {
                var subscriptionProvider = WikiNotifySource.Instance.GetSubscriptionProvider();
                var userList             = new List <string>();
                var IAmAsRecipient       = (IDirectRecipient)WikiNotifySource.Instance.GetRecipientsProvider().GetRecipient(SecurityContext.CurrentAccount.ID.ToString());

                if (IAmAsRecipient != null)
                {
                    userList = new List <string>(
                        subscriptionProvider.GetSubscriptions(
                            Community.Wiki.Common.Constants.EditPage,
                            IAmAsRecipient)
                        );
                }

                var pageName = WikiPage ?? string.Empty;
                subscribed = userList.Exists(s => string.Compare(s, pageName, StringComparison.InvariantCultureIgnoreCase) == 0 || (s == null && string.Empty.Equals(pageName)));
                var SubscribeTopicLink = string.Format(CultureInfo.CurrentCulture, string.Format(CultureInfo.CurrentCulture,
                                                                                                 "<a id=\"statusSubscribe\" class=\"follow-status " +
                                                                                                 (subscribed ? "subscribed" : "unsubscribed") +
                                                                                                 "\" title=\"{0}\" href=\"#\"></a>",
                                                                                                 !subscribed ? WikiResource.NotifyOnEditPage : WikiResource.UnNotifyOnEditPage));

                SubscribeLinkBlock.Text = SubscribeTopicLink;
            }

            var delURL = string.Format(@"javascript:if(confirm('{0}')) __doPostBack('{1}', '');", WikiResource.cfmDeletePage, _Default_GetDelUniqId());

            sb.Append("<div id=\"WikiActionsMenuPanel\" class=\"studio-action-panel\">");
            sb.Append("<ul class=\"dropdown-content\">");
            sb.AppendFormat("<li><a class=\"dropdown-item\" href=\"{0}\">{1}</a></li>",
                            ActionHelper.GetViewPagePath(this.ResolveUrlLC("pagehistorylist.aspx"), WikiPage),
                            WikiResource.menu_ShowVersions);

            sb.AppendFormat("<li><a class=\"dropdown-item\" href=\"javascript:window.print();\">{0}</a></li>", WikiResource.menu_PrintThePage);

            if (canEdit)
            {
                sb.AppendFormat("<li><a class=\"dropdown-item\" href=\"{0}\">{1}</a></li>",
                                ActionHelper.GetEditPagePath(this.ResolveUrlLC("default.aspx"), WikiPage),
                                WikiResource.menu_EditThePage);
            }

            if (canDelete)
            {
                sb.AppendFormat("<li><a class=\"dropdown-item\" href=\"{0}\">{1}</a></li>", delURL, WikiResource.menu_DeleteThePage);
            }

            sb.Append("</ul>");
            sb.Append("</div>");

            ActionPanel.Text = sb.ToString();

            sb = new StringBuilder();

            sb.AppendLine("var notyfy = " + subscribed.ToString().ToLower(CultureInfo.CurrentCulture) + ";");
            sb.AppendLine("var pageId = \"" + HttpUtility.HtmlEncode((Page as WikiBasePage).WikiPage).EscapeString() + "\";");
            sb.AppendLine("jq(\"#statusSubscribe\").on(\"click\", function(){");
            sb.AppendLine("AjaxPro.onLoading = function(b) {");
            sb.AppendLine("if(b) LoadingBanner.displayLoading();");
            sb.AppendLine("else LoadingBanner.hideLoading();");
            sb.AppendLine("}");
            sb.AppendLine("MainWikiAjaxMaster.SubscribeOnEditPage(notyfy, pageId, callbackNotifyWikiPage);");
            sb.AppendLine("});");
            sb.AppendLine("function callbackNotifyWikiPage(result){notyfy = result.value;");
            sb.AppendLine("if(!notyfy){");
            sb.AppendLine("jq(\"#statusSubscribe\").removeClass(\"subscribed\").addClass(\"unsubscribed\");");
            sb.AppendFormat("jq(\"#statusSubscribe\").attr(\"title\", \"{0}\");", WikiResource.NotifyOnEditPage);
            sb.AppendLine("} else {");
            sb.AppendLine("jq(\"#statusSubscribe\").removeClass(\"unsubscribed\").addClass(\"subscribed\");");
            sb.AppendFormat("jq(\"#statusSubscribe\").attr(\"title\", \"{0}\");", WikiResource.UnNotifyOnEditPage);
            sb.AppendLine("}};");

            Page.RegisterInlineScript(sb.ToString());
        }
コード例 #12
0
        public async Task <ActionResultDto> Execute(ContextDto context)
        {
            GetListKhoPhieuChuyenByCriteriaBiz biz = new GetListKhoPhieuChuyenByCriteriaBiz(context);
            var result = new ActionResultDto();

            try
            {
                var _draw   = Protector.Int(draw);
                var _start  = Protector.Int(start);
                var _length = Protector.Int(length);

                /* =========================
                 * fixed input
                 * ========================= */
                sortName = string.IsNullOrEmpty(sortName) ? "PhieuChuyenId" : sortName;
                sortDir  = string.IsNullOrEmpty(sortDir) ? "asc" : sortDir;
                _length  = _length < 1 ? 10 : _length;
                fields   = string.IsNullOrEmpty(fields) ? "*" : fields;
                if (search != null && search != "")
                {
                    try
                    {
                        if (search.Split('|')[0] != "" && search.Split('|')[0] != "__/__/____")
                        {
                            biz.START_DATE = DateTime.ParseExact(search.Split('|')[0], "dd/MM/yyyy", CultureInfo.GetCultureInfo("fr-FR")).ToString("yyyy-MM-dd");
                        }
                    }
                    catch
                    {
                        biz.START_DATE = "";
                    }
                    try
                    {
                        if (search.Split('|')[1] != "" && search.Split('|')[1] != "__/__/____")
                        {
                            biz.END_DATE = DateTime.ParseExact(search.Split('|')[1], "dd/MM/yyyy", CultureInfo.GetCultureInfo("fr-FR")).ToString("yyyy-MM-dd");
                        }
                    }
                    catch
                    {
                        biz.END_DATE = "";
                    }
                    biz.KHO_HANG   = search.Split('|')[2];
                    biz.TRANG_THAI = search.Split('|')[3];
                }
                var orderClause = sortName + " " + sortDir;
                var total       = 0;
                biz.SEARCH_STRING = searchstring;
                biz.LOGIN_ID      = LoginId;
                biz.FIELD         = fields;
                biz.ORDER_CLAUSE  = orderClause;
                biz.SKIP          = _start;
                biz.TAKE          = _length;
                IEnumerable <dynamic> listPhieuChuyen = await biz.Execute();

                if (listPhieuChuyen.Count() > 0)
                {
                    var obj = listPhieuChuyen.FirstOrDefault();

                    total = Protector.Int(obj.MAXCNT);
                }

                dynamic _metaData = new System.Dynamic.ExpandoObject();
                _metaData.draw  = _draw;
                _metaData.total = total;

                return(ActionHelper.returnActionResult(HttpStatusCode.OK, listPhieuChuyen, _metaData));
            }
            catch (Exception ex)
            {
                result.ReturnCode = HttpStatusCode.InternalServerError;
                result.ReturnData = new
                {
                    error = new
                    {
                        code    = HttpStatusCode.InternalServerError,
                        type    = HttpStatusCode.InternalServerError.ToString(),
                        message = ex.InnerException != null ? ex.InnerException.Message : ex.Message
                    }
                };
                return(result);
            }
        }
コード例 #13
0
 public static RootedTimeout Launch(Action callback, long dueTime, CancellationToken token)
 {
     return(Launch(callback, ActionHelper.GetNoopAction(), dueTime, token));
 }
コード例 #14
0
 /// <summary>
 ///     Pauses the player.
 /// </summary>
 public void Pause()
 {
     ActionHelper.Try(() => BackgroundMediaPlayer.Current.Pause(), 2);
 }
コード例 #15
0
ファイル: ActionHelper.cs プロジェクト: rodydavis/Space-Sonic
 // Setiap objek Awake.
 void Awake()
 {
     // menginstance this, supaya Actionhelper static (Accessable).
     instanceAction = this;
 }
コード例 #16
0
ファイル: Manager.cs プロジェクト: HaKDMoDz/kinectQlikView
        /// <summary>
        /// Create Helpers to manage the streams from the Kinect Sensor
        /// </summary>
        public void CreateHelpers()
        {
            LogHelper.logInput("Create Helpers", LogHelper.logType.INFO, "Manager");

            ////
            //   Kinect
            ////
            kinectMgr = QlikMove.Kinect.KinectHelper.Instance;

            ////
            //  Gesture Helper
            ////
            GestureMgr = GestureHelper.Instance;
            //add the callback method when an event is triggered
            GestureMgr.EventRecognised += new EventHandler<QlikMove.StandardHelper.EventArguments.QlikMoveEventArgs>(this.Event_EventRecognised);

            ////
            //  AudioStream
            ////
            VoiceMgr = VoiceHelper.Instance;

            ////
            //  Launch the ActionRecogniser with its method
            ////
            ActionMgr = ActionHelper.Instance;
        }
コード例 #17
0
        private void PrintResultBySave(SaveResult result, string pageName)
        {
            var infoType = InfoType.Info;

            if (!result.Equals(SaveResult.Ok) && !result.Equals(SaveResult.NoChanges))
            {
                infoType = InfoType.Alert;
            }

            switch (result)
            {
            case SaveResult.SectionUpdate:
                Response.RedirectLC(ActionHelper.GetViewPagePath(this.ResolveUrlLC("Default.aspx"), pageName), this);
                break;

            case SaveResult.OkPageRename:
            case SaveResult.Ok:
                PrintInfoMessage(WikiResource.msgSaveSucess, infoType);
                if (Action.Equals(ActionOnPage.AddNew))
                {
                    Response.RedirectLC(ActionHelper.GetEditPagePath(this.ResolveUrlLC("Default.aspx"), pageName), this);
                }
                else if (Action.Equals(ActionOnPage.AddNewFile))
                {
                    Response.RedirectLC(ActionHelper.GetEditFilePath(this.ResolveUrlLC("Default.aspx"), pageName), this);
                }
                break;

            case SaveResult.FileEmpty:
                PrintInfoMessage(WikiResource.msgFileEmpty, infoType);
                break;

            case SaveResult.FileSizeExceeded:
                PrintInfoMessage(FileSizeComment.GetFileSizeExceptionString(FileUploader.MaxUploadSize), infoType);
                break;

            case SaveResult.NoChanges:
                PrintInfoMessage(WikiResource.msgNoChanges, infoType);
                break;

            case SaveResult.PageNameIsEmpty:
                PrintInfoMessage(WikiResource.msgPageNameEmpty, infoType);
                break;

            case SaveResult.PageNameIsIncorrect:
                PrintInfoMessage(WikiResource.msgPageNameIncorrect, infoType);
                break;

            case SaveResult.SamePageExists:
                PrintInfoMessage(WikiResource.msgSamePageExists, infoType);
                break;

            case SaveResult.UserIdIsEmpty:
                PrintInfoMessage(WikiResource.msgInternalError, infoType);
                break;

            case SaveResult.OldVersion:
                PrintInfoMessage(WikiResource.msgOldVersion, infoType);
                break;

            case SaveResult.Error:
                PrintInfoMessage(WikiResource.msgMarkupError, InfoType.Alert);
                break;
            }
        }
コード例 #18
0
 protected string GetFileLink(string FileName)
 {
     return(ActionHelper.GetViewFilePath(mainPath, FileName));
 }
コード例 #19
0
        private static async Task <AsanaResponse <T> > UseRequest <T>(string resource, Action <HttpRequestMessage, RequestParametersContainer> action = null) where T : class, new()
        {
            AsanaResponse <T> response = null;

            try
            {
                response = await GetResponse <T>(resource, action);

                switch (response.StatusCode)
                {
                case HttpStatusCode.ServiceUnavailable:
                    response.StatusDescription = "Asana service is not available. Try later please";
                    break;

                case HttpStatusCode.BadGateway:
                    response.StatusDescription = "Asana service is not available. Try later please";
                    break;

                case HttpStatusCode.BadRequest:
                    ActionHelper.SafeExecute(() =>
                    {
                        response.Errors =
                            JsonConvert.DeserializeObject <AsanaErrors>(
                                response.Content);
                    });

                    break;

                case HttpStatusCode.OK:
                case HttpStatusCode.Created:
                    response.Data = JsonConvert.DeserializeObject <DataClass <T> >(response.Content).data;
                    break;

                case HttpStatusCode.Unauthorized:
                    break;

                case HttpStatusCode.Forbidden:
                    response.StatusDescription = "Forbidden request to Asana service";
                    break;

                case (HttpStatusCode)429:
                    response.StatusDescription = "Asana service is not available. Try later please";
                    break;

                case 0:
                case HttpStatusCode.NotFound:
                    response.StatusDescription = "Asana service is not available. Try later please";

                    if (!string.IsNullOrEmpty(response.Content))
                    {
                        ActionHelper.SafeExecute(() =>
                        {
                            response.Errors =
                                JsonConvert.DeserializeObject <AsanaErrors>(
                                    response.Content);
                        });
                    }

                    break;

                default:
                    throw new Exception(string.Format("Unhandled status code {0}", response.StatusCode));
                }


                return(response);
            }
            catch (Exception e)
            {
                throw;
            }
        }
コード例 #20
0
        public async Task <ActionResultDto> Execute(ContextDto context)
        {
            try
            {
                init();
                validate();

                var biz = new UpdateKhoPhieuXuatBiz(context);
                biz.PhieuXuatId    = _PhieuXuat.PhieuXuatId;
                biz.ChiPhi         = _PhieuXuat.ChiPhi ?? 0;
                biz.LoaiPhieu      = _PhieuXuat.LoaiPhieu;
                biz.KhachHangId    = _PhieuXuat.KhachHangId;
                biz.DiaChi         = _PhieuXuat.DiaChi;
                biz.KhoXuat        = _PhieuXuat.KhoXuat;
                biz.NgayChungTu    = _PhieuXuat.NgayChungTu;
                biz.NgayThanhToan  = _PhieuXuat.NgayThanhToan;
                biz.NgayXuat       = _PhieuXuat.NgayXuat;
                biz.NguoiGiaoHang  = _PhieuXuat.NguoiGiaoHang;
                biz.NguoiNhanHang  = _PhieuXuat.NguoiNhanHang;
                biz.SoDienThoai    = _PhieuXuat.SoDienThoai;
                biz.NoiDung        = _PhieuXuat.NoiDung;
                biz.Seri           = _PhieuXuat.Seri;
                biz.SoHoaDon       = _PhieuXuat.SoHoaDon;
                biz.SoPhieu        = _PhieuXuat.SoPhieu;
                biz.TaiKhoanCo     = _PhieuXuat.TaiKhoanCo;
                biz.TaiKhoanGiaVon = _PhieuXuat.TaiKhoanGiaVon;
                biz.TaiKhoanKho    = _PhieuXuat.TaiKhoanKho;
                biz.TaiKhoanNo     = _PhieuXuat.TaiKhoanNo;
                biz.ThueVAT        = _PhieuXuat.ThueVAT;
                biz.TienThue       = _PhieuXuat.TienThue;
                biz.ThuKho         = _PhieuXuat.ThuKho;
                biz.Hinh           = _PhieuXuat.Hinh;
                biz.CtrVersion     = _PhieuXuat.CtrVersion;

                biz.CHI_TIET = strListChiTiet();
                biz.LOGIN_ID = _LoginId;
                var result = await biz.Execute();

                if (String.IsNullOrEmpty(biz.MESSAGE))
                {
                    var ls = new InsertKhoLuocSuAction();
                    ls.InsertKhoLuocSu(context, "KhoPhieuXuat", result.FirstOrDefault().PhieuXuatId, "Update", _LoginId);
                }
                else
                {
                    throw new BaseException(biz.MESSAGE.Split('|')[2]);
                }

                dynamic _metaData = new System.Dynamic.ExpandoObject();

                return(ActionHelper.returnActionResult(HttpStatusCode.OK, result.FirstOrDefault(), _metaData));
            }
            catch (BaseException ex)
            {
                return(ActionHelper.returnActionError(HttpStatusCode.BadRequest, ex.Message));
            }
            catch (Exception ex)
            {
                return(ActionHelper.returnActionError(HttpStatusCode.InternalServerError, ex.InnerException != null ? ex.InnerException.Message : ex.Message));
            }
        }
コード例 #21
0
 protected void cmdCancel_Click(object sender, EventArgs e)
 {
     Response.RedirectLC(ActionHelper.GetViewPagePath(this.ResolveUrlLC("PageHistoryList.aspx"), PageNameUtil.Decode(WikiPage)), this);
 }
コード例 #22
0
ファイル: SignFormNew.cs プロジェクト: heng222/MyRepository
        private void DoConnect()
        {
            this.lblError.Visible = false;
            this.picError.Visible = false;
            this.btnRetry.Enabled = false;
            this.Cursor           = Cursors.WaitCursor;
            if (IsTreeList)
            {
                ControlService.DashboardTree.DashboardTreeList.Cursor = Cursors.WaitCursor;
            }
            if (IsCancel)
            {
                if (connStatus != null)
                {
                    if (connStatus.Connection != null)
                    {
                        connStatus.Connection.Cancel();
                    }
                    else if (connStatus.Login != null)
                    {
                        connStatus.Login.Cancel();
                    }
                    connStatus = null;

                    ControlService.DashboardTree.DashboardTreeList.FocusedNode.ImageIndex = 1;
                    ActionHelper.OnDisconnected(true);

                    ControlService.DashboardTree.DashboardTreeList.Cursor = Cursors.Default;
                }
                return;
            }

            //SignInfo Current = ControlService.SignCombo.Current;

            ConnectionExceptionAction.IsCancel = false;
            IPEndPoint endPoint      = null;
            IPEndPoint proxyEndPoint = null;

            endPoint = new IPEndPoint(IPAddress.Parse(Current.LoginInfomation.IpAddress), Current.LoginInfomation.Port);
            Current.Controller.Connection.FtpUser.Account       = Current.LoginInfomation.ConnectionUserName;
            Current.Controller.Connection.FtpUser.NoSecurityPWD = Current.LoginInfomation.ConnectionPassword;

            TcpUFEConnection tcpConn = Current.Controller.Connection as TcpUFEConnection;

            if (tcpConn != null)
            {
                var connParams = new TcpConnectionParams(endPoint, proxyEndPoint, Current.LoginInfomation.ProxyType, Current.LoginInfomation.PorxyUserName, Current.LoginInfomation.PorxyPassword);
                tcpConn.Params = connParams;
            }
            ProWrite.UI.Controls.Actions.UFE.Responses.UFEResponseService.Init(Current);
            ActionHelper.OnCancelConnect();

            IFtpManager ftpMgr = Current.Controller.Connection.FtpManager;

            try
            {
                ftpMgr.Open();
                picCommunication.Image = Resources.Resource.GetImage(Resources.Resource.Images.Pass);
                Thread.Sleep(200);
                ftpMgr.IsConnected = true;
            }

            catch (Exception ex)
            {
                picError.Visible      = true;
                lblError.Visible      = true;
                this.btnRetry.Enabled = true;
                this.Cursor           = Cursors.Default;
                //picError.Image = Resources.Resource.GetImage(Resources.Resource.Images.Baffle);
                ftpMgr.IsConnected = false;
                SocketException inner = ex.InnerException as SocketException;
                if (inner != null && inner.SocketErrorCode == SocketError.TimedOut)
                {
                    //MsgBox.Warning("Unable to connect ¨C connection timed out after multiple attempts");
                }
                else
                {
                    //MsgBox.Warning("Sorry,connection failed,please check your user name or password.");
                }
                ControlService.DashboardTree.DashboardTreeList.Cursor = Cursors.Default;
                return;
            }

            connStatus = new ConnectionEntity();

            connStatus.Connection = Current.Controller.Connection.OpenAsync(p =>
            {
                ControlService.DashboardTree.Cursor = Cursors.Default;
                if (p.IsSuccessed)
                {
                    picNetWork.Image = Resources.Resource.GetImage(Resources.Resource.Images.Pass);
                    Thread.Sleep(100);
                    picConnection.Image = Resources.Resource.GetImage(Resources.Resource.Images.Pass);
                    Thread.Sleep(200);
                    DoLogin(Current, Current.LoginInfomation.Password);
                }
                else
                {
                    picError.Visible = true;
                    lblError.Visible = true;
                    //picError.Image = Resources.Resource.GetImage(Resources.Resource.Images.Baffle);
                    this.btnRetry.Enabled = true;
                    this.Cursor           = Cursors.Default;
                    connStatus            = null;
                    //_isCancelConnect = false;
                    if (!IsCancel)
                    {
                        new ConnectionExceptionAction(p.Exception).Perform();
                    }
                    ActionHelper.OnDisconnected(true);
                    ControlService.DashboardTree.DashboardTreeList.Cursor = Cursors.Default;
                }
            });
        }
コード例 #23
0
 public ResourceExtractor(ActionHelper actionHelper, string outputPath, bool replaceExisting = false)
 {
     _actionHelper   = actionHelper;
     OutputPath      = outputPath;
     ReplaceExisting = replaceExisting;
 }
コード例 #24
0
 public PageObject_ArrangeAmeeting(IWebDriver theDriver, ActionHelper theActionHelper)
 {
     //PageFactory.InitElements(theDriver, this);
     actionHelper = theActionHelper;
 }
コード例 #25
0
 public Task RawGetSystemTextJsonClass() => RawMakeRequest(() => ActionHelper.GetDeserializedClass(_systemTextJsonRepository, _accountNumber));
コード例 #26
0
ファイル: TokenWizard.cs プロジェクト: DhanashreeA/lightwave
 private void btnAdd_Click(object sender, EventArgs e)
 {
     ActionHelper.Execute(delegate()
     {
         txtSamlToken.Text    = string.Empty;
         txtIdToken.Text      = string.Empty;
         txtAccessToken.Text  = string.Empty;
         txtRefreshToken.Text = string.Empty;
         if (ValidateInputs())
         {
             var service   = SnapInContext.Instance.ServiceGateway;
             var serverDto = new ServerDto()
             {
                 Tenant = txtDefaultTenant.Text, ServerName = txtServer.Text, Port = txtPort.Text, Protocol = GetProtocol()
             };
             serverDto.TokenType = cbSaml.Checked ? TokenType.SAML : TokenType.Bearer;
             serverDto.Url       = lnkURLPreview.Text;
             serverDto.StsUrl    = cbSaml.Checked ? txtStsUri.Text : string.Empty;
             if (cbSaml.Checked)
             {
                 if (loginTab.SelectedTab == tabUser)
                 {
                     GetSamlTokenByUserCredentials(service, serverDto);
                 }
                 else if (loginTab.SelectedTab == tabGssTicket)
                 {
                     var token         = GetSamlTokenByGss(service, serverDto);
                     txtSamlToken.Text = token;
                 }
                 else if (loginTab.SelectedTab == tabSolutionUser)
                 {
                     var isValid = ValidateSolutionUserFields();
                     if (isValid)
                     {
                         var token         = GetSamlTokenByCertificate(service, serverDto);
                         txtSamlToken.Text = token;
                     }
                 }
                 else if (loginTab.SelectedTab == tabTokenFile)
                 {
                     var isValid = ValidateTokenFields();
                     if (isValid)
                     {
                         var token         = GetSamlTokenByToken(service, serverDto);
                         txtSamlToken.Text = token;
                     }
                 }
             }
             else
             {
                 if (loginTab.SelectedTab == tabUser)
                 {
                     var authToken = GetJwtTokenByUserCredentials(service, serverDto);
                     PopulateToken(authToken);
                 }
                 else if (loginTab.SelectedTab == tabSolutionUser)
                 {
                     var isValid = ValidateSolutionUserFields();
                     if (isValid)
                     {
                         var authToken = GetJwtTokenByCertificate(service, serverDto);
                         PopulateToken(authToken);
                     }
                 }
                 else if (loginTab.SelectedTab == tabGssTicket)
                 {
                     var authToken = GetJwtTokenByGssTicket(service, serverDto);
                     PopulateToken(authToken);
                 }
             }
         }
     }, null);
     close = false;
 }
コード例 #27
0
 public Task RawGetJsonNetStruct() => RawMakeRequest(() => ActionHelper.GetDeserializedStruct(_jsonNetRepository, _accountNumber));
コード例 #28
0
        public async Task <ActionResultDto> Execute(ContextDto context)
        {
            GetListKhoCongNoKhachHangByCriteriaBiz biz = new GetListKhoCongNoKhachHangByCriteriaBiz(context);
            var result = new ActionResultDto();

            try
            {
                var _draw   = Protector.Int(draw);
                var _start  = Protector.Int(start);
                var _length = Protector.Int(length);

                /* =========================
                 * fixed input
                 * ========================= */
                sortName = string.IsNullOrEmpty(sortName) ? "HangHoaId" : sortName;
                sortDir  = string.IsNullOrEmpty(sortDir) ? "asc" : sortDir;
                _length  = _length < 1 ? 10 : _length;
                fields   = string.IsNullOrEmpty(fields) ? "*" : fields;
                if (search != null && search != "")
                {
                    try
                    {
                        if (search.Split('|')[0] != "" && search.Split('|')[0] != "__/__/____")
                        {
                            biz.TuNgay = DateTime.ParseExact(search.Split('|')[0], "dd/MM/yyyy", CultureInfo.GetCultureInfo("fr-FR")).ToString("yyyy-MM-dd");
                        }
                    }
                    catch
                    {
                        biz.TuNgay = "";
                    }
                    try
                    {
                        if (search.Split('|')[1] != "" && search.Split('|')[1] != "__/__/____")
                        {
                            biz.DenNgay = DateTime.ParseExact(search.Split('|')[1], "dd/MM/yyyy", CultureInfo.GetCultureInfo("fr-FR")).ToString("yyyy-MM-dd");
                        }
                    }
                    catch
                    {
                        biz.DenNgay = "";
                    }
                    biz.KhachHangId = search.Split('|')[2];
                }
                var orderClause = sortName + " " + sortDir;
                var total       = 0;
                biz.LoginId     = LoginId;
                biz.FieldsField = fields;
                biz.OrderClause = orderClause;
                biz.Skip        = _start;
                biz.Take        = _length;
                IEnumerable <dynamic> listHangHoa = await biz.Execute();

                if (listHangHoa.Count() > 0)
                {
                    var obj = listHangHoa.FirstOrDefault();

                    total = Protector.Int(obj.MAXCNT);
                }

                dynamic _metaData = new System.Dynamic.ExpandoObject();
                _metaData.draw  = _draw;
                _metaData.total = total;

                return(ActionHelper.returnActionResult(HttpStatusCode.OK, listHangHoa, _metaData));
            }
            catch (Exception ex)
            {
                result.ReturnCode = HttpStatusCode.InternalServerError;
                result.ReturnData = new
                {
                    error = new
                    {
                        code    = HttpStatusCode.InternalServerError,
                        type    = HttpStatusCode.InternalServerError.ToString(),
                        message = ex.InnerException != null ? ex.InnerException.Message : ex.Message
                    }
                };
                return(result);
            }
        }
コード例 #29
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();
            _certificates = new List <CertificateDto> ();
            _currentStep  = WizardSteps.One;
            SetWizardStep();
            ReloadCertificates();

            //Events
            this.BtnTestConnection.Activated += TestConnection;
            this.BtnNext.Activated           += OnClickNextButton;
            this.BtnBack.Activated           += OnClickBackButton;
            this.BtnAddCertificate.Activated += (object sender, EventArgs e) => {
                var openPanel = new NSOpenPanel();
                openPanel.ReleasedWhenClosed = true;
                openPanel.Prompt             = "Select file";

                var result = openPanel.RunModal();
                if (result == 1)
                {
                    var filePath = openPanel.Url.AbsoluteString.Replace("file://", string.Empty);
                    var cert     = new X509Certificate2();
                    ActionHelper.Execute(delegate() {
                        cert.Import(filePath);
                        var certfificateDto = new CertificateDto {
                            Encoded = cert.ExportToPem(), Chain = cert.GetFormattedThumbPrint()
                        };
                        _certificates.Add(certfificateDto);
                        ReloadCertificates();
                    });
                }
            };

            this.RdoIdentitySource.Activated += (object sender, EventArgs e) =>
            {
                SetSpnControls();
            };
            this.RdoDomainController.Activated += (object sender, EventArgs e) =>
            {
                var anyDc = RdoDomainController.SelectedTag == 1;
                if (anyDc)
                {
                    SetConnectionString();
                }
                else
                {
                    TxtLdapConnection.StringValue = (NSString)string.Empty;
                }
                ChkProtect.Enabled = anyDc;
                EnableDisableConnectionString(!anyDc);
            };
            this.BtnRemoveCertificate.Activated += (object sender, EventArgs e) => {
                if (LstCertificates.SelectedRows.Count > 0)
                {
                    foreach (var row in LstCertificates.SelectedRows)
                    {
                        _certificates.RemoveAt((int)row);
                    }
                    ReloadCertificates();
                }
            };
            this.BtnPrimaryImport.Activated += (object sender, EventArgs e) => {
            };

            this.BtnSecondaryImport.Activated += (object sender, EventArgs e) => {
            };
            this.TxtDomainName.Changed        += (object sender, EventArgs e) => {
                SetConnectionString();
            };

            this.ChkProtect.Activated += (object sender, EventArgs e) => {
                SetConnectionString();
            };
            this.RdoSpn.Activated += (object sender, EventArgs e) => {
                SetSpnControls();
            };
            BtnPrimaryImport.Enabled      = false;
            BtnSecondaryImport.Enabled    = false;
            this.TxtPrimaryUrl.Activated += (object sender, EventArgs e) =>
            {
                BtnPrimaryImport.Enabled = this.TxtPrimaryUrl.StringValue != null && this.TxtPrimaryUrl.StringValue.StartsWith("ldaps://");
            };
            this.TxtSecondaryConnection.Activated += (object sender, EventArgs e) =>
            {
                BtnSecondaryImport.Enabled = this.TxtSecondaryConnection.StringValue != null && this.TxtSecondaryConnection.StringValue.StartsWith("ldaps://");
            };
            BtnPrimaryImport.Activated += (object sender, EventArgs e) =>
            {
                ImportCertificates(TxtPrimaryUrl.StringValue);
            };
            BtnSecondaryImport.Activated += (object sender, EventArgs e) =>
            {
                ImportCertificates(TxtSecondaryConnection.StringValue);
            };
            if (IdentityProviderDto != null)
            {
                DtoToView();
            }
            else
            {
                IdentityProviderDto = new IdentityProviderDto();
            }
            this.BtnAdvanced.Activated += (object sender, EventArgs e) =>
            {
                var form = new ExternalDomainAdvancedSettingsController()
                {
                    IdentityProviderDto = new IdentityProviderDto
                    {
                        Schema        = IdentityProviderDto.Schema == null ? new Dictionary <string, SchemaObjectMappingDto>() :new Dictionary <string, SchemaObjectMappingDto>(IdentityProviderDto.Schema),
                        AttributesMap = IdentityProviderDto.AttributesMap == null ?  new Dictionary <string, string>() : new Dictionary <string, string>(IdentityProviderDto.AttributesMap),
                        BaseDnForNestedGroupsEnabled = IdentityProviderDto.BaseDnForNestedGroupsEnabled,
                        MatchingRuleInChainEnabled   = IdentityProviderDto.MatchingRuleInChainEnabled,
                        DirectGroupsSearchEnabled    = IdentityProviderDto.DirectGroupsSearchEnabled
                    }
                };
                var result = NSApplication.SharedApplication.RunModalForWindow(form.Window);

                if (result == 1)
                {
                    IdentityProviderDto.Schema        = GetSchema(form.IdentityProviderDto.Schema);
                    IdentityProviderDto.AttributesMap = new Dictionary <string, string>(form.IdentityProviderDto.AttributesMap);
                    IdentityProviderDto.BaseDnForNestedGroupsEnabled = form.IdentityProviderDto.BaseDnForNestedGroupsEnabled;
                    IdentityProviderDto.MatchingRuleInChainEnabled   = form.IdentityProviderDto.MatchingRuleInChainEnabled;
                    IdentityProviderDto.DirectGroupsSearchEnabled    = form.IdentityProviderDto.DirectGroupsSearchEnabled;
                }
            };
            SetSpnControls();
        }
コード例 #30
0
ファイル: ServerNode.cs プロジェクト: syeduguri/lightwave
 public void ShowHttpTransport(object sender, EventArgs e)
 {
     ActionHelper.Execute(delegate() {
         UIErrorHelper.ShowAlert("ShowHttpTransport", "Alert");
     });
 }
コード例 #31
0
 protected string GetPageLink(string PageName)
 {
     return(ActionHelper.GetViewPagePath(mainPath, PageName));
 }
コード例 #32
0
 // Use this for initialization
 void Start()
 {
     actionManager = ActionHelper.GetManager();
     currentCamera = gameObject.GetComponent<Camera>();
     gameOverStarted = false;
 }
コード例 #33
0
ファイル: Task.promise.cs プロジェクト: csharpHub/Theraot
 internal void SetPromiseCheck(Action value)
 {
     _promiseCheck = value ?? ActionHelper.GetNoopAction();
 }
コード例 #34
0
 protected new string GetPageViewLink(Page page)
 {
     return(ActionHelper.GetViewPagePathWithVersion(this.ResolveUrlLC("Default.aspx"), page.PageName, page.Version));
 }
コード例 #35
0
 public static Disposable Create()
 {
     return(new Disposable(ActionHelper.GetNoopAction()));
 }