Ejemplo n.º 1
0
        private void EditSetItem_Click(object sender, EventArgs e)
        {
            Form esf = Application.OpenForms["editSetForm"];

            if (esf != null)
            {
                esf.Activate();
                return;
            }
            else
            {
                int selectedrow;
                try
                {
                    selectedrow = extensionsSetGrid.CurrentCell.RowIndex;
                }
                catch (NullReferenceException)
                {
                    // Mo rules in grid yet
                    return;
                }
                int         columnbydefault = 0; // column with id (invisible)
                SetModel    setToEdit       = DBConnection.LoadSetByID(extensionsSetGrid.Rows[selectedrow].Cells[columnbydefault].Value.ToString());
                editSetForm editSetForm     = new editSetForm(setToEdit, extensionsSetGrid);
                editSetForm.Show();
            }
        }
Ejemplo n.º 2
0
        public void AddSet()
        {
            var ret = new SetModel(Items);

            Items.Add(ret);
            Items.SelectedItem = ret;
        }
Ejemplo n.º 3
0
        public SetTabViewModel()
        {
            AddSetCommand = new RelayCommand(AddSet);

            Items = new IdeCollection <IdeBaseItem>(this);

            var setSerializer = new SetSerializer()
            {
                Game = ViewModelLocator.GameLoader.Game
            };

            var setAssets = ViewModelLocator.AssetsTabViewModel.Assets.Where(x => x.Type == AssetType.Xml && x.Name == "set");

            foreach (var asset in setAssets)
            {
                asset.IsReserved = true;
                asset.LockName   = true;
                var set      = (Set)setSerializer.Deserialize(asset.TargetFilePath);
                var setModel = new SetModel(set, Items);
                Items.Add(setModel);
            }

            Items.CollectionChanged += (a, b) =>
            {
                //            ViewModelLocator.GameLoader.Sets = Items.Select(x => ((SetModel)x)._set);
            };
        }
Ejemplo n.º 4
0
    public static SetModel getInstance()
    {
        if(_instance == null)
            _instance = new SetModel();

        return _instance;
    }
Ejemplo n.º 5
0
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
            var appConfig = new SetModel();

            configuration.GetSection("SetModel").Bind(appConfig);
        }
Ejemplo n.º 6
0
 public static void CreateThumbnailsForAllTopics(string path, SetModel setModel)
 {
     foreach (TopicModel topicModel in setModel.SetTopics)
     {
         CreateThumbnails(path, setModel.SetName, topicModel.TopicName);
     }
 }
Ejemplo n.º 7
0
 public editSetForm(SetModel set, DataGridView dgv)
 {
     InitializeComponent();
     setToEdit       = set;
     rulesGrid       = dgv;
     this.Icon       = Properties.Resources.appicon;
     resourceManager = currentCulture.GlobalResourseManager;
 }
Ejemplo n.º 8
0
    public static SetModel getInstance()
    {
        if (_instance == null)
        {
            _instance = new SetModel();
        }

        return(_instance);
    }
Ejemplo n.º 9
0
 public AddSetPresenter(MainView mainView, SetModel setModel, TopicModel topicModel)
 {
     _addSetView = new AddSetView();
     _addSet     = new AddSet();
     _addSetView.SubmitBtn.Click += SubmitBtn_Click;
     _mainView   = mainView;
     _setModel   = setModel;
     _topicModel = topicModel;
 }
Ejemplo n.º 10
0
    private void OnButtonSetClick()
    {
        SetModel = new SetModel();
        SetView  = (SetView)UIFactory.Instance.GetUIView("SetView");
        SetView.Show();

        SetModel.OnValueChange += SetView.UpdateView;
        SetModel.UpdataData();
    }
