Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _filePath = WebDialogueContext.GetDialogueParameter<string>("Path");
     if (!WAFRuntime.FileSystem.FileExists(_filePath)) WebDialogueContext.SendResult(ExchangeResult.Cancel);
     _editor = new CodeEditor();
     _editor.Language = "cs";
     _editor.Height = Unit.Percentage(100);
     _editor.Width = Unit.Percentage(100);
     pnlEditor.Controls.Add(_editor);
     _editor.Text = WAFRuntime.FileSystem.FileReadAllText(_filePath);
     MainButton btnSaveChanges = new MainButton();
     btnSaveChanges.Text = "Save";
     btnSaveChanges.Click += new EventHandler(btnSaveChanges_Click);
     Form.Controls.Add(btnSaveChanges);
     WebDialogueContext.AddDialogueButton(btnSaveChanges);
     MainButton btnSaveAndClose = new MainButton();
     btnSaveAndClose.Text = "Save & Close";
     btnSaveAndClose.Tooltip = "Save data and then close this dialog window";
     btnSaveAndClose.Click += new EventHandler(btnSaveAndClose_Click);
     Form.Controls.Add(btnSaveAndClose);
     WebDialogueContext.AddDialogueButton(btnSaveAndClose);
     MainButton btnCloseFile = new MainButton();
     btnCloseFile.Text = "Close";
     btnCloseFile.Tooltip = "Close this dialog window";
     btnCloseFile.Click += new EventHandler(btnCloseFile_Click);
     Form.Controls.Add(btnCloseFile);
     WebDialogueContext.AddDialogueButton(btnCloseFile);
 }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        lstComparisons.DblClick += new EventHandler(btnResolve_Click);

        MainButton btnResolve = new MainButton();
        btnResolve.Text = "Edit and resolve";
        this.Controls.Add(btnResolve);
        btnResolve.Click += new EventHandler(btnResolve_Click);
        WebDialogueContext.AddDialogueButton(btnResolve);

        MainButton btnLocalVersion = new MainButton();
        btnLocalVersion.Text = "Let LOCAL definition decide";
        this.Controls.Add(btnLocalVersion);
        btnLocalVersion.Click += new EventHandler(btnLocalVersion_Click);
        WebDialogueContext.AddDialogueButton(btnLocalVersion);

        MainButton btnExternalVersion = new MainButton();
        btnExternalVersion.Text = "Let EXTERNAL definition decide";
        this.Controls.Add(btnExternalVersion);
        btnExternalVersion.Click += new EventHandler(btnExternalVersion_Click);
        WebDialogueContext.AddDialogueButton(btnExternalVersion);

        MainButton btnImport = new MainButton();
        btnImport.Text = "Close and accept changes";
        this.Controls.Add(btnImport);
        btnImport.Click += btnImport_Click;
        WebDialogueContext.AddDialogueButton(btnImport);

        _comparisons = WebDialogueContext.GetDialogueParameter<List<Comparison>>("Comparisons");
        updateList();
    }
        public override void RefreshButton(Currencies playerCurrencies)
        {
            var selectedItem = GetSelectedItem();
            var haveSpace    = CanAddRewardToInventory(selectedItem);

            MainButton.interactable = selectedItem != null && selectedItem.CanClaim && haveSpace;
            var tooltip = MainButton.GetComponent <UITooltip>();

            if (tooltip != null)
            {
                tooltip.m_text = "";
                if (selectedItem != null && !selectedItem.CanClaim)
                {
                    tooltip.m_text = "$mod_epicloot_bounties_notcompletetooltip";
                }
                else if (selectedItem != null && !haveSpace)
                {
                    tooltip.m_text = "$mod_epicloot_bounties_noroomtooltip";
                }
            }

            var canAbandon = selectedItem != null && selectedItem.BountyInfo.State == BountyState.InProgress;

            AbandonButton.interactable = canAbandon;
            AbandonButtonIcon.color    = canAbandon ? Color.red : Color.grey;
        }
Exemple #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) {
            refreshDropDown();
            ddlFilter.SelectedValue = WebDialogueContext.GetDialogueParameter<string>("Filter");
        }

        MainButton btnRefresh = new MainButton();

        btnRefresh.Text = Local.Text("Web.WAF.Dialogues.Main.RevisionRequestsBtnRefresh");

        btnRefresh.Tooltip = Local.Text("Web.WAF.Dialogues.Main.RevisionRequestsBtnRefreshToolTip");
        Controls.Add(btnRefresh);
        WebDialogueContext.AddDialogueButton(btnRefresh);

        MainButton btnEdit = new MainButton();

        btnEdit.Text = Local.Text("Web.WAF.Dialogues.Main.RevisionRequestsBtnEdit");
        Controls.Add(btnEdit);
        btnEdit.Click += new EventHandler(btnEdit_Click);
        WebDialogueContext.AddDialogueButton(btnEdit);

        MainButton btnClose = new MainButton();

        btnClose.Text = Local.Text("Web.WAF.Dialogues.Main.RevisionRequestsBtnClose");
        Controls.Add(btnClose);
        btnClose.Click += new EventHandler(btnClose_Click);
        WebDialogueContext.AddDialogueButton(btnClose);

        revisionList.DblClick += new EventHandler(btnEdit_Click);

        ddlFilter.SelectedIndexChanged += new EventHandler(ddlFilter_SelectedIndexChanged);

        setQuery();
    }
    public void OnGuildeNewFunc(string btnName)
    {
        var p = MainButton.GetOriginPosition() + DataModel.HollowPos;

        DataModel.HollowPos  = p;
        DataModel.PointerPos = DataModel.HollowPos + DataModel.PointerPos;
    }
        private async void Countdown(int number = 5)
        {
            if (number != 0)
            {
                CountdownNumber.Text = number.ToString();
                await CountdownNumber.ScaleTo(1, 350, Easing.CubicInOut);

                await Task.Delay(300);

                await CountdownNumber.FadeTo(0, 150, Easing.CubicOut);

                CountdownNumber.Scale   = 0;
                CountdownNumber.Opacity = 1;
                Countdown(--number);
            }
            else
            {
                // Take photo

                // Show
                _coverVisible = !_coverVisible;
                AnimationContainer.ScaleTo(1, 300, Easing.CubicOut);
                await MainButton.ScaleTo(0, 300, Easing.CubicOut);

                MainButton.InputTransparent = false;
                PulseButton();
            }
        }
Exemple #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bool displayLocal = WebDialogueContext.GetDialogueParameter<bool>("DisplayLocal", true);
        QueryData qd = new QueryData();
        qd.AddField("UserGroupId", DataValueType.IntegerType);
        qd.AddField("Name", DataValueType.ShortStringType);

        qd.AddRow(SystemUserGroupType.Anonymous, Local.Text("Web.WAF.Dialogues.Main.AccessUserGroup.BuiltInForAnonymous"));
        qd.AddRow(SystemUserGroupType.AllUsers, Local.Text("Web.WAF.Dialogues.Main.AccessUserGroup.BuiltInForSystemUsers"));
         qd.AddRow(SystemUserGroupType.Administrator, Local.Text("Web.WAF.Dialogues.Main.AccessUserGroup.BuiltInForAdmin"));

        if (displayLocal) {
            foreach (UserGroup g in WAFContext.Session.GetContents<UserGroup>(null, AqlUserGroup.Name).OrderBy(g => g.Name)) {
                qd.AddRow(g.NodeId, g.Name);
            }
        }
        contentList.IQuery = new DataQuery(qd);
        if (!displayLocal) {
            MainButton btnSearchLocal = new MainButton();
            Controls.Add(btnSearchLocal);
            btnSearchLocal.Text = "Search local groups...";
            btnSearchLocal.Click += new EventHandler(btnSearchLocal_Click);
            WebDialogueContext.AddDialogueButton(btnSearchLocal);
        }
        MainButton btn = new MainButton();
        Controls.Add(btn);
        btn.Text = "Select";
        btn.Click += new EventHandler(contentList_DblClick);
        WebDialogueContext.AddDialogueButton(btn);
    }
