コード例 #1
0
 /// <summary>
 ///  Creates a link that will open a jQuery UI dialog form.
 /// </summary>
 /// <param name="linkText">The inner text of the anchor element</param>
 /// <param name="dialogContentUrl">The url that will return the content to be loaded into the dialog window</param>
 /// <param name="dialogTitle">The title to be displayed in the dialog window</param>
 /// <param name="dialogWidth">width in pixels of dialog</param>
 /// <param name="saveButtonText">Text for the save button</param>
 /// <param name="cancelButtonText">Text for the cancel button</param>
 /// <param name="extraCssClasses">Any extra css classes for the button</param>
 /// <param name="onJavascriptReadyFunction">Optional javascript function to run when dialog is loaded</param>
 /// <param name="postData">Optional; if provided, will switch the dialog load to a POST from a GET</param>
 /// <param name="disabledState">Optional; if provided, will switch the dialog load to a POST from a GET</param>
 /// <param name="hoverText">Optional; if provided, will switch the dialog load to a POST from a GET</param>
 /// <returns></returns>
 public static HtmlString ModalDialogFormLink(string linkText,
                                              string dialogContentUrl,
                                              string dialogTitle,
                                              int?dialogWidth,
                                              string saveButtonText,
                                              string cancelButtonText,
                                              List <string> extraCssClasses,
                                              string onJavascriptReadyFunction,
                                              string postData,
                                              DisabledState disabledState,
                                              string hoverText
                                              )
 {
     return(ModalDialogFormLink(null,
                                linkText,
                                dialogContentUrl,
                                dialogTitle,
                                dialogWidth,
                                SaveButtonID,
                                saveButtonText,
                                cancelButtonText,
                                extraCssClasses,
                                onJavascriptReadyFunction,
                                postData,
                                null,
                                hoverText,
                                false,
                                disabledState));
 }
コード例 #2
0
 public AdsProjectSettings(string path, SettingsScope scopes, IEnumerable <string> keywords = null)
     : base(path, scopes, k_ServiceName, keywords)
 {
     m_StateMachine = new SimpleStateMachine <AdsEvent>();
     m_StateMachine.AddEvent(AdsEvent.Enabling);
     m_StateMachine.AddEvent(AdsEvent.Disabling);
     m_EnabledState  = new EnabledState(m_StateMachine, this);
     m_DisabledState = new DisabledState(m_StateMachine, this);
     m_StateMachine.AddState(m_EnabledState);
     m_StateMachine.AddState(m_DisabledState);
 }
コード例 #3
0
        public AdsProjectSettings(string path, SettingsScope scopes, IEnumerable <string> keywords = null)
            : base(path, scopes, k_ServiceName, keywords)
        {
            m_StateMachine = new SimpleStateMachine <AdsEvent>();
            m_StateMachine.AddEvent(AdsEvent.Enabling);
            m_StateMachine.AddEvent(AdsEvent.Disabling);
            m_EnabledState  = new EnabledState(m_StateMachine, this);
            m_DisabledState = new DisabledState(m_StateMachine, this);
            m_AppleGameId   = AdvertisementSettings.GetGameId(RuntimePlatform.IPhonePlayer);
            m_AndroidGameId = AdvertisementSettings.GetGameId(RuntimePlatform.Android);

            m_StateMachine.AddState(m_EnabledState);
            m_StateMachine.AddState(m_DisabledState);
        }
コード例 #4
0
        public AnalyticsProjectSettings(string path, SettingsScope scopes, IEnumerable <string> keywords = null)
            : base(path, scopes, k_ServiceName, keywords)
        {
            m_StateMachine = new SimpleStateMachine <ServiceEvent>();

            m_StateMachine.AddEvent(ServiceEvent.Disabled);
            m_StateMachine.AddEvent(ServiceEvent.Integrating);
            m_StateMachine.AddEvent(ServiceEvent.Enabled);

            m_DisabledState    = new DisabledState(m_StateMachine, this);
            m_IntegrationState = new IntegrationState(m_StateMachine, this);
            m_EnabledState     = new EnabledState(m_StateMachine, this);

            m_StateMachine.AddState(m_DisabledState);
            m_StateMachine.AddState(m_IntegrationState);
            m_StateMachine.AddState(m_EnabledState);

            m_ValidationPoller = new AnalyticsValidationPoller();
        }