Ejemplo n.º 11
0
 private DbParameter[] ExecutionSelectSet(SetModel DataPar)
 {
     DbParameter[] sqliteparList = new DbParameter[4];
     sqliteparList[0] = Db_Sqlite.CreateDbParameter("@UpdateTime", DataPar.SetUpdateTime);
     sqliteparList[1] = Db_Sqlite.CreateDbParameter("@Id", DataPar.SetID);
     sqliteparList[2] = Db_Sqlite.CreateDbParameter("@IdleTime", DataPar.SetIdelTime);
     sqliteparList[3] = Db_Sqlite.CreateDbParameter("@NoticeShowTime", DataPar.SetNoticeShowTime);
     return(sqliteparList);
 }
Ejemplo n.º 12
0
        /// <summary>
        /// 解析语句
        /// </summary>
        protected override void ParsingModel()
        {
            var gp = SetRegex.Match(CodeString);

            Model = new SetModel
            {
                Name = gp.Groups["name"].Value,
                Oper = gp.Groups["oper"].Value,
            };
        }
Ejemplo n.º 13
0
        public static SetModel Convert(DbSetModel inputModel)
        {
            SetModel outputModel = new SetModel();

            outputModel.trainingData = inputModel.trainingData;
            outputModel.setDate      = inputModel.Date;
            outputModel.comment      = inputModel.comment;

            return(outputModel);
        }
Ejemplo n.º 14
0
 public void BtnDelDeleteTopic_Click(object sender, EventArgs e)
 {
     if (_setView.TopicListbox.SelectedItem != null)
     {
         DeleteTopic(_setView.TopicListbox.SelectedItem.Text);
         _setView.TopicListbox.Items.Clear();
         _setModel = GetBySetName.GetByName(SetModel.SelectedSet);
         PopulateTopicListbox();
     }
 }
Ejemplo n.º 15
0
 private void process(SetModel setModel)
 {
     viewer.gameObject.SetActive(true);
     Debug.Log("got SetModel");
     for (int i = 0; i < objects.Length; i++)
     {
         objects[i].SetActive(i == setModel.index);
     }
     currentTransform = objects[setModel.index].GetComponent <Transform>(); hudPoint.Hide();
 }
        public async Task <IHttpActionResult> GetSet(int id)
        {
            SetModel set = await provider.GetSet(id);

            if (set == null)
            {
                return(NotFound());
            }

            return(Ok(set));
        }
Ejemplo n.º 17
0
        public void setModelTest_0arg()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
            }
                                                     );
            var intent        = new SetModel();
            var AlexaResponse = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "What's the model of the car?");
        }
Ejemplo n.º 18
0
    public void OnClientConnected(int connectionID)
    {
        byte[] bytesArray = DataParser.ObjecttoByteArray <FileObject>(fileObject);
        server.Send(connectionID, bytesArray);
        SetModel model = new SetModel();

        model.index = currentServerIndex;
        byte[] firstData = DataParser.ObjecttoByteArray <SetModel>(model);
        server.Send(connectionID, firstData);
        byte[] secondData = DataParser.ObjecttoByteArray <SetPosition>(currentPosition);
        server.Send(connectionID, secondData);
    }
Ejemplo n.º 19
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            //Program.OperateDLL("C:/Users/NicoleS/source/repos/FlightSimulator/plugins/CircularDetect.dll");
            ISetModel                setModel    = new SetModel();
            SetViewModel             setVM       = new SetViewModel(setModel);
            IFlightSimulatorModel    simModel    = new FlightSimulatorModel(setModel);
            FlightSimulatorViewModel flightSimVM = new FlightSimulatorViewModel(simModel);
            // does main window run simultanasle?
            MainWindow window = new MainWindow(setVM, flightSimVM);

            window.ShowDialog();
        }
Ejemplo n.º 20
0
        public void setModelTest_1arg()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Model", "tercel" }
            }
                                                     );
            var intent        = new SetModel();
            var AlexaResponse = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "The selected model is tercel ");
        }
