예제 #1
0
	void Init(){
		mainPanel =  GameObjectTools.GetComponentInChildren <MainPanel> (gameObject);
		playPanel = GameObjectTools.GetComponentInChildren<PlayPanel> (gameObject);
		pausePanel = GameObjectTools.GetComponentInChildren<PausePanel> (gameObject);
		gameOverPanel = GameObjectTools.GetComponentInChildren<GameOverPanel> (gameObject);

		mainPanel.gameObject.SetActive (true);
		playPanel.gameObject.SetActive (false);
		pausePanel.gameObject.SetActive (false);
		gameOverPanel.gameObject.SetActive (false);

		mainPanel.Init ();
		playPanel.Init ();
		pausePanel.Init ();
		gameOverPanel.Init ();
	}
예제 #2
0
 public ClassUMLObject_Mode(MainPanel _Panel)
     : base(_Panel)
 {
     Description = "Create a usecase object";
 }
예제 #3
0
 /// <summary> Установка параметров </summary>
 /// <param name="countCandles"></param>
 protected void ComputeParams(Rectangle RectCanvas)
 {
     MainPanel.SetRect(new GRectangle(RectCanvas));
 }
예제 #4
0
 public FHMapper(MainPanel MainPanel)
 {
     this.MainPanel = MainPanel;
 }
예제 #5
0
 public UndoRedoManager(MainPanel parentPanel)
 {
     this.parentPanel = parentPanel;
 }
예제 #6
0
 void Start()
 {
     Popup.Show();
     MainPanel.Show();
 }
 public void AddSongPageNavigate(object sender, RoutedEventArgs e)
 {
     MainPanel.Navigate(typeof(AddSong));
 }
 public void SongListPageNavigate(object sender, RoutedEventArgs e)
 {
     MainPanel.Navigate(typeof(SongList));
 }
예제 #9
0
 private void clear()
 {
     MainPanel.Refresh();
 }
