예제 #1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (SharedId > 0)
            {
                apShared.Visible   = true;
                lblEntryOwner.Text = Util.CommonHelper.GetUserStatus(SharedId);
            }
            else
            {
                apShared.Visible = false;
            }

            BindToolbar();
            BindTabs();
            if (!IsPostBack)
            {
                ViewState["CurrentTab"] = pc["ToDoView_CurrentTab"];
                Mediachase.IBN.Business.ToDo.AddHistory(ToDoID, Mediachase.IBN.Business.ToDo.GetToDoTitle(ToDoID));
            }

            CommandManager cm = CommandManager.GetCurrent(this.Page);

            cm.AddCommand("ToDo", "", "ToDoView", "MC_PM_ToDoRedirect");
            cm.AddCommand("ToDo", "", "ToDoView", "MC_ToDo_AddSucc");
            cm.AddCommand("ToDo", "", "ToDoView", "MC_ToDo_AddSuccHandler");
            cm.AddCommand("ToDo", "", "ToDoView", "MC_ToDo_AddPred");
            cm.AddCommand("ToDo", "", "ToDoView", "MC_ToDo_AddPredHandler");
        }
		protected void AssignmentGrid_RowDataBound(object sender, GridViewRowEventArgs e)
		{
			CommandManager cm = CommandManager.GetCurrent(this.Page);
			ImageButton reassignButton = (ImageButton)e.Row.FindControl("ReassignButton");
			if (reassignButton != null)
			{
				CommandParameters cp = new CommandParameters("MC_WF_SelectUser");
				cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
				cp.AddCommandArgument("AssignmentId", ((EntityObject)(e.Row.DataItem)).PrimaryKeyId.ToString());
				string cmd = cm.AddCommand("User", String.Empty, "ActiveAssignments", cp);
				cmd = cmd.Replace("\"", "&quot;");

				reassignButton.Attributes.Add("onclick", String.Concat(cmd, "return false;"));
			}

			ImageButton editButton = (ImageButton)e.Row.FindControl("EditButton");
			if (editButton != null)
			{
				CommandParameters cp = new CommandParameters("MC_WF_EditAssignment");
				cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
				cp.AddCommandArgument("AssignmentId", ((EntityObject)(e.Row.DataItem)).PrimaryKeyId.ToString());
				string cmd = cm.AddCommand("User", String.Empty, "ActiveAssignments", cp);
				cmd = cmd.Replace("\"", "&quot;");

				editButton.Attributes.Add("onclick", String.Concat(cmd, "return false;"));
			}
		}
예제 #3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            UtilHelper.RegisterCssStyleSheet(Page, "~/Styles/IbnFramework/objectDD.css");

            ApplyLocalization();
            if (!IsPostBack)
            {
                BindValues();
            }

            CommandManager cm = CommandManager.GetCurrent(this.Page);

            if (!String.IsNullOrEmpty(Command))                 // popup mode
            {
                secHeader.Visible             = false;
                MainTable.Attributes["class"] = "ibn-propertysheet";
                if (cm != null)
                {
                    cm.AddCommand("Incident", "", "IncidentView", "MC_HDM_SelectResourceInFrame");
                    cm.AddCommand("Incident", "", "IncidentView", "MC_HDM_GroupResponsibilityInFrame");
                }
            }
            else
            {
                BindToolbar();
                if (cm != null)
                {
                    cm.AddCommand("Incident", "", "IncidentView", "MC_HDM_SelectResource");
                    cm.AddCommand("Incident", "", "IncidentView", "MC_HDM_GroupResponsibility");
                }
            }
            trPriority.Visible = PortalConfig.CommonIncidentAllowEditPriorityField;
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CommandManager cm = CommandManager.GetCurrent(this.Page);

            cm.AddCommand(String.Empty, String.Empty, PlaceName, "MC_MUI_NeedToDataBind");
            cm.AddCommand(String.Empty, String.Empty, PlaceName, CommandEditName);
        }
        public void DuplicateCommand()
        {
            const string TestCommandName = "duplicate";
            var          manager         = new CommandManager();

            manager.AddCommand(TestCommandName, new Command());
            manager.AddCommand(TestCommandName, new Command());
        }
예제 #6
0
 public Help(CommandManager c)
 {
     this.c = c;
     c.AddTab(ParseTab, "help", "h");
     c.AddCommand(ParseCommandHelp, "help", "h");
     
     c.AddCommand(ParseCommandChatHelp, "chathelp");
 }
예제 #7
0
        public Help(CommandManager c)
        {
            this.c = c;
            c.AddTab(ParseTab, "help", "h");
            c.AddCommand(ParseCommandHelp, "help", "h");

            c.AddCommand(ParseCommandChatHelp, "chathelp");
        }
