Exemplo n.º 1
0
        /// <summary>
        /// Resets element values to their loaded values
        /// </summary>
        internal static void ResetZoom(bool animate = true)
        {
            if (ConfigureWindows.GetMainWindow.MainImage.Source == null)
            {
                return;
            }

            if (animate)
            {
                BeginZoomAnimation(1);
            }
            else
            {
                scaleTransform.ScaleX = scaleTransform.ScaleY = 1.0;
                translateTransform.X  = translateTransform.Y = 0.0;
            }

            Tooltip.CloseToolTipMessage();
            ZoomValue = 1;

            // Display non-zoomed values
            if (Pics.Count == 0)
            {
                /// Display values from web
                SetTitle.SetTitleString((int)ConfigureWindows.GetMainWindow.MainImage.Source.Width, (int)ConfigureWindows.GetMainWindow.MainImage.Source.Height);
            }
            else
            {
                SetTitle.SetTitleString((int)ConfigureWindows.GetMainWindow.MainImage.Source.Width, (int)ConfigureWindows.GetMainWindow.MainImage.Source.Height, FolderIndex);
            }

            UC.GetQuickSettingsMenu.ZoomSlider.Value = 1.0;
        }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {//WWWWW1231231231231231231123123
        this.Title = Title + SetTitle.getTitle();
        string msg = Request.QueryString["msg"].ToString();

        this.Label1.Text = msg;
    }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.Title = Title + SetTitle.getTitle();
         int currentPage;
         try {
             currentPage = Convert.ToInt32(Request.QueryString["p"]);
         }
         catch {
             currentPage = 1;
         }
         if (currentPage == 0)
         {
             currentPage = 1;
         }
         PagedDataSource ps = new PagedDataSource();
         PopOperate      op = new PopOperate();
         ps.DataSource                = op.viewAll();
         ps.AllowPaging               = true;
         ps.CurrentPageIndex          = currentPage - 1;
         ps.PageSize                  = 6;
         this.Pagination1.pageCount   = ps.PageCount;
         this.Pagination1.currentPage = currentPage;
         this.Pagination1.pageUrl     = "pop.aspx";
         this.Pagination1.paramName   = "p";
         this.DataListPop.DataSource  = ps;
         this.DataListPop.DataBind();
     }
 }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.Title = Title + SetTitle.getTitle();
        }
        if (Convert.ToString(Session["admin"]) != "admin")
        {
            Response.Redirect("~/refresh.aspx?msg=" + "对不起,只有管理员才能对文章进行相关的操作0!");
            return;
        }

        int            aid = Convert.ToInt32(Request.QueryString["aid"]);
        ArticleOperate aop = new ArticleOperate();
        bool           b   = aop.delete(aid);

        if (b)
        {
            Response.Redirect("~/refresh.aspx?msg=" + "文章删除成功!");
        }
        else
        {
            Response.Redirect("~/refresh.aspx?msg=" + "文章删除失败!");
        }
    }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.Title = Title + SetTitle.getTitle();
     }
 }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //????asdfasdfasdf2131232112311231212312312123123123.0.021321321356
     if (!IsPostBack)
     {
         this.Title = Title + SetTitle.getTitle();
     }
 }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.Title = SetTitle.getTitle();
         dataListDatabind();
     }
 }
Exemplo n.º 8
0
        public static void initializeInGameEditor()
        {
            Omni.self.Print(" % - Initializing In-game GUI Editor");
            SetTitle.initialize();
            WindowSettings.initialize();
            ChangeFontSize.initialize();
            ObjectCreator oIngameContext = new ObjectCreator("GuiControl", "IngameContext, IngameGuiGroup", typeof(InGameContext));

            oIngameContext.Create();
        }
Exemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.Title = Title + SetTitle.getTitle();
     }
     if (Convert.ToString(Session["admin"]) != "admin")
     {
         Response.Redirect("~/refresh.aspx?msg=" + "对不起,只有管理员才能对文章进行相关的操作0!");
         return;
     }
 }