Exemple #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _deleteFileWhenDownloadIsComplete = (bool)WebDialogueContext.DialogueParameters["DeleteFileWhenDownloadIsComplete"];
        _filePath = (string)WebDialogueContext.DialogueParameters["FilePath"];
        _fileDownloadName = (string)WebDialogueContext.DialogueParameters["FileDownloadName"];
        var fi = WAFRuntime.FileSystem.GetFileInfo(_filePath);
        long fileSize = fi.Length;

        StringBuilder sb = new StringBuilder();
        sb.Append("<div style=\"width:80px;float:left; margin-bottom:3px; \">Name:</div><div style=\"float:left;\">" + _fileDownloadName + "</div><div style=\"clear:both;\"></div>");
        sb.Append("<div style=\"width:80px;float:left; margin-bottom:3px;\">Size:</div><div style=\"float:left;\">" + Utils.GetByteSizeString(fileSize) + "</div><div style=\"clear:both;\"></div>");

        if (Utils.ClientIsOpera() || _deleteFileWhenDownloadIsComplete) {
            sb.Append("<div style=\"float:left;\">Click \"Done\" when your download is completed. </div><div style=\"clear:both;\"></div>");
        } else {
            sb.Append("<div style=\"width:80px;float:left;\">Type:</div><div style=\"float:left;\">" + FilePropertyValue.GetOSFileTypeName(_filePath) + "</div><div style=\"clear:both;\"></div>");
        }
        litInfo.Text = sb.ToString();

        _downloadButton = new MainButton();
        _downloadButton.Text = "Download";
        _downloadButton.Click += new EventHandler(downloadButton_Click);
        Controls.Add(_downloadButton);
        WebDialogueContext.AddDialogueButton(_downloadButton);
        if (Utils.ClientIsOpera() || _deleteFileWhenDownloadIsComplete) {
            _closeButton = new MainButton();
            _closeButton.Click += new EventHandler(closeButton_Click);
            Controls.Add(_closeButton);
            _closeButton.Text = "Done";
            WebDialogueContext.AddDialogueButton(_closeButton);
        }
    }
Exemple #9
0
    // Use this for initialization
    void Start()
    {
        int  S   = MainButton.getS();
        Text txt = transform.GetComponent <Text>();

        txt.text = StNm[S - 1];
        Instantiate(bg[S - 1], new Vector2(130, 480), Quaternion.identity);
    }
Exemple #10
0
 public static void SetupMainButton()
 {
     if (mainButton == null)
     {
         mainButton = (parentGuiView.AddUIComponent(typeof(MainButton)) as MainButton);
     }
     mainButton.Show();
 }
Exemple #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     var btnSave = new MainButton();
     btnSave.Click += btnSave_OnClick;
     btnSave.Text = "Save & Close";
     Controls.Add(btnSave);
     WebDialogueContext.AddDialogueButton(btnSave);
 }
 public void SetNewAbbreviation(string shortForm, string fullForm, string genderForm, string pluralForm, string genderPluralForm)
 {
     DataContext = _currentVm = new AddSimpleAbbreviationViewModel(_repositories, shortForm, fullForm, genderForm, pluralForm, genderPluralForm);
     if (!string.IsNullOrEmpty(fullForm))
     {
         MainButton.Focus();
     }
 }
Exemple #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     MainButton btn = new MainButton();
     btn.ID = "btnStartDelivery";
     Controls.Add(btn);
     btn.Click += new EventHandler(btn_Click);
     btn.Text = "Save settings";
     WebDialogueContext.AddDialogueButton(btn);
 }
Exemple #14
0
    void img()
    {
        Image imgplase = GameObject.Find("Image").GetComponent <Image>();

        imgplase.preserveAspect = true;        //比率を変えない
        int S = MainButton.getSw();

        imgplase.sprite = imgs[S];
    }
Exemple #15
0
 void OnButtonClick(MainButton btn)
 {
     btn.ButtonName.onClick.AddListener(() =>
     {
         OpenPanel = Instantiate(btn.value);
         panel.SetActive(false);
         BackBtn.gameObject.SetActive(true);
     });
 }
        private void MainTextBox_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                try
                {
                    if (string.IsNullOrWhiteSpace(MainTextBox.Text))
                    {
                        this.start    = this.end = DateTime.Now;
                        this.notified = true;

                        Settings.Default.LastTimeSpan = TimeSpan.Zero;

                        MainTextBox.Template = (ControlTemplate)Resources["ValidTextBoxTemplate"];
                        MainButton.Focus();
                        return;
                    }

                    object o = FromString(MainTextBox.Text);

                    if (o is DateTime)
                    {
                        start    = DateTime.Now;
                        end      = (DateTime)o;
                        notified = false;

                        Settings.Default.LastTimeSpan = TimeSpan.Zero;

                        MainTextBox.Template = (ControlTemplate)Resources["ValidTextBoxTemplate"];
                        MainButton.Focus();
                    }
                    else if (o is TimeSpan)
                    {
                        TimeSpan ts = (TimeSpan)o;

                        start    = DateTime.Now;
                        end      = start.Add(ts);
                        notified = false;

                        Settings.Default.LastTimeSpan = ts;

                        MainTextBox.Template = (ControlTemplate)Resources["ValidTextBoxTemplate"];
                        MainButton.Focus();
                    }
                }
                catch (Exception)
                {
                    MainTextBox.Template = (ControlTemplate)Resources["InvalidTextBoxTemplate"];
                }
            }
            else if (e.Key == Key.Escape)
            {
                MainTextBox.Template = (ControlTemplate)Resources["ValidTextBoxTemplate"];
                MainButton.Focus();
            }
        }
Exemple #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MainButton btn = new MainButton();

        btn.ID = "btnStartDelivery";
        Controls.Add(btn);
        btn.Click += new EventHandler(btn_Click);
        btn.Text = Local.Text("Web.WAF.Dialogues.Newsletter.EditSettingsBtnSaveSettings");
        WebDialogueContext.AddDialogueButton(btn);
    }
Exemple #18
0
    void name()
    {
        dscs = Resources.Load("CandyList") as TextAsset; //名前を書いておいたtxtファイル読み込み
        txt  = dscs.text;                                //txtファイルのtextをstringに
        List = txt.Split(char.Parse("\n"));              //改行できる
        Text = GameObject.Find("SweetsName");            //説明をいれるテキストボックスを取得
        int S = MainButton.getSw();

        targetText      = Text.GetComponent <Text>(); //textコンポーネント取得
        targetText.text = List[S];                    //ListのS番目の説明を表示
    }
Exemple #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     MainButton btn = new MainButton();
     this.Controls.Add(btn);
     btn.ID = "btnStartImport";
     btn.Click += new EventHandler(btnStartImport_Click);
     btn.Text = "Start import";
     WebDialogueContext.AddDialogueButton(btn);
     if (!IsPostBack) {
         txtSeparator.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator;
     }
 }
Exemple #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.OrderId = (int)WebDialogueContext.DialogueParameters["OrderId"];
     MainButton btn = new MainButton();
     btn.ID = "btnSendPartialShipment";
     Controls.Add(btn);
     string postBackStr = Page.ClientScript.GetPostBackEventReference(btn, "");
     btn.ClientScript = "if(Page_ClientValidate('valGroup')){ " + postBackStr + "  };";
     btn.Click += new EventHandler(btn_Click);
     btn.Text = "Send partial shipment";
     WebDialogueContext.AddDialogueButton(btn);
 }
Exemple #21
0
 public static void RemoveGui()
 {
     isGuiRunning = false;
     if (parentGuiView != null)
     {
         parentGuiView = null;
         UnityEngine.Object.Destroy(mainUI);
         UnityEngine.Object.Destroy(mainButton);
         mainUI     = null;
         mainButton = null;
     }
 }
Exemple #22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.ShopId = (int)WebDialogueContext.DialogueParameters["ShopId"];
        Shop shop = WAFContext.Session.GetContent<Shop>(this.ShopId);

        MainButton btn = new MainButton();
        btn.ID = "btnSaveShop";
        Controls.Add(btn);
        btn.Click += new EventHandler(btn_Click);
        btn.Text = "Save and close";
        WebDialogueContext.AddDialogueButton(btn);
    }
