예제 #1
0
        protected void SetStateNode(RadTreeNode node)
        {
            if (node == null)
            {
                return;
            }

            if (!node.Enabled)
            {
                node.ImageUrl  = ResourceProvider.GetImageUrl(typeof(EntityTreeView), "spacer.png", true);
                node.Category  = string.Empty;
                node.Checkable = true;
                node.Checked   = false;
            }
            else if (string.IsNullOrEmpty(node.Category) && !node.Checked)
            {
                node.ImageUrl = ResourceProvider.GetImageUrl(typeof(EntityTreeView), "unchecked.png", true);
            }
            else if (string.IsNullOrEmpty(node.Category) && node.Checked)
            {
                node.ImageUrl = ResourceProvider.GetImageUrl(typeof(EntityTreeView), "checked.png", true);
            }
            else if (node.Category == "1")
            {
                node.ImageUrl = ResourceProvider.GetIconImageUrl("add.png", IconSize.Smaller, true);
                node.CheckChildNodes();
            }
            else if (node.Category == "2")
            {
                node.ImageUrl = ResourceProvider.GetIconImageUrl("cancel.png", IconSize.Smaller, true);
                DisableChildNodes(node);
            }

            node.Checkable = false;
        }
예제 #2
0
        protected override void LoadResources()
        {
            base.LoadResources();

            GetUserGroupsButton.Text = Resources.UserLdapInfoControl_GetUserGroupsButton_Text;
            UserGroupsCommonGridView.Columns[0].HeaderText = Resources.UserLdapInfoControl_UserGroupsCommonGridView_LdapGroupNameColumn_HeaderText;
            UserGroupsCommonGridView.Columns[1].HeaderText = Resources.UserLdapInfoControl_UserGroupsCommonGridView_GroupNameColumn_HeaderText;
            UserGroupsNoteLabel.Text       = Resources.UserLdapInfoControl_UserGroupsNoteLabel_Text;
            ClearUserLdapInfoButton.Text   = Resources.UserLdapInfoControl_ClearUserLdapInfoButton_Text;
            ReconnectUserToLdapButton.Text = Resources.UserLdapInfoControl_ReconnectUserToLdapButton_Text;

            ClearUserLdapInfoUpdateProgress.ProgressText      = Resources.UserLdapInfoControl_UpdateProgress_Text;
            ClearUserLdapInfoUpdateProgress.Timeout           = int.MaxValue;
            ClearUserLdapInfoUpdateProgress.HideAfter         = -1;
            ClearUserLdapInfoUpdateProgress.ShowSuccessText   = false;
            ClearUserLdapInfoUpdateProgress.PostBackControlId = this.ClearUserLdapInfoButton.ClientID;

            //GetUserGroups
            GetUserGroupsViewProcessLiteral.Text     = Resources.UserLdapInfoControl_UpdateProgress_Text;
            GetUserGroupsViewProcessImage.ImageAlign = ImageAlign.AbsMiddle;
            GetUserGroupsViewProcessImage.ImageUrl   = ResourceProvider.GetImageUrl(typeof(UpdateProgress), "Loader.gif", true);

            //ReconnectUserToLdap
            ReconnectUserToLdapViewProcessLiteral.Text     = Resources.UserLdapInfoControl_UpdateProgress_Text;
            ReconnectUserToLdapViewProcessImage.ImageAlign = ImageAlign.AbsMiddle;
            ReconnectUserToLdapViewProcessImage.ImageUrl   = ResourceProvider.GetImageUrl(typeof(UpdateProgress), "Loader.gif", true);
        }