예제 #10
0
        /// <summary>
        /// Search for the selected item in Spotify
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void SearchButton_Click(object sender, RoutedEventArgs e)
        {
            string feedbackMessage = "";

            if (Feedback == null)
            {
                return;
            }
            Feedback.Text                     = "";
            feedbackMessage                   = "";
            PlaylistHeader.Visibility         = Visibility.Collapsed;
            TracklistHeader.Visibility        = Visibility.Collapsed;
            AlbumlistHeader.Visibility        = Visibility.Collapsed;
            ResultsHeaderContainer.Visibility = Visibility.Collapsed;
            if (SearchBox.Text == "")
            {
                feedbackMessage = "Please enter text to search for (I can't read your mind...yet)";
            }
            else
            {
                searchSave     = SearchBox.Text;
                searchTypeSave = SearchType.SelectedIndex;
                MainPanel.SetValue(MarginProperty, new Thickness(0, 20, 0, 0));
                RelativePanel.SetAlignTopWithPanel(SearchBox, true);
                ComboBoxItem selected         = SearchType.SelectedValue as ComboBoxItem;
                String       selectedString   = selected.Content.ToString().ToLower();
                UriBuilder   searchUriBuilder = new UriBuilder(SEARCH_URL);
                List <KeyValuePair <string, string> > queryParams = new List <KeyValuePair <string, string> >
                {
                    new KeyValuePair <string, string>("type", selectedString),
                    new KeyValuePair <string, string>("limit", "10"),
                    new KeyValuePair <string, string>("q", SearchBox.Text.Replace(" ", "+"))
                };
                string queryParamsString = RequestHandler.ConvertToQueryString(queryParams);
                searchUriBuilder.Query = queryParamsString;
                string searchResultString = await RequestHandler.SendCliGetRequest(searchUriBuilder.Uri.ToString());

                JsonObject searchResultJson = new JsonObject();
                try
                {
                    searchResultJson = JsonObject.Parse(searchResultString);
                }
                catch (COMException)
                {
                    return;
                }

                ClearResults();
                Results.Visibility = Visibility.Visible;

                // playlists
                if (selectedString == "playlist")
                {
                    if (searchResultJson.TryGetValue("playlists", out IJsonValue playlistsJson) && playlistsJson.ValueType == JsonValueType.Object)
                    {
                        JsonObject playlists = playlistsJson.GetObject();
                        if (playlists.TryGetValue("items", out IJsonValue itemsJson) && itemsJson.ValueType == JsonValueType.Array)
                        {
                            JsonArray playlistsArray = itemsJson.GetArray();
                            if (playlistsArray.Count == 0)
                            {
                                feedbackMessage = "No playlists found.";
                            }
                            else
                            {
                                ResultsHeaderContainer.Visibility = Visibility.Visible;
                                PlaylistHeader.Visibility         = Visibility.Visible;
                                long loadingKey = DateTime.Now.Ticks;
                                MainPage.AddLoadingLock(loadingKey);
                                App.mainPage.SetLoadingProgress(PlaybackSource.Spotify, 0, playlistsArray.Count, loadingKey);
                                foreach (JsonValue playlistJson in playlistsArray)
                                {
                                    if (playlistJson.GetObject().TryGetValue("href", out IJsonValue fullHref) && fullHref.ValueType == JsonValueType.String)
                                    {
                                        string fullPlaylistString = await RequestHandler.SendCliGetRequest(fullHref.GetString());

                                        Playlist playlist = new Playlist();
                                        await playlist.SetInfo(fullPlaylistString);

                                        PlaylistList playlistList = new PlaylistList(playlist);
                                        try
                                        {
                                            if (!App.isInBackgroundMode)
                                            {
                                                Results.Items.Add(playlistList);
                                                if (Results.Items.IndexOf(playlistList) % 2 == 1)
                                                {
                                                    playlistList.TurnOffOpaqueBackground();
                                                }
                                            }
                                        }
                                        catch (COMException) { }
                                        App.mainPage.SetLoadingProgress(PlaybackSource.Spotify, Results.Items.Count, playlistsArray.Count, loadingKey);
                                    }
                                }
                                MainPage.RemoveLoadingLock(loadingKey);
                            }
                        }
                    }
                }

                // track
                else if (selectedString == "track")
                {
                    if (searchResultJson.TryGetValue("tracks", out IJsonValue tracksJson) && tracksJson.ValueType == JsonValueType.Object)
                    {
                        JsonObject tracks = tracksJson.GetObject();
                        if (tracks.TryGetValue("items", out IJsonValue itemsJson) && itemsJson.ValueType == JsonValueType.Array)
                        {
                            JsonArray tracksArray = itemsJson.GetArray();
                            if (tracksArray.Count == 0)
                            {
                                feedbackMessage = "No tracks found.";
                            }
                            else
                            {
                                ResultsHeaderContainer.Visibility = Visibility.Visible;
                                TracklistHeader.Visibility        = Visibility.Visible;
                                long loadingKey = DateTime.Now.Ticks;
                                MainPage.AddLoadingLock(loadingKey);
                                App.mainPage.SetLoadingProgress(PlaybackSource.Spotify, 0, tracksArray.Count, loadingKey);
                                foreach (JsonValue trackJson in tracksArray)
                                {
                                    Track track = new Track();
                                    await track.SetInfoDirect(trackJson.Stringify());

                                    TrackList trackList = new TrackList(track);
                                    try
                                    {
                                        if (!App.isInBackgroundMode)
                                        {
                                            Results.Items.Add(trackList);
                                            if (Results.Items.IndexOf(trackList) % 2 == 1)
                                            {
                                                trackList.TurnOffOpaqueBackground();
                                            }
                                        }
                                    }
                                    catch (COMException) { }
                                    App.mainPage.SetLoadingProgress(PlaybackSource.Spotify, Results.Items.Count, tracksArray.Count, loadingKey);
                                }
                                MainPage.RemoveLoadingLock(loadingKey);
                            }
                        }
                    }
                }

                // album
                else if (selectedString == "album")
                {
                    if (searchResultJson.TryGetValue("albums", out IJsonValue albumsJson) && albumsJson.ValueType == JsonValueType.Object)
                    {
                        JsonObject albums = albumsJson.GetObject();
                        if (albums.TryGetValue("items", out IJsonValue itemsJson) && itemsJson.ValueType == JsonValueType.Array)
                        {
                            JsonArray albumsArray = itemsJson.GetArray();
                            if (albumsArray.Count == 0)
                            {
                                feedbackMessage = "No albums found.";
                            }
                            else
                            {
                                ResultsHeaderContainer.Visibility = Visibility.Visible;
                                AlbumlistHeader.Visibility        = Visibility.Visible;
                                long loadingKey = DateTime.Now.Ticks;
                                MainPage.AddLoadingLock(loadingKey);
                                App.mainPage.SetLoadingProgress(PlaybackSource.Spotify, 0, albumsArray.Count, loadingKey);
                                foreach (JsonValue albumJson in albumsArray)
                                {
                                    Album album = new Album();
                                    await album.SetInfo(albumJson.Stringify());

                                    AlbumList albumList = new AlbumList(album);
                                    try
                                    {
                                        if (!App.isInBackgroundMode)
                                        {
                                            Results.Items.Add(albumList);
                                            if (Results.Items.IndexOf(albumList) % 2 == 1)
                                            {
                                                albumList.TurnOffOpaqueBackground();
                                            }
                                        }
                                    }
                                    catch (COMException) { }
                                    App.mainPage.SetLoadingProgress(PlaybackSource.Spotify, Results.Items.Count, albumsArray.Count, loadingKey);
                                }
                                MainPage.RemoveLoadingLock(loadingKey);
                            }
                        }
                    }
                }
            }
            Feedback.Text = feedbackMessage;
            if (feedbackMessage == "")
            {
                Feedback.Visibility = Visibility.Collapsed;
            }
            else
            {
                Feedback.Visibility = Visibility.Visible;
            }
        }
예제 #11
0
 public void InitMainView(MainPanel mainView)
 {
     playerTxt = mainView.playerTxt;
 }
예제 #12
0
 protected override void Awake()
 {
     base.Awake();
     Instance = this;
 }
