예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            var dispatcher = System.Windows.Application.Current.MainWindow.Dispatcher;

            Panel parentPanel = (Panel)menuFile.Parent;

            parentPanel.Children.Remove(menuFile);
            expander.Content = menuFile;

            eventHandlerRenamed = (sender, args) => dispatcher.BeginInvoke(
                new Action(() => { Task_TaskRenamed(sender, args); }));
            eventHandlerDescriptionChanged = (sender, args) => dispatcher.BeginInvoke(
                new Action(() => { Task_TaskDescriptionChanged(sender, args); }));
            eventHandlerDateDueChanged = (sender, args) => dispatcher.BeginInvoke(
                new Action(() => { Task_TaskDateDueChanged(sender, args); }));

            sideWindowControls = new Control[] { textBoxTaskName, textBoxTaskDescription, datePickerDue, toggleButtonFolder };
            SideWindowEnable(false);

            webClient = new TaskWebClient(tasks);
            webClient.RecievedTasks += (sender, args) => dispatcher.BeginInvoke(
                new Action(() => { HandleTasksRecieve(sender, args); }));
            webClient.RecievedTask += (sender, args) => dispatcher.BeginInvoke(
                new Action(() => { HandleTaskRecieve(sender, args); }));
            webClient.Connect("185.16.95.101");

            gridSplitter.DragDelta += SplitterNameDragDelta;

            //If firsttime setup
            StartupWindow startupWindow = new StartupWindow();

            startupWindow.Show();
        }
예제 #2
0
        static void Main(string[] args)
        {
            TaskCollection tasks = new TaskCollection();

            TaskWebClient client = new TaskWebClient(tasks);

            client.RecievedData  += new EventHandler <RecievedDataEventArgs>(HandleData);
            client.RecievedTasks += new EventHandler <RecievedTasksEventArgs>(HandleTasks);

            client.Connect("185.16.95.101");

            Console.ReadLine();
        }