예제 #3
0
        private void Tree_DataBind()
        {
            Type   typeOfThis     = typeof(EntitiesControl);
            string entityImageUrl = CustomUrlProvider.CreateApplicationAbsoluteUrl(ResourceProvider.GetImageUrl(typeOfThis, "Entity.gif"));
            string fieldImageUrl  = CustomUrlProvider.CreateApplicationAbsoluteUrl(ResourceProvider.GetImageUrl(typeOfThis, "Field.gif"));
            string eventImageUrl  = CustomUrlProvider.CreateApplicationAbsoluteUrl(ResourceProvider.GetImageUrl(typeOfThis, "Event.gif"));

            foreach (Entity entity in EntityFieldProvider.Entities)
            {
                RadTreeNode entityNode = new RadTreeNode(entity.Name);
                entityNode.ImageUrl = entityImageUrl;
                Tree.Nodes.Add(entityNode);

                if (entity.EnableHierarchy)
                {
                    RadTreeNode parentNode = entityNode;
                    foreach (EntityNodeType nodeType in entity.NodeTypes)
                    {
                        RadTreeNode nodeTypeNode = new RadTreeNode(nodeType.Name);
                        nodeTypeNode.ImageUrl = entityImageUrl;
                        parentNode.Nodes.Add(nodeTypeNode);

                        foreach (EntityEvent entityEvent in nodeType.Events)
                        {
                            RadTreeNode eventNode = new RadTreeNode(entityEvent.Name);
                            eventNode.ImageUrl = eventImageUrl;
                            nodeTypeNode.Nodes.Add(eventNode);
                        }

                        parentNode = nodeTypeNode;
                    }

                    foreach (EntityEvent entityEvent in entity.CustomEvents)
                    {
                        RadTreeNode eventNode = new RadTreeNode(entityEvent.Name);
                        eventNode.ImageUrl = eventImageUrl;
                        entityNode.Nodes.Add(eventNode);
                    }
                }
                else
                {
                    foreach (EntityField field in entity.Fields)
                    {
                        RadTreeNode fieldNode = new RadTreeNode(field.Name);
                        fieldNode.ImageUrl = fieldImageUrl;
                        entityNode.Nodes.Add(fieldNode);
                    }

                    foreach (EntityEvent entityEvent in entity.Events)
                    {
                        RadTreeNode eventNode = new RadTreeNode(entityEvent.Name);
                        eventNode.ImageUrl = eventImageUrl;
                        entityNode.Nodes.Add(eventNode);
                    }
                }
            }
        }
예제 #4
0
        protected override void LoadResources()
        {
            imgGoogleAppsLogo.ImageUrl = ResourceProvider.GetImageUrl(typeof(GoogleIntegrationControl), "GoogleApps.jpg", true);

            hlGoogleAppsForBusiness.Text = Resources.GoogleIntegrationControl_GoogleAppsForBusiness_Text;

            GoogleIntegrationElement settings = FrameworkConfiguration.Current.WebApplication.Integration.Google;

            hlAddApplication.Text        = string.Format(CultureInfo.InvariantCulture, Resources.GoogleIntegrationControl_AddApplication_Text, settings.ApplicationName);
            hlAddApplication.NavigateUrl = settings.ApplicationListingUrl;

            litCaption.Text = Resources.GoogleIntegrationControl_Caption_Text;

            BaseControl.LoadResources(EditForm, typeof(OrganizationLdapSettingsControl).Name);
            lblGoogleDomain.Text   = Resources.GoogleIntegrationControl_EditForm_GoogleDomain_HeaderText;
            lblGoogleEmail.Text    = Resources.GoogleIntegrationControl_EditForm_GoogleEmail_HeaderText;
            lblGooglePassword.Text = Resources.GoogleIntegrationControl_EditForm_GooglePassword_HeaderText;
            lblTitle.Text          = Resources.GoogleIntegrationControl_EditForm_ObjectName;

            lblDescription.Text = Resources.GoogleIntegrationControl_Description_Text;
            lblGoogleSetup.Text = Resources.GoogleIntegrationControl_GoogleSetup_Text;

            lblStep1.Text = Resources.GoogleIntegrationControl_Step1_Text;
            lbStep1.Text  = Resources.GoogleIntegrationControl_Step1_LinkButton_Text;

            lbImportUsers.Text = Resources.GoogleIntegrationControl_ImportUsers_LinkButton_Text;

            upStep1Progress.ProgressText      = Resources.GoogleIntegrationControl_UpdateProgress_Text;
            upStep1Progress.Timeout           = int.MaxValue;
            upStep1Progress.HideAfter         = int.MaxValue;
            upStep1Progress.ShowSuccessText   = false;
            upStep1Progress.PostBackControlId = this.lbStep1.ClientID;

            lblStep2.Text = Resources.GoogleIntegrationControl_Step2_Text;
            lbStep2.Text  = Resources.GoogleIntegrationControl_Step2_LinkButton_Text;

            upStep2Progress.ProgressText      = Resources.GoogleIntegrationControl_UpdateProgress_Text;
            upStep2Progress.Timeout           = int.MaxValue;
            upStep2Progress.HideAfter         = int.MaxValue;
            upStep2Progress.ShowSuccessText   = false;
            upStep2Progress.PostBackControlId = this.lbStep2.ClientID;

            btnSaveToken.Text        = Resources.GoogleIntegrationControl_SaveTokenButton_Text;
            btnChangeToken.Text      = Resources.GoogleIntegrationControl_ChangTokenButton_Text;
            lblTokenDescription.Text = Resources.GoogleIntegrationControl_TokenDescription_Text;
            btnCancel.Text           = Resources.AutoGeneratedButtonsField_CancelButton_Text;

            lblYourGoogleDomain.Text = Resources.GoogleIntegrationControl_YourGoogleDomain_Text;
        }