Exemplo n.º 10
0
 internal static void CloseCrop()
 {
     if (Pics.Count == 0)
     {
         SetTitle.SetTitleString((int)ConfigureWindows.GetMainWindow.MainImage.Source.Width, (int)ConfigureWindows.GetMainWindow.MainImage.Source.Height);
     }
     else
     {
         SetTitle.SetTitleString((int)ConfigureWindows.GetMainWindow.MainImage.Source.Width, (int)ConfigureWindows.GetMainWindow.MainImage.Source.Height, FolderIndex);
     }
     ConfigureWindows.GetMainWindow.ParentContainer.Children.Remove(GetCropppingTool);
     CanNavigate = true;
 }
Exemplo n.º 11
0
        void HandleSetTitle(SetTitle packet)
        {
            // -1 at none
            if (packet.TitleID > 0)
            {
                if (!GetPlayer().HasTitle((uint)packet.TitleID))
                    return;
            }
            else
                packet.TitleID = 0;

            GetPlayer().SetChosenTitle((uint)packet.TitleID);
        }
Exemplo n.º 12
0
        internal static async void PerformCrop()
        {
            if (Pics.Count == 0)
            {
                SetTitle.SetTitleString((int)ConfigureWindows.GetMainWindow.MainImage.Source.Width, (int)ConfigureWindows.GetMainWindow.MainImage.Source.Height);
            }
            else
            {
                SetTitle.SetTitleString((int)ConfigureWindows.GetMainWindow.MainImage.Source.Width, (int)ConfigureWindows.GetMainWindow.MainImage.Source.Height, FolderIndex);
            }

            await SaveCrop().ConfigureAwait(false);

            CanNavigate = true;
        }
Exemplo n.º 13
0
        public void OnSetTitle(SetTitle setTitle)
        {
            FormInvoke invoke = new FormInvoke(
                delegate
            {
                _form.SetTitle(setTitle.Body.Title);
            }
                );

            WinFormsServicePort.Post(invoke);

            _state.Title = setTitle.Body.Title;
            setTitle.ResponsePort.Post(DefaultUpdateResponseType.Instance);
            DoSendNotification(setTitle);
        }
Exemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Convert.ToString(Session["admin"]) != "admin")
     {
         Response.Redirect("~/refresh.aspx?msg=" + "对不起,只有管理员才能登陆发表文章!");
         return;
     }
     if (!IsPostBack)
     {
         this.Title = Title + SetTitle.getTitle();
         MyClassOperate mop = new MyClassOperate();
         this.DropDownListClass.DataSource     = mop.getAllCidCname();
         this.DropDownListClass.DataTextField  = "cname";
         this.DropDownListClass.DataValueField = "cid";
         this.DropDownListClass.DataBind();
     }
 }
Exemplo n.º 15
0
        void HandleSetTitle(SetTitle packet)
        {
            // -1 at none
            if (packet.TitleID > 0 && packet.TitleID < PlayerConst.MaxTitleIndex)
            {
                if (!GetPlayer().HasTitle((uint)packet.TitleID))
                {
                    return;
                }
            }
            else
            {
                packet.TitleID = 0;
            }

            GetPlayer().SetUInt32Value(PlayerFields.ChosenTitle, (uint)packet.TitleID);
        }
Exemplo n.º 16
0
        public Loader(string imagePath, Image image, LoadOption load)
        {
            this.Image       = image;
            this.loadOption  = load;
            isPrevious       = false;
            SetTitleCallback = this.DefaltSetTitle;

            if (imagePath != null)
            {
                Load(imagePath);
            }
            else if (loadOption.CurrentFile != null)
            {
                imagePath = loadOption.CurrentFile;
                Load(imagePath);
            }
        }
Exemplo n.º 17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.Title = Title + SetTitle.getTitle();
         string s;
         try
         {
             s = Request.QueryString["s"].ToString();
             if (s.Length > 20)
             {
                 s = s.Substring(0, 20);
             }
             ArticleOperate aop = new ArticleOperate();
             int            currentPage;
             try
             {
                 currentPage = Convert.ToInt32(Request.QueryString["p"]);
             }
             catch
             {
                 currentPage = 1;
             }
             if (currentPage == 0)
             {
                 currentPage = 1;
             }
             PagedDataSource ps = new PagedDataSource();
             ps.DataSource                       = aop.search(s);
             ps.AllowPaging                      = true;
             ps.PageSize                         = 20;
             ps.CurrentPageIndex                 = currentPage - 1;
             this.Pagination1.pageCount          = ps.PageCount;
             this.Pagination1.paramName          = "p";
             this.Pagination1.currentPage        = currentPage;
             this.Pagination1.pageUrl            = "res.aspx?s=" + s;
             this.DataListArticleList.DataSource = ps;
             this.DataListArticleList.DataBind();
         }
         catch
         {
             Response.Redirect("refresh.aspx?msg=" + "请输入要查询的关键字!");
         }
     }
 }