Exemple #23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     MainButton btn = new MainButton();
     btn.ID = "btnStartDelivery";
     Controls.Add(btn);
     btn.Click += new EventHandler(btn_Click);
     //btn.Text = "Save settings";
     btn.Text = Local.Text("Web.Waf.Dialogues.Blog.EditSettings.ButtonSaveSettings");
     WebDialogueContext.AddDialogueButton(btn);
     if (!IsPostBack) {
         LoadDefaults();
     }
 }
Exemple #24
0
    void Gacharu()
    {
        //Kekka = GetComponentInChildren<Text>();
        int S = MainButton.getS();         //Stage取得

        if (S == 1)
        {
            Okashi = Random.Range(0, 9);            //0行目から8行目
        }
        else if (S == 2)
        {
            Okashi = Random.Range(9, 15);            //9行目から14行目
        }
        else if (S == 3)
        {
            Okashi = Random.Range(15, 21);            //15行目から20行目
        }
        candy                = CandyList.text;
        List                 = candy.Split(char.Parse("\n"));
        this.targetText      = this.GetComponent <Text>(); //お菓子の名前表示する場所
        this.targetText.text = List[Okashi];               //お菓子の名前

        /*Debug.Log(Okashi-1);
         * Debug.Log(Sweets2);*/
        foreach (Sprite sp in Sweets2)
        {
            if ((Okashi).ToString() == sp.name)
            {
                Sweets.preserveAspect = true;                //比率を変えない
                Sweets.sprite         = sp;
            }
        }
        collect = PlayerPrefs.GetString("CollectList", "000000000000000000000");
        string bf;

        if (Okashi == 0)
        {
            bf = "";
        }
        else
        {
            bf = collect.Substring(0, Okashi);
        }
        string af = collect.Substring(Okashi + 1);

        collect = bf + 1 + af;
        PlayerPrefs.SetString("CollectList", collect);
        PlayerPrefs.Save();
    }
Exemple #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) {
            ProductBase p = WAFContext.Session.GetSetting<ProductBase>(WebDialogueContext.DialogueParameters["Product"].ToString(), PersistenceScope.UserSession);
            this.ShopId = WAFShopHelper.GetCurrentShopId();
        }
        //Site site = WAFContext.Session.GetContent<Site>(this.SiteId);

        MainButton btn = new MainButton();
        btn.ID = "btnSetProductCategoryForProduct";
        Controls.Add(btn);
        btn.Click += new EventHandler(btn_Click);
        btn.Text = "Save and continue";
        WebDialogueContext.AddDialogueButton(btn);
    }
Exemple #26
0
 /// <summary>
 /// draws scene
 /// </summary>
 public override void Draw()
 {
     MainButton.Draw(rotation);
     if (popout)
     {
         foreach (SceneButton button in sceneButtons)
         {
             if (button.name != "Main")
             {
                 button.Draw();
             }
         }
     }
     spectrum.Draw();
 }
Exemple #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _difference = WebDialogueContext.GetDialogueParameter<Dictionary<Guid, Comparison>>("Difference");
        _orgActions = WebDialogueContext.GetDialogueParameter<Dictionary<Guid, SynchronizationAction>>("OrgActions");
        if (!IsPostBack) {
            _actions = _actions = WebDialogueContext.GetDialogueParameter<Dictionary<Guid, SynchronizationAction>>("Actions");
            _listIdentical = WebDialogueContext.GetDialogueParameter<ActionOnIdentical>("DefaultActionOnIdentical") != ActionOnIdentical.None;
        }
        updateList();

        if (WebDialogueContext.GetDialogueParameter<ActionOnIdentical>("DefaultActionOnIdentical") == ActionOnIdentical.None) {
            btnToggelIdentical = new MainButton();
            btnToggelIdentical.Text = "Show/Hide identical";
            this.Controls.Add(btnToggelIdentical);
            btnToggelIdentical.Click += new EventHandler(btnToggelIdentical_Click);
            WebDialogueContext.AddDialogueButton(btnToggelIdentical);
        }

        MainButton btnDoNothing = new MainButton();
        btnDoNothing.Text = "No action";
        this.Controls.Add(btnDoNothing);
        btnDoNothing.Click += new EventHandler(btnDoNothing_Click);
        WebDialogueContext.AddDialogueButton(btnDoNothing);

        MainButton btnRecAction = new MainButton();
        btnRecAction.Text = "Recommended action";
        this.Controls.Add(btnRecAction);
        btnRecAction.Click += new EventHandler(btnRecAction_Click);
        WebDialogueContext.AddDialogueButton(btnRecAction);

        MainButton btnLocalVersion = new MainButton();
        btnLocalVersion.Text = "LOCAL version";
        this.Controls.Add(btnLocalVersion);
        btnLocalVersion.Click += new EventHandler(btnLocalVersion_Click);
        WebDialogueContext.AddDialogueButton(btnLocalVersion);

        MainButton btnExternalVersion = new MainButton();
        btnExternalVersion.Text = "EXTERNAL version";
        this.Controls.Add(btnExternalVersion);
        btnExternalVersion.Click += new EventHandler(btnExternalVersion_Click);
        WebDialogueContext.AddDialogueButton(btnExternalVersion);

        MainButton btnSynchronize = new MainButton();
        btnSynchronize.Text = "Start synchronization";
        this.Controls.Add(btnSynchronize);
        btnSynchronize.Click += btnSynchronize_Click;
        WebDialogueContext.AddDialogueButton(btnSynchronize);
    }
Exemple #28
0
 public virtual void Clicked(MainButton button)
 {
     Reset();
     foreach (MainButton b in all)
     {
         if (b == button)
         {
             b.SetState(true);
             content[button.id - 1].gameObject.SetActive(true);
         }
         else
         {
             b.SetState(false);
         }
     }
 }
Exemple #29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (WAFRuntime.Engine.License.GetMontlyCreditLimitAbsolute("mms") > WAFRuntime.Engine.License.GetMontlyCreditUsed("mms")) {
        MainButton btnMMSUpload = new MainButton();
        Form.Controls.Add(btnMMSUpload);
        btnMMSUpload.Text = "MMS...";
        WebDialogueContext.AddDialogueButton(btnMMSUpload);
        btnMMSUpload.Click += new EventHandler(btnMMSUpload_Click);
        //}

        _btnBasicUpload = new LightButton();
        Form.Controls.Add(_btnBasicUpload);
        _btnBasicUpload.Click += new EventHandler(btnBasicUpload_Click);

        init();
    }
Exemple #30
0
    void CreateBG()
    {
        int S = MainButton.getS();

        if (S == 0)
        {
            Instantiate(BG[0], new Vector3(1350, 0, 0), Quaternion.identity);
            Instantiate(BG[0], new Vector3(-810, 0, 0), Quaternion.identity);
        }
        else
        {
            obj = BG[S - 1];
            Instantiate(obj, new Vector3(1350, 0, 0), Quaternion.identity);
            Instantiate(obj, new Vector3(-810, 0, 0), Quaternion.identity);
        }
    }
Exemple #31
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) {
            this.SiteId = (int)WebDialogueContext.DialogueParameters["SiteId"];
            ProductBase p = WAFContext.Session.GetSetting<ProductBase>(WebDialogueContext.DialogueParameters["Product"].ToString(), PersistenceScope.UserSession);
            this.ProductId = p.NodeId;
        }
        //Site site = WAFContext.Session.GetContent<Site>(this.SiteId);

        MainButton btn = new MainButton();
        btn.ID = "btnSetShopForProduct";
        Controls.Add(btn);
        btn.Click += new EventHandler(btn_Click);

        btn.Text = Local.Text("Web.WAF.Dialogues.ShopSelectShopForProductBtnSaveAndContinue");
        WebDialogueContext.AddDialogueButton(btn);
    }
 /// <summary>
 /// Pulse the take photo button
 /// </summary>
 private async void PulseButton()
 {
     if (_coverVisible)
     {
         // Is visible
         if (_pulseForward)
         {
             await MainButton.ScaleTo(0.9, 600, Easing.CubicInOut);
         }
         else
         {
             await MainButton.ScaleTo(1.0, 600, Easing.CubicInOut);
         }
         _pulseForward = !_pulseForward;
         PulseButton();
     }
 }