예제 #13
0
 public None_Mode(MainPanel _Panel)
     : base(_Panel)
 {
     Description = "Not select any tool";
 }
예제 #14
0
 private void RefreshMainPanel()
 {
     MainPanel.Refresh();
 }
예제 #15
0
 public UseCaseUMLObject_Mode(MainPanel _Panel)
     : base(_Panel)
 {
     Description = "Create a class object";
 }
예제 #16
0
 public void Back()
 {
     MainPanel.SetActive(true);
     ConfPanel.SetActive(false);
     LvlPanel.SetActive(false);
 }
예제 #17
0
        private void button2_Click(object sender, EventArgs e)
        {
            ConsolePanel.Text = "";
            var command = mainBox.Text;

            string[] multiLine = command.Split('\n');

            for (int i = 0; i < multiLine.Length - 1; i++)
            {
                String   abc    = multiLine[i].Trim();
                string[] syntax = abc.Split('(');
                try
                {
                    if (string.Compare(syntax[0].ToLower(), "moveto") == 0)
                    {
                        String[] parameter1 = syntax[1].Split(',');
                        String[] parameter2 = parameter1[1].Split(')');
                        String   p1         = parameter1[0];
                        String   p2         = parameter2[0];
                        PenMove(int.Parse(p1), int.Parse(p2));
                    }
                    else if (syntax[0].Equals("\n"))
                    {
                    }
                    else if (string.Compare(syntax[0].ToLower(), "drawto") == 0)
                    {
                        String[] parameter1 = syntax[1].Split(',');
                        String[] parameter2 = parameter1[1].Split(')');
                        String   p1         = parameter1[0];
                        String   p2         = parameter2[0];
                        DrawPen(int.Parse(p1), int.Parse(p2));
                    }

                    else if (string.Compare(syntax[0].ToLower(), "clear") == 0)
                    {
                        clear();
                    }

                    else if (string.Compare(syntax[0].ToLower(), "clear") == 0)
                    {
                        reset();
                    }

                    else if (string.Compare(syntax[0].ToLower(), "rectangle") == 0)
                    {
                        String[] parameter1 = syntax[1].Split(',');
                        String[] parameter2 = parameter1[1].Split(')');
                        String   p1         = parameter1[0];
                        String   p2         = parameter2[0];
                        rectangleDrawing(positionX, positionY, int.Parse(p1), int.Parse(p2));
                    }

                    else if (string.Compare(syntax[0].ToLower(), "circle") == 0)
                    {
                        String[] parameter2 = syntax[1].Split(')');
                        String   p2         = parameter2[0];
                        circleDrawing(positionX, positionY, int.Parse(p2));
                    }
                    else if (string.Compare(syntax[0].ToLower(), "triangle") == 0)
                    {
                        String[] parameter1 = syntax[1].Split(',');
                        String[] parameter2 = parameter1[1].Split(')');
                        String   p1         = parameter1[0];
                        String   p2         = parameter2[0];

                        triangleDrawing(positionX, positionY, int.Parse(p1), int.Parse(p2));
                    }
                    else
                    {
                        ConsolePanel.Text = "";
                        ConsolePanel.Text = ("There is a syntax error on line: " + (i + 1));
                        MainPanel.Refresh();
                        break;
                    }
                }
                catch (Exception)
                {
                    ConsolePanel.Text = "";
                    ConsolePanel.Text = ("Wrong parameter passed on line: " + (i + 1));
                    MainPanel.Refresh();
                    break;
                }
            }
        }
 public void RegisterPageNavigate(object sender, RoutedEventArgs e)
 {
     MainPanel.Navigate(typeof(RegisterPage));
 }
