示例#1
0
        // This initialization method tells the control if it is the first one in the container form
        public actionClockControl(string initStartTime, string initEndTime, string initName, bool isFirst = false) : this()
        {
            m_ErrorCount = 0;
            //Match matchStart = Regex.Match(initStartTime, @"[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] s?([ap]m)?$", RegexOptions.IgnoreCase);
            Match matchStart  = Regex.Match(initStartTime, @"[0-9][0-9]:[0-9][0-9]:[0-9][0-9]$", RegexOptions.IgnoreCase);
            Match matchLength = Regex.Match(initEndTime, @"[0-9][0-9]:[0-9][0-9]:[0-9][0-9]$", RegexOptions.IgnoreCase);

            if ((matchStart.Success == false) || (matchLength.Success == false) || (initName == ""))
            {
                m_Action = new TimerDatastore(System.DateTime.Now.ToString(), "00:00:01", "ERROR");
            }
            else
            {
                m_Action = new TimerDatastore(initStartTime, initEndTime, initName);
            }
            // Parse all the stuff used to initialize the timer.


            uxTimeOfAction.Text = m_Action.StartOffset.ToString();
            uxEndOfAction.Text  = m_Action.Length.ToString();
            uxNameLabel.Text    = m_Action.Name;
            if (isFirst == true)
            {
                m_isFirst = true;
            }
            EventMessenger.SendMessage(this, m_Action, true, false);
        }
示例#2
0
 public actionClockControl(TimerDatastore actionObject) : this()
 {
     m_Action            = actionObject;
     uxNameLabel.Text    = m_Action.Name;
     uxTimeOfAction.Text = m_Action.StartOffset.ToString();
     uxEndOfAction.Text  = m_Action.Length.ToString();
 }
        public uxFullSingleTimer(TimerDatastore inAction) : this()
        {
            // Parse all the stuff used to initialize the timer.

            m_Action = inAction;

            uxTimeOfAction.Text = m_Action.StartOffset.ToString();
            uxEndOfAction.Text  = m_Action.Length.ToString();
            uxNameLabel.Text    = m_Action.Name;
        }
 void EventMessenger_Changed(object sender, TimerDatastore e, bool add, bool del)
 {
     if (deSerializerActive == false)
     {
         if (add == true && del == false)
         {
             m_Container.addTimer(e);
             SaveControls();
             //MessageBox.Show("saved");
         }
         if (add == false && del == true)
         {
             m_Container.delTimer(e);
             SaveControls();
         }
     }
 }
示例#5
0
        static void Main(string[] args)
        {
            Console.Write("Google username: "******"Google password: "******"";

            do
            {
                key = Console.ReadKey(true);

                // Backspace Should Not Work
                if (key.Key != ConsoleKey.Backspace)
                {
                    password += key.KeyChar;
                    Console.Write("*");
                }
                else
                {
                    Console.Write("\b");
                }
            }
            // Stops Receving Keys Once Enter is Pressed
            while (key.Key != ConsoleKey.Enter);

            Console.WriteLine();
            // END section

            Console.Write("Document Name: ");
            string docName = Console.ReadLine();

            formatSheet mySheet = new formatSheet(username, password, docName, "Sheet1");

            TimerContainerStore myContainer = new TimerContainerStore();

            foreach (DataRow row in mySheet.dt.Rows)
            {
                TimerDatastore myData = new TimerDatastore();
                myData.UpdateStart(MasterTime.GetOffset());
                int myColumn = 0;
                foreach (object column in row.ItemArray)
                {
                    if (column.ToString() != "")
                    {
                        switch (myColumn)
                        {
                        case 0:
                            myData.UpdateLength(column.ToString());
                            MasterTime.SetOffset(MasterTime.GetOffset(), column.ToString());
                            //Console.WriteLine(showDate + " " + column.ToString() + "am");
                            break;

                        case 1:
                            myData.Name = column.ToString();
                            break;

                        default:
                            break;
                        }
                        myColumn++;
                    }
                }
                myContainer.addTimer(myData);
            }

            foreach (TimerDatastore timer in myContainer.Timers)
            {
                Console.WriteLine("Start Offset: " + timer.StartOffset.ToString());
                Console.WriteLine("End Offset: " + timer.Length.ToString());
                Console.WriteLine("Label: " + timer.Name);
                Console.WriteLine("-----------");
            }

            SaveStore.SaveControls(myContainer);
        }
        //public static event Action<object, TimerDatastore, bool, bool> Changed;

        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <param name="add"></param>
        /// <param name="del"></param>
        public static void SendMessage(object sender, TimerDatastore e, bool add, bool del)
        {
            //Changed(sender, e, add, del);
        }