Ejemplo n.º 21
0
    private void Update()
    {
        if (hudPoint.enable && currentTransform != null)
        {
            hudPoint.SetPoint(currentTransform.TransformPoint(localPos));
        }
        if (client == null)
        {
            return;
        }
        if (!client.Connected)
        {
            Error.ShowError(startScene, "Server Disconnected");
            return;
        }

        Telepathy.Message msg;
        while (client.GetNextMessage(out msg))
        {
            switch (msg.eventType)
            {
            case Telepathy.EventType.Connected:
                break;

            case Telepathy.EventType.Data:
                SetPosition setPosition = DataParser.DeserializeObject <SetPosition>(msg.data);
                if (setPosition != null)
                {
                    process(setPosition);
                    break;
                }
                SetModel setModel = DataParser.DeserializeObject <SetModel>(msg.data);
                if (setModel != null)
                {
                    process(setModel);
                    break;
                }
                FileObject fileObject = DataParser.DeserializeObject <FileObject>(msg.data);
                if (fileObject != null)
                {
                    process(fileObject);
                    break;
                }

                break;

            case Telepathy.EventType.Disconnected:
                Error.ShowError(startScene, "Server Disconnected");
                break;
            }
        }
    }
Ejemplo n.º 22
0
        public SetlistboxPresenter(SetModel setModel, List <SetModel> setModels, MainView mainView, SetListboxView setListboxView)
        {
            _setModel       = setModel;
            _setModels      = setModels;
            _mainView       = mainView;
            _setlistboxView = setListboxView;

            GenerateSetlist(); //Populate HomeSetlist with set names
            ShowSetlist();
            _setlistboxView.Load += OnSetListViewLoadedEventRaised;
            _setlistboxView.HomeSetList.MouseClick       += HomeSetList_MouseClick;
            _setlistboxView.HomeSetList.MouseDoubleClick += HomeSetList_MouseDoubleClick;
        }
Ejemplo n.º 23
0
        public static SetModel GetByName(string selectedSet)
        {
            DataAccessStatus dataAccessStatus = new DataAccessStatus();


            try
            {
                int index = 0;
                //Get all sets
                foreach (string setFolder in Directory.GetDirectories(Base._setsFolder))
                {
                    _setModel         = new SetModel();
                    _setModel.SetName = setFolder.Remove(0, setFolder.LastIndexOf('\\') + 1);
                    _setModel.SetID   = index;

                    //If set folder matches passed in set name
                    if (setFolder.Remove(0, setFolder.LastIndexOf('\\') + 1) == selectedSet)
                    {
                        //Get set's topics from folder names
                        foreach (string topicFolder in Directory.GetDirectories(setFolder))
                        {
                            TopicModel topicModel = new TopicModel();

                            topicModel.TopicName = topicFolder.Remove(0, topicFolder.LastIndexOf('\\') + 1);

                            string tfile            = topicFolder + @"\" + topicModel.TopicName + ".rtf";
                            byte[] topicFileInBytes = Encoding.ASCII.GetBytes(tfile);
                            topicModel.TopicFile = topicFileInBytes; //Set topicModel.TopicFile
                            //Get list of videos
                            string videoFolder = Path.Combine(topicFolder, "Videos");
                            foreach (string topicVideo in Directory.GetFiles(videoFolder, ("*.mp4, *.avi")))
                            {
                                //TODO: Sort results?
                                topicModel.TopicVideos.Add(topicVideo);
                            }
                            _setModel.SetTopics.Add(topicModel); //Add topicModel to set
                        }
                        return(_setModel);
                    }
                    index++;
                }
            }
            catch (DirectoryNotFoundException e)
            {
                dataAccessStatus.setValues(status: "Error", operationSucceeded: false, exceptionMessage: e.Message, customMessage: $"Directory {_setModel.SetName} wasn't found", stackTrace: e.StackTrace);
                return(null);
                //throw new DataAccessException(dataAccessStatus);
            }
            return(null);
        }
Ejemplo n.º 24
0
        public async Task <IActionResult> Create([FromBody] SetModel model)
        {
            var Set = _mapper.Map <Set>(model);

            try
            {
                await _setService.Create(Set);

                return(Ok(Set));
            }
            catch (AppException ex)
            {
                return(BadRequest(new { message = ex.Message }));
            }
        }