예제 #19
0
    public void selfArrive(bool success, List <int> route, bool showSettle)
    {
        if (success)
        {
            Sound.playSound(SoundType.Arrive);
        }
        if (Mode == MapMode.Level)
        {
            this.gameOver = true;
            CSPassFinish pf = new CSPassFinish();
            pf.Success = success ? 1 : 0;
            pf.Pass    = this.Pass;
            if (route == null)
            {
//			route =
            }
            pf.Route = route;
            SocketManager.SendMessageAsyc((int)MiGongOpcode.CSPassFinish, CSPassFinish.SerializeToBytes(pf), delegate(int opcode, byte[] data) {
                SCPassFinish pas = SCPassFinish.Deserialize(data);
                if (showSettle)
                {
                    StringBuilder sb = new StringBuilder(pas.Success == 1 ? Message.getText("success") : Message.getText("fail"));
                    if (pas.PassReward != null)
                    {
                        sb.Append("\n");
                        sb.Append("gold:" + pas.PassReward.Gold + "|energy:" + pas.PassReward.Energy);
                        if (pas.PassReward.Item != null && pas.PassReward.Item.Count > 0)
                        {
                            foreach (PBItem item in pas.PassReward.Item)
                            {
                                sb.Append("|" + item.ItemId + ":" + item.Count);
                            }
                        }
                    }

                    GameObject go = transform.parent.parent.Find("Canvas/settle").gameObject;
                    go.transform.Find("Text").GetComponent <Text> ().text = sb.ToString();
                }
                if (pas.Success == 1)                 // 修改关卡并解锁
                {
                    GameObject mainGo   = GameObject.Find("main");
                    MainPanel mainPanel = mainGo.GetComponent <MainPanel>();
                    mainPanel.openPass  = pas.OpenPass;
                    mainPanel.doShowLock();
                }
            });
            if (showSettle)
            {
                GameObject settleGo = transform.parent.parent.Find("Canvas/settle").gameObject;
                settleGo.SetActive(true);
            }
        }
        else if (Mode == MapMode.Unlimited)
        {
            this.gameOver = true;
            CSUnlimitedFinish uf = new CSUnlimitedFinish();
            uf.Success = success ? 1 : 0;
            uf.Route   = route;
            uf.Pass    = this.Pass;
            SocketManager.SendMessageAsyc((int)MiGongOpcode.CSUnlimitedFinish, CSUnlimitedFinish.SerializeToBytes(uf), delegate(int opcode, byte[] data) {
                SCUnlimitedFinish pas = SCUnlimitedFinish.Deserialize(data);
                if (showSettle)
                {
                    GameObject go = transform.parent.parent.Find("Canvas/settle").gameObject;
                    go.transform.Find("Text").GetComponent <Text> ().text = pas.Success == 1 ? Message.getText("success") : Message.getText("fail");
                }
            });
            if (showSettle)
            {
                GameObject settleGo = transform.parent.parent.Find("Canvas/settle").gameObject;
                settleGo.SetActive(true);
            }
        }
        else if (Mode == MapMode.Online)
        {
            CSArrived arrived = new CSArrived();
            Pacman    pacman  = pacmanMap [SocketManager.accountId];
            arrived.Pos = pacman.outX * td + pacman.outY;
            SocketManager.SendMessageAsyc((int)MiGongOpcode.CSArrived, CSArrived.SerializeToBytes(arrived), delegate(int opcode, byte[] data) {
//				SCArrived ret = SCArrived.Deserialize(data);
                // TODO 结算
            });
            // TODO 结算
        }
    }
예제 #20
0
 public void InitMainView(MainPanel mainView)
 {
     caroBoardView = mainView.caroBoardView;
     playerTxt     = mainView.playerTxt;
 }
예제 #21
0
    // Use this for initialization
    void Start()
    {
        // 设置button
        closeButton.onClick.AddListener(delegate {
            Sound.playSound(SoundType.Click);
            WarnDialog.showWarnDialog(Message.getText("exit?"), delegate {
                selfArrive(false, null, false);
                Destroy(transform.parent.parent.gameObject);
                GameObject mainGo   = GameObject.Find("main");
                MainPanel mainPanel = mainGo.GetComponent <MainPanel>();
                mainPanel.showUi(this.Mode);
            });
        });
        okButton.onClick.AddListener(delegate {
            Sound.playSound(SoundType.Click);
            Destroy(transform.parent.parent.gameObject);
            GameObject mainGo   = GameObject.Find("main");
            MainPanel mainPanel = mainGo.GetComponent <MainPanel>();
            mainPanel.showUi(this.Mode);
        });
        // 0.21 碰撞体的宽,1.9碰撞体的长
        wallWidth = 0.13f * myScale;
        nodeX     = 1.9f * myScale - wallWidth * 2; nodeY = 1.9f * myScale - wallWidth * 2;

        // 显示当前的道具数量
        showSkillCountAndAddClick("addSpeed", ItemType.AddSpeed);
        showSkillCountAndAddClick("addTime", ItemType.AddTime);
        showSkillCountAndAddClick("mulBean", ItemType.MulBean);
        showSkillCountAndAddClick("showRoute", ItemType.ShowRoute);
        //
        if (Mode == MapMode.Online)
        {
            // 屏蔽
            starSlider.transform.parent.gameObject.SetActive(false);
            transform.parent.parent.Find("Canvas/skills").gameObject.SetActive(false);
            transform.parent.parent.Find("Canvas/score").gameObject.SetActive(false);
            // time居中
            Vector3 old = transform.parent.parent.Find("Canvas/time").localPosition;
            transform.parent.parent.Find("Canvas/time").localPosition = new Vector3(0, old.y, old.z);
            //
            foreach (KeyValuePair <string, Pacman> kv in pacmanMap)
            {
                int       x = kv.Value.inX;
                int       y = kv.Value.inY;
                Transform scoreShowtransform = null;
                if (x < 2 && y < 2)
                {
                    scoreShowtransform = transform.parent.parent.Find("Canvas/onlineScoreShow/blue");
                }
                else if (y > 2 && x < 2)
                {
                    scoreShowtransform = transform.parent.parent.Find("Canvas/onlineScoreShow/green");
                }
                else if (y > 2 && x > 2)
                {
                    scoreShowtransform = transform.parent.parent.Find("Canvas/onlineScoreShow/red");
                }
                else if (x > 2 && y < 2)
                {
                    scoreShowtransform = transform.parent.parent.Find("Canvas/onlineScoreShow/yellow");
                }
                scoreShowtransform.gameObject.SetActive(true);
                scoreText.Add(kv.Key, scoreShowtransform.Find("Text").GetComponent <Text>());
            }

            //
            SocketManager.AddServerSendReceive((int)MiGongOpcode.SCSendEatBean, delegate(int opcode, byte[] data) {
                SCSendEatBean ret = SCSendEatBean.Deserialize(data);
                foreach (PBEatBeanInfo bean in ret.Beans)
                {
                    _checkEatBean(bean.UserId, bean.BeanPos);                    // 谁吃的
                }
            });
        }
        // 注册玩家到达的信息
        SocketManager.AddServerSendReceive((int)MiGongOpcode.SCUserArrived, userArrived);
        SocketManager.AddServerSendReceive((int)MiGongOpcode.SCGameOver, doGameOver);

        // 联网模式
        SocketManager.AddServerSendReceive((int)MiGongOpcode.SCUserMove, userMoveAction);

        currentTime = totalTime;

        createMap();
    }
