Пример #1
0
        private void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            // percentage left and right panel
            var desiredPanelWidth = this.ActualWidth * 0.15;

            LeftPanel.Width  = Math.Max(desiredPanelWidth, LeftPanel.MinWidth);
            RightPanel.Width = Math.Max(desiredPanelWidth, RightPanel.MinWidth);

            LeftPanel.UpdateLayout();
            RightPanel.UpdateLayout();

            if (_leftPanelHidden)
            {
                LeftPanel.Margin = new Thickness(
                    -MWLeftPanelTabControl.ActualWidth, LeftPanel.Margin.Top,
                    LeftPanel.Margin.Right, LeftPanel.Margin.Bottom);
            }

            if (_rightPanelHidden)
            {
                RightPanel.Margin = new Thickness(
                    RightPanel.Margin.Left, RightPanel.Margin.Top,
                    -MWRightPanelStackPanel.ActualWidth, RightPanel.Margin.Bottom);
            }

            // scale assets
            RepaintTrackRenderer();
        }
Пример #2
0
 void Awake()
 {
     leftPanel              = FindObjectOfType <LeftPanel> ();
     breedingPopup          = FindObjectOfType <BreedingPopup> ();
     breedingPopupTransform = FindObjectOfType <BreedingPopup> ().gameObject.transform;
     geneticDockTransform   = FindObjectOfType <BreedingPopup> ().geneticDock.transform;
 }
Пример #3
0
        public void Update()
        {
            if (needsCameraUpdate)
            {
                needsCameraUpdate = false;
                UpdateCameraOffset();
            }

            runButton.Update();
            menuButton.Update();
            addStatButton.Update();
            addSkillButton.Update();

            if (IsLeftPanelVisible)
            {
                LeftPanel.Update();
                leftPanelFrame.Update();
            }

            if (IsRightPanelVisible)
            {
                RightPanel.Update();
                rightPanelFrame.Update();
            }

            if (!IsLeftPanelVisible || !IsRightPanelVisible)
            {
                minipanel.Update();
            }
        }
Пример #4
0
 void Awake()
 {
     city            = FindObjectOfType <City> ();
     leftPanel       = FindObjectOfType <LeftPanel> ();
     breedingManager = FindObjectOfType <BreedingManager> ();
     crimeManager    = FindObjectOfType <CrimeManager> ();
 }
Пример #5
0
 public void SetUp()
 {
     Initialize();
     _homePage      = new HomePage(Driver);
     _leftPanelPage = new LeftPanel(Driver);
     _homePage.NavigateTo();
     _homePage.HomePageSectionsButton("Alerts, Frame & Windows").Click();
 }
Пример #6
0
 async private void HideLeftPanel()
 {
     if (LeftPanel != null)
     {
         leftSwipeGesture.TranslateTo(0, leftSwipeGesture.TranslationY, SpeedAnimatePanel, Easing.CubicOut);
         await LeftPanel.TranslateTo(0, LeftPanel.TranslationY, SpeedAnimatePanel, Easing.CubicOut);
     }
 }
Пример #7
0
 public void SetUp()
 {
     Initialize();
     _homePage      = new HomePage(Driver);
     _leftPanelPage = new LeftPanel(Driver);
     _homePage.NavigateTo();
     _homePage.HomePageSectionsButton("Interactions").Click();
 }
Пример #8
0
        public MainPage() : base(PanelSetEnum.psLeftRight)
        {
            #region right menu
            var btnRightMenuShow = new Button
            {
                Text = "Right menu show",
            };
            btnRightMenuShow.Clicked += (s, e) => { IsShowRightPanel = !IsShowRightPanel; };

            //add button to main layout on page
            ContentLayout.Children.Add(btnRightMenuShow);

            //set width for right panel
            RightPanelWidth = 150;

            //add label to main layout on right panel
            RightPanel.AddToContext(
                new StackLayout
            {
                Padding  = new Thickness(32),
                Children =
                {
                    new Label
                    {
                        Text      = "right menu",
                        TextColor = Color.Red,
                    }
                }
            });
            RightPanel.BackgroundColor = Color.Blue;

            #endregion

            #region left menu
            var btnLeftMenuShow = new Button
            {
                Text = "Left menu show",
            };
            btnLeftMenuShow.Clicked += (s, e) => { IsShowLeftPanel = !IsShowLeftPanel; };

            ContentLayout.Children.Add(btnLeftMenuShow);

            LeftPanel.BackgroundColor = Color.Yellow;
            LeftPanel.AddToContext(
                new StackLayout
            {
                Padding  = new Thickness(32),
                Children =
                {
                    new Label
                    {
                        Text      = "left menu",
                        TextColor = Color.Green,
                    }
                }
            });
            #endregion
        }