예제 #8
0
 public MainWindowViewModel()
 {
     CommandManager.AddCommand("GenerateQuestions", new SimpleCommand <QuestionEnumType>()
     {
         ExecuteDelegate = GenerateQuestions
     });
     CommandManager.AddCommand("ShowAnswer", new SimpleCommand <QuestionEnumType>()
     {
         ExecuteDelegate = ShowAnswer
     });
 }
예제 #9
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Configuration.HelpDeskEnabled)
            {
                throw new Mediachase.Ibn.LicenseRestrictionException();
            }

            if (IncidentId < 0)
            {
                Response.Redirect("../Common/NotExistingID.aspx?IncidentID=1");
            }

            string path = PortalConfig.IssueShortInfoControlDefaultValue;

            if (File.Exists(Server.MapPath(PortalConfig.IssueShortInfoControl)))
            {
                path = PortalConfig.IssueShortInfoControl;
            }
            System.Web.UI.Control control = LoadControl(path);
            InfoPlaceHolder.Controls.Add(control);

            if (SharedID > 0)
            {
                apShared.Visible   = true;
                lblEntryOwner.Text = Util.CommonHelper.GetUserStatus(SharedID);
            }
            else
            {
                apShared.Visible = false;
            }

            BindToolbar();
            BindTabs();
            if (!IsPostBack)
            {
                ViewState["CurrentTab"] = pc["IncidentView_CurrentTab"];
                try
                {
                    Incident.AddHistory(IncidentId, Incident.GetTitle(IncidentId));
                }
                catch
                {
                    Response.Redirect("../Common/NotExistingID.aspx?IncidentId=1");
                }
            }

            if (!Security.CurrentUser.IsExternal)
            {
                CommandManager cm = CommandManager.GetCurrent(this.Page);
                cm.AddCommand("Incident", "", "IncidentView", "MC_HDM_RelatedIssAdd");
                cm.AddCommand("Incident", "", "IncidentView", "MC_HDM_Redirect");
            }
        }
 // Update is called once per frame
 void Update()
 {
     if (selected && Input.GetKey(KeyCode.P))
     {
         Vector3 tempTarget = (Vector3)RtsManager.Current.ScreenPointToMapPosition(Input.mousePosition);
         commandManager.AddCommand(Cmd_Patrol.New(transform.gameObject, tempTarget));
     }
     if (selected && Input.GetKey(KeyCode.F))
     {
         Vector3 tempTarget = (Vector3)RtsManager.Current.ScreenPointToMapPosition(Input.mousePosition);
         commandManager.AddCommand(Cmd_Patrol.New(transform.gameObject, tempTarget));
     }
 }
예제 #11
0
        private void BindBlockHeader()
        {
            // Check, that there are fields left
            MetaClass            mc             = MetaDataWrapper.GetMetaClassByName(ClassName);
            HistoryMetaClassInfo historyInfo    = HistoryManager.GetInfo(mc);
            Collection <string>  selectedFields = historyInfo.SelectedFields;
            bool fieldsExist = false;

            foreach (MetaField mf in mc.Fields)
            {
                if (HistoryManager.IsSupportedField(mf) && !selectedFields.Contains(mf.Name))
                {
                    fieldsExist = true;
                    break;
                }
            }

            CommandManager    cm = CommandManager.GetCurrent(this.Page);
            CommandParameters cp;

            if (fieldsExist)
            {
                string            id  = String.Empty;
                ListViewProfile[] mas = ListViewProfile.GetSystemProfiles(HistoryManager.GetHistoryMetaClassName(ClassName), "ItemHistoryList");
                if (mas.Length == 0)
                {
                    id = CHelper.GetHistorySystemListViewProfile(HistoryManager.GetHistoryMetaClassName(ClassName), "ItemHistoryList");
                }
                else
                {
                    id = mas[0].Id;
                }

                cp = new CommandParameters("MC_ListApp_HistoryProfileEdit");
                cp.CommandArguments = new Dictionary <string, string>();
                cp.AddCommandArgument("ClassName", HistoryManager.GetHistoryMetaClassName(ClassName));
                cp.AddCommandArgument("uid", id);
                string cmd = cm.AddCommand("", "", "ListInfoView", cp);
                MainBlockHeader.AddRightLink(
                    GetGlobalResourceObject("IbnFramework.ListInfo", "HistoryView").ToString(),
                    String.Format("javascript:{{{0}}};", cmd));

                cp = new CommandParameters("MC_ListApp_AddHistoryFieldFrame", new Dictionary <string, string>());
                cp.AddCommandArgument("ClassName", ClassName);
                string command = cm.AddCommand("", "", "ListInfoView", cp);

                MainBlockHeader.AddRightLink(
                    GetGlobalResourceObject("IbnFramework.ListInfo", "AddField").ToString(),
                    String.Format("javascript:{{{0}}};", command));
            }
        }