예제 #5
0
        private void LoadResources()
        {
            OrganizationName.ErrorMessage = Resources.SignupOrganizationControl_OrganizationName_ErrorMessage;
            OrganizationNameLabel.Text    = Resources.SignupOrganizationControl_OrganizationNameLabel_Text;
            OrganizationNameHelpText.Text = Resources.SignupOrganizationControl_OrganizationNameHelpText_Text;
            OrganizationNameTick.ImageUrl = EmailTick.ImageUrl = OrganizationUrlTick.ImageUrl
                                                                     = ResourceProvider.GetImageUrl(typeof(SignupOrganizationControl), "Tick.png", true);
            Email.ErrorMessage        = Resources.SignupOrganizationControl_Email_ErrorMessage;
            EmailLabel.Text           = Resources.SignupOrganizationControl_EmailLabel_Text;
            OrganizationUrlLabel.Text = Resources.SignupOrganizationControl_OrganizationUrlLabel_Text;
            Schema.Text = Uri.UriSchemeHttps + Uri.SchemeDelimiter;
            PartialCustomUrlRootAddress.Text      = "." + FrameworkConfiguration.Current.WebApplication.CustomUrl.PartialCustomUrlRootAddressesFirst;
            OrganizationUrl.ErrorMessage          = Resources.CustomUrlProvider_CustomUrlAlreadyExists;
            OrganizationUrlValidator.ErrorMessage = Resources.CustomUrlProvider_CustomUrlAlreadyExists;
            CreateMyAccountButton.Text            = Resources.SignupOrganizationControl_CreateMyAccountButton_Text;

            ModalTitleLiteral.Text                 = Resources.SignupOrganizationControl_ModalTitleLiteral_Text;
            ModalMessageLiteral.Text               = Resources.SignupOrganizationControl_ModalMessageLiteral_Text;
            ModalSelectActionLiteral.Text          = Resources.SignupOrganizationControl_ModalSelectActionLiteral_Text;
            ModalLoginLink.Text                    = Resources.SignupOrganizationControl_ModalLoginLink_Text;
            ModalSelectActionSeparatorLiteral.Text = Resources.SignupOrganizationControl_ModalSelectActionSeparatorLiteral_Text;
            CreateMyAccountModalButton.Text        = Resources.SignupOrganizationControl_CreateMyAccountModalButton_Text;

            if (!string.IsNullOrEmpty(FrameworkConfiguration.Current.WebApplication.SmallLogoImageUrl))
            {
                ModalWindowHeader.Attributes["class"] += " bg";
                ModalWindowHeader.Style[HtmlTextWriterStyle.BackgroundImage] = "url(" + CustomUrlProvider.CreateApplicationAbsoluteUrl(FrameworkConfiguration.Current.WebApplication.SmallLogoImageUrl) + ")";
            }

            CaptchaLabel.Text = Resources.SignupOrganizationControl_CaptchaLabel_Text;
            AgreeLabel.Text   = string.Format(CultureInfo.InvariantCulture, Resources.SignupOrganizationControl_AgreeLabel_Text
                                              , BaseControl.GetHyperlink(FrameworkConfiguration.Current.WebApplication.Support.TermsUrl, Resources.SignupOrganizationControl_TermsLink_Text)
                                              , BaseControl.GetHyperlink(FrameworkConfiguration.Current.WebApplication.Support.PrivacyPolicyUrl, Resources.SignupOrganizationControl_PrivacyPolicyLink_Text));

            ErrorContinueLabel.Text = Resources.SignupOrganizationControl_ErrorContinueLabel_Text;
            ErrorContinueLink.Text  = Resources.SignupOrganizationControl_ErrorContinueLink_Text;

            if (string.IsNullOrEmpty(FrameworkConfiguration.Current.WebApplication.MobileLogoImageUrl))
            {
                LogoImage.Visible = LogoImage3.Visible = false;
            }
            else
            {
                LogoImage.ImageUrl = LogoImage3.ImageUrl = FrameworkConfiguration.Current.WebApplication.MobileLogoImageUrl;
            }
        }