コード例 #5
0
        /// <summary>
        ///     Creates a link that will open a jQuery UI dialog form.
        ///     Adds additional parameters controlling button IDs if needed.
        /// </summary>
        /// <param name="linkID">Optional LinkID to be able to access it later on the page</param>
        /// <param name="linkText">The inner text of the anchor element</param>
        /// <param name="dialogContentUrl">The url that will return the content to be loaded into the dialog window</param>
        /// <param name="dialogTitle">The title to be displayed in the dialog window</param>
        /// <param name="dialogWidth">width in pixels of dialog</param>
        /// <param name="saveButtonID">ID for the save button for later reference by jQuery, etc. Take care to make unique!</param>
        /// <param name="saveButtonText">Text for the save button</param>
        /// <param name="cancelButtonText">Text for the cancel button</param>
        /// <param name="extraCssClasses">Any extra css classes for the button</param>
        /// <param name="onJavascriptReadyFunction">Optional javascript function to run when dialog is loaded</param>
        /// <param name="postData">Optional; if provided, will switch the dialog load to a POST from a GET</param>
        /// <param name="optionalDialogFormID"></param>
        /// <param name="hoverText"></param>
        /// <param name="skipAjax"></param>
        /// <param name="disabledState"></param>
        /// <returns></returns>
        public static HtmlString ModalDialogFormLink(string linkID,
                                                     string linkText,
                                                     string dialogContentUrl,
                                                     string dialogTitle,
                                                     int?dialogWidth,
                                                     string saveButtonID,
                                                     string saveButtonText,
                                                     string cancelButtonText,
                                                     List <string> extraCssClasses,
                                                     string onJavascriptReadyFunction,
                                                     string postData,
                                                     string optionalDialogFormID,
                                                     string hoverText,
                                                     bool skipAjax,
                                                     DisabledState disabledState)
        {
            var builder = new TagBuilder("a");

            builder.InnerHtml += linkText;
            if (!string.IsNullOrWhiteSpace(linkID))
            {
                builder.Attributes.Add("id", linkID);
            }

            if (disabledState == DisabledState.NotDisabled)
            {
                builder.Attributes.Add("href", dialogContentUrl);
            }
            else
            {
                builder.Attributes.Add("href", "javascript:void(0);");
                builder.Attributes.Add("style", "cursor: not-allowed;opacity: .5; ");
            }

            builder.Attributes.Add("data-dismiss", "modal");
            builder.Attributes.Add("data-dialog-title", dialogTitle);
            builder.Attributes.Add("data-dialog-width", dialogWidth.ToString());

            if (!string.IsNullOrWhiteSpace(saveButtonID))
            {
                builder.Attributes.Add("data-save-button-id", saveButtonID);
            }
            builder.Attributes.Add("data-save-button-text", saveButtonText);
            builder.Attributes.Add("data-cancel-button-text", cancelButtonText);


            if (!string.IsNullOrWhiteSpace(optionalDialogFormID))
            {
                builder.Attributes.Add("data-optional-dialog-form-id", optionalDialogFormID);
            }

            builder.Attributes.Add("data-skip-ajax", skipAjax.ToString());

            var javascripReadyFunctionAsParameter = !string.IsNullOrWhiteSpace(onJavascriptReadyFunction) ? $"function() {{{onJavascriptReadyFunction}();}}" : "null";
            var postDataAsParameter = !string.IsNullOrWhiteSpace(postData) ? postData : "null";
            var onclickFunction     = $"return modalDialogLink(this, {javascripReadyFunctionAsParameter}, {postDataAsParameter});";

            if (disabledState == DisabledState.NotDisabled)
            {
                builder.Attributes.Add("onclick", onclickFunction);
            }

            if (extraCssClasses != null)
            {
                foreach (var extraCssClass in extraCssClasses)
                {
                    builder.AddCssClass(extraCssClass);
                }
            }

            if (!string.IsNullOrWhiteSpace(hoverText))
            {
                builder.Attributes.Add("title", hoverText);
            }

            return(new HtmlString(builder.ToString()));
        }