예제 #12
0
        void SetCommandAction(CommandButton button, Vector3 position, Transform interactableTransform, CommandType commandType)
        {
            switch (commandType)
            {
            case CommandType.NONE:
                break;

            case CommandType.MOVE:
                button.SetCommand(() =>
                {
                    commandManager.AddCommand(new MovePositionCommand(position));
                    HidePanel();
                });
                break;

            case CommandType.FEED:
                button.SetCommand(() =>
                {
                    commandManager.AddCommand(new MoveAndInteractCommand(interactableTransform, typeof(IFeedable)));
                    HidePanel();
                });
                break;

            case CommandType.PLANT_FUEL:
                button.SetCommand(() =>
                {
                    commandManager.AddCommand(new PlantCommand(position));
                    HidePanel();
                });
                break;

            case CommandType.HARVEST:
                button.SetCommand(() =>
                {
                    commandManager.AddCommand(new MoveAndInteractCommand(interactableTransform, typeof(IHarvestable)));
                    HidePanel();
                });
                break;

            case CommandType.CRAFT:
                button.SetCommand(() =>
                {
                    HidePanel();
                });
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(commandType), commandType, null);
            }
        }
예제 #13
0
        public void ItemOnTargetField()
        {   //need number of max. clients
            Level level6 = new Level(MAX_PLAYER);

            Monster player13 = new Monster("monster", new Archer(), 2, 3);
            Monster player14 = new Monster("monster", new Archer(), 3, 3);
            Monster player15 = new Monster("monster", new Archer(), 4, 3);

            Hero  player16 = new Hero("hero", new Knight(), 10, 10);
            Field field7   = new Field(10, 11, new Floor());
            Field field8   = new Field(10, 13, new Floor());
            Field field9   = new Field(10, 12, new Floor());

            field7.Item = new DefenseBoost(2);
            field9.Item = new AttackBoost(3);

            level6.AddPlayerToLevel(player13);
            level6.AddPlayerToLevel(player14);
            level6.AddPlayerToLevel(player15);
            level6.AddPlayerToLevel(player16);
            level6.AddFieldToLevel(field7);
            level6.AddFieldToLevel(field8);
            level6.AddFieldToLevel(field9);

            CommandGameMove cmove14 = new CommandGameMove("234hug2haa1248325sdf5", 10, 11);

            cmove14.SourcePlayer = player16;
            cmove14.Level        = level6;

            CommandManager cm3 = new CommandManager();

            cm3.AddCommand(cmove14);
            cm3.ProcessPendingTransactions();

            Assert.AreEqual(0.5, player16.DefenseBoost);
            Assert.AreEqual(null, field7.Item);
            Assert.AreEqual(null, field8.Item);

            CommandGameMove cmove16 = new CommandGameMove("234hug2haa1248325sdf5", 10, 12);

            cmove16.SourcePlayer = player16;
            cmove16.Level        = level6;

            cm3.AddCommand(cmove16);
            cm3.ProcessPendingTransactions();

            Assert.AreEqual(0.75, player16.AttackBoost);
            Assert.AreEqual(null, field9.Item);
        }
예제 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GetCurrentFolder();
            CHelper.AddToContext(_folderIdKey, _folderId.ToString());
            CHelper.AddToContext(_containerKeyKey, _containerKey);
            CHelper.AddToContext(_containerNameKey, _containerName);

            if (!Page.IsPostBack)
            {
                BindBlockHeader();

                if (_pc["fs_ViewStyle"] == null)
                {
                    _pc["fs_ViewStyle"] = "ListView";
                }
            }
            _viewName = _pc["fs_ViewStyle"];

            grdMain.ClassName = _className;
            grdMain.ViewName  = _viewName;
            grdMain.PlaceName = _placeName;

            MainMetaToolbar.ClassName = _className;
            MainMetaToolbar.ViewName  = _viewName;
            MainMetaToolbar.PlaceName = _placeName;

            CommandManager cm = CommandManager.GetCurrent(this.Page);

            CommandParameters cp = new CommandParameters("FL_ChangeFolderTree");

            cp.CommandArguments = new System.Collections.Generic.Dictionary <string, string>();
            cp.AddCommandArgument("ContainerKey", _containerKey);
            cp.AddCommandArgument("FolderId", _rootId.ToString());
            string cmd = cm.AddCommand(_className, _viewName, _placeName, cp);

            cmd = cmd.Replace("\"", "&quot;");

            jsTreeExt.FolderId        = _folderId.ToString();
            jsTreeExt.IconUrl         = ResolveClientUrl("~/layouts/images/folder.gif");
            jsTreeExt.RootHrefCommand = String.Format("javascript:{0}", cmd);
            jsTreeExt.RootId          = _rootId.ToString();
            jsTreeExt.RootNodeText    = LocRM.GetString("tRoot");
            jsTreeExt.TreeSourceUrl   = ResolveClientUrl("~/Apps/FileLibrary/Pages/FileLibraryTreeSource.aspx?ContainerName=" + _containerName + "&ContainerKey=" + _containerKey + "&FolderId=" + _folderId);

            BindDataGrid(!Page.IsPostBack);

            cm.AddCommand(_className, _viewName, _placeName, "FL_Selected_MoveToFolder");
        }