예제 #6
0
        private static void Tree_SetNodeAttributes(RadTreeNode node)
        {
            if (node == null)
            {
                return;
            }

            ActionType type       = (ActionType)Enum.Parse(typeof(ActionType), node.Category);
            string     imageUrl   = null;
            Type       typeOfThis = typeof(ActionsControl);

            if (node.ParentNode == null)
            {
                imageUrl      = ResourceProvider.GetImageUrl(typeOfThis, "Folder.gif");
                node.Expanded = true;
            }

            switch (type)
            {
            case ActionType.GlobalNavigationLink:
                if (node.ParentNode != null)
                {
                    if (imageUrl == null)
                    {
                        imageUrl = ResourceProvider.GetImageUrl(typeOfThis, "HyperLink.gif");
                    }
                }
                break;

            case ActionType.Page:
                if (imageUrl == null)
                {
                    imageUrl = ResourceProvider.GetImageUrl(typeOfThis, "Page.gif");
                }
                break;

            case ActionType.Control:
                imageUrl = ResourceProvider.GetImageUrl(typeOfThis, "Control.gif");
                break;
            }

            node.ImageUrl = CustomUrlProvider.CreateApplicationAbsoluteUrl(imageUrl);
        }
예제 #7
0
            public void InstantiateIn(Control container)
            {
                if (container == null)
                {
                    return;
                }

                using (Image img = new Image())
                {
                    img.ImageAlign = ImageAlign.AbsMiddle;
                    img.ImageUrl   = ResourceProvider.GetImageUrl(typeof(UpdateProgress), "Loader.gif", true);
                    container.Controls.Add(img);
                }

                using (Label lbl = new Label())
                {
                    ApplyCommonStyle(lbl);
                    lbl.ForeColor = System.Drawing.Color.Gray;
                    lbl.Text      = m_Text;
                    container.Controls.Add(lbl);
                }
            }