Exemple #33
0
    protected void Page_Load(object sender, EventArgs e)
    {
        btnSelectVideo.Click += new EventHandler(btnSelectVideo_Click);
        chkUseOrgFile.CheckedChanged += new EventHandler(chkUseOrgFile_CheckedChanged);
        btnEditVideo.Click += new EventHandler(btnEditVideo_Click);
        txtWidth.Attributes.Add("onchange", "updateHeight();");
        txtHeight.Attributes.Add("onchange", "updateWidth();");
        txtWidth.Attributes.Add("onkeyup", "updateHeight();");
        txtHeight.Attributes.Add("onkeyup", "updateWidth();");
           // txtQuality.Attributes.Add("disabled", "disabled");
        ddlQuality.Attributes.Add("onchange", "qualityChanged();");
        ddlFormat.Attributes.Add("onchange", "formatChanged();");

        NameValueCollection nvc = WebDialogueContext.GetDialogueParameter<NameValueCollection>("Parameters");

        if (!IsPostBack) {
            txtHeight.Text = Utils.GetIntegerOnly(nvc["y"], 240).ToString();
            txtWidth.Text = Utils.GetIntegerOnly(nvc["x"], 320).ToString();
            chkAutoplay.Checked = (nvc["autoplay"] + "") == "1";
            PropertyPath pp = new PropertyPath(nvc["VideoFile"]);
            FilePropertyValue fpv = WAFContext.Session.GetProperty<FilePropertyValue>(pp);

            chkUseOrgFile.Checked = nvc["use_org_file"] == "1";
            chkUseOrgFile.Visible = fpv.FileExtension.ToLower() == ".flv" || fpv.FileExtension.ToLower() == ".mp4";
            ddlQuality.Enabled = !(chkUseOrgFile.Visible && chkUseOrgFile.Checked);

            if (fpv.VideoHeight > 0 && fpv.VideoWidth > 0) {
                ListItem it = new ListItem();
                it.Value = ((double)fpv.VideoWidth / (double)fpv.VideoHeight).ToString("0.0000000000000").Replace(",", ".");
                it.Text = "Original ratio " + ((double)fpv.VideoWidth / (double)fpv.VideoHeight).ToString("0.00").Replace(",", ".") + " (" + fpv.VideoWidth + "x" + fpv.VideoHeight + ")";
                ddlFormat.Items.Insert(0, it);
            }
            findbestFormat();
            txtQuality.Text = Utils.GetIntegerOnly(nvc["bitrate"], 500).ToString();
            txtVideo.Text = nvc["VideoFile"] + "";
            findbestQuality();
            updateVideoFile();
        }
        MainButton buttonOk = new MainButton();
        buttonOk.Text = Local.Text("Web.WAF.Dialogues.Editor.EditVideoButtonOk");
        //b.Text = "Ok";
        Controls.Add(buttonOk);
        WebDialogueContext.AddDialogueButton(buttonOk);
        buttonOk.Click += new EventHandler(buttonOk_Click);
    }
Exemple #34
0
    void Awake()
    {
#if !UNITY_EDITOR
        try
        {
#endif

        mBtnController = GetComponent <MainButton>();
        PanelRoot.gameObject.SetActive(false);

#if !UNITY_EDITOR
    }
    catch (Exception ex)
    {
        Logger.Error(ex.ToString());
    }
#endif
    }
Exemple #35
0
    public override void Clicked(MainButton button)
    {
        isMainPulmon = false;
        header.SetActive(false);
        switch (button.id)
        {
        case 1:
            content1.SetActive(true);
            break;

        case 2:
            content2.SetActive(true);
            break;

        case 3:
            content3.SetActive(true);
            break;
        }
    }
        public async void ShowHideButtons()
        {
            containerButtonsExpanded = !containerButtonsExpanded;
            var targetOpacity = 0;
            var targetHeight  = 0;
            var targetWidth   = 0;

            if (containerButtonsExpanded)
            {
                targetOpacity = 1;
                targetHeight  = Actions.Count * 44 + (Actions.Count * 10);
                targetWidth   = MAX_WIDTH;
            }

            if (!disableRotation)
            {
                if (containerButtonsExpanded)
                {
                    await MainButton.RotateTo(45, 100, Easing.Linear);
                }
                else
                {
                    await MainButton.RotateTo(0, 100, Easing.Linear);
                }
            }

            if (containerButtonsExpanded)
            {
                Container.HeightRequest = targetHeight;
                Container.WidthRequest  = targetWidth;
            }
            var taskList = new List <Task> {
                Container.FadeTo(targetOpacity, 150)
            };
            await Task.WhenAny(taskList);

            if (!containerButtonsExpanded)
            {
                Container.HeightRequest = targetHeight;
                Container.WidthRequest  = targetWidth;
            }
        }
Exemple #37
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MainButton mbReplaceAll = new MainButton();

        mbReplaceAll.Text = Local.Text("Web.WAF.Dialogues.Main.SearchResultBtnReplaceAll");
        mbReplaceAll.Click += new EventHandler(mbReplaceAll_Click);
        Controls.Add(mbReplaceAll);
        WebDialogueContext.AddDialogueButton(mbReplaceAll);

        MainButton mbReplaceSelected = new MainButton();

        mbReplaceSelected.Text = Local.Text("Web.WAF.Dialogues.Main.SearchResultBtnReplaceSelected");
        mbReplaceSelected.Click += new EventHandler(mbReplaceSelected_Click);
        Controls.Add(mbReplaceSelected);
        WebDialogueContext.AddDialogueButton(mbReplaceSelected);

        MainButton mbChangeSearch = new MainButton();

        mbChangeSearch.Text = Local.Text("Web.WAF.Dialogues.Main.SearchResultBtnChangeSearch");
        mbChangeSearch.Click += new EventHandler(mbChangeSearch_Click);
        Controls.Add(mbChangeSearch);
        WebDialogueContext.AddDialogueButton(mbChangeSearch);

        List<string> fieldNames = new List<string>();
        List<DataValueType> fieldDataValueType = new List<DataValueType>();
        List<IDataValue[]> data = new List<IDataValue[]>();

        fieldNames.Add("n");
        fieldDataValueType.Add(DataValueType.IntegerType);

        Dictionary<CKeyNLRC, int> hits = WebDialogueContext.GetDialogueParameter<Dictionary<CKeyNLRC, int>>("Hits");
        int i = 0;
        foreach (CKeyNLRC key in hits.Keys) {
            data.Add(new IDataValue[] { new IntegerDataValue(i++) });
            _keys.Add(key);
            _hits.Add(hits[key]);
        }

        list.IQuery = new DataQuery(fieldNames, fieldDataValueType, data);
        if (WAFContext.Session.Definitions.Culture.Count == 1) list.Columns[2].Visible = false;
        list.ViewMode = ListViewOptions.Details;
    }
Exemple #38
0
        void ReleaseDesignerOutlets()
        {
            if (ImageView != null)
            {
                ImageView.Dispose();
                ImageView = null;
            }

            if (MainButton != null)
            {
                MainButton.Dispose();
                MainButton = null;
            }

            if (ScrollView != null)
            {
                ScrollView.Dispose();
                ScrollView = null;
            }
        }
Exemple #39
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ce = new CodeEditor();
        pnlEditor.Controls.Add(ce);
        ce.Height = Unit.Pixel(WebDialogueContext.Exchange.WindowHeight);
        ce.Width = Unit.Pixel(WebDialogueContext.Exchange.WindowWidth - 10);
        ce.Text = WebDialogueContext.GetDialogueParameter<string>("Text");
        ce.Language = WebDialogueContext.GetDialogueParameter<string>("Language");

        MainButton mb = new MainButton();
        mb.Click += new EventHandler(mb_Click);
        mb.Text = WebDialogueContext.GetDialogueParameter<string>("ButtonText", "Save");
        this.Form.Controls.Add(mb);
        WebDialogueContext.AddDialogueButton(mb);

        mb = new MainButton();
        mb.Text = "Resize";
        this.Form.Controls.Add(mb);
        WebDialogueContext.AddDialogueButton(mb);
    }
