public SelectedQuestionForm(Question question, User user) { profileDB = new ProfileDB(); InitializeComponent(); this.user = user; this.question = question; AddNewLabel(question.questionName); AddNewButton(1173, 632); lblInfo.Text = "Likes: " + question.questionLikes + " views: " + question.questionViews + " answers: " + question.questionAnswers; var value = question.questionCreationDate.Month; var enumDisplayStatus = (Question.Months)value; var stringValue = enumDisplayStatus.ToString(); lblDate.Text = question.questionCreationDate.Year + " " + stringValue + " " + question.questionCreationDate.Day; RefreshTextBox(); button1.Click += delegate(Object sender, EventArgs e) { button1_Click(sender, e); }; btnDislike.Click += delegate(Object sender, EventArgs e) { btnDislike_Click(sender, e); }; btnLike.Click += delegate(Object sender, EventArgs e) { btnLike_Click(sender, e); }; }
private void SaveBtn_Click(object sender, EventArgs e, List <Question> questionList) { var profileDB = new ProfileDB(); profileDB.db.InsertIntoQuestions(new Question(0, 0, 0, 0, questiontxt.Text, questiontxt.Text, DateTime.Now, user.userID)); var rpf = new RecentQuestions(user); rpf.Show(); this.Close(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MemoryAddresses.Init("memory_addresses.xml"); BuffDB.Init("buffdb.xml"); Dics.Init(); GlobalKeyboard.Init(); KeySetting.Init(); TaskDB.Init(); ProfileDB.Init(); GUI = new GUI(); ProcessManager.Init(); Application.Run(GUI); }
public static List <Profile> LoadProfiles() { List <Profile> ps = new List <Profile>(); if (File.Exists(Application.persistentDataPath + "/XMLFiles/profiles.xml")) { XmlSerializer serializer = new XmlSerializer(typeof(ProfileDB)); FileStream stream = new FileStream(Application.persistentDataPath + "/XMLFiles/profiles.xml", FileMode.Open); profileDB = serializer.Deserialize(stream) as ProfileDB; stream.Close(); for (int i = 0; i < profileDB.profiles.Count; i++) { ps.Add(new Profile(profileDB.profiles[i])); } } return(ps); }
public void Delete() { List <string> _toSave = new List <string>(); foreach (TaskBase _t in _tasks) { _toSave.Add(_t.TaskDBEntry.Name); _t.Delete(); } _buffs = null; _toolbar = null; Program.GUI.RemoveCharWindow(_charWindow); Profile _profile = new Profile(this._name, _toSave); ProfileDB.SaveProfile(_profile); }
public Character(Client _parentClient) { this._parentClient = _parentClient; _processHandle = OpenProcess(PROCESS_WM_READ + PROCESS_WM_WRITE, false, _parentClient.Process.Id); DataSet _dsName = new DataSet(MemoryAddresses.MemoryDic["name"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["name"].Bytecount); DataSet _dsHp = new DataSet(MemoryAddresses.MemoryDic["hp"].Address, _processHandle, 100, MemoryAddresses.MemoryDic["hp"].Bytecount); DataSet _dsMaxHp = new DataSet(MemoryAddresses.MemoryDic["maxhp"].Address, _processHandle, 100, MemoryAddresses.MemoryDic["maxhp"].Bytecount); DataSet _dsSp = new DataSet(MemoryAddresses.MemoryDic["sp"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["sp"].Bytecount); DataSet _dsMaxSp = new DataSet(MemoryAddresses.MemoryDic["maxsp"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["maxsp"].Bytecount); DataSet _dsJob = new DataSet(MemoryAddresses.MemoryDic["job"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["job"].Bytecount); DataSet _dsBLvl = new DataSet(MemoryAddresses.MemoryDic["blvl"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["blvl"].Bytecount); DataSet _dsJLvl = new DataSet(MemoryAddresses.MemoryDic["jlvl"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["jlvl"].Bytecount); DataSet _dsX = new DataSet(MemoryAddresses.MemoryDic["x"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["x"].Bytecount); DataSet _dsY = new DataSet(MemoryAddresses.MemoryDic["y"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["y"].Bytecount); _buffs = new Buffs(_processHandle); _toolbar = new Toolbar(_processHandle); _exp = new Exp(_processHandle); _dsName.Changed += DsNameChange; _dsJob.Changed += DsJob_Changed; _dsHp.Changed += DsHp_Changed; _dsMaxHp.Changed += DsMaxHp_Changed; _dsSp.Changed += DsSp_Changed; _dsMaxSp.Changed += DsMaxSp_Changed; _dsX.Changed += DsX_Changed; _dsY.Changed += DsY_Changed; _dsBLvl.Changed += DsBLvl_Changed; _dsJLvl.Changed += DsJlvl_Changed; _exp.ExpPerHourChanged += ExpPerHour_Changed; _charWindow = new CharWindow(); _charWindow.buttonResetExp.Click += CharWindowResetExp_Click; _charWindow.buttonAddTask.Click += CharWindowAddTask_Click; //Program.GUI.Shown += GUI_Shown; DsNameChange(_dsName); DsJob_Changed(_dsJob); DsHp_Changed(_dsHp); DsMaxHp_Changed(_dsMaxHp); DsSp_Changed(_dsSp); DsMaxSp_Changed(_dsMaxSp); DsBLvl_Changed(_dsBLvl); DsJlvl_Changed(_dsJLvl); _availableDBTasks = TaskDB.GetTaskListByJob(_job); List <TaskDBEntry> _toAddDBTasks = new List <TaskDBEntry>(); Profile _loadedProfile = ProfileDB.GetProfile(this._name); if (_loadedProfile != null) { foreach (string _string in _loadedProfile.TaskDBNames) { foreach (TaskDBEntry _dbtask in _availableDBTasks) { if (_dbtask.Name == _string) { _toAddDBTasks.Add(_dbtask); } } } foreach (TaskDBEntry _dbtask in _toAddDBTasks) { _availableDBTasks.Remove(_dbtask); this.AddTask(_dbtask); } } _charWindow.comboBoxTasks.DataSource = _availableDBTasks; _charWindow.comboBoxTasks.DisplayMember = "TaskName"; Program.GUI.AddCharWindow(_charWindow); }