Exemplo n.º 18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Convert.ToString(Session["admin"]) != "admin")
     {
         Response.Redirect("~/refresh.aspx?msg=" + "对不起,只有管理员才能对文章进行相关的操作!");
         return;
     }
     if (!IsPostBack)
     {
         this.Title = Title + SetTitle.getTitle();
         try
         {
             int currentPage;
             try
             {
                 currentPage = Convert.ToInt32(Request.QueryString["p"]);
             }
             catch
             {
                 currentPage = 1;
             }
             if (currentPage == 0)
             {
                 currentPage = 1;
             }
             ArticleOperate  aop = new ArticleOperate();
             PagedDataSource ps  = new PagedDataSource();
             ps.DataSource                       = aop.viewList();
             ps.AllowPaging                      = true;
             ps.PageSize                         = 20;
             ps.CurrentPageIndex                 = currentPage - 1;
             this.Pagination1.pageCount          = ps.PageCount;
             this.Pagination1.currentPage        = currentPage;
             this.Pagination1.pageUrl            = "list.aspx";
             this.Pagination1.paramName          = "p";
             this.DataListArticleList.DataSource = ps;
             this.DataListArticleList.DataBind();
         }
         catch
         {
             Response.Redirect("~/refresh.aspx?msg=" + "显示出错,请稍候尝试!");
         }
     }
 }
Exemplo n.º 19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.Title = Title + SetTitle.getTitle();
         try
         {
             int cid = Convert.ToInt32(Request.QueryString["cid"]);
             int currentPage;
             try
             {
                 currentPage = Convert.ToInt32(Request.QueryString["p"]);
             }
             catch
             {
                 currentPage = 1;
             }
             if (currentPage == 0)
             {
                 currentPage = 1;
             }
             ArticleOperate  aop = new ArticleOperate();
             PagedDataSource ps  = new PagedDataSource();
             ps.DataSource                = aop.viewAllByCid(cid);
             ps.AllowPaging               = true;
             ps.PageSize                  = 20;
             ps.CurrentPageIndex          = currentPage - 1;
             this.Pagination1.currentPage = currentPage;
             this.Pagination1.pageCount   = ps.PageCount;
             this.Pagination1.pageUrl     = "list.aspx?cid=" + cid;
             this.Pagination1.paramName   = "p";
             MyClassOperate mop = new MyClassOperate();
             this.Page.Title = (mop.getByCid(cid)).cname + this.Page.Title;
             this.DataListArticleList.DataSource = ps;
             this.DataListArticleList.DataBind();
         }
         catch
         {
             Response.Redirect("refresh.aspx?msg=" + "对不起没有此分类的信息");
         }
     }
 }
Exemplo n.º 20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.Title = Title + SetTitle.getTitle();
     if (Convert.ToString(Session["admin"]) == "admin")
     {
         int pid;
         try
         {
             pid = Convert.ToInt32(Request.QueryString["p"]);
         }
         catch
         {
             Response.Redirect("~/refresh.aspx?msg=" + "对不起,请选中要回复的留言");
         }
     }
     else
     {
         Response.Redirect("~/refresh.aspx?msg=" + "对不起,只有管理员才能对文章进行相关的操作!");
     }
 }