Exemple #40
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _showByReferenceOption = (bool)WebDialogueContext.DialogueParameters["ShowReferenceCheckbox"];
     _defaultReference = (bool)WebDialogueContext.DialogueParameters["ReferenceCheckboxDefaultValue"];
     if (_showByReferenceOption || (!_defaultReference)) {
         MainButton btnCopy = new MainButton();
         Controls.Add(btnCopy);
         btnCopy.Text = _showByReferenceOption ? "Select copy" : "Select";
         WebDialogueContext.AddDialogueButton(btnCopy);
         btnCopy.Click += new EventHandler(btnCopy_Click);
     }
     if (_showByReferenceOption || (_defaultReference)) {
         MainButton btnRef = new MainButton();
         Controls.Add(btnRef);
         btnRef.Text = _showByReferenceOption ? "Select by reference" : "Select";
         WebDialogueContext.AddDialogueButton(btnRef);
         btnRef.Click += new EventHandler(btnRef_Click);
     }
     flu.ListClick += new EventHandler(flu_ListClick);
 }
Exemple #41
0
        public override void RefreshButton(Currencies playerCurrencies)
        {
            var selectedItem = GetSelectedItem();

            MainButton.interactable = selectedItem != null && selectedItem.CanAfford && !selectedItem.AlreadyPurchased;

            var tooltip = MainButton.GetComponent <UITooltip>();

            if (tooltip != null)
            {
                tooltip.m_text = "";
                if (selectedItem != null && !selectedItem.CanAfford)
                {
                    tooltip.m_text = "$mod_epicloot_merchant_cannotafford";
                }
                else if (selectedItem != null && selectedItem.AlreadyPurchased)
                {
                    tooltip.m_text = "$mod_epicloot_merchant_purchasedtooltip";
                }
            }
        }
Exemple #42
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _showByReferenceOption = (bool)WebDialogueContext.DialogueParameters["ShowReferenceCheckbox"];
        _defaultReference = (bool)WebDialogueContext.DialogueParameters["ReferenceCheckboxDefaultValue"];
        if (_showByReferenceOption || (!_defaultReference)) {
            MainButton btnCopy = new MainButton();
            Controls.Add(btnCopy);
            btnCopy.Text = _showByReferenceOption ? Local.Text("Web.WAF.Dialogues.Main.FileLibraryBtnCopySelectCopy") : Local.Text("Web.WAF.Dialogues.Main.FileLibraryBtnCopySelect");
            WebDialogueContext.AddDialogueButton(btnCopy);
            btnCopy.Click += new EventHandler(btnCopy_Click);
        }
        if (_showByReferenceOption || (_defaultReference)) {
            MainButton btnRef = new MainButton();
            Controls.Add(btnRef);

            btnRef.Text = _showByReferenceOption ? Local.Text("Web.WAF.Dialogues.Main.FileLibraryBtnRefSelectByRef") : Local.Text("Web.WAF.Dialogues.Main.FileLibraryBtnRefSelect");
            WebDialogueContext.AddDialogueButton(btnRef);
            btnRef.Click += new EventHandler(btnRef_Click);
        }
        flu.ListClick += new EventHandler(flu_ListClick);
    }
        public override void RefreshButton(Currencies playerCurrencies)
        {
            var selectedItem = GetSelectedItem();
            var haveSpace    = Player.m_localPlayer.GetInventory().FindEmptySlot(false).x >= 0 || Player.m_localPlayer.GetInventory().FindFreeStackSpace(selectedItem?.ItemInfo.Item.m_shared.m_name) > 0;

            MainButton.interactable = selectedItem != null && selectedItem.CanAfford(playerCurrencies) && haveSpace;
            var tooltip = MainButton.GetComponent <UITooltip>();

            if (tooltip != null)
            {
                tooltip.m_text = "";
                if (selectedItem != null && !selectedItem.CanAfford(playerCurrencies))
                {
                    tooltip.m_text = "$mod_epicloot_merchant_cannotafford";
                }
                else if (!haveSpace)
                {
                    tooltip.m_text = "$mod_epicloot_merchant_noroomtooltip";
                }
            }
        }
Exemple #44
0
        /// <summary>
        /// 文章入力欄下にあるボタンコントロールを取得する。
        /// </summary>
        /// <param name="parent">ボタン群の親コントロール。</param>
        /// <param name="button">ボタン種別。</param>
        /// <returns>コントロール。取得できなかった場合は null 。</returns>
        private static dynamic GetMainButton(dynamic parent, MainButton button)
        {
            if (parent == null)
            {
                return(null);
            }
            if (!EnumCache <MainButton> .HashSet.Contains(button))
            {
                return(null);
            }

            try
            {
                return(parent.Children[(int)button]);
            }
            catch (Exception ex)
            {
                ThreadDebug.WriteException(ex);
            }
            return(null);
        }
Exemple #45
0
    protected void Page_Load(object sender, EventArgs e)
    {
        name1 = WebDialogueContext.GetDialogueParameter<string>("Name1").ToUpper();
        name2 = WebDialogueContext.GetDialogueParameter<string>("Name2").ToUpper();
        compareWith2 = WebDialogueContext.GetDialogueParameter<bool>("CompareWith2");
        if (!IsPostBack) {
            txt1.Value = WebDialogueContext.GetDialogueParameter<string>("Text1");
            txt2.Value = WebDialogueContext.GetDialogueParameter<string>("Text2");
            txtResult.Value = WebDialogueContext.GetDialogueParameter<string>("Result");
            pnl1.Text = name1 + " version";
            pnl2.Text = name2 + " version";
        }
        updateCompPanelText();

        MainButton btnCompare = new MainButton();
        btnCompare.Text = "Toggle comparison";
        this.Controls.Add(btnCompare);
        btnCompare.Click += new EventHandler(btnCompare_Click);
        WebDialogueContext.AddDialogueButton(btnCompare);

        MainButton btnCopyLocal = new MainButton();
        btnCopyLocal.Text = "Copy " + name1 + " to NEW";
        this.Controls.Add(btnCopyLocal);
        btnCopyLocal.Click += new EventHandler(btnCopyLocal_Click);
        WebDialogueContext.AddDialogueButton(btnCopyLocal);

        MainButton btnCopyExternal = new MainButton();
        btnCopyExternal.Text = "Copy " + name2 + " to NEW";
        this.Controls.Add(btnCopyExternal);
        btnCopyExternal.Click += new EventHandler(btnCopyExternal_Click);
        WebDialogueContext.AddDialogueButton(btnCopyExternal);

        MainButton btnResolve = new MainButton();
        btnResolve.Text = "Close and accept NEW version";
        this.Controls.Add(btnResolve);
        btnResolve.Click += new EventHandler(btnResolve_Click);
        WebDialogueContext.AddDialogueButton(btnResolve);

        txtResult.Focus();
    }
Exemple #46
0
        private void Protect()
        {
            DriveInfo di = cbDrives.SelectedItem as DriveInfo;

            if (di == null)
            {
                return;
            }
            Windows7Taskbar.SetProgressState(Handle, ProgressState.Indeterminate);
            MainButton.Text = "Close";
            action          = ButtonAction.Close;
            try
            {
                MainButton.Enabled = false;
                MainButton.Update();
                long cnt  = 0;
                long size = di.TotalFreeSpace;
                while (size > 0)
                {
                    cnt++;
                    FileInfo fi = new FileInfo((di.RootDirectory.FullName + "dummy.file" + (cnt > 1 ? cnt.ToString() : "")));
                    using (FileStream fs = fi.OpenWrite())
                    {
                        InfoLabel.Text = String.Format("Writing {0} {1} remaining", fi.Name, GetSize(size));
                        InfoLabel.Update();
                        long newSize = Math.Min(fs.Length + size, 4294967294);
                        fs.SetLength(newSize);
                    }
                    size = di.TotalFreeSpace;
                }
                InfoLabel.Text = String.Format("{0} dummy file(s) created, {1} free", cnt, GetSize(di.TotalFreeSpace));
            }
            catch (Exception ex)
            {
                InfoLabel.Text = ex.Message;
            }
            MainButton.Enabled = true;
            Windows7Taskbar.SetProgressState(Handle, ProgressState.NoProgress);
        }