Пример #9
0
        protected void PushAll_Btn_Click(object sender, EventArgs e)
        {
            CurDT.DefaultView.RowFilter = "";
            int count = CurDT.Rows.Count;

            PushContent(CurDT);
            ReBind();
            ScriptManager.RegisterStartupScript(LeftPanel, LeftPanel.GetType(), "", "<script>alert('推送完成,已" + count + "篇内容');</script>", false);
        }
Пример #10
0
 void Awake()
 {
     leftPanel        = FindObjectOfType <LeftPanel> ();
     unitManager      = FindObjectOfType <UnitManager> ();
     breedingManager  = FindObjectOfType <BreedingManager> ();
     mouseController  = FindObjectOfType <MouseController> ();
     sampleToIconMap  = new Dictionary <int, GeneticIcon> ();
     displayedSamples = new List <GeneticSample> ();
 }
Пример #11
0
        async private void ShowLeftPanel()
        {
            IsShowRightPanel = false;

            if (LeftPanel != null)
            {
                leftSwipeGesture.TranslateTo(_leftPanelWidth, leftSwipeGesture.TranslationY, SpeedAnimatePanel, Easing.CubicOut);
                await LeftPanel.TranslateTo(_leftPanelWidth, LeftPanel.TranslationY, SpeedAnimatePanel, Easing.CubicOut);
            }
        }
Пример #12
0
        private void PrintButton_Click(object sender, EventArgs e)
        {
            LeftPanel.DrawToBitmap(b, LeftPanel.ClientRectangle);
            QuestionListView.DrawToBitmap(c, QuestionListView.ClientRectangle);

            if (printPreviewDialog1.ShowDialog() == DialogResult.OK)
            {
                printDocument1.Print();
            }
        }
Пример #13
0
 public void LeftPanelState(bool state)
 {
     if (state)
     {
         LeftPanel.GetComponent <PanelAnimator>().GoEnd();
     }
     else
     {
         LeftPanel.GetComponent <PanelAnimator>().GoStart();
     }
 }
Пример #14
0
        private void CreateLeftGrid()
        {
            if (LeftPanel != null)
            {
                var leftGrid = GdiMapper.ToGdiGrid(ChartGridModel);
                leftGrid.CellSize = CellSize;
                leftGrid.Size     = LeftPanel.Size;
                leftGrid.IsDrawnFromRightToLeft = true;

                LeftPanel.AddChild(leftGrid);
            }
        }
Пример #15
0
 protected void PushSel_Btn_Click(object sender, EventArgs e)
 {
     //另外还需要加入来源判断吧,或重新生成Index直接从dt中取值
     if (!string.IsNullOrEmpty(Request.Form["idchk"]))
     {
         CurDT.DefaultView.RowFilter = "Index IN(" + Request.Form["idchk"] + ")";
         int count = CurDT.DefaultView.ToTable().Rows.Count;
         PushContent(CurDT.DefaultView.ToTable());
         ReBind();
         ScriptManager.RegisterStartupScript(LeftPanel, LeftPanel.GetType(), "", "<script>alert('推送完成,已" + count + "篇内容');</script>", false);
     }
 }