예제 #8
0
        /// <summary>
        /// Renders control.
        /// </summary>
        /// <param name="writer">The HtmlTextWriter to render content to.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            if (writer == null)
            {
                return;
            }

            Unit width = Width;

            if (this.ComboBoxMode)
            {
                if ((Width.Type == UnitType.Percentage) || Width.IsEmpty)
                {
                    Width = Unit.Pixel(200);
                }

                writer.AddStyleAttribute(HtmlTextWriterStyle.Width, Width.ToString());
                writer.AddAttribute(HtmlTextWriterAttribute.Id, string.Concat(ClientID, "_container"));
                writer.AddAttribute(HtmlTextWriterAttribute.Name, string.Concat(UniqueID, "$container"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div); // Div1

                if (this.Theme == MasterPageTheme.Modern)
                {
                    writer.AddStyleAttribute("background", string.Format(CultureInfo.InvariantCulture, "url(\"{0}\") no-repeat right 6px", ResourceProvider.GetImageUrl(typeof(TreeView), "Modern.png", true)));
                    writer.AddStyleAttribute(HtmlTextWriterStyle.Height, "31px");
                }
                else
                {
                    writer.AddStyleAttribute(HtmlTextWriterStyle.PaddingRight, "19px");
                    writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
                    writer.AddStyleAttribute("border", "1px solid ActiveBorder");
                    writer.AddStyleAttribute(HtmlTextWriterStyle.Height, "19px");
                    writer.AddStyleAttribute("*height", "21px");
                    writer.AddStyleAttribute("background", string.Format(CultureInfo.InvariantCulture, "Window url(\"{0}\") no-repeat right top", ResourceProvider.GetImageUrl(typeof(TreeView), "DropArrow.gif", true)));
                }
                writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Concat("TreeView_ToggleTreeView('", this.ClientID + "');"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div); // Div2

                writer.AddAttribute(HtmlTextWriterAttribute.Id, string.Concat(ClientID, "_txt"));
                writer.AddAttribute(HtmlTextWriterAttribute.Name, string.Concat(UniqueID, "$txt"));
                writer.AddAttribute(HtmlTextWriterAttribute.Type, "text");
                writer.AddAttribute(HtmlTextWriterAttribute.ReadOnly, "readonly");
                writer.AddStyleAttribute(HtmlTextWriterStyle.Cursor, "default");
                writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
                writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundColor, "Transparent");
                if (this.Theme == MasterPageTheme.Modern)
                {
                    writer.AddStyleAttribute(HtmlTextWriterStyle.PaddingRight, "36px !important");
                }
                else
                {
                    writer.AddStyleAttribute(HtmlTextWriterStyle.VerticalAlign, "middle");
                    writer.AddStyleAttribute(HtmlTextWriterStyle.PaddingTop, "2px");
                    writer.AddStyleAttribute("border", "0 none");
                }

                string value = SelectedValues;
                if (!string.IsNullOrEmpty(value))
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Value, value);
                }

                writer.RenderBeginTag(HtmlTextWriterTag.Input); // Input
                writer.RenderEndTag();                          // Input

                writer.RenderEndTag();                          // Div2

                if (this.Theme == MasterPageTheme.Modern)
                {
                    Style.Add(HtmlTextWriterStyle.BorderColor, "#646464");
                    Style.Add(HtmlTextWriterStyle.MarginTop, "-1px");

                    if (Width.Type == UnitType.Pixel)
                    {
                        base.Width = Unit.Pixel((int)Width.Value - 2);
                    }
                }
                else
                {
                    Style.Add(HtmlTextWriterStyle.BorderColor, "ActiveBorder");
                }
                Style.Add(HtmlTextWriterStyle.Position, "absolute");
                Style.Add(HtmlTextWriterStyle.Display, "none");
                Style.Add(HtmlTextWriterStyle.BackgroundColor, "Window");
                Style.Add(HtmlTextWriterStyle.BorderStyle, "solid");
                Style.Add(HtmlTextWriterStyle.BorderWidth, "1px");
                Style.Add(HtmlTextWriterStyle.Height, "150px");
                Style.Add(HtmlTextWriterStyle.ZIndex, "500");
            }

            base.Render(writer);

            if (ComboBoxMode)
            {
                base.Width = width;
                writer.RenderEndTag(); // Div1
            }
        }