Exemple #47
0
    void CreateGr()
    {
        int S     = MainButton.getS();
        int L     = MainButton.getL();
        int Stage = 3 * (S - 1) + 1 + L;

        if (Stage == -5)
        {
            Stage = 1;
        }
        StrData = StageData.text;
        StgData = StrData.Split(char.Parse("\n"));
        int len = StgData[Stage - 1].Length;   //lenをステージデータのStage-1行目の長さにする

        for (int i = 0; i < len - 1; i++)      //len回繰り返す
        //string c= StgData[Stage-1];//cをステージ-1行目のn番目の文字にする
        {
            int Ch = int.Parse(StgData[Stage - 1].Substring(i, 1));
            obj = Gr[Ch];
            Instantiate(obj, new Vector3((540 * i) - 270, -360, 0), Quaternion.identity);
        }
    }
Exemple #48
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (WebDialogueContext.Exchange == null) return;
        _selectMode = (ListSelectionMode)WebDialogueContext.DialogueParameters["SelectionMode"];
        UniqueList<int> classIds = (UniqueList<int>)WebDialogueContext.DialogueParameters["ClassIds"];

        if (classIds.Count == 1) WebDialogueContext.SendResult(classIds.GetFirst());
        if (classIds.Count == 0) {
            WAFContext.Session.Notify(DialogueIcon.Info, "No type available");
            WebDialogueContext.CloseExchange();
        }

        MainButton btn = new MainButton();
        Controls.Add(btn);
        btn.Text = "Select";
        btn.Click += new EventHandler(list_DblClick);
        WebDialogueContext.AddDialogueButton(btn);

        addTab(0, "local", classIds);
        addTab(1, "system", classIds);
        addTab(2, "internal", classIds);
    }
Exemple #49
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!WebDialogueContext.DialogueParameters.ContainsKey("UseCustomButtons")) {
         MainButton defaultOkButton = new MainButton();
         defaultOkButton.Text = "Ok";
         defaultOkButton.Click += new EventHandler(defaultOkButton_Click);
         Controls.Add(defaultOkButton);
         WebDialogueContext.AddDialogueButton(defaultOkButton);
     } else {
         string[] customButtons = (string[])WebDialogueContext.DialogueParameters["CustomButtons"];
         int index = 0;
         foreach (string b in customButtons) {
             MainButton customButton = new MainButton();
             customButton.Text = b;
             customButton.Value = index.ToString();
             Controls.Add(customButton);
             WebDialogueContext.AddDialogueButton(customButton);
             customButton.Click += new EventHandler(customButton_Click);
             index++;
         }
     }
 }
        public async void Animate()
        {
            FirstLight.FadeTo(0, 0);
            SecondLight.FadeTo(0, 0);
            LoginLabel.FadeTo(0, 0);
            MainButton.FadeTo(0, 0);
            MainLabel.FadeTo(0, 0);
            MAinFrame.FadeTo(0.0);
            FirstLight.TranslationY  = -180;
            SecondLight.TranslationY = -160;
            Clock.TranslationY       = -80;
            MainLabel.TranslationY   = -30;
            MainButton.TranslationY  = -30;
            MAinFrame.TranslationY   = -30;
            await Clock.FadeTo(0, 0);

            Task.Delay(1000);

            FirstLight.FadeTo(1, 500);
            await FirstLight.TranslateTo(0, 0, 300);

            LoginLabel.FadeTo(1, 900);
            SecondLight.FadeTo(1, 500);
            await SecondLight.TranslateTo(0, 0, 300);

            Clock.FadeTo(1, 500);
            await Clock.TranslateTo(0, 0, 300);

            MAinFrame.FadeTo(1, 500);
            await MAinFrame.TranslateTo(0, 0, 300);

            MainButton.FadeTo(1, 500);
            await MainButton.TranslateTo(0, 0, 300);

            MainLabel.FadeTo(1, 500);
            await MainLabel.TranslateTo(0, 0, 300);
        }
Exemple #51
0
    void CreateToge()
    {
        int S     = MainButton.getS();
        int L     = MainButton.getL();
        int Stage = 3 * (S - 1) + 1 + L;

        StrDatat = TogeData.text;
        StgDatat = StrDatat.Split(char.Parse("\n"));
        int len = StgDatat[Stage - 1].Length;      //lenをステージデータのStage-1行目の長さにする
        int n   = 0;

        for (int i = 0; i < len - 1; i++)      //len回繰り返す
        {
            int Ch = int.Parse(StgDatat[Stage - 1].Substring(i, 1));
            if (Ch == 1)
            {
                n++;
                var toge = Instantiate(Toge, new Vector3((540 * i) - 270, -213, 0), Quaternion.identity);
                toge.name = "Toge" + n;
                SpriteRenderer img = toge.GetComponent <SpriteRenderer>();
                img.sprite = togeimg[S - 1];
            }
            else if (Ch == 2)
            {
                n++;
                var toge  = Instantiate(Toge, new Vector3((540 * i) - 270 + 40, -213, 0), Quaternion.identity);
                var toge2 = Instantiate(Toge, new Vector3((540 * i) - 270 - 40, -213, 0), Quaternion.identity);
                toge.name = "Toge" + n;
                n++;
                toge2.name = "Toge" + n;
                SpriteRenderer img = toge.GetComponent <SpriteRenderer>();
                img.sprite = togeimg[S - 1];
                SpriteRenderer img2 = toge2.GetComponent <SpriteRenderer>();
                img2.sprite = togeimg[S - 1];
            }
        }
    }
Exemple #52
0
    protected override void OnInit(EventArgs e)
    {
        object oKey = WebDialogueContext.Exchange.DialogueParameters["ContentKey"];
        CKeyNLR key = null;
        if (oKey is CKeyNLR) {
            key = oKey as CKeyNLR;
        } else if (oKey is CKeyNLRC) {
            key = (oKey as CKeyNLRC).CreateCKeyNLR();
        }
        contentEdit.PropertyPositionsString = "Main(Native.ArticleBase(BodyContent Files))";
        contentEdit.HideGroups.Add("Options");
        contentEdit.HideGroups.Add("Meta");
        contentEdit.HideGroups.Add("Children");

        if (key != null) {
            if (!WAFContext.Session.ContentExists(key, true, true)) {
                WebDialogueContext.SendResult(null);
                contentEdit.Visible = false;
            }
        }
        if (!IsPostBack) {
            if (oKey is CKeyNLR) {
                contentEdit.ContentKey = oKey as CKeyNLR;
            } else if (oKey is CKeyNLRC) {
                contentEdit.ContentKeyC = oKey as CKeyNLRC;
            }

        }

        MainButton btn = new MainButton();
        btn.ID = "btnSendNow";
        Controls.Add(btn);
        btn.Click += new EventHandler(btnSendNow_Click);
        btn.Text = "Send now";
        WebDialogueContext.AddDialogueButton(btn);
        base.OnInit(e);
    }
        private async void Button_Clicked(object sender, EventArgs e)
        {
            if (_coverVisible)
            {
                // Hide
                _coverVisible = !_coverVisible;
                ViewExtensions.CancelAnimations(MainButton);
                AnimationContainer.ScaleTo(0, 300, Easing.CubicOut);
                await MainButton.ScaleTo(0, 300, Easing.CubicOut);

                MainButton.InputTransparent = true;
                Countdown();
            }
            else
            {
                // Show
                _coverVisible = !_coverVisible;
                AnimationContainer.ScaleTo(1, 300, Easing.CubicOut);
                await MainButton.ScaleTo(0, 300, Easing.CubicOut);

                MainButton.InputTransparent = false;
                PulseButton();
            }
        }
        public async Task ScaleButton()
        {
            await MainButton.ScaleTo(1.1, 500, Easing.CubicIn);

            await MainButton.ScaleTo(1, 500, Easing.CubicOut);
        }