예제 #15
0
 public ChatCommands(CommandManager c)
 {
     c.AddCommand(TellAdmin, "telladmin", "admin");
     c.AddCommand(Channel, "channel", "ch", "c");
     c.AddCommand(Shout, "shout");
     c.AddCommand(Prod, "push", "prod", "slap");
     c.AddCommand(Firehose, "firehose");
     c.AddCommand(Tell, "tell", "msg");
     c.AddCommand(Timestamp, "timestamp");
     c.AddCommand(Me, null, "me");
     c.AddCommand(Chat.ResetChannel, "reset");
 }
예제 #16
0
 public ChatCommands(CommandManager c)
 {
     c.AddCommand(TellAdmin, "telladmin", "admin");
     c.AddCommand(Channel, "channel", "ch", "c");
     c.AddCommand(Shout, "shout");
     c.AddCommand(Prod, "push", "prod", "slap");
     c.AddCommand(Firehose, "firehose");
     c.AddCommand(Tell, "tell", "msg");
     c.AddCommand(Timestamp, "timestamp");
     c.AddCommand(Me, null, "me");
     c.AddCommand(Chat.ResetChannel, "reset");
 }
예제 #17
0
        private void BindToolbar()
        {
            secHeader.AddText(LocRM.GetString("TaskResources"));
            if (Task.CanModifyResources(TaskID))
            {
                // resource utilization
                if (dgMembers.Items.Count > 0)
                {
                    string text = String.Format(CultureInfo.InvariantCulture,
                                                "<img alt='' src='{0}'/> {1}",
                                                Page.ResolveUrl("~/Layouts/Images/ResUtil.png"),
                                                LocRM2.GetString("Utilization"));
                    string link = String.Format(CultureInfo.InvariantCulture,
                                                "javascript:OpenPopUpNoScrollWindow('{0}?users={1}&amp;ObjectId={2}&amp;ObjectTypeId={3}',750,300)",
                                                Page.ResolveUrl("~/Common/ResourceUtilGraphForObject.aspx"),
                                                users,
                                                TaskID,
                                                (int)ObjectTypes.Task);
                    secHeader.AddRightLink(text, link);
                }

                // Modify
                CommandManager    cm  = CommandManager.GetCurrent(this.Page);
                CommandParameters cp  = new CommandParameters("MC_PM_TaskResEdit");
                string            cmd = cm.AddCommand("Task", "", "TaskView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                secHeader.AddRightLink("<img alt='' src='../Layouts/Images/icons/editgroup.gif'/> " + LocRM.GetString("Modify"), "javascript:" + cmd);
            }
        }
예제 #18
0
        /// <summary>
        /// Adds a new sceneView to the scene
        /// </summary>
        public void AddView()
        {
            string name = "New View ";
            int    cnt  = 1;

            while (mScene.GetView(name + cnt) != null)
            {
                cnt++;
            }

            GUIView view = new GUIView(name + cnt);

            mCommandManager.AddCommand(new AddViewCommand(mScene, view), true);

            View = view;
        }
예제 #19
0
    private void Start()
    {
        CommandManager cm = new CommandManager();
        //建立一个Command重复使用
        Command c = null;

        c = new CommandA(new ReciverA(), "命令A1");
        cm.AddCommand(c);
        c = new CommandA(new ReciverA(), "命令A2");
        cm.AddCommand(c);
        c = new CommandB(new ReciverB(), "命令B1");
        cm.AddCommand(c);

        //执行
        cm.ExecuateCommand();
    }
예제 #20
0
 public override void OnPluginLoad()
 {
     CommandManager.AddCommand("plugintest", async(e) =>
     {
         await e.Channel.SendMessage("This plugin works!");
     });
 }
예제 #21
0
        public void TrapTestLaserbeam()
        {
            Level level9 = new Level(MAX_PLAYER);

            Hero    player34 = new Hero("hero", new Archer(), 11, 9);
            Monster player35 = new Monster("monster", new Knight(), 7, 7);
            Monster player36 = new Monster("monster", new Knight(), 18, 7);
            Monster player37 = new Monster("monster", new Knight(), 9, 7);

            Field field10 = new Field(12, 9, new LaserBeam(true));

            level9.AddPlayerToLevel(player34);
            level9.AddPlayerToLevel(player35);
            level9.AddPlayerToLevel(player36);
            level9.AddPlayerToLevel(player37);
            level9.AddFieldToLevel(field10);

            CommandManager cm6 = new CommandManager();

            CommandGameMove cmove13 = new CommandGameMove("2f2de19a291c41b5ae950faa11162e07", 12, 9);

            cmove13.SourcePlayer = player34;
            cmove13.Level        = level9;

            cm6.AddCommand(cmove13);
            cm6.ProcessPendingTransactions();

            Assert.AreEqual(3.5, player34.Life);
        }
예제 #22
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack || String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0)
            {
                BindData();
            }

            string btnId = btnImport.UniqueID;

            if (Page.IsPostBack && !String.IsNullOrEmpty(btnId) && Request.Form[btnId] != null)
            {
                string filePath = FilesControl.GetSelectedFilePath();

                if (String.IsNullOrEmpty(filePath))
                {
                    DisplayErrorMessage("No selected file.");
                    return;
                }
                else
                {
                    SelectedFilePath = filePath;
                }
            }

            CommandManager cm = CommandManager.GetCurrent(this.Page);

            cm.AddCommand("", "Content", "SiteImport", "cmdShowDialogSiteImportConfirm");
        }