예제 #9
0
        /// <summary>
        /// Raises the PreRender event and registers client scripts.
        /// </summary>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            radFormDecorator = new RadFormDecorator();
            radFormDecorator.DecoratedControls = FormDecoratorDecoratedControls.CheckBoxes;
            Controls.Add(radFormDecorator);

            string script = @"

               function EnableAllChildren(nodes)
               {
                   var i;
                   for (i=0; i<nodes.get_count(); i++)
                   {
                       nodes.getNode(i).set_enabled(true);
                       nodes.getNode(i).set_checkable(true);
                       nodes.getNode(i).set_checked(false);
                       nodes.getNode(i).set_checkable(false);
                       nodes.getNode(i).set_imageUrl('" + ResourceProvider.GetImageUrl(typeof(EntityTreeView), "unchecked.png", true) + @"');

                       if (nodes.getNode(i).get_nodes().get_count()> 0)
                       {
                           EnableAllChildren(nodes.getNode(i).get_nodes());
                       }
                   }
               }

               function UpdateAllChildren(nodes, checked)
               {
                   var i;
                   for (i=0; i<nodes.get_count(); i++)
                   {
                       nodes.getNode(i).set_category('');
                       if (checked)
                       {
                           nodes.getNode(i).set_enabled(true);
                           nodes.getNode(i).set_checkable(true);
                           nodes.getNode(i).set_checked(true);
                           nodes.getNode(i).set_checkable(false);
                           nodes.getNode(i).set_imageUrl('" + ResourceProvider.GetImageUrl(typeof(EntityTreeView), "checked.png", true) + @"');
                       }
                       else
                       {                           
                           nodes.getNode(i).set_imageUrl('" + ResourceProvider.GetImageUrl(typeof(EntityTreeView), "spacer.png", true) + @"');    
                           nodes.getNode(i).set_checkable(true);
                           nodes.getNode(i).set_checked(false);
                           nodes.getNode(i).set_checkable(false);
                           nodes.getNode(i).set_enabled(false);
                       }
                       
                       if (nodes.getNode(i).get_nodes().get_count()> 0)
                       {
                           UpdateAllChildren(nodes.getNode(i).get_nodes(), checked);
                       }
                   }
               }

             function onClientNodeClicked(sender, eventArgs) 
             {
               var tree = $find('" + this.ClientID + @"');
               tree.trackChanges();
               var node = eventArgs.get_node();
               var childNodes = eventArgs.get_node().get_nodes();
               if (node.get_enabled())
               {
                   if ((node.get_category() == '' || node.get_category() == null) && !node.get_checked())
                   {                  
                      node.set_checkable(true);
                      node.set_checked(true);
                      node.set_checkable(false);
                      node.set_category(''); 
                      node.set_imageUrl('" + ResourceProvider.GetImageUrl(typeof(EntityTreeView), "checked.png", true) + @"');                                   
                   }
                   else if ((node.get_category() == '' || node.get_category() == null) && node.get_checked())
                   {
                      node.set_imageUrl('" + ResourceProvider.GetIconImageUrl("add.png", IconSize.Smaller, true) + @"');
                      node.set_category('1');
                      node.set_checkable(true);
                      node.set_checked(true);
                      node.set_checkable(false);
                      UpdateAllChildren(childNodes, true);
                   }
                   else if (node.get_category() == '1')
                   {
                      node.set_checkable(true);
                      node.set_checked(true);
                      node.set_checkable(false);
                      UpdateAllChildren(childNodes, false);
                      node.set_category('2');
                      node.set_imageUrl('" + ResourceProvider.GetIconImageUrl("cancel.png", IconSize.Smaller, true) + @"');              
                   }
                   else if (node.get_category() == '2')
                   {                 
                      node.set_checkable(true);
                      node.set_checked(false);
                      node.set_checkable(false);
                      node.set_category('');        
                      node.set_imageUrl('" + ResourceProvider.GetImageUrl(typeof(EntityTreeView), "unchecked.png", true) + @"');
                      EnableAllChildren(childNodes);
                   }
               }
               tree.commitChanges();
            }";

            ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "EntityTreeView_onClientNodeClicked", script, true);
        }