Exemple #55
0
 public void AddDialogueButton(MainButton button)
 {
     button.Visible = false;
     AddDialogueButton(button.Text, button.ClientScript, button.Enabled.ToString());
 }
Exemple #56
0
 protected override void OnInit(EventArgs e)
 {
     MainMenu menu = WAFMaster.EditModule.Menu;
     menu.SetMenu(this.GetMenuItems());
     menu.Click += new EventHandler<MainMenuItem>(menu_Click);
     if (!IsPostBack && WAFContext.Request.SpecifiesNodeId) {
         if (WAFContext.Session.NodeExists(WAFContext.Session.CurrentNodeId, true, true)) {
             contentForm.ContentKey = new CKeyNLR(WAFContext.Session.CurrentNodeId, WAFContext.Session.LCID, Request["rev"] != null ? int.Parse(Request["rev"]) : 0);
             //WAFContext.Session.ContentEditRedirectFlagged = false;
         }
     }
     contentTree.RelationId = AqlRelHierarchical.Relation.RelationId;
     contentTree.RootKey = WAFContext.Session.CompleteKeyC(WAFContext.Session.SiteId);
     Utils.EnsureClientScriptInclude("jquery-1.6.2.min", Page);
     btnBack = contentForm.AddMainButton("Back", true);
     btnBack.Click += new EventHandler(btnBack_Click);
     btnSaveAndBack = contentForm.AddMainButton("Save & Back", true);
     btnSaveAndBack.Click += new EventHandler(btnSaveAndBack_Click);
     btnSaveAndClose = contentForm.AddMainButton("Save & Close", true);
     btnSaveAndClose.Click += new EventHandler(btnSaveAndClose_Click);
     btnRefresh = contentForm.AddMainButton("Refresh", false);
     btnRefresh.Click += new EventHandler(btnRefresh_Click);
     btnClose = contentForm.AddMainButton("Close", false); ;
     btnClose.Click += new EventHandler(btnClose_Click);
     contentForm.FormRefresh += new EventHandler(contentForm_Refresh);
     contentTree.IncludeDeleted = WAFMaster.EditModule.Menu.IsItemChecked("View_Deleted");
     contentForm.IncludeDeleted = WAFMaster.EditModule.Menu.IsItemChecked("View_Deleted");
     contentTree.IncludeUnpublished = WAFMaster.EditModule.Menu.IsItemChecked("View_Unpublished");
     contentForm.IncludeUnpublished = WAFMaster.EditModule.Menu.IsItemChecked("View_Unpublished");
     contentTree.ShowIDs = WAFMaster.EditModule.Menu.IsItemChecked("View_IDs");
     contentForm.ShowAdvancedFunctions = WAFMaster.EditModule.Menu.IsItemChecked("View_AdvancedPropertyOptions");
     contentForm.ContentDeleted += new EventHandler(contentForm_ContentDeleted);
     initLinkGraph();
     base.OnInit(e);
 }
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                string exePath   = Assembly.GetExecutingAssembly().Location;
                string exeDir    = new FileInfo(exePath).DirectoryName;
                string soundsDir = System.IO.Path.Combine(exeDir, "Sounds");
                foreach (string soundFilePath in Directory.GetFiles(soundsDir, "*.wav"))
                {
                    MenuItem soundMenuItem = new MenuItem();
                    soundMenuItem.Header      = System.IO.Path.GetFileNameWithoutExtension(soundFilePath);
                    soundMenuItem.Tag         = System.IO.Path.GetFileName(soundFilePath);
                    soundMenuItem.IsCheckable = true;
                    soundMenuItem.Click      += new RoutedEventHandler(SoundMenuItem_Click);

                    MainContextMenu.Items.Insert(MainContextMenu.Items.Count - 2, soundMenuItem);
                }
            }
            catch (Exception)
            {
            }

            UpdateSoundMenuItems();

            AlwaysOnTopMenuItem.IsChecked          = Settings.Default.AlwaysOnTop;
            ScaleInterfaceMenuItem.IsChecked       = Settings.Default.ScaleInterface;
            LoopNotificationMenuItem.IsChecked     = Settings.Default.LoopNotification;
            LoopTimerMenuItem.IsChecked            = Settings.Default.LoopTimer;
            CloseOnFinishMenuItem.IsChecked        = Settings.Default.CloseOnFinish;
            FlashOnFinishMenuItem.IsChecked        = Settings.Default.FlashOnFinish;
            PopupOnFinishMenuItem.IsChecked        = Settings.Default.PopupOnFinish;
            RememberTimerOnCloseMenuItem.IsChecked = Settings.Default.RememberTimerOnClose;
            ShowTimerInTrayMenuItem.IsChecked      = Settings.Default.ShowTimerInTray;

            Topmost = Settings.Default.AlwaysOnTop;

            if (Settings.Default.LoopTimer)
            {
                Settings.Default.LoopNotification  = false;
                LoopNotificationMenuItem.IsChecked = false;

                Settings.Default.CloseOnFinish  = false;
                CloseOnFinishMenuItem.IsChecked = false;
            }

            if (Settings.Default.CloseOnFinish)
            {
                Settings.Default.LoopNotification  = false;
                LoopNotificationMenuItem.IsChecked = false;

                Settings.Default.LoopTimer  = false;
                LoopTimerMenuItem.IsChecked = false;
            }

            if (Settings.Default.WindowSettingsSaved)
            {
                try
                {
                    Height      = Settings.Default.WindowHeight;
                    Width       = Settings.Default.WindowWidth;
                    Left        = Settings.Default.WindowLeft;
                    Top         = Settings.Default.WindowTop;
                    WindowState = Settings.Default.WindowState;
                }
                catch (Exception)
                {
                }
            }

            string args = (string)Application.Current.Properties["Args"];

            if (!string.IsNullOrEmpty(args))
            {
                try
                {
                    if (Regex.IsMatch(args, "(^|\\s+)-startMinimized($|\\s+)", RegexOptions.IgnoreCase))
                    {
                        args = Regex.Replace(args, "(^|\\s+)-startMinimized($|\\s+)", string.Empty, RegexOptions.IgnoreCase);
                        if (Settings.Default.ShowTimerInTray)
                        {
                            Hide();
                        }
                        else
                        {
                            WindowState = System.Windows.WindowState.Minimized;
                        }
                    }

                    if (Regex.IsMatch(args, "(^|\\s+)-closeWhenDone($|\\s+)", RegexOptions.IgnoreCase))
                    {
                        args = Regex.Replace(args, "(^|\\s+)-closeWhenDone($|\\s+)", string.Empty, RegexOptions.IgnoreCase);
                        closeOnFinishThisTime = true;
                    }

                    object o = FromString(args);

                    if (o is DateTime)
                    {
                        start    = DateTime.Now;
                        end      = (DateTime)o;
                        notified = false;

                        Settings.Default.LastTimeSpan = TimeSpan.Zero;

                        MainTextBox.Template = (ControlTemplate)Resources["ValidTextBoxTemplate"];
                        MainButton.Focus();
                    }
                    else if (o is TimeSpan)
                    {
                        TimeSpan ts = (TimeSpan)o;

                        start    = DateTime.Now;
                        end      = start.Add(ts);
                        notified = false;

                        Settings.Default.LastTimeSpan = ts;

                        MainTextBox.Template = (ControlTemplate)Resources["ValidTextBoxTemplate"];
                        MainButton.Focus();
                    }

                    StartTimer();
                }
                catch (Exception)
                {
                    MainTextBox.Template = (ControlTemplate)Resources["InvalidTextBoxTemplate"];
                }
            }
            else if (Settings.Default.RememberTimerOnClose && Settings.Default.TimerRunning && Settings.Default.CurrentStart != DateTime.MinValue && Settings.Default.CurrentEnd != DateTime.MinValue && DateTime.Now > Settings.Default.CurrentStart && DateTime.Now < Settings.Default.CurrentEnd)
            {
                start    = Settings.Default.CurrentStart;
                end      = Settings.Default.CurrentEnd;
                notified = false;

                MainTextBox.Template = (ControlTemplate)Resources["ValidTextBoxTemplate"];
                MainButton.Focus();

                StartTimer();
            }

            interopHelper = new WindowInteropHelper(this);

            UpdateNotifyIcon();
        }