Пример #16
0
        /// <summary>
        /// 推送文章
        /// </summary>
        /// <param name="dt">需要推送的文章dt</param>
        private void PushContent(DataTable dt)
        {
            if (dt == null || dt.Rows.Count < 0)
            {
                return;
            }
            HttpHelper http     = new HttpHelper();
            HtmlHelper htmlHelp = new HtmlHelper();

            string[] strArr = new string[] { "http://chanye.hbncw.cn:8080/AddArticle.aspx|CYT", "http://dqt.hbncw.net:89/AddArticle.aspx|DQT" };
            foreach (string str in strArr)
            {
                string url  = str.Split('|')[0];
                string plat = str.Split('|')[1];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    try
                    {
                        DataRow dr = dt.Rows[i];
                        Dictionary <string, object> param = new Dictionary <string, object>();
                        param.Add("Title", dr["Title"]);
                        string content = htmlHelp.ConvertImgUrl(dr["Contents"].ToString(), SiteConfig.SiteInfo.SiteUrl);
                        param.Add("Contents", HttpUtility.UrlEncode(content)); //这里需要对方用UrlDecode
                        param.Add("CateName", dr["CateName"]);                 //目标栏目名称
                        param.Add("Author", dr["Author"]);
                        param.Add("PublishDate", dr["PublishDate"]);
                        param.Add("ImgUrl", dr["ImgUrl"]);
                        param.Add("Keyword", dr["Keyword"]);
                        param.Add("CityName", dr["CityName"]);
                        param.Add("Platform", dr["Platform"]);
                        param.Add("ProductType", plat);
                        HttpResult result = http.UploadParam(url, param);
                        if (!result.Html.Contains("-1"))
                        {
                            UpdateCatch(dr);
                        }
                    }
                    catch (Exception ex)
                    {
                        ScriptManager.RegisterStartupScript(LeftPanel, LeftPanel.GetType(), "", "<script>alert('推送错误,原因:" + ex.Message + "');</script>", false);
                    }
                }
            }

            //有几个问题需要咨询
            //1,文章是否要同时推送到党群与产业通,或根据节点,推送至不同的平台(党群||产业通)
            //2,对方有无对我们的内容解码处理
            //3,需要配置好栏目节点之间的对应XML
            //1,图片需要转为http格式(需要配后应)
        }
Пример #17
0
    void OnEnable()
    {
        tex_bg = Resources.Load <Texture2D> ("GUISkin/Grid");
        lst_chars.Add(new Character(this, "N/A", 7));
        coordinate  = Vector2.zero;
        colorWindow = new ColorWindow();
        leftPanel   = new LeftPanel(this);
        rightPanel  = new RightPanel(this);
        GUISkin mySkin = Resources.Load <GUISkin> ("GUISkin/NodeSkin");

        style_button = mySkin.GetStyle("button");

        CreateNode(Vector2.zero, 0);
        //Selection.selectionChanged = LoadStoryAsset;
    }
Пример #18
0
        public async Task ChangeLeftDir(File file = null)
        {
            //try
            //{
            if (null != file)
            {
                LeftPanel.ChangeDirectory(file);
            }
            await refreshListing(LeftPanel);

            //}
            //catch (Exception e)
            //{
            //    await ShowAlert(e);
            //}
        }
Пример #19
0
        private void Copy()
        {
            try
            {
                string file = LeftPanel.File.file;
                string filePath = Path.GetFileName(file);
                string destination = RightPanel.path + '\\' + filePath;
                LeftPanel.File = null;

                File.Copy(file, destination, true);
            }
            catch { }

            LeftPanel.Reload(LeftPanel.path);
            RightPanel.Reload(RightPanel.path);
        }
Пример #20
0
        public async Task CopyToLeft(File file)
        {
            //try {
            string target = System.IO.Path.Combine(new string[] { LeftPanel.GetCurrentDir().Id, file.Title });

            using (var manager = new CopierManager(
                       LeftPanel, file, LeftPanel.GetNewFile(file.Title, target)))
            {
                await manager.CopyAsync();
                await refreshListing(LeftPanel);
            }
            //}
            //catch(Exception e)
            //{
            //    await ShowAlert(e);
            //}
        }