예제 #23
0
        public void HeroCollecteKey()
        {
            Level level12 = new Level(MAX_PLAYER);

            Hero  player8 = new Hero("hero", new Archer(), 10, 10);
            Field field23 = new Field(10, 11, new Floor());

            field23.Item = Key.GetInstance();
            level12.AddPlayerToLevel(player8);
            level12.AddFieldToLevel(field23);
            field23.Item.IsVisible = true;
            Assert.IsTrue(field23.Item.IsVisible);

            CommandGameMove cmove3 = new CommandGameMove("23156asd1a56sd", 10, 11);

            cmove3.SourcePlayer = player8;
            cmove3.Level        = level12;

            CommandManager cm2 = new CommandManager();

            cm2.AddCommand(cmove3);
            cm2.ProcessPendingTransactions();

            Assert.IsTrue(player8.HasKey);
            Assert.IsNull(field23.Item);
        }
예제 #24
0
        public void MonsterCantCollecteKey()
        {
            Level level11 = new Level(MAX_PLAYER);

            Monster player7 = new Monster("monster", new Archer(), 10, 10);
            Field   field22 = new Field(10, 11, new Floor());

            field22.Item = Key.GetInstance();
            level11.AddPlayerToLevel(player7);
            level11.AddFieldToLevel(field22);
            field22.Item.IsVisible = true;
            Assert.IsTrue(field22.Item.IsVisible);

            CommandGameMove cmove2 = new CommandGameMove("23156asd1a56sd", 10, 11);

            cmove2.SourcePlayer = player7;
            cmove2.Level        = level11;

            CommandManager cm3 = new CommandManager();

            cm3.AddCommand(cmove2);
            cm3.ProcessPendingTransactions();

            Assert.IsFalse(player7.HasKey);
            Assert.IsNotNull(field22.Item);
            Assert.IsTrue(field22.Item is Key);
        }
예제 #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DefineFolderId();

            if (!Page.IsPostBack)
            {
                if (!ListManager.CanReadFolder(_folderId))
                {
                    throw new AccessDeniedException();
                }

                if (pc["Lists_FV_Sort"] == null)
                {
                    pc["Lists_FV_Sort"] = "sortName";
                }

                if (Request["Assign"] != null && Request["Assign"] == "1")
                {
                    string listClass = "List_" + Request["ListId"];
                    Dictionary <string, string> dic = new Dictionary <string, string>();
                    dic.Add("ClassName", listClass);
                    CommandParameters cp = new CommandParameters("MC_ListApp_Security", dic);
                    CommandManager    cm = CommandManager.GetCurrent(this.Page);
                    ClientScript.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString("N"),
                                                       cm.AddCommand("", "", "ListInfoList", cp), true);
                }
            }
            BindToolBar();

            ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(btnRefresh);
        }
