コード例 #1
0
ファイル: Main.cs プロジェクト: divyamamgai/FileOrganizer
 public void PopulateGroups(object groupTupleObject) {
     try {
         if (GroupsFlowPanel.InvokeRequired) GroupsFlowPanel.Invoke((MethodInvoker)delegate { PopulateGroups(groupTupleObject); });
         else {
             Tuple<GroupDetails, TaskCollection> GroupTupleObject = (Tuple<GroupDetails, TaskCollection>)groupTupleObject;
             GroupDetails GroupDetailsObject = GroupTupleObject.Item1;
             GroupButton GroupButtonObject = new GroupButton(ref GroupDetailsObject);
             GroupButtonObject.Width = GroupsFlowPanel.Width - 30;
             GroupButtonObject.Height = 70;
             GroupButtonObject.Padding = new Padding(5, 5, 5, 5);
             GroupButtonObject.MouseClick += new MouseEventHandler(delegate (object sender, MouseEventArgs e) {
                 try {
                     if (e.Button == MouseButtons.Left) {
                         GroupForm GroupFormObject = new GroupForm(ref GroupTupleObject, ref GroupButtonObject);
                         GroupFormObject.ShowDialog();
                     } else if (e.Button == MouseButtons.Right && GroupTupleObject.Item1.Enabled && GroupTupleObject.Item2.TaskList.Count > 0) {
                         GroupRunner GroupRunnerFormObject = new GroupRunner(ref GroupTupleObject);
                         GroupRunnerFormObject.ShowDialog();
                     }
                 } catch { }
             });
             GroupsFlowPanel.Controls.Add(GroupButtonObject);
             if (++GroupsLoadedCount == NumberOfGroups) {
                 GroupButtonList = GroupsFlowPanel.Controls.OfType<GroupButton>().Cast<GroupButton>().ToList();
                 SortByChangeEnabled(true);
                 SortByComboBox.SelectedIndex = 0;
             }
         }
     } catch {
         GroupsFlowPanel.Invoke((MethodInvoker)delegate { PopulateGroups(groupTupleObject); });
     }
 }
コード例 #2
0
 public GroupForm(ref Tuple<GroupDetails, TaskCollection> groupTuppleObject, ref GroupButton groupButtonObject) {
     InitializeComponent();
     GroupExisting = true;
     GroupSaved = false;
     GroupTuppleObject = groupTuppleObject;
     GroupButtonObject = groupButtonObject;
     LoadGroupData();
 }
コード例 #3
0
ファイル: Main.cs プロジェクト: divyamamgai/FileOrganizer
 public void AddGroup(Tuple<GroupDetails, TaskCollection> groupTuppleObject) {
     GroupDetails GroupDetailsObject = groupTuppleObject.Item1;
     GroupButton GroupButtonObject = new GroupButton(ref GroupDetailsObject);
     GroupButtonObject.Width = GroupsFlowPanel.Width - 30;
     GroupButtonObject.Height = 70;
     GroupButtonObject.Padding = new Padding(5, 5, 5, 5);
     GroupButtonObject.MouseClick += new MouseEventHandler(delegate (object sender, MouseEventArgs e) {
         if (e.Button == MouseButtons.Left) {
             GroupForm GroupFormObject = new GroupForm(ref groupTuppleObject, ref GroupButtonObject);
             GroupFormObject.ShowDialog();
         } else if (e.Button == MouseButtons.Right && groupTuppleObject.Item1.Enabled && groupTuppleObject.Item2.TaskList.Count > 0) {
             GroupRunner GroupRunnerFormObject = new GroupRunner(ref groupTuppleObject);
             GroupRunnerFormObject.ShowDialog();
         }
     });
     GroupsFlowPanel.Controls.Add(GroupButtonObject);
     GroupButtonList.Add(GroupButtonObject);
 }
コード例 #4
0
        public GroupForm() {
            InitializeComponent();
            GroupExisting = false;
            GroupSaved = false;
            TaskCollectionObject = new TaskCollection();
            GroupButtonObject = null;

            this.Text = "Create Group";
            CreateSaveGroupButton.Text = "Create Group";
            CancelCloseButton.Text = "Cancel";
            PathChangeEnabled(false);
            GroupID = Options.LastGroupID + 1;
            GroupIDLabel.Text = "ID : " + GroupID.ToString();
            EnabledComboBox.SelectedIndex = 0;
            OccurrenceComboBox.SelectedIndex = 0;
            DayComboBox.SelectedIndex = 0;
            IntervalComboBox.SelectedIndex = 0;
            DeleteGroup.Visible = false;
        }