Exemplo n.º 21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //asdfasdfasdfasdfaasddf
        if (!IsPostBack)
        {
            this.Title = SetTitle.getTitle();
            try
            {
                int     aid = Convert.ToInt32(Request.QueryString["aid"]);
                Article at  = (new ArticleOperate()).getByAid(aid);
                if (at == null || at.Equals(null))
                {
                    this.Page.Title      = "此文章不存在,或被管理员删除,请见谅" + " " + Title;
                    this.lblcontent.Text = "此文章不存在,或被管理员删除,请见谅!";

                    this.txtComment.Text         = "此文章不存在,不允许发表评论";
                    this.txtComment.Enabled      = false;
                    this.btnCommit.EnableTheming = false;
                }
                else
                {
                    this.lbltitle.Text             = at.title;
                    this.Page.Title                = at.title + " " + Title;
                    this.lblposttime.Text          = at.posttime.ToString();
                    this.lblcontent.Text           = at.content;
                    this.lblcname.Text             = at.cname;
                    this.hklist.NavigateUrl        = "list.aspx?cid=" + at.cid.ToString();
                    this.hklastArticle.NavigateUrl = "article.aspx?aid=" + (at.aid - 1).ToString();
                    this.hknextArticle.NavigateUrl = "article.aspx?aid=" + (at.aid + 1).ToString();
                    this.lblCommet.Text            = at.countcomment.ToString();
                    CommentOperate cop = new CommentOperate();
                    this.DataListAllComment.DataSource = cop.viewAllbyAid(aid);
                    this.DataListAllComment.DataBind();
                }
            }
            catch
            {
                Response.Redirect("refresh.aspx?msg=" + "此文章不存在,或被管理员删除,请见谅!");
            }
        }
    }
Exemplo n.º 22
0
        public Task Handle(object command)
        {
            return(command switch
            {
                Create cmd => HandleCreate(cmd),
                Update cmd => HandleFullUpdate(cmd),
                SetTitle cmd => HandleUpdate(cmd.Id, (a) => a.SetTitle(cmd.Title),
                                             (a) => Repository.Update(a)),
                SetReleaseYear cmd => HandleUpdate(cmd.Id, (a) => a.SetReleaseYear(cmd.ReleaseYear),
                                                   (a) => Repository.Update(a)),
                SetPageCount cmd => HandleUpdate(cmd.Id, (a) => a.SetPageCount(cmd.PageCount),
                                                 (a) => Repository.Update(a)),
                SetWordCount cmd => HandleUpdate(cmd.Id, (a) => a.SetWordCount(cmd.WordCount),
                                                 (a) => Repository.Update(a)),
                SetIsbn cmd => HandleUpdate(cmd.Id, (a) => a.SetIsbn(cmd.Isbn),
                                            (a) => Repository.Update(a)),
                SetBookCoverPath cmd => HandleUpdate(cmd.Id, (a) => a.SetBookCoverPath(cmd.BookCoverPath),
                                                     (a) => Repository.Update(a)),
                SetDescription cmd => HandleUpdate(cmd.Id, (a) => a.SetDescription(cmd.Description),
                                                   (a) => Repository.Update(a)),
                SetNotes cmd => HandleUpdate(cmd.Id, (a) => a.SetNotesOld(cmd.Notes),
                                             (a) => Repository.Update(a)),
                SetIsRead cmd => HandleUpdate(cmd.Id, (a) => a.SetIsRead(cmd.IsRead),
                                              (a) => Repository.Update(a)),

                SetLanguage cmd => HandleUpdateAsync(cmd.Id,
                                                     async a => await UpdateLanguageAsync(a, cmd.Language.Id)),
                SetPublisher cmd => HandleUpdateAsync(cmd.Id,
                                                      async a => await UpdatePublisherAsync(a, cmd.Publisher.Id)),

                SetAuthors cmd => HandleUpdateAsync(cmd.Id,
                                                    async a => await UpdateBookAuthorsAsync(a, cmd.Authors)),
                SetFormats cmd => HandleUpdateAsync(cmd.Id,
                                                    async a => await UpdateBookFormatsAsync(a, cmd.Formats)),
                SetGenres cmd => HandleUpdateAsync(cmd.Id,
                                                   async a => await UpdateBookGenresAsync(a, cmd.Genres)),
                SetBookReadDates cmd => HandleUpdateAsync(cmd.Id,
                                                          async a => await UpdateBookReadDatesAsync(a, cmd.BookReadDates)),
                Delete cmd => HandleDeleteAsync(cmd),
                _ => Task.CompletedTask
            });
Exemplo n.º 23
0
        /// <summary>
        /// Zooms to given value
        /// </summary>
        /// <param name="value"></param>
        internal static void Zoom(double value)
        {
            if (value > UC.GetQuickSettingsMenu.ZoomSlider.Maximum)
            {
                return;
            }

            ZoomValue = value;

            BeginZoomAnimation(ZoomValue);

            /// Displays zoompercentage in the center window
            if (!string.IsNullOrEmpty(ZoomPercentage))
            {
                Tooltip.ShowTooltipMessage(ZoomPercentage, true);
            }
            else
            {
                Tooltip.CloseToolTipMessage();
            }

            /// Display updated values
            if (Pics.Count == 0)
            {
                /// Display values from web
                SetTitle.SetTitleString((int)ConfigureWindows.GetMainWindow.MainImage.Source.Width, (int)ConfigureWindows.GetMainWindow.MainImage.Source.Height);
            }
            else
            {
                SetTitle.SetTitleString((int)ConfigureWindows.GetMainWindow.MainImage.Source.Width, (int)ConfigureWindows.GetMainWindow.MainImage.Source.Height, FolderIndex);
            }

            if (UC.GetQuickSettingsMenu.ZoomSlider.Value != value)
            {
                UC.GetQuickSettingsMenu.ZoomSlider.Value = value;
            }
        }
Exemplo n.º 24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Convert.ToString(Session["admin"]) != "admin")
     {
         Response.Redirect("~/refresh.aspx?msg=" + "对不起,只有管理员才能对文章进行相关的操作!");
         return;
     }
     if (!IsPostBack)
     {
         this.Title = Title + SetTitle.getTitle();
         MyClassOperate mop = new MyClassOperate();
         this.DropDownListClass.DataSource     = mop.getAllCidCname();
         this.DropDownListClass.DataTextField  = "cname";
         this.DropDownListClass.DataValueField = "cid";
         this.DropDownListClass.DataBind();
         try
         {
             int     aid = Convert.ToInt32(Request.QueryString["aid"]);
             Article at  = (new ArticleOperate()).getByAid(aid);
             if (at == null || at.Equals(null))
             {
                 this.lblcontext.Text = "对不起,此文章不存在,或被管理员删除";
             }
             else
             {
                 this.txtTitle.Text = at.title;
                 Page.Title         = at.title + Title;
                 this.DropDownListClass.SelectedValue = at.cid.ToString();
                 this.txtBody.Value = at.content;
             }
         }
         catch
         {
             Response.Redirect("~/refresh.aspx?msg=" + "此文章不存在,或被管理员删除,请见谅!");
         }
     }
 }