예제 #26
0
        public void ManualTrapdoorAttackAndTrapHidden()
        {
            Level level7 = new Level(MAX_PLAYER);

            Hero player2 = new Hero("hero", new Archer(), 11, 9);

            Field field2 = new Field(12, 9, new Trapdoor());
            Field field5 = new Field(11, 9, new Floor());

            level7.AddPlayerToLevel(player2);
            level7.AddFieldToLevel(field2);
            level7.AddFieldToLevel(field5);

            CommandManager cm7 = new CommandManager();

            CommandGameMove cmove7 = new CommandGameMove("2f2de19a291c41b5ae950faa11162e07", 12, 9);

            cmove7.SourcePlayer = player2;
            cmove7.Level        = level7;

            cm7.AddCommand(cmove7);

            cm7.ProcessPendingTransactions();

            Assert.AreEqual(4.25, player2.Life);
            Assert.AreEqual(11, player2.XPosition);
            Assert.AreEqual(9, player2.YPosition);
        }
예제 #27
0
        public void TrapTestSpikefield()
        {
            Level level8 = new Level(MAX_PLAYER);

            Hero    player30 = new Hero("hero", new Archer(), 11, 9);
            Monster player31 = new Monster("monster", new Knight(), 7, 7);
            Monster player32 = new Monster("monster", new Knight(), 18, 7);
            Monster player33 = new Monster("monster", new Knight(), 9, 7);

            Field field9 = new Field(12, 9, new SpikeField());

            level8.AddPlayerToLevel(player30);
            level8.AddPlayerToLevel(player31);
            level8.AddPlayerToLevel(player32);
            level8.AddPlayerToLevel(player33);
            level8.AddFieldToLevel(field9);

            CommandManager cm5 = new CommandManager();

            CommandGameMove cmove = new CommandGameMove("2f2de19a291c41b5ae950faa11162e07", 12, 9);

            cmove.SourcePlayer = player30;
            cmove.Level        = level8;

            cm5.AddCommand(cmove);
            cm5.ProcessPendingTransactions();

            Assert.AreEqual(4, player30.Life);
        }
예제 #28
0
        private void HandleInGameCommands(String[] message, String plainText)
        {
            //In game
            GameCommandTypes messageType = GameCommandTypes.Chat;
            int clientID = -1;
            int lockstep = -1;

            String[] data = { "-1" };

            try
            {
                messageType = (GameCommandTypes)Convert.ToInt32(message[1]);
                clientID    = Convert.ToInt32(message[2]);
                lockstep    = Convert.ToInt32(message[3]);
                data        = message[4].Split(' ');
            }
            catch
            {
                Console.WriteLine("CLIENT: Network error 3");
            }
            finally
            {
                switch (messageType)
                {
                case GameCommandTypes.Chat:
                    Console.WriteLine(message[4]);
                    break;

                case GameCommandTypes.SpawnAgent:
                    commandManager.AddCommand(new SpawnAgentCommand(lockstep, int.Parse(data[0]), int.Parse(data[1]), int.Parse(data[2]), int.Parse(data[3])));
                    world.AgentCount++;
                    break;
                }
            }
        }
		protected void Page_Load(object sender, EventArgs e)
		{
			if (String.IsNullOrEmpty(OwnerType) || OwnerId < 0)
			{
				this.Visible = false;
				return;
			}
			if (OwnerType == AssignmentEntity.FieldOwnerDocumentId && !Document.CanUpdate(OwnerId))
			{
				this.Visible = false;
				return;
			}

			// We do it to ensure raise Page_PreRender, becase Page_PreRender doesn't work if Visible=false
			this.Visible = true;

			if (!IsPostBack)
			{
				BindData();
			}
			else
			{
				LoadAssignment();
			}

			CommandManager cm = CommandManager.GetCurrent(this.Page);
			cm.AddCommand("User", "", "ActiveAssignments", "MC_WF_Reassign");
		}
예제 #30
0
        public static void SearchLocalizationKeys()
        {
            var commandManager = new CommandManager();

            foreach (var localizationTable in LocalizationOfflineCache.LoadAllBundled())
            {
                Dictionary <string, string> textMap = localizationTable.GetTextMapFor(EditorLocalizationConfiguration.GetMasterCulture());
                if (textMap == null)
                {
                    Debug.LogWarning("Failed to get TextMap for MasterCulture: " + EditorLocalizationConfiguration.GetMasterCulture().DisplayName);
                    return;
                }

                foreach (var kvp in textMap)
                {
                    string key           = kvp.Key;
                    string localizedText = kvp.Value;

                    commandManager.AddCommand(new GenericCommand(localizedText, () => {
                        Debug.Log(string.Format("Copied '{0}' into the clipboard!", key));
                        EditorGUIUtility.systemCopyBuffer = key;
                    }, detailText: key));
                }
            }

            CommandPaletteWindow.InitializeWindow("Localization Keys..", commandManager, clearInput: true);
        }