Ejemplo n.º 25
0
    void balancCallBack(object obj)
    {
        int result = (int)obj;

        if (result == Config.CODE_SUCCESS)
        {
            Txt_Money_My.text = UserModel.getInstance().UserVo.money.ToString();
            Txt_Charge.text   = "";
            int ownMoney = SetModel.getInstance().setVo.money;
            //PopMessageManager.show("结算获得:" + ownMoney);

            PopAlertManager.show("", "结算获得:" + ownMoney);
            //Application.LoadLevel(SceneConfig.SceneLevelFight);
        }
    }
Ejemplo n.º 26
0
        private SetModel GetSetModel(DataTable table)
        {
            SetModel setmodel = new SetModel();

            if (table == null || table.Rows.Count == 0)
            {
                return(null);
            }
            setmodel.SetID             = Int32.Parse(table.Rows[0]["Id"].ToString());
            setmodel.SetIdelTime       = table.Rows[0]["SysIdleTime"].ToString();
            setmodel.SetNoticeShowTime = table.Rows[0]["PostShowTime"].ToString();
            setmodel.SetUpdateTime     = ((DateTime)table.Rows[0]["Updatetime"]).ToString("yyyy/MM/dd HH:mm:ss.fff ");
            WebPath = table.Rows[0]["URL"].ToString();
            return(setmodel);
        }
Ejemplo n.º 27
0
        public override void AddToSet(string key, string value, double score)
        {
            QueueCommand(() =>
            {
                var fetchedSet =
                    _storage.ObjectRepository.Set <SetModel>().FirstOrDefault(v => v.Key == key && v.Value == value);

                if (fetchedSet == null)
                {
                    fetchedSet = new SetModel(key, value);
                    _storage.ObjectRepository.Add(fetchedSet);
                }

                fetchedSet.Score = score;
            });
        }
Ejemplo n.º 28
0
 /**
  * 充值处理
  * */
 private void Btn_ChargeClick(GameObject go)
 {
     //在这里监听按钮的点击事件
     if (go == Btn_Charge.gameObject)
     {
         int Money = int.Parse(Txt_Charge.text);
         if (Money > 0)
         {
             SetModel.getInstance().ChargeAction(Money, betChargeCallBack);
         }
         else
         {
             PopMessageManager.show("充值金额必须大于0");
         }
     }
 }
Ejemplo n.º 29
0
        /// <summary>
        /// 修改服务器配置
        /// </summary>
        private void ConfigServer()
        {
            var set  = new SetModel();
            var view = set.view;

            SubCloseEvent(view);
            view.Confirm.Click += (sender, args) =>
            {
                manage.InitUserName();
                set.Save();

                CloseDialog(view);
            };

            view.ShowDialog();
        }
Ejemplo n.º 30
0
        public virtual JsonResult ScheduleStudent(SetModel setModel)
        {
            if (!ModelState.IsValid)
            {
                var errors = ModelState.Values.SelectMany(v => v.Errors).ToList();
                return(Json(new { errors }, JsonRequestBehavior.AllowGet));
            }
            var studentSectionAssociation = _setModelToStudentSectionAssociationMapper.Build(setModel);

            _genericRepository.Add(studentSectionAssociation);
            _genericRepository.Save();

            var sectionListItem = _studentSectionAssociationToSectionListItemModelMapper.Build(studentSectionAssociation);

            return(Json(sectionListItem, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 31
0
 /**
  * 结算处理
  * */
 private void Btn_BalancClick(GameObject go)
 {
     //在这里监听按钮的点击事件
     if (go == Btn_Balance.gameObject)
     {
         int myMoney = UserModel.getInstance().UserVo.money;
         if (myMoney > 0)
         {
             SetModel.getInstance().BalancAction(balancCallBack);
         }
         else
         {
             PopMessageManager.show("当前账户余额必须大于0");
         }
     }
 }