예제 #22
0
 /// <summary>
 /// For setting auto-complete items
 /// </summary>
 /// <param name="mainPanel">An instance of the MainPanel</param>
 public void SetMainPanel(MainPanel mainPanel)
 {
     this.mainPanel = mainPanel;
 }
        /*private ToolStripMenuItem ExportPropertySubMenu;
         * private ToolStripMenuItem ExportAnimationSubMenu;
         * private ToolStripMenuItem ExportDirectorySubMenu;
         * private ToolStripMenuItem ExportPServerXML;
         * private ToolStripMenuItem ExportDataXML;
         * private ToolStripMenuItem ExportImgData;
         * private ToolStripMenuItem ExportRawData;
         * private ToolStripMenuItem ExportGIF;
         * private ToolStripMenuItem ExportAPNG;
         *
         * private ToolStripMenuItem ImportSubMenu;
         * private ToolStripMenuItem ImportXML;
         * private ToolStripMenuItem ImportImgData;*/

        public ContextMenuManager(MainPanel haRepackerMainPanel, UndoRedoManager undoMan)
        {
            this.parentPanel = haRepackerMainPanel;

            SaveFile = new ToolStripMenuItem("Save", Properties.Resources.disk, new EventHandler(
                                                 delegate(object sender, EventArgs e)
            {
                foreach (WzNode node in GetNodes(sender))
                {
                    new SaveForm(parentPanel, node).ShowDialog();
                }
            }));
            Rename = new ToolStripMenuItem("Rename", Properties.Resources.rename, new EventHandler(
                                               delegate(object sender, EventArgs e)
            {
                haRepackerMainPanel.PromptRenameSelectedTreeNode();
            }));
            Remove = new ToolStripMenuItem("Remove", Properties.Resources.delete, new EventHandler(
                                               delegate(object sender, EventArgs e)
            {
                haRepackerMainPanel.PromptRemoveSelectedTreeNodes();
            }));

            Unload = new ToolStripMenuItem("Unload", Properties.Resources.delete, new EventHandler(
                                               delegate(object sender, EventArgs e)
            {
                if (!Warning.Warn("Are you sure you want to unload this file?"))
                {
                    return;
                }

                foreach (WzNode node in GetNodes(sender))
                {
                    Program.WzMan.UnloadWzFile((WzFile)node.Tag);
                }
            }));
            Reload = new ToolStripMenuItem("Reload", Properties.Resources.arrow_refresh, new EventHandler(
                                               delegate(object sender, EventArgs e)
            {
                if (!Warning.Warn("Are you sure you want to reload this file?"))
                {
                    return;
                }

                foreach (WzNode node in GetNodes(sender))
                {
                    Program.WzMan.ReloadWzFile((WzFile)node.Tag, parentPanel);
                }
            }));
            CollapseAllChildNode = new ToolStripMenuItem("Collapse All", Properties.Resources.collapse, new EventHandler(
                                                             delegate(object sender, EventArgs e)
            {
                foreach (WzNode node in GetNodes(sender))
                {
                    node.Collapse();
                }
            }));
            ExpandAllChildNode = new ToolStripMenuItem("Expand all", Properties.Resources.expand, new EventHandler(
                                                           delegate(object sender, EventArgs e)
            {
                foreach (WzNode node in GetNodes(sender))
                {
                    node.ExpandAll();
                }
            }));

            AddImage = new ToolStripMenuItem("Image", null, new EventHandler(
                                                 delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }

                string name;
                if (NameInputBox.Show("Add Image", 0, out name))
                {
                    nodes[0].AddObject(new WzImage(name)
                    {
                        Changed = true
                    }, undoMan);
                }
            }));
            AddDirectory = new ToolStripMenuItem("Directory", null, new EventHandler(
                                                     delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }
                haRepackerMainPanel.AddWzDirectoryToSelectedNode(nodes[0]);
            }));
            AddByteFloat = new ToolStripMenuItem("Float", null, new EventHandler(
                                                     delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }

                haRepackerMainPanel.AddWzByteFloatToSelectedNode(nodes[0]);
            }));
            AddCanvas = new ToolStripMenuItem("Canvas", null, new EventHandler(
                                                  delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }

                haRepackerMainPanel.AddWzCanvasToSelectedNode(nodes[0]);
            }));
            AddLong = new ToolStripMenuItem("Long", null, new EventHandler(
                                                delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }
                haRepackerMainPanel.AddWzLongToSelectedNode(nodes[0]);
            }));
            AddInt = new ToolStripMenuItem("Int", null, new EventHandler(
                                               delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }
                haRepackerMainPanel.AddWzCompressedIntToSelectedNode(nodes[0]);
            }));
            AddConvex = new ToolStripMenuItem("Convex", null, new EventHandler(
                                                  delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }

                haRepackerMainPanel.AddWzConvexPropertyToSelectedNode(nodes[0]);
            }));
            AddDouble = new ToolStripMenuItem("Double", null, new EventHandler(
                                                  delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }
                haRepackerMainPanel.AddWzDoublePropertyToSelectedNode(nodes[0]);
            }));
            AddNull = new ToolStripMenuItem("Null", null, new EventHandler(
                                                delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }

                haRepackerMainPanel.AddWzNullPropertyToSelectedNode(nodes[0]);
            }));
            AddSound = new ToolStripMenuItem("Sound", null, new EventHandler(
                                                 delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }

                haRepackerMainPanel.AddWzSoundPropertyToSelectedNode(nodes[0]);
            }));
            AddString = new ToolStripMenuItem("String", null, new EventHandler(
                                                  delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }

                haRepackerMainPanel.AddWzStringPropertyToSelectedIndex(nodes[0]);
            }));
            AddSub = new ToolStripMenuItem("Sub", null, new EventHandler(
                                               delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }

                haRepackerMainPanel.AddWzSubPropertyToSelectedIndex(nodes[0]);
            }));
            AddUshort = new ToolStripMenuItem("Short", null, new EventHandler(
                                                  delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }

                haRepackerMainPanel.AddWzUnsignedShortPropertyToSelectedIndex(nodes[0]);
            }));
            AddUOL = new ToolStripMenuItem("UOL", null, new EventHandler(
                                               delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }
                haRepackerMainPanel.AddWzUOLPropertyToSelectedIndex(nodes[0]);
            }));
            AddVector = new ToolStripMenuItem("Vector", null, new EventHandler(
                                                  delegate(object sender, EventArgs e)
            {
                WzNode[] nodes = GetNodes(sender);
                if (nodes.Length != 1)
                {
                    MessageBox.Show("Please select only ONE node");
                    return;
                }
                haRepackerMainPanel.AddWzVectorPropertyToSelectedIndex(nodes[0]);
            }));

            AddConvexSubMenu = new ToolStripMenuItem("Add", Properties.Resources.add, AddVector);
            AddDirsSubMenu   = new ToolStripMenuItem("Add", Properties.Resources.add, AddDirectory, AddImage);
            AddPropsSubMenu  = new ToolStripMenuItem("Add", Properties.Resources.add, AddCanvas, AddConvex, AddDouble, AddByteFloat, AddLong, AddInt, AddNull, AddUshort, AddSound, AddString, AddSub, AddUOL, AddVector);

            WzFileMenu = new ContextMenuStrip();
            WzFileMenu.Items.AddRange(new ToolStripItem[] { AddDirsSubMenu, SaveFile, Unload, Reload });

            WzDirectoryMenu = new ContextMenuStrip();
            WzDirectoryMenu.Items.AddRange(new ToolStripItem[] { AddDirsSubMenu, Rename, /*export, import,*/ Remove });

            PropertyContainerMenu = new ContextMenuStrip();
            PropertyContainerMenu.Items.AddRange(new ToolStripItem[] { AddPropsSubMenu, Rename, /*export, import,*/ Remove });

            PropertyMenu = new ContextMenuStrip();
            PropertyMenu.Items.AddRange(new ToolStripItem[] { Rename, /*export, import,*/ Remove });

            SubPropertyMenu = new ContextMenuStrip();
            SubPropertyMenu.Items.AddRange(new ToolStripItem[] { AddPropsSubMenu, Rename, /*export, import,*/ Remove });
        }