예제 #31
0
        private void BindToolbar()
        {
            secHeader.AddText(LocRM.GetString("tTitle"));

            /*
             * using (IDataReader rdr = Mediachase.IBN.Business.ToDo.GetListVacantPredecessors(BaseToDoID))
             * {
             *      if (rdr.Read())
             *      {
             *              CommandManager cm = CommandManager.GetCurrent(this.Page);
             *              CommandParameters cp = new CommandParameters("MC_PM_AddPredTodo");
             *              string cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);
             *              cmd = cmd.Replace("\"", "&quot;");
             *              secHeader.AddRightLink("<img alt='' src='../Layouts/Images/icons/task_predecessors.gif'/> " + LocRM.GetString("Add"),
             *                      String.Format("javascript:{{{0}}}", cmd));
             *      }
             * }
             */

            // Add Predecessors
            CommandManager    cm  = CommandManager.GetCurrent(this.Page);
            CommandParameters cp  = new CommandParameters("MC_ToDo_AddPred");
            string            cmd = cm.AddCommand("ToDo", "", "ToDoView", cp);

            cmd = cmd.Replace("\"", "&quot;");
            secHeader.AddRightLink("<img alt='' src='../Layouts/Images/icons/task_predecessors.gif'/> " + LocRM2.GetString("AddPredecessors"),
                                   "javascript:" + cmd);

            secHeader.AddRightLink("<img alt='' src='../Layouts/Images/icons/task_create.gif'/> " + LocRM2.GetString("Create"),
                                   ResolveClientUrl("~/ToDo/ToDoEdit.aspx?SuccID=" + BaseToDoID));
        }
예제 #32
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Configuration.ProjectManagementEnabled)
            {
                throw new Mediachase.Ibn.LicenseRestrictionException();
            }

            if (SharedID > 0)
            {
                apShared.Visible   = true;
                lblEntryOwner.Text = Util.CommonHelper.GetUserStatus(SharedID);
            }
            else
            {
                apShared.Visible = false;
            }

            isMSProject = Project.GetIsMSProject(Task.GetProject(TaskId));

            BindToolbar();
            BindTabs();
            if (!IsPostBack)
            {
                ViewState["CurrentTab"] = pc["TaskView_CurrentTab"];
                Task.AddHistory(TaskId, Task.GetTaskTitle(TaskId));
            }

            CommandManager cm = CommandManager.GetCurrent(this.Page);

            cm.AddCommand("Task", "", "TaskView", "MC_PM_TaskRedirect");
        }
예제 #33
0
        public RegionCommands(CommandManager c)
        {
            c.AddTab(RegionTab, "region", "reg");
            c.AddCommand(RegionCommand, "region", "reg", "faction", "f");

            AddTab(TabSet, "set");
            AddTab(TabRename, "rename", "ren");
            AddTab(TabMessage, "message");
            AddTab(TabResize, "resize", "res");

            AddCommand(SetRegionStart, "start", "create");
            AddCommand(Set, "set");
            AddCommand(Rename, "rename", "ren");
            AddCommand(Message, "message");
            AddCommand(Type, "type");
            AddCommand(AddResident, "add");
            AddCommand(RemoveResident, "remove", "rem");
            AddCommand(Resize, "resize", "res");
            AddCommand(Report, "report");
            AddCommand(ShowSidebar, "show", "on", "off");

            AddAdminCommand(Delete, "delete", "del");
        }