Пример #21
0
        private void LeftPanel_DragEnter(object sender, DragEventArgs e)
        {
            Point   p    = PointToClient(new Point(e.X, e.Y));
            Control ctrl = e.Data.GetData(e.Data.GetFormats(true)[0]) as Control;

            if (ctrl is L_ListCell)
            {
                e.Effect = DragDropEffects.Move;
                rec      = new Rectangle(0, p.Y - 2, LeftPanel.Width, 4);
                onDrag   = true;
                LeftPanel.Refresh();
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }
        }
Пример #22
0
        private void WorkerDownloadThumbsProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            ProgressPanel.Visible = true;
            CurrentAction.Text    = Resources.LoadingThumbnails;
            Progress.Maximum      = 100;
            Progress.Value        = e.ProgressPercentage;

            if (e.UserState is string)
            {
                CurrentAction.Text = (string)e.UserState;
            }
            LeftPanel.Refresh();
            foreach (var control in LeftPanel.Controls.OfType <MetroTile>())
            {
                control.Refresh();
            }
            Application.DoEvents();
        }
Пример #23
0
 private void WorkerDownloadThumbsCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     CurrentAction.Text = Resources.ReadyToCopy;
     LeftPanel.Refresh();
     foreach (var control in LeftPanel.Controls.OfType <MetroTile>())
     {
         control.Refresh();
     }
     Application.DoEvents();
     if (!_autoMode)
     {
         EnablePanels();
         if (!_autoMode)
         {
             return;
         }
     }
     CopyFilesAsync();
 }
Пример #24
0
    private void ActionPanelContralDown()
    {
        ActionPanel.SetBool("Up", false);
        ActionPanel.SetBool("Down", true);

        TopPanel.SetBool("Up", true);
        TopPanel.SetBool("Down", false);

        LeftPanel.SetBool("Up", true);
        LeftPanel.SetBool("Down", false);

        FanHuiPanel.SetBool("Up", false);
        FanHuiPanel.SetBool("Down", true);

        GuoShuPanel.SetBool("Up", false);
        GuoShuPanel.SetBool("Down", true);

        ShuInfoPanel.SetBool("Up", false);
        ShuInfoPanel.SetBool("Down", true);
    }
Пример #25
0
    private void FanHuiPanelUp(LandProperty isLand)
    {
        ShuInfoPanel.gameObject.SetActive(true);
        ShuInfoPanel.transform.position = Camera.main.WorldToScreenPoint(isLand.transform.position);
        return;

        TopPanel.SetBool("Up", false);
        TopPanel.SetBool("Down", true);

        LeftPanel.SetBool("Up", false);
        LeftPanel.SetBool("Down", true);

        GuoShuPanel.SetBool("Up", true);
        GuoShuPanel.SetBool("Down", false);

        FanHuiPanel.SetBool("Up", true);
        FanHuiPanel.SetBool("Down", false);

        ShuInfoPanel.SetBool("Up", true);
        ShuInfoPanel.SetBool("Down", false);
    }
Пример #26
0
        private void ChangeDriveButton_Click(object sender, EventArgs e)
        {
            Button button = sender as Button;

            if (LeftPanel.Contains(button))
            {
                //данная кнопка принадлежит левой панели
                LeftViewRootPath      = button.Text + ":\\";
                LeftPathTextBox.Text  = LeftViewRootPath;
                LeftViewObserver.Path = LeftViewRootPath;
                UpdateListView(LeftListView, LeftViewRootPath);
            }
            else
            {
                //данная кнопка принадлежит правой панели
                RightViewRootPath      = button.Text + ":\\";
                RightPathTextBox.Text  = RightViewRootPath;
                RightViewObserver.Path = RightViewRootPath;
                UpdateListView(RightListView, RightViewRootPath);
            }
        }
Пример #27
0
        private void CopyExecute(object obj)
        {
            string source = "";
            string target = "";

            if (LeftPanel.SelectedPath != null)
            {
                source = Path.Combine(LeftPanel.CurrentPath, LeftPanel.GetCorrectSelectedPath());
                target = Path.GetFullPath(RightPanel.CurrentPath);
            }
            else if (RightPanel.SelectedPath != null)
            {
                source = Path.Combine(RightPanel.CurrentPath, RightPanel.GetCorrectSelectedPath());
                target = Path.GetFullPath(LeftPanel.CurrentPath);
            }

            _model.Copy(source, target); // Model usage


            UpdateCurrentPathContents(); // Updating view
        }
