Ejemplo n.º 1
0
        public MainWin()
        {
            ///p为三点中点
            UnitPoint p = HitUtil.CenterPointFrom3Points(new UnitPoint(0, 2), new UnitPoint(1.4142136f, 1.4142136f), new UnitPoint(2, 0));

            InitializeComponent();
            Text = Program.AppName;                     //设置窗口名称
            string[] args = Environment.GetCommandLineArgs();

            //从某个文件打开时参数会有两个
            if (args.Length == 2)                       // assume it points to a file
            {
                OpenDocument(args[1]);
            }
            else
            {
                OpenDocument(string.Empty);
            }

            m_menuItems = new MenuItemManager(this);
            m_menuItems.SetupStripPanels();               //初始化上下左右四个工具面板
            SetupToolbars();                              //安装三个工具栏

            Application.Idle += new EventHandler(OnIdle); //添加触发,不断刷新三个控件
        }
Ejemplo n.º 2
0
        /// <summary>
        /// status为状态,答题时,testID绘图题第几题,id为卷名,stuID为姓名
        /// 出题时,testID为题库题目ID
        /// 标准答案时,testID为题库题目ID
        /// </summary>
        /// <param name="status"></param>
        /// <param name="examName"></param>
        /// <param name="testId"></param>
        public MainWin(string status, string examName, string testID, string stuID, string stuName, string className, string school)
        {
            this.examName  = examName;
            this.testID    = testID;
            this.status    = status;
            this.stuID     = stuID;
            this.stuName   = stuName;
            this.className = className;
            this.school    = school;
            ///p为三点中点
            UnitPoint p = HitUtil.CenterPointFrom3Points(new UnitPoint(0, 2), new UnitPoint(1.4142136f, 1.4142136f), new UnitPoint(2, 0));

            InitializeComponent();
            Text = Program.AppName;         //设置窗口名称
            string[] args = Environment.GetCommandLineArgs();

            //从某个文件打开时参数会有两个
            if (args.Length == 2)           // assume it points to a file
            {
                OpenDocument(args[1], status);
            }
            else
            {
                OpenDocument(string.Empty, status);
            }

            m_menuItems = new MenuItemManager(this);
            m_menuItems.SetupStripPanels();               //初始化上下左右四个工具面板
            SetupToolbars();                              //安装三个工具栏

            Application.Idle += new EventHandler(OnIdle); //添加触发,不断刷新三个控件
            if (status.Equals("答题"))
            {
                string sql = "declare @num int " +
                             "exec @num = findOrderNum '" + examName + "'," + testID + " " +
                             "print @num " +
                             "select 作图题题目 from 作图题库 where id=@num";

                OnFileOpen(sql);
            }
            if (status.Equals("修改答案"))
            {
                string sql = "use [CAD__" + school + "] select 画图题答案" + testID + " from testScore_" + examName + " where 学号='" + this.stuID + "'";
                OnFileOpen(sql);
            }
            if (status.Equals("标准答案"))
            {
                string sql = "select 作图题题目 from 作图题库 where id=" + testID;
                OnFileOpen(sql);
                //OpenDocument("D://9.cadxml", status);
            }
        }
Ejemplo n.º 3
0
        public MainWin()
        {
            UnitPoint p = HitUtil.CenterPointFrom3Points(new UnitPoint(0, 2), new UnitPoint(1.4142136f, 1.4142136f), new UnitPoint(2, 0));

            InitializeComponent();
            Text = Program.AppName;
            string[] args = Environment.GetCommandLineArgs();
            if (args.Length == 2)             // assume it points to a file
            {
                OpenDocument(args[1]);
            }
            else
            {
                OpenDocument(string.Empty);
            }

            m_menuItems = new MenuItemManager(this);
            m_menuItems.SetupStripPanels();
            SetupToolbars();

            Application.Idle += new EventHandler(OnIdle);
        }