예제 #34
0
        public Admin(CommandManager c)
        {
            c.AddTab(GameRuleComplete, "gamerule");
            c.AddAdminCommand(MassPardon, "masspardon");
            c.AddAdminCommand(KillJava, "killjava");
            c.AddAdminCommand(NickCommand, "nick");
            c.AddAdminCommand(Say, "say");
            c.AddAdminCommand(Say2, "say2");
            c.AddAdminCommand(Kick, "kick");
            c.AddAdminCommand(Ban, "ban");
            c.AddAdminCommand(BanIP, "ban-ip", "banip");
            c.AddAdminCommand(CleanBannedRegions, "cleanregionsbanned");
            c.AddAdminCommand(VanillaCommands, "give");
            c.AddAdminCommand(VanillaCommands, "enchant");
            c.AddAdminCommand(VanillaCommands, "difficulty");
            c.AddAdminCommand(VanillaCommands, "gamerule");
            c.AddAdminCommand(VanillaCommands, "spawnpoint");
            c.AddAdminCommand(VanillaCommands, "clear");
            c.AddAdminCommand(VanillaCommands, "gamemode");
            c.AddAdminCommand(VanillaCommands, "effect");
            c.AddAdminCommand(VanillaCommands, "scoreboard");
            c.AddAdminCommand(VanillaCommands, "weather");
            c.AddAdminCommand(VanillaCommands, "toggledownfall");
            c.AddAdminCommand(VanillaCommands, "setidletimeout");
            c.AddAdminCommand(VanillaCommands, "op", "deop");

            c.AddAdminCommand(VanillaCommands, "achievement");
            c.AddAdminCommand(VanillaCommands, "blockdata");
            c.AddAdminCommand(VanillaCommands, "clone");
            c.AddAdminCommand(VanillaCommands, "defaultgamemode");
            c.AddAdminCommand(VanillaCommands, "execute");
            c.AddAdminCommand(VanillaCommands, "fill");
            c.AddAdminCommand(VanillaCommands, "particle");
            c.AddAdminCommand(VanillaCommands, "playsound");
            c.AddAdminCommand(VanillaCommands, "setblock");
            c.AddAdminCommand(VanillaCommands, "summon");
            c.AddAdminCommand(VanillaCommands, "title");

            c.AddAdminCommand(VanillaLoad, "vanillaload");
            c.AddAdminCommand(VanillaUnload, "vanillaunload");
            c.AddAdminCommand(VanillaStop, "vanillarestart");
            c.AddAdminCommand(AllBack, "allback");
            c.AddAdminCommand(OldRestart, null, "restart", "shutdown", "stop");
            c.AddAdminCommand(ProxyStop, "proxystop");
            c.AddAdminCommand((player, cmd, iarg) =>
            {
                Threads.DebugThreads();
            }, "debugthreads");
            c.AddAdminCommand((player, cmd, iarg) =>
            {
                player.TellSystem(Chat.Pink, "New Usage: /ban 30 username Reason for ban");
            }, null, "ban30");
            
            c.AddAdminCommand(VanillaSuspend, "vanillastop");
            c.AddAdminCommand(VanillaResume, "vanillastart");
            c.AddAdminCommand(Possess, "possess", "poss");
            c.AddAdminCommand(Slots, "slots");
            c.AddAdminCommand(Flush, "flush");
            c.AddAdminCommand(Mode, "mode", "gm", "m");
            c.AddAdminCommand(Teleport, "tp", "go");
            c.AddAdminCommand(Crash, "crash");
            
            c.AddAdminCommand((player, cmd, offset) =>
            {
                if (cmd.Length != 4)
                    throw new UsageException("/ee effectID amplification duration");
                
                var ee = new EntityEffect(player.EntityID, (PlayerEffects)int.Parse(cmd [1]), int.Parse(cmd [2]), int.Parse(cmd [3]));
                player.Queue.Queue(ee);
                player.TellSystem(Chat.Purple, ee.ToString());
            }, "ee");

#if DEBUG
            c.AddCommand((player, cmd, offset) =>
            {
                var steer = new Steer();
                steer.Action = Steer.Actions.Unmount;
                player.FromClient(steer);

            }, "steer");
#endif
        }
예제 #35
0
 public Players(CommandManager c)
 {
     this.c = c;
     //CommandManager.AddTab(ParseTab, "help", "h");
     c.AddCommand(TheEnd, null, "theend");
     c.AddCommand(Position, "position", "pos", "coord", "coords", "cord");
     c.AddCommand(Time, null, "time", "timeset", "settime");
     c.AddCommand(Load, "load", "lag", "uptime", "l");
     c.AddCommand(Die, "kill", "suicide", "killmyself", "kil", "death", "die");
     c.AddCommand(Inbox.Read, "read");
     c.AddCommand(Stat, "stat");
     c.AddCommand(Donate, "donate", "donors", "donor", "doner", "donator", "dontae", "vip");
     c.AddCommand(Motd, "motd", "welcome", "info");
     c.AddCommand(Rules, "rulebook", "rules", "rule");
     c.AddCommand(Version, "version", "ver");
     c.AddCommand(Pardon, "pardon", "vote", "vot", "unban", "uban", "umbanned", "unbanned");
     c.AddCommand(ToGreenRoom, "greenroom", "wait");
     c.AddCommand(ToConstruct, "construct", "con", "cons");
     c.AddCommand(ToHell, "hell", "hel");
     c.AddCommand(ToRealWorld, "vanilla", "real", "back");
     c.AddCommand(ToIsland, "island");
     c.AddCommand(ToHardcore, "hardcore");
     c.AddCommand(ToWarp, "warp");
     c.AddCommand(LockChest, null, "lock", "lwc", "chest", "cprivate", "private", "lcpassword");
 }
예제 #36
0
 public static void Init(CommandManager c)
 {
     c.AddCommand(GetTexture, "texturepack");
 }