예제 #24
0
 private void MainPanel_Paint(object sender, PaintEventArgs e)
 {
     MainPanel.CreateGraphics().DrawImage(Draw_pic(), 0, 0);
 }
예제 #25
0
        /// <summary>
        /// 重新设置单元格
        /// </summary>
        private void InitCells()
        {
            int column = 0; int row = 0;

            MainPanel.RowCount = 6;
            DateTime currMonth = new DateTime(displayDate.Year, displayDate.Month, 1);
            DateTime currDay   = new DateTime();

            currDay = currMonth.AddDays((double)(0 - currMonth.DayOfWeek));
            CalendarCell currCell = new CalendarCell();

            #region 填充单元格
            while (column < 7 && row < 6)
            {
                HFDate  lunarProcessor = new HFDate(currDay);
                DayInfo currDayInfo    = new DayInfo();
                currDayInfo.date    = currDay;
                currDayInfo.animal  = animalNames[lunarProcessor.LunarYear.Zhi.IntValue - 1];
                currDayInfo.lunarM  = lunarProcessor.LunarCalendarMonth;
                currDayInfo.lunarD  = lunarProcessor.LunarCalendarDay;
                currDayInfo.ganZhi  = lunarProcessor.LunarYear.Name + "年";
                currDayInfo.ganZhiM = lunarProcessor.LunarMonth.Name + "月";
                currDayInfo.ganZhiD = lunarProcessor.LunarDay.Name + "日";
                currDayInfo.lunarMS = lunarProcessor.LunarCalendarMonthString;
                currDayInfo.lunarDS = lunarProcessor.LunarCalendarDayString;
                currDayInfo.term    = lunarProcessor.SolarTermInfo;

                currDayInfo.isHoliday      = IsHoliday(ref currDayInfo); //加入节假日判断
                currDayInfo.isLunarHoliday = IsLunarHoliday(ref currDayInfo);

                currCell         = (CalendarCell)MainPanel.GetControlFromPosition(column, row);
                currCell.Visible = true;

                SetCellText(currCell, currDayInfo);
                SetCellColor(currCell);
                if (currDayInfo.date.Date == displayDate.Date)
                {
                    cColumn = column; cRow = row;
                    CellClicked(currCell, new EventArgs());
                }

                column++;
                if (column > 6)
                {
                    column = 0;
                    row++;
                }

                currDay = currDay.AddDays(1);
            }

            CalendarCell tmpCell = (CalendarCell)MainPanel.GetControlFromPosition(0, 5);
            if (((DayInfo)tmpCell.Tag).date.Month != displayDate.Date.Month)
            {
                for (int i = 0; i < 7; i++)
                {
                    tmpCell         = (CalendarCell)MainPanel.GetControlFromPosition(i, 5);
                    tmpCell.Visible = false;
                }
            }

            #endregion
            oldDate = displayDate;
            return;
        }