Exemplo n.º 25
0
        public static void Run()
        {
            try
            {
                Console.Clear();

                while (_running)
                {
                    ConsoleEx.WrapInOutputLock(() => {
                        Console.CursorVisible = false;
                        Console.SetCursorPosition(0, 0);
                        ConsoleEx.WriteLineEnh(SetTitle.Invoke().FixedWidthEnh(ConsoleEx.WindowWidth - 12) + "    " + DateTime.Now.ToStringHH24mmss());
                        ConsoleEx.WriteLineEnh(SetKeysHelp.Invoke().FixedWidthEnh(ConsoleEx.WindowWidth - 8 /*16*/) + "  " + "- *Q*U|T" /*$" * R*estart - *Q*U|T"*/);

                        OnRefresh?.Invoke();
                        Console.CursorVisible = true;
                    });

                    var keyInfo = ConsoleEx.ReadKeyWithTimeout(RefreshInterval);
                    if (keyInfo == null)
                    {
                        continue;
                    }

                    if (keyInfo.Value.KeyChar != 'Q' && keyInfo.Value.KeyChar != '|')
                    {
                        OnKey?.Invoke(keyInfo.Value.KeyChar.ToString());
                    }

                    HandleStandardKey(keyInfo);
                }
            }
            finally
            {
                _cts.Cancel();
            }
        }
Exemplo n.º 26
0
 public IActionResult Put([FromServices] SetTitleHandler handler, SetTitle request)
 {
     handler.Handle(request);
     return(Ok());
 }
Exemplo n.º 27
0
 public Game1(Form1 form, Control control)
     : base(control)
 {
     this.form = form;
     setTitle  = form.SetTitle;
 }