Пример #28
0
        private void AddBarSeries(DataSeries series, int offsetY)
        {
            var y = (CellSize.Height / 2) + offsetY;

            foreach (var value in series.Data)
            {
                var length = WidthUnit * value;

                var bar = new GdiRectangle
                {
                    Size            = new SizeF(Math.Abs(length), BarSettingModel.Size),
                    Margin          = new PointF(0, y),
                    BackgroundColor = series.Color,
                };

                var text = new GdiText
                {
                    Margin            = new PointF(bar.Size.Width + 2, 0),
                    Content           = string.Format(BarSettingModel.FormatValue, value),
                    Font              = BarSettingModel.ValueFont,
                    TextColor         = Color.Gray,
                    VerticalAlignment = GdiSharp.Enum.GdiVerticalAlign.Middle
                };

                if (length > 0)
                {
                    RightPanel.AddChild(bar);
                }
                else if (length < 0)
                {
                    LeftPanel.AddChild(bar);
                    bar.HorizontalAlignment  = GdiSharp.Enum.GdiHorizontalAlign.Right;
                    text.HorizontalAlignment = GdiSharp.Enum.GdiHorizontalAlign.Right;
                }

                bar.AddChild(text);

                y += CellSize.Height;
            }
        }
Пример #29
0
        public void Render()
        {
            if (IsLeftPanelVisible)
            {
                LeftPanel.Render();
                leftPanelFrame.Render();
            }

            if (IsRightPanelVisible)
            {
                RightPanel.Render();
                rightPanelFrame.Render();
            }

            // Render the background bottom bar
            renderWindow.Draw(panelSprite, 0, new Point(0, 600));
            renderWindow.Draw(panelSprite, 1, new Point(166, 600));
            renderWindow.Draw(panelSprite, 2, new Point(294, 600));
            renderWindow.Draw(panelSprite, 3, new Point(422, 600));
            renderWindow.Draw(panelSprite, 4, new Point(550, 600));
            renderWindow.Draw(panelSprite, 5, new Point(685, 600));

            // Render the health bar
            renderWindow.Draw(healthManaSprite, 0, new Point(30, 587));
            renderWindow.Draw(gameGlobeOverlapSprite, 0, new Point(28, 595));

            // Render the mana bar
            renderWindow.Draw(healthManaSprite, 1, new Point(692, 588));
            renderWindow.Draw(gameGlobeOverlapSprite, 1, new Point(693, 591));

            if (!IsLeftPanelVisible || !IsRightPanelVisible)
            {
                minipanel.Render();
            }

            runButton.Render();
            menuButton.Render();
            addStatButton.Render();
            addSkillButton.Render();
        }
Пример #30
0
        public void RefreshLeftPanel() //a bal panel képeit tölti újra
        {
            LeftPanel.Controls.Clear();
            LeftPanel.Invalidate();
            LPheight = 0;
            //minden kép kirajzolása balra
            foreach (var image in Images)
            {
                int k = 0;
                for (int i = 0; i < 80; i += 10)
                {
                    for (int j = 0; j < 80; j += 10)
                    {
                        GenStaticPanel(new Point(j + LPleftpadding, i + LPtoppadding + LPheight), LeftPanel, image[k]);
                        k++;
                    }
                }

                LPheight += 100;
            }
            LPheight = 0;
            foreach (var image in ZImages)
            {
                int k = 0;
                for (int i = 0; i < 80; i += 10)
                {
                    for (int j = 0; j < 80; j += 10)
                    {
                        GenStaticPanel(new Point(j + LPleftpadding + 100, i + LPtoppadding + LPheight), LeftPanel, image[k]);
                        k++;
                    }
                }

                LPheight += 100;
            }
            toolStripStatusLabel1.Text = Images.Count() + " patterns loaded.";
        }