예제 #26
0
 /// <summary>
 /// Progresses the control1_ progress completed.
 /// </summary>
 /// <param name="data">The data.</param>
 void ProgressControl1_ProgressCompleted(object data)
 {
     btnImport.Enabled = true;
     MainPanel.Update();
 }
예제 #27
0
        /// <summary>
        /// 方向键被按下
        /// </summary>
        /// <param name="direction">方向:1.上;2.右;3.下;4.左</param>
        private void ArrowKeyPressed(int direction)
        {
            DayInfo      info = new DayInfo();
            CalendarCell cell = new CalendarCell();

            switch (direction)
            {
            case 1:
                if (cRow == 0)
                {
                    cell        = (CalendarCell)MainPanel.GetControlFromPosition(cColumn, cRow);
                    info        = (DayInfo)cell.Tag;
                    displayDate = info.date.Date.AddDays(-7);
                    CheckDateChange();
                    return;
                }
                else
                {
                    cRow--;
                }
                break;

            case 2:
                if (cColumn == 6)
                {
                    if (cRow == 5)
                    {
                        cell        = (CalendarCell)MainPanel.GetControlFromPosition(cColumn, cRow);
                        info        = (DayInfo)cell.Tag;
                        displayDate = info.date.Date.AddDays(1);
                        CheckDateChange();
                        return;
                    }
                    else
                    {
                        cColumn = 0; cRow++;
                    }
                }
                else
                {
                    cColumn++;
                }
                break;

            case 3:
                if (cRow == 5)
                {
                    cell        = (CalendarCell)MainPanel.GetControlFromPosition(cColumn, cRow);
                    info        = (DayInfo)cell.Tag;
                    displayDate = info.date.Date.AddDays(7);
                    CheckDateChange();
                    return;
                }
                else
                {
                    cRow++;
                }
                break;

            case 4:
                if (cColumn == 0)
                {
                    if (cRow == 0)
                    {
                        cell        = (CalendarCell)MainPanel.GetControlFromPosition(cColumn, cRow);
                        info        = (DayInfo)cell.Tag;
                        displayDate = info.date.Date.AddDays(-1);
                        CheckDateChange();
                        return;
                    }
                    else
                    {
                        cColumn = 6; cRow--;
                    }
                }
                else
                {
                    cColumn--;
                }
                break;
            }
            cell = (CalendarCell)MainPanel.GetControlFromPosition(cColumn, cRow);
            CellClicked(cell, new EventArgs());
        }
예제 #28
0
 public static void Initialize()
 {
     _mainPanel = new MainPanel();
     GamePadInput.StaticInputInstance.ButtonGuideDown += XInputOnButtonGuideDown;
 }
 private void MainPanel_MouseDown(object sender, MouseButtonEventArgs e)
 {
     MainPanel.Focus();
 }
