private void Button_Submit_Click(object sender, RoutedEventArgs e)
        {
            var dr = MessageBox.Show("Sure to commit?", "Information", MessageBoxButton.OKCancel);

            if (dr == MessageBoxResult.Cancel)
            {
                return;
            }
            CSCore.Solve(this.rtid, this.workitemId, this.nodeId, this.TextBox_Solution.Text);
            this.Close();
        }
        private void Button_Submit_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListBox_MyPlans.Items.Count < 2)
            {
                MessageBox.Show("Decompose should contain at least 2 steps");
                return;
            }
            var plist = (from object item in this.ListBox_MyPlans.Items select item as string).ToList();

            CSCore.Decompose(this.rtid, this.workitemId, this.nodeId, plist);
            this.Close();
        }
        private void RefreshRequestList()
        {
            var reqs = CSCore.RefreshRequest(GlobalDataPackage.CurrentUsername);

            this.requests = reqs.Copy();
            reqs.Columns.RemoveAt(2);
            reqs.Columns.RemoveAt(5 - 1);
            reqs.Columns.RemoveAt(6 - 2);
            reqs.Columns.RemoveAt(7 - 3);
            reqs.Columns.RemoveAt(8 - 4);
            reqs.Columns.RemoveAt(9 - 5);
            this.DataGrid_Requests.ItemsSource = reqs.DefaultView;
        }
 private void Button_Submit_Click(object sender, RoutedEventArgs e)
 {
     this.isCancel = false;
     if (!this.isReadonly)
     {
         CSCore.NewRequest(this.TextBox_TaskName.Text.Trim(),
                           this.TextBox_Description.Text.Trim(),
                           Convert.ToInt32(this.TextBox_JudgeCount.Text),
                           Convert.ToInt32(this.TextBox_SolveCount.Text),
                           Convert.ToInt32(this.TextBox_SolveVoteCount.Text),
                           Convert.ToInt32(this.TextBox_DecomposeCount.Text),
                           Convert.ToInt32(this.TextBox_DecomposeVoteCount.Text));
     }
     this.Close();
 }
Exemplo n.º 5
0
        private void Button_VoteThis_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListBox_Composes.SelectedIndex == -1)
            {
                return;
            }
            var dr = MessageBox.Show("Sure to choose this decompose plan?", "Information", MessageBoxButton.OKCancel, MessageBoxImage.Information);

            if (dr == MessageBoxResult.Cancel)
            {
                return;
            }
            var selectedItem = (this.ListBox_Composes.SelectedItem as ListBoxItem).Tag as Tuple <string, List <string> >;

            CSCore.VoteForDecompose(this.rtid, this.nodeId, selectedItem.Item1, this.workitemId);
            this.Close();
        }
        private void Button_VoteThis_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListBox_CandidateSolutions.SelectedIndex == -1)
            {
                return;
            }
            var dr = MessageBox.Show("Sure to vote this solution?", "Information", MessageBoxButton.OKCancel);

            if (dr == MessageBoxResult.Cancel)
            {
                return;
            }
            var worker = this.solveList[this.ListBox_CandidateSolutions.SelectedIndex].Item1;

            CSCore.VoteForSolution(this.rtid, this.nodeId, worker, this.workitemId);
            this.Close();
        }
 public SolveVoteWindow(string taskName, string description, string workitemId, string rtid, string nodeId)
 {
     InitializeComponent();
     this.workitemId               = workitemId;
     this.nodeId                   = nodeId;
     this.rtid                     = rtid;
     this.TextBox_Title.Text       = $"[Description: {taskName}]";
     this.TextBox_Description.Text = description;
     this.solveList                = CSCore.GetSolveList(this.rtid, this.nodeId);
     this.ListBox_CandidateSolutions.Items.Clear();
     for (var i = 0; i < this.solveList.Count; i++)
     {
         var lbi = new ListBoxItem
         {
             Content = "Solution " + (i + 1)
         };
         this.ListBox_CandidateSolutions.Items.Add(lbi);
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (CSCore.DoLogin(this.TextBox_username.Text, this.PasswordBox_password.Password))
     {
         if (GlobalDataPackage.CurrentUserViewRole == UserViewRole.Requester)
         {
             new RequesterWindow().Show();
         }
         else
         {
             new SolverWindow().Show();
         }
         this.Close();
     }
     else
     {
         MessageBox.Show("Invalid username or password");
     }
 }
Exemplo n.º 9
0
 public DecomposeVoteWindow(string taskName, string description, string workitemId, string rtid, string nodeId)
 {
     InitializeComponent();
     this.workitemId               = workitemId;
     this.nodeId                   = nodeId;
     this.rtid                     = rtid;
     this.TextBox_Title.Text       = $"[Description: {taskName}]";
     this.TextBox_Description.Text = description;
     this.decomposes               = CSCore.GetDecomposeList(rtid, nodeId);
     this.ListBox_Composes.Items.Clear();
     for (var i = 0; i < this.decomposes.Count; i++)
     {
         var lbi = new ListBoxItem()
         {
             Content = "Plan " + (i + 1),
             Tag     = this.decomposes[i]
         };
         this.ListBox_Composes.Items.Add(lbi);
     }
 }
Exemplo n.º 10
0
        public void RefreshList()
        {
            this.ListBox_Solver_Tasks.Items.Clear();
            var rtids = CSCore.GetAllActiveRTID();

            foreach (var rtid in rtids)
            {
                var workitems = InteractionManager.GetMyWorkitem(GlobalDataPackage.CurrentUserWorkerId, rtid);
                foreach (var workitem in workitems)
                {
                    var itemDict = workitem.Item2;
                    var request  = CSCore.GetRequestByRTID(rtid);
                    var retArgs  = ReturnDataHelper.DecodeDictionaryByString(itemDict["Argument"]);
                    var lbi      = new ListBoxItem
                    {
                        Content = String.Format("Task: {0} | From CrowdSourcing Request: {1} | By: {2}",
                                                itemDict["TaskName"], request.ItemArray[1], request.ItemArray[2]),
                        Tag = new Tuple <Dictionary <String, String>, Dictionary <String, String> >(itemDict, retArgs)
                    };
                    this.ListBox_Solver_Tasks.Items.Add(lbi);
                }
            }
        }
Exemplo n.º 11
0
 public static extern MmResult waveInGetDevCaps(IntPtr deviceID, out CSCore.SoundIn.WaveInCaps waveInCaps, uint cbWaveInCaps);
Exemplo n.º 12
0
 /// <summary>
 /// Initializes a new XAudio2SoundProvider class
 /// <param name="xaudio2">The XAudio2 Instance.</param>
 /// <param name="soundInitializer">The ISoundInitializer.</param>
 /// </summary>
 internal XAudio2SoundProvider(CSCore.XAudio2.XAudio2 xaudio2, ISoundInitializer soundInitializer)
 {
     SoundInitializer = soundInitializer;
     _xaudio2 = xaudio2;
     _xaudio2.CreateMasteringVoice();
 }