Exemple #58
0
    protected override void OnInit(EventArgs e)
    {
        _treeControl = new TemplateTree();
        _treeControl.RootFolder = WAFContext.PathFromRootToAppFolder;
        _treeControl.AllowSelect = true;
        _treeControl.AllowDrag = false;
        _treeControl.DblClick += new EventHandler(_treeControl_DblClick);
        pnlLeft.Controls.Add(_treeControl);
        cntFrm.CommandClick += new EventHandler<CommandArgument>(cntFrm_CommandClick);
        WAFPanel p1 = new WAFPanel();
        p1.Width = Unit.Percentage(100);
        p1.Height = Unit.Pixel(26);
        p1.Border = false;
        p1.Margin = true;
        MainButton saveAspx = new MainButton();
        saveAspx.Click += new EventHandler(saveAspx_Click);

        saveAspx.Text = Local.Text("Web.WAF.Edit.Templates.TemplatesSaveChanges");
        p1.Controls.Add(saveAspx);
        tabASPXFile.Controls.Add(p1);

        _aspxFileEditor = new CodeEditor();
        _aspxFileEditor.Width = Unit.Percentage(100);
        _aspxFileEditor.Height = Unit.Percentage(100);
        _aspxFileEditor.Language = "html";
        tabASPXFile.Controls.Add(_aspxFileEditor);

        WAFPanel p2 = new WAFPanel();
        p2.Width = Unit.Percentage(100);
        p2.Height = Unit.Pixel(26);
        p2.Border = false;
        p2.Margin = true;

        MainButton saveCodebehind = new MainButton();
        saveCodebehind.Click += new EventHandler(saveCodebehind_Click);
        saveCodebehind.Text = Local.Text("Web.WAF.Edit.Templates.TemplatesSaveChanges");

        _codebehindEditor = new CodeEditor();
        _codebehindEditor.Width = Unit.Percentage(100);
        _codebehindEditor.Height = Unit.Percentage(100);
        _codebehindEditor.Language = "cs";
        tabCodebindFile.Controls.Add(p2);
        tabCodebindFile.Controls.Add(_codebehindEditor);
        p2.Controls.Add(saveCodebehind);

        TemplatesMaster.ViewChanged += new EventHandler<MainMenuItem>(TemplatesMaster_ViewChanged);
        btnCreateTemplate.Click += new EventHandler(btnCreateTemplate_Click);

        if (!IsPostBack && Request["Open"] != null) {
            CKeyNLR key = new CKeyNLR(Request["Open"]);
            cntFrm.ContentKey = key;
            tabbedView.Visible = true;
            Template s = WAFContext.Session.GetContent<Template>(key);
            string treeKey = s.Filepath + "." + s.NodeId + ".";

            if (WAFRuntime.FileSystem.FileExists(WAFContext.PathFromRootToAppFolder + s.Filepath)) {
                treeKey += "match#";
            } else {
                treeKey += "onlyContent#";
            }
            _treeControl.SetSelected(treeKey);
            _treeControl.Refresh();
            updateCodeEditors(s.Filepath);
            cntFrm.Refresh();
        }

        base.OnInit(e);
    }
Exemple #59
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) {
            SetPanelVisibility(WizardPanel.PerformSetup);
        }
        MainButton btn = new MainButton();

        btn.ID = "btnCloseWizard";
        Controls.Add(btn);
        btn.Click += new EventHandler(btn_Click);
        btn.Text = Local.Text("Web.WAF.Dialogues.ShopSetupShopWizardBtnCloseWizard");
        WebDialogueContext.AddDialogueButton(btn);
    }
Exemple #60
0
    protected void Page_Load(object sender, EventArgs e)
    {
        chkLinkStatus.SelectedIndexChanged += new EventHandler(chkLinkStatus_SelectedIndexChanged);
        chkLinkType.SelectedIndexChanged += new EventHandler(chkLinkType_SelectedIndexChanged);
        if (!IsPostBack) {
            foreach (object v in Enum.GetValues(typeof(LinkUrlType))) {
                chkLinkType.Items.Add(new ListItem(Utils.GetFriendlyName(Enum.GetName(typeof(LinkUrlType), v)), ((int)v).ToString()));
                chkLinkType.Items[chkLinkType.Items.Count - 1].Selected = ((int)v) == (int)LinkUrlType.External || ((int)v) == (int)LinkUrlType.Internal;
            }
            foreach (object v in Enum.GetValues(typeof(LinkUrlStatus))) {
                chkLinkStatus.Items.Add(new ListItem(Utils.GetFriendlyName(Enum.GetName(typeof(LinkUrlStatus), v)), ((int)v).ToString()));
                chkLinkStatus.Items[chkLinkStatus.Items.Count - 1].Selected = !(((int)v) == (int)LinkUrlStatus.Valid || ((int)v) == (int)LinkUrlStatus.Unknown);
            }
        }

        setQuery();
        if (WAFContext.Session.Access.IsAdmin()) {
            MainButton btnReeval = new MainButton();
            btnReeval.Text = "Re-evaluate all...";
            btnReeval.Tooltip = "Re-run broken links checker on all nodes on site";
            btnReeval.Click += new EventHandler(btnReeval_Click);
            btnReeval.Confirm = true;
            btnReeval.ConfirmQuestion = "This will take several minutes and the site may slow down. Continue?";
            this.Form.Controls.Add(btnReeval);
            WebDialogueContext.AddDialogueButton(btnReeval);
        }

        MainButton btnRevalSel = new MainButton();
        btnRevalSel.Text = "Re-evaluate selected";
        btnRevalSel.Tooltip = "Re-run broken links checker on the selected items";
        btnRevalSel.Click += new EventHandler(btnRevalSel_Click);
        this.Form.Controls.Add(btnRevalSel);
        WebDialogueContext.AddDialogueButton(btnRevalSel);

        MainButton btnGraph = new MainButton();
        btnGraph.Text = "Graph";
        btnGraph.Tooltip = "Show graph visualization of node links";
        btnGraph.ClientScript = " var url = " + lst.ClientScriptId + ".GetSelectedValues().split('|')[0].split('_')[2]; if(url==null){ WAF.Notify('Please select an url. ');}else{ url = url.replace('###','_'); url= url.substring(0,1)=='?' ? '" + WAFContext.UrlFromRootToApp + "'+url : url; var p=new Object();p['url']=url; WAF.StartWorkflowMethod('" + typeof(LinkGraphs).FullName + "', p, null, false, true, null, null, null);};";
        this.Form.Controls.Add(btnGraph);
        WebDialogueContext.AddDialogueButton(btnGraph);

        MainButton btnEdit = new MainButton();
        btnEdit.Text = "Edit";
        btnEdit.Click += new EventHandler(btnEdit_Click);
        this.Form.Controls.Add(btnEdit);
        WebDialogueContext.AddDialogueButton(btnEdit);

        MainButton btnBrowse = new MainButton();
        btnBrowse.Text = "Browse";
        btnBrowse.ClientScript = " var url = " + lst.ClientScriptId + ".GetSelectedValues().split('|')[0].split('_')[2]; if(url==null){ WAF.Notify('Please select an url to browse. ');}else{url = url.replace('###','_'); window.open(url.substring(0,1)=='?' ? '" + WAFContext.UrlFromRootToApp + "'+url : url)};";
        this.Form.Controls.Add(btnBrowse);
        WebDialogueContext.AddDialogueButton(btnBrowse);

        MainButton btnRefresh = new MainButton();
        btnRefresh.Text = "Refresh";
        this.Form.Controls.Add(btnRefresh);
        WebDialogueContext.AddDialogueButton(btnRefresh);

        MainButton btnClose = new MainButton();
        btnClose.Text = "Close";
        btnClose.Click += new EventHandler(btnClose_Click);
        this.Form.Controls.Add(btnClose);
        WebDialogueContext.AddDialogueButton(btnClose);
    }