예제 #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SAVEbutton1.Click   += new EventHandler(SAVEbutton1_Click);
            CancelButton1.Click += new EventHandler(CancelButton1_Click);

            if (Request.QueryString["List"] != null)
            {
                listGuid    = new Guid(Request.QueryString["List"]);
                currentList = spWeb.Lists[listGuid];

                if (CheckCustomRights(currentList))
                {
                    Control tagTitleControl = Page.Header.FindControl("PlaceHolderPageTitle").Parent;
                    if (tagTitleControl != null)
                    {
                        AddTagTitle(tagTitleControl);
                    }

                    Control titleLinkControl = FindInnerControl(Page, "PlaceHolderPageTitleInTitleArea");
                    if (titleLinkControl != null)
                    {
                        AddLinkTitle(titleLinkControl);
                    }

                    PageDescriptionText.Text = "View Permission (Powered by SPGuys)";

                    GenerateInnerHtml();

                    if (!Page.IsPostBack)
                    {
                        SPViewCollection viewCollection = currentList.Views;
                        ViewState["CheckViewsCount"] = viewCollection.Count.ToString();

                        int i = 0;
                        foreach (SPView currentView in viewCollection)
                        {
                            if (currentView.Title != "")
                            {
                                Control peopleEditorControl = MainPanel.FindControl("pe" + i.ToString());
                                if (peopleEditorControl != null)
                                {
                                    PeopleEditor pe = (PeopleEditor)peopleEditorControl;
                                    pe.CommaSeparatedAccounts = SelectFromProperties(currentView);
                                }

                                i++;
                            }
                        }

                        if (SelectViceVersaFromProperties(currentSite, currentList, true))
                        {
                            this.chbxPermission.Checked = true;
                        }
                        else
                        {
                            this.chbxPermission.Checked = false;
                        }
                    }
                }
                else
                {
                    SPUtility.HandleAccessDenied(new UnauthorizedAccessException());
                }
            }
            else
            {
                SPUtility.HandleAccessDenied(new UnauthorizedAccessException());
            }
        }
예제 #31
0
        public Form1()
        {
            InitializeComponent();



#if DEBUG == true
            for (int i = 0; i < 16; i++)
            {
                ActionTypes at_A = (ActionTypes)i;
                string      s1   = "";
                string      s2   = "";
                string      s3   = "";
                s1 += (at_A.BinaryString(4) + "  :  ");
                s2 += ("ANY   :  ");
                s3 += ("HAS   :  ");
                for (int j = 0; j < 16; j++)
                {
                    ActionTypes at_B = (ActionTypes)j;
                    s1 += (at_B.BinaryString(4) + "  ");
                    s2 += (at_A.HasAny(at_B) ? "TRUE  " : "FALSE ");
                    s3 += (at_A.HasFlag(at_B) ? "TRUE  " : "FALSE ");
                }

                Console.WriteLine(s1);
                Console.WriteLine(s2);
                Console.WriteLine(s3);
                Console.WriteLine();
            }

            TimeBox.TestSubtract();
#endif

            notifyIcon1.BalloonTipClosed += (sender, e) =>
            {
                var thisIcon = (NotifyIcon)sender;
                thisIcon.Visible = false;
                thisIcon.Dispose();
            };

            // watch this file structure
            _fcWatcher            = new FileChangeWatcher();
            _fcWatcher.Extensions = new string[] { ".cs" };
            _fcWatcher.Changed   += FolderChangeWatcher_Changed;
            _fcWatcher.Error     += FolderChangeWatcher_Error;
            //_fcWatcher.AutoSaveMinutesInterval = 3;

            eventScroller1.FileChangeWatcher = _fcWatcher;

            themeController          = new ThemeController();
            themeController.Changed += Themer_Changed;

            mainPanel = new MainPanel(_fcWatcher, doubleBuffer1, themeController.Theme);

            this.Icon = notifyIcon1.Icon;
            BaseForm.ApplicationIcon = notifyIcon1.Icon;

            toolStripTextBoxWithLabelIdleTime.LabelText    = "Idle Time(m)";
            toolStripTextBoxWithLabelTimePerEdit.LabelText = "Per Edit Time(m)";
            toolStripTextBoxWithLabelIdleTime.Set(_fcWatcher.UserIdleMinutes);
            toolStripTextBoxWithLabelTimePerEdit.Set(_fcWatcher.PerEditMinutes);
            toolStripTextBoxWithLabelIdleTime.TextBox.EnterPressed    += TextBox_EnterPressed;
            toolStripTextBoxWithLabelTimePerEdit.TextBox.EnterPressed += TextBox_EnterPressed1;
            useIdleEventsToolStripMenuItem.Checked    = _fcWatcher.UseIdleEvents;
            advancedToolStripMenuItem.DropDownClosed += AdvancedToolStripMenuItem_DropDownClosed;
            Application.Idle += Application_Idle;
        }
예제 #32
0
        private void CreateTabItem(int viewType, string title)
        {
            foreach (var p in Panels)
            {
                if (p.ViewMainType == viewType)
                {
                    ShowTabItem(p);
                    return;
                }
            }

            var panel = new MainPanel(viewType);
            CreateTabItem(panel, "pack://application:,,,/CBSUI;component/Images/ie.ico", title);
            Panels.Add(panel);
        }
 public void LoginPageNavigate(object sender, RoutedEventArgs e)
 {
     MainPanel.Navigate(typeof(Login));
 }