コード例 #1
0
    protected void BTN_ExportPDF_Click(object sender, EventArgs e)
    {
        using (StringWriter sw = new StringWriter())
        {
            using (HtmlTextWriter hw = new HtmlTextWriter(sw))
            {
                //Hide Comment column because of Ajax conflict
                GV.Columns[13].Visible = false;
                GV.RenderControl(hw);
                StringReader sr     = new StringReader(sw.ToString());
                Document     pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
                pdfDoc.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());

                PdfWriter writer = PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
                pdfDoc.Open();
                XMLWorkerHelper.GetInstance().ParseXHtml(writer, pdfDoc, sr);
                pdfDoc.Close();
                Response.ContentType = "application/pdf";
                Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.pdf");
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.Write(pdfDoc);
                Response.End();
            }
        }
    }
コード例 #2
0
        private void Connect()
        {
            DataTable dt = workflow2.GetUserInWorkflow(Request["userID"], false);

            GV.DataSource = dt;
            GV.DataBind();
        }
コード例 #3
0
ファイル: Meta.cs プロジェクト: Sl0vi/MigraDoc
        /// <summary>
        /// Gets the object specified by name from dom.
        /// </summary>
        public object GetValue(DocumentObject dom, string name, GV flags)
        {
            int dot = name.IndexOf('.');
            if (dot == 0)
                throw new ArgumentException(DomSR.InvalidValueName(name));
            string trail = null;
            if (dot > 0)
            {
                trail = name.Substring(dot + 1);
                name = name.Substring(0, dot);
            }
            ValueDescriptor vd = _vds[name];
            if (vd == null)
                throw new ArgumentException(DomSR.InvalidValueName(name));

            object value = vd.GetValue(dom, flags);
            if (value == null && flags == GV.GetNull)  //??? also for GV.ReadOnly?
                return null;

            //REVIEW DaSt: Create object in case of GV.ReadWrite?
            if (trail != null)
            {
                if (value == null || trail == "")
                    throw new ArgumentException(DomSR.InvalidValueName(name));
                DocumentObject doc = value as DocumentObject;
                if (doc == null)
                    throw new ArgumentException(DomSR.InvalidValueName(name));
                value = doc.GetValue(trail, flags);
            }
            return value;
        }
コード例 #4
0
    /// <summary>
    /// 查询数据
    /// </summary>
    private void Query()
    {
        //构造查询Hash对象
        Hashtable queryItems = new Hashtable();

        switch (selSelRange.Value)        //根据查询范围下拉框的选择,把对应的查询内容添加到查询哈希表中
        {
        case "教师编号": queryItems.Add("jsbh", txtSelContent.Value); break;

        case "教师姓名": queryItems.Add("jsxm", txtSelContent.Value); break;

        case "所属院系编号": queryItems.Add("jsb.yxbh", txtSelContent.Value); break;

        case "所属院系名称": queryItems.Add("yxmc", txtSelContent.Value); break;
        }
        if (showAll.Checked != true)      //判断是否显示全部
        {
            queryItems.Add("zzzt", 1);    //显示全部时,把在职状态为true添加到查询条件中
        }

        DataTable dt = Gzl.BusinessLogicLayer.JS.QueryJS(queryItems); //执行查询

        GV.DataSource = dt;                                           //把GirdView表的数据源设为dt
        GV.DataBind();                                                //绑定数据源

        labelPage.Text = "查询结果(第" + (GV.PageIndex + 1).ToString() + "页 共" + GV.PageCount.ToString() + "页)";
    }
コード例 #5
0
        public override object GetValue(DocumentObject dom, GV flags)
        {
            FieldInfo      fieldInfo = FieldInfo;
            DocumentObject val;

            if (fieldInfo != null)
            {
                // Member is a field
                val = FieldInfo.GetValue(dom) as DocumentObject;
                if (val == null && flags == GV.ReadWrite)
                {
                    val        = CreateValue() as DocumentObject;
                    val.parent = dom;
                    FieldInfo.SetValue(dom, val);
                    return(val);
                }
            }
            else
            {
                // Member is a property
                val = PropertyInfo.GetGetMethod(true).Invoke(dom, Type.EmptyTypes) as DocumentObject;
            }
            if (val != null && (val.IsNull() && flags == GV.GetNull))
            {
                return(null);
            }

            return(val);
        }
コード例 #6
0
ファイル: Test.cs プロジェクト: kitswd11/2ddotrpg
    // Use this for initialization
    void Start()
    {
        NewGame.OnClickAsObservable()
        .Subscribe(_ => {
            GV.newGame();
            PlayerManager.initialize();
            Debug.Log(PlayerManager.players[0].BaseParam.Atk);
        });
        SaveGame.OnClickAsObservable()
        .Subscribe(_ => {
            GV.save();    //newGame();
            Debug.Log(PlayerManager.players[0].BaseParam.Atk);
        });
        LoadGame.OnClickAsObservable()
        .Subscribe(_ => {
            GV.load();
            PlayerManager.initialize();
            Debug.Log(PlayerManager.players[0].BaseParam.Atk);
        });
        AddValue.OnClickAsObservable()
        .Subscribe(_ => {
            PlayerManager.players[0].BaseParam.Atk += 1;
        });

        Observable.NextFrame()
        .Subscribe(_ => {
        });
    }
コード例 #7
0
    public void EndGame(bool win)
    {
        uiLinks.gameOverPanel.SetActive(true);
        string gameOverStats = GV.SecondsToTimeString(time);

        if (win)
        {
            uiLinks.gameOverStatsContainer.anchorMax = new Vector2(1f, 0.85f);
            uiLinks.victoryText.SetActive(true);
        }
        else
        {
            uiLinks.gameOverStatsContainer.anchorMax = new Vector2(1f, 1f);
            uiLinks.victoryText.SetActive(false);
        }
        float successRate = (numberOfStacksSolved + numberOfStacksNotSolved > 0) ? 100f * numberOfStacksSolved / (numberOfStacksSolved + numberOfStacksNotSolved) : 0;

        gameOverStats += "\r\n" + gameManager.currentWave;
        gameOverStats += "\r\n" + successRate.ToString("0.##") + "%";
        gameOverStats += "\r\n" + numberOfStacksSolved;
        gameOverStats += "\r\n" + numberOfStacksNotSolved;
        uiLinks.gameOverStats.text = gameOverStats;
        isTutorial = true; //acts like a pause
        ProgressTracker.Instance.SubmitProgress(3);
    }
コード例 #8
0
ファイル: CSVLoader.cs プロジェクト: kitswd11/2ddotrpg
    /*===============================================================*/

    /*===============================================================*/
    /// <summary>
    /// @author Hironari Ushiyama
    /// @brief CSVを読み込み,CSVのID属性に対応したKeyの自動生成とセーブデータへの保存をするクラス
    /// @param string CSVファイル名 拡張子は抜かす
    /// @param string[] CSVキー内容格納配列
    /// </summary>
    public void KeyGeneration(string file, string[] keyArray)
    {
        // ローダーの生成
        CSVLoader loader = new CSVLoader( );
        // 配列カウント用 index
        int index = 0;
        // 配列 ID 入れていき更新していく変数
        string name = "";
        // CSV を読み込み, CSV のデータテーブルを生成
        CSVTable csvTable = loader.LoadCSV(file);

        foreach (CSVRecord record in csvTable.Records)
        {
            foreach (string header in csvTable.Headers)
            {
                if (header == "ID")
                {
                    // ID を元に Key 名を変更
                    name = record.GetField(header);
                }
                // ID 属性を元にキーネームを変更していく
                keyArray[index] = name + "_" + header;
                // キーネーム, キーネームに対応した CSV データ
                SaveData.setString(name + "_" + header, record.GetField(header));
                // 配列の入れ口をインクリメント
                index++;
                // Debug 出力
                //Debug.Log( "セーブデータキー : " + name + "_" + header );
                //DebugDisplayLog.displayLog.Add( name + "_" + header );
            }
        }
        // セーブクラスを用いて CSV の内容をセーブする
        GV.save( );
    }
コード例 #9
0
    /// <summary>
    /// 根据页面上用户输入的查询条件,查询用户数据
    /// </summary>
    private void Query()
    {
        //构造查询Hash对象
        Hashtable queryItems = new Hashtable();

        if (selSelRange.Value == "院系编号")
        {
            queryItems.Add("yxbh", txtSelContent.Value);
        }
        else if (selSelRange.Value == "院系名称")
        {
            queryItems.Add("yxmc", txtSelContent.Value);
        }
        if (showAll.Checked != true)
        {
            queryItems.Add("yxbz", 1);
        }



        DataTable dt = Gzl.BusinessLogicLayer.YX.QueryYX(queryItems);

        GV.DataSource = dt;
        GV.DataBind();

        labelPage.Text = "查询结果(第" + (GV.PageIndex + 1).ToString() + "页 共" + GV.PageCount.ToString() + "页)";
    }
コード例 #10
0
    /// <summary>
    /// 查询数据
    /// </summary>
    private void Query()
    {
        //构造查询Hash对象
        Hashtable queryItems = new Hashtable();

        switch (selRange.Value)
        {
        case "教师编号": queryItems.Add("[js_kc_gxb].jsbh", txtContent.Value); break;

        case "教师姓名": queryItems.Add("jsxm", txtContent.Value); break;

        case "开办院系编号": queryItems.Add("[js_kc_gxb].kcbh", txtContent.Value); break;

        case "开办院系名称":
        {
            Hashtable ht = new Hashtable();
            ht.Add("yxmc", txtContent.Value);
            string yxbh = "";
            foreach (DataRow dr in YX.QueryYX(ht).Rows)
            {
                yxbh = dr["yxbh"].ToString();
            }
            queryItems.Add("[js_kc_gxb].kcbh", yxbh); break;
        }
        }

        DataTable dt = Gzl.BusinessLogicLayer.KCRW.Query(queryItems);

        GV.DataSource = dt;
        GV.DataBind();

        labelPageGV.Text = "查询结果(第" + (GV.PageIndex + 1).ToString() + "页 共" + GV.PageCount.ToString() + "页)";
    }
コード例 #11
0
        public override object GetValue(DocumentObject dom, GV flags)
        {
            if (!Enum.IsDefined(typeof(GV), flags))
            {
                throw new ArgumentException("flags");
            }
            //throw new InvalidEnumArgumentException("flags", (int)flags, typeof(GV));

            Debug.Assert(this.memberInfo is FieldInfo, "Properties of DocumentObjectCollection not allowed.");
            DocumentObjectCollection val = FieldInfo.GetValue(dom) as DocumentObjectCollection;

            if (val == null && flags == GV.ReadWrite)
            {
                val        = CreateValue() as DocumentObjectCollection;
                val.parent = dom;
                FieldInfo.SetValue(dom, val);
                return(val);
            }
            if (val != null && val.IsNull() && flags == GV.GetNull)
            {
                return(null);
            }

            return(val);
        }
コード例 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    List <BO.FamilyMember> familyMembers = familyMemberRepository.GetAllFamilyMembers();
                    if (familyMembers.Count != (int)Utilities.OperationState.ZeroCount)
                    {
                        Session["FamilyMembers"] = familyMembers;
                        GV.DataSource            = familyMemberRepository.GetAllFamilyMembers();
                        GV.DataBind();
                    }
                    else
                    {
                        errorMessage.InnerText = "No Record Found!";
                        message.Attributes.Add("Class", "alert alert-danger show");
                    }
                }

                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
コード例 #13
0
    public void ControlParticuleEnemy(float dt, Dictionary <Transform, Particule> _listeParticuleEnemy, Dictionary <Transform, Planet> _PlayerPlanets)
    {
        currentTimeToEnemyAttack += dt;
        int RandomNumber = GV.GetRandomInt(new Vector2(1, _listeParticuleEnemy.Count - 1));

        if (currentTimeToEnemyAttack >= GV.TIME_ENEMY_TO_ATTACK)
        {
            if (_listeParticuleEnemy.ElementAt(RandomNumber).Key == null)
            {
                currentTimeToEnemyAttack -= dt;
            }
            else if (_listeParticuleEnemy.ElementAt(RandomNumber).Key != null)
            {
                Vector3   RandomExistParticule     = _listeParticuleEnemy.ElementAt(GV.GetRandomInt(new Vector2(1, _listeParticuleEnemy.Count - 1))).Key.position;
                Transform nearPlayerPlanetPosition = GetMostNearPositionOfPlanet(RandomExistParticule, _PlayerPlanets);
                foreach (KeyValuePair <Transform, Particule> kv in _listeParticuleEnemy)
                {
                    if (kv.Key != null)
                    {
                        kv.Value.setParticuleDestination(nearPlayerPlanetPosition);
                    }
                }
                currentTimeToEnemyAttack = 0;
            }
        }
    }
コード例 #14
0
        public void bindGv()
        {
            DataTable dt = getNewsDt();

            GV.DataSource = dt.DefaultView;
            GV.DataBind();
        }
コード例 #15
0
ファイル: Ant.cs プロジェクト: mattstg/Assets
    Vector2 GetRandomGoalVector()
    {
        float randAng = Random.Range(0, 360) * Mathf.Deg2Rad;

        return(GV.AddVectors(new Vector2((float)Mathf.Cos(randAng), (float)Mathf.Sin(randAng)) * (GV.ANT_STATE_TIMER + 1) * GV.ANT_SPEED, transform.position));
        //return GV.AddVectors(new Vector2(Random.Range(-1f, 1f), Random.Range(-1f, 1f)).normalized * (GV.ANT_STATE_TIMER + 1) * GV.ANT_SPEED, transform.position);
    }
コード例 #16
0
        public ServerStarter()
        {
            GV.InitServer();
            var session = GV.Session;

            session.On("disconnect", () => { OnClose(); });
            GV.MWindow.Hide();
            GV.MWindow.Width  = 0;
            GV.MWindow.Height = 0;
            if (session != null)
            {
                session.On("connectSucess", (d) => { connectionSucesss = true; });
                Thread checker = new Thread(() =>
                {
                    //Got 3 Secons to check if connection was a sucess or not
                    Thread.Sleep(3000);
                    if (!connectionSucesss)
                    {
                        //Server is not running
                        OnClose();
                    }
                    else
                    {
                        //Server Does Run
                        // - Init Login View
                        this.UiChange(() =>
                        {
                            this.ChangeScreen(new LoginControl(), "Login Screen");
                        });
                        this.UiChange(() => { GV.MWindow.Show(); });
                    }
                });
                checker.Start();
            }
        }
コード例 #17
0
ファイル: WatchForms.cs プロジェクト: VE-2016/VE-2016
        public void ExpandNodes(TreeNode main, ref int act, bool expand = true)
        {
            if (main.IsExpanded == true)
            {
                expand = true;
            }

            foreach (TreeNode nodes in main.Nodes)
            {
                ListViewItem v = nodes.Tag as ListViewItem;

                if (nodes.IsExpanded || expand == true)
                {
                    if (v == null)
                    {
                        continue;
                    }
                    //lv.Items.Insert(act + 1, v);
                    //act = lv.Items.IndexOf(v);

                    GV.Insert(act + 1, v);
                    act = GV.IndexOf(v);

                    if (nodes.IsExpanded)
                    {
                        ExpandNodes(nodes, ref act, false);
                    }

                    //nodes.Expand();
                }
            }
        }
コード例 #18
0
        private void Connect()
        {
            GV.Visible = false;
            if (ddl_Locations.Items.Count == 0)
            {
                return;
            }

            lblPopUpLocation.Text = ddl_Locations.SelectedItem.Text;

            DataTable dt = tools.GetMaintenanceUsers(ddl_Locations.SelectedValue, "");

            if (dt.Rows.Count > 0)
            {
                dt.Columns.Add("Location");
                foreach (DataRow dr in dt.Rows)
                {
                    dr["Location"] = dr["BP"] + " - " + tools.getPlantName(dr["BP"].ToString());
                }

                GV.DataSource = dt;
                GV.DataBind();
                GV.Visible = true;
            }
        }
コード例 #19
0
        protected void GV_Sort(object sender, GridViewSortEventArgs e)
        {
            List <Entity> sortedList = GetDataSource();

            if (e.SortExpression == "Id")
            {
                if (e.SortDirection == SortDirection.Ascending)
                {
                    sortedList.Sort((x, y) => x.Id.CompareTo(y.Id));
                }
                else
                {
                    sortedList.Sort((x, y) => y.Id.CompareTo(x.Id));
                }
            }
            else if (e.SortExpression == "Name")
            {
                if (e.SortDirection == SortDirection.Ascending)
                {
                    sortedList.Sort((x, y) => x.Name.CompareTo(y.Name));
                }
                else
                {
                    sortedList.Sort((x, y) => y.Name.CompareTo(x.Name));
                }
            }

            GV.DataSource = sortedList;
            GV.DataBind();
        }
コード例 #20
0
        protected void GV_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "delete")
            {
                List <int> lst = new List <int>();
                lst = (List <int>)Session["ItemList"];

                lst.Remove(Convert.ToInt32(e.CommandArgument));

                string itemList = "";

                foreach (var item in lst)
                {
                    itemList += (itemList == "" ? "" : ",") + item;
                }

                using (var db = new bigshopeEntities())
                {
                    var query = db.addToCart(itemList);
                    GV.DataSource = query;
                    GV.DataBind();
                }

                Session["ItemList"] = lst;
            }
        }
コード例 #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            if (Session["ItemList"] != null)
            {
                List <int> lst = new List <int>();
                lst = (List <int>)Session["ItemList"];

                string ItemList = "";

                foreach (var item in lst)
                {
                    ItemList += (ItemList == "" ? "" : ",") + item;
                }

                using (var db = new bigshopeEntities())
                {
                    var query = db.addToCart(ItemList);
                    GV.DataSource = query;
                    GV.DataBind();
                }
            }
        }
コード例 #22
0
    private void SetupCauldron(Vector2 loc)
    {
        Cauldron cauldron = GameObject.Instantiate(Resources.Load <GameObject>("Prefabs/Cauldron")).GetComponent <Cauldron>();

        cauldron.Initialize();
        cauldron.transform.position = GV.GetRandomSpotNear(loc, 1);
    }
コード例 #23
0
        public override object GetValue(DocumentObject dom, GV flags)
        {
            if (!Enum.IsDefined(typeof(GV), flags))
            {
                //throw new InvalidEnumArgumentException("flags", (int)flags, typeof(GV));
                throw new ArgumentException("flags");
            }

            FieldInfo      fieldInfo = FieldInfo;
            DocumentObject val;

            if (fieldInfo != null)
            {
                // Member is a field
                val = FieldInfo.GetValue(dom) as DocumentObject;
                if (val == null && flags == GV.ReadWrite)
                {
                    val        = CreateValue() as DocumentObject;
                    val.parent = dom;
                    FieldInfo.SetValue(dom, val);
                    return(val);
                }
            }
            else
            {
                // Member is a property
                val = PropertyInfo.GetGetMethod(true).Invoke(dom, Type.EmptyTypes) as DocumentObject;
            }
            if (val != null && (val.IsNull() && flags == GV.GetNull))
            {
                return(null);
            }

            return(val);
        }
コード例 #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (YetkiKontrol(pageName + "-Delete"))
        {
            if (Page.IsPostBack && !string.IsNullOrEmpty(Request.Form["HdnSil"]) && Regex.IsMatch(Request.Form["HdnSil"].Replace(",", ""), "^\\d+$"))
            {//seçilen değerler varsa siliniyor
                Snlg_DBConnect vt = new Snlg_DBConnect(true);
                try
                {
                    vt.SorguCalistir("snlg_V1.msp_EPostaSablonSil", CommandType.StoredProcedure, new Snlg_DBParameter[1] {
                        new Snlg_DBParameter("@EPId", SqlDbType.VarChar, Request.Form["HdnSil"])
                    });
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz e-posta şablonu silindi.", false);
                    GV.DataBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }
        }
        else
        {
            Snlg_Hata.ziyaretci.HataGosterHatali("Bu işlemi yapmak için yetkili değilsiniz.", false);
            return;
        }

        if (IsPostBack)
        {
            GridSayfala(GV, "Sayfalama");
        }
    }
コード例 #25
0
        public override object GetValue(DocumentObject dom, GV flags)
        {
            if (!Enum.IsDefined(typeof(GV), flags))
            {
                throw new ArgumentException("flags");
            }
            //throw new InvalidEnumArgumentException("flags", (int)flags, typeof(GV));

            object val;

            if (FieldInfo != null)
            {
                val = FieldInfo.GetValue(dom);
            }
            else
            {
                val = PropertyInfo.GetGetMethod(true).Invoke(dom, Type.EmptyTypes);
            }
            INullableValue ival = val as INullableValue;

            if (ival != null && ival.IsNull && flags == GV.GetNull)
            {
                return(null);
            }
            return(val);
        }
コード例 #26
0
    protected void GV_Sorting(object sender, GridViewSortEventArgs e)
    {
        //排序
        DataClassesDataContext db = new DataClassesDataContext();
        //var khxxs = from k in db.JB_khxx
        //            where (k.dizhi.Contains("") && k.id.Contains(""))
        //            select k;
        var lst = db.JB_khxx.OrderBy(ee => ee.id);

        switch (e.SortExpression)
        {
        case "mingcheng":
            lst = db.JB_khxx.OrderBy(ee => ee.mingcheng);;
            break;

        case "Dianhua":
            lst = db.JB_khxx.OrderBy(ee => ee.dianhua);;
            break;

        case "ChuanZhen":
            lst = db.JB_khxx.OrderBy(ee => ee.chuanzhen);;
            break;
        }
        //var lst = khxxs.OrderByDescending(ee=>ee.mingcheng);
        GV.DataSource = lst;
        GV.DataBind();
    }
コード例 #27
0
ファイル: Meta.cs プロジェクト: GorelH/PdfSharp
    /// <summary>
    /// Gets the object specified by name from dom.
    /// </summary>
    public object GetValue(DocumentObject dom, string name, GV flags)
    {
      int dot = name.IndexOf('.');
      if (dot == 0)
        throw new ArgumentException(DomSR.InvalidValueName(name));
      string trail = null;
      if (dot > 0)
      {
        trail = name.Substring(dot + 1);
        name = name.Substring(0, dot);
      }
      ValueDescriptor vd = this.vds[name];
      if (vd == null)
        throw new ArgumentException(DomSR.InvalidValueName(name));

      object value = vd.GetValue(dom, flags);
      if (value == null && flags == GV.GetNull)  //??? oder auch GV.ReadOnly?
        return null;

      //REVIEW DaSt: Sollte beim GV.ReadWrite das Objekt angelegt werden?
      if (trail != null)
      {
        if (value == null || trail == "")
          throw new ArgumentException(DomSR.InvalidValueName(name));
        DocumentObject doc = value as DocumentObject;
        if (doc == null)
          throw new ArgumentException(DomSR.InvalidValueName(name));
        value = doc.GetValue(trail, flags);
      }
      return value;
    }
コード例 #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["userID"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                string userId   = Session["userID"].ToString();
                string userName = UserManager.GetUserName(userId);
                Label  i        = (Label)Page.Master.FindControl("labUser");
                i.Text = userName;

                if (!RoleManager.IsHasDuty(userName, "HasDuty_RoleManage"))
                {
                    Response.Redirect("noDuty.aspx");
                }
                else
                {
                    GV.DataSource = RoleManager.DutyListRoles();
                    GV.DataBind();
                }
            }
        }
        this.Page.Title = "权限管理";
    }
コード例 #29
0
    static public Quaternion tan2q(Vector3 e, Vector3 s)
    {
        float th = -((float)Math.PI / 2.0f) + GV.atan((e.y - s.y) / (e.x - s.x));

        // float th = GV.atan(-(e.x - s.x) / (e.y - s.y));
        return(new Quaternion(0.0f, 0.0f, sin(th / 2.0f), cos(th / 2.0f))); // r = 1
    }
コード例 #30
0
    //External calls used by the other developers, I include may overloads for ease of use.

    /// <summary>
    /// Creates a random monster at random location
    /// </summary>
    public Monster CreateMonster()
    {
        string  monsterName = GV.GetRandomElemFromArr <string>(monsterNames);
        Vector2 location    = GV.GetRandomSpotInMap();

        return(CreateMonster(monsterName, location, Ingredient.RandomIngredient()));
    }
コード例 #31
0
    private void BindGrid()
    {
        HF_Date.Value  = DDL_week.SelectedValue;
        HF_Plant.Value = DDL_plant.SelectedValue.ToString();

        string conString = ConfigurationManager.ConnectionStrings["KPI-ReportConnectionString"].ConnectionString;

        using (SqlConnection con = new SqlConnection(conString))
        {
            using (SqlCommand cmd = new SqlCommand())
            {
                cmd.CommandText = "uspGetResultsByPlantForOneWeek";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Action", "SELECT");
                cmd.Parameters.AddWithValue("@DateW", HF_Date.Value);
                cmd.Parameters.AddWithValue("@Plant_ID", HF_Plant.Value);
                cmd.Connection = con;
                using (SqlDataAdapter sda = new SqlDataAdapter())
                {
                    sda.SelectCommand = cmd;
                    using (DataSet ds = new DataSet())
                    {
                        sda.Fill(ds);
                        GV.DataSource = ds;
                        GV.DataBind();
                    }
                }
            }
        }
    }
コード例 #32
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        //多条件模糊查询
        DataClassesDataContext db = new DataClassesDataContext();
        //var khxxs = from k in db.JB_khxx
        //            where (k.id.Contains(tb_ID.Text) && k.mingcheng.Contains(tb_MingCheng.Text))
        //            select k;
        /////////////////////////////////////////// StartsWith 用法 /////////////////////////////////////////////////////////
        //var khxxs = from k in db.JB_khxx
        //            where (k.id.StartsWith(tb_ID.Text) && k.mingcheng.StartsWith(tb_MingCheng.Text))
        //            select k;
        /////////////////////////////////////////// EndsWith 用法 ////////////////////////////////////////////////////////
        //var khxxs = from k in db.JB_khxx
        //            where (k.id.EndsWith(tb_ID.Text) && k.mingcheng.EndsWith(tb_MingCheng.Text))
        //            select k;
        //////////////////////////////////////////////////////////////////////////////
        //多条件模糊查询 利用SqlMethods类
        //DataClassesDataContext db = new DataClassesDataContext();
        var khxxs = from k in db.JB_khxx
                    where SqlMethods.Like(k.id, "%" + tb_ID.Text + "%") && SqlMethods.Like(k.mingcheng, tb_MingCheng.Text + "%")
                    select k;

        /////
        GV.DataSource = khxxs;
        GV.DataBind();
    }
コード例 #33
0
ファイル: ValueDescriptor.cs プロジェクト: GorelH/PdfSharp
 public abstract object GetValue(DocumentObject dom, GV flags);
コード例 #34
0
ファイル: ValueDescriptor.cs プロジェクト: GorelH/PdfSharp
    public override object GetValue(DocumentObject dom, GV flags)
    {
      if (!Enum.IsDefined(typeof(GV), flags))
        throw new InvalidEnumArgumentException("flags", (int)flags, typeof(GV));

      Debug.Assert(this.memberInfo is FieldInfo, "Properties of DocumentObjectCollection not allowed.");
      DocumentObjectCollection val = FieldInfo.GetValue(dom) as DocumentObjectCollection;
      if (val == null && flags == GV.ReadWrite)
      {
        val = CreateValue() as DocumentObjectCollection;
        val.parent = dom;
        FieldInfo.SetValue(dom, val);
        return val;
      }
      if (val != null && val.IsNull() && flags == GV.GetNull)
        return null;

      return val;
    }
コード例 #35
0
ファイル: ValueDescriptor.cs プロジェクト: GorelH/PdfSharp
    public override object GetValue(DocumentObject dom, GV flags)
    {
      if (!Enum.IsDefined(typeof(GV), flags))
        throw new InvalidEnumArgumentException("flags", (int)flags, typeof(GV));

      FieldInfo fieldInfo = FieldInfo;
      DocumentObject val;
      if (fieldInfo != null)
      {
        // Member is a field
        val = FieldInfo.GetValue(dom) as DocumentObject;
        if (val == null && flags == GV.ReadWrite)
        {
          val = CreateValue() as DocumentObject;
          val.parent = dom;
          FieldInfo.SetValue(dom, val);
          return val;
        }
      }
      else
      {
        // Member is a property
        val = PropertyInfo.GetGetMethod(true).Invoke(dom, Type.EmptyTypes) as DocumentObject;
      }
      if (val != null && (val.IsNull() && flags == GV.GetNull))
        return null;

      return val;
    }
コード例 #36
0
ファイル: ValueDescriptor.cs プロジェクト: GorelH/PdfSharp
    public override object GetValue(DocumentObject dom, GV flags)
    {
      if (!Enum.IsDefined(typeof(GV), flags))
        throw new InvalidEnumArgumentException("flags", (int)flags, typeof(GV));

      object val;
      if (FieldInfo != null)
        val = FieldInfo.GetValue(dom);
      else
        val = PropertyInfo.GetGetMethod(true).Invoke(dom, Type.EmptyTypes);
      INullableValue ival = val as INullableValue;
      if (ival != null && ival.IsNull && flags == GV.GetNull)
        return null;
      return val;
    }
コード例 #37
0
ファイル: ValueDescriptor.cs プロジェクト: Sl0vi/MigraDoc
        public override object GetValue(DocumentObject dom, GV flags)
        {
            if (!Enum.IsDefined(typeof(GV), flags))
                throw new /*InvalidEnum*/ArgumentException(DomSR.InvalidEnumValue(flags), "flags");

            FieldInfo fieldInfo = FieldInfo;
            DocumentObject val;
            if (fieldInfo != null)
            {
                // Member is a field
                val = FieldInfo.GetValue(dom) as DocumentObject;
                if (val == null && flags == GV.ReadWrite)
                {
                    val = (DocumentObject)CreateValue();
                    val._parent = dom;
                    FieldInfo.SetValue(dom, val);
                    return val;
                }
            }
            else
            {
                // Member is a property
#if !NETFX_CORE
                val = PropertyInfo.GetGetMethod(true).Invoke(dom, null) as DocumentObject;
#else
                val = PropertyInfo.GetValue(dom) as DocumentObject;
#endif
            }
            if (val != null && (val.IsNull() && flags == GV.GetNull))
                return null;

            return val;
        }
コード例 #38
0
ファイル: Style.cs プロジェクト: GorelH/PdfSharp
    /// <summary>
    /// Returns the value with the specified name and value access.
    /// </summary>
    public override object GetValue(string name, GV flags) //newStL
    {
      if (name == null)
        throw new ArgumentNullException("name");
      if (name == "")
        throw new ArgumentException("name");

      if (name.ToLower().StartsWith("font"))
      {
        return ParagraphFormat.GetValue(name);
      }
      return base.GetValue(name, flags);
    }
コード例 #39
0
ファイル: ValueDescriptor.cs プロジェクト: Sl0vi/MigraDoc
        public override object GetValue(DocumentObject dom, GV flags)
        {
            if (!Enum.IsDefined(typeof(GV), flags))
                throw new /*InvalidEnum*/ArgumentException(DomSR.InvalidEnumValue(flags), "flags");

#if !NETFX_CORE
            object val = FieldInfo != null ? FieldInfo.GetValue(dom) : PropertyInfo.GetGetMethod(true).Invoke(dom, null);
#else
            object val = FieldInfo != null ? FieldInfo.GetValue(dom) : PropertyInfo.GetValue(dom);
#endif
            INullableValue ival = val as INullableValue;
            if (ival != null && ival.IsNull && flags == GV.GetNull)
                return null;
            return val;
        }
コード例 #40
0
ファイル: ValueDescriptor.cs プロジェクト: DavidS/MigraDoc
    public override object GetValue(DocumentObject dom, GV flags)
    {
      FieldInfo fieldInfo = FieldInfo;
      DocumentObject val;
      if (fieldInfo != null)
      {
        // Member is a field
        val = FieldInfo.GetValue(dom) as DocumentObject;
        if (val == null && flags == GV.ReadWrite)
        {
          val = CreateValue() as DocumentObject;
          val.parent = dom;
          FieldInfo.SetValue(dom, val);
          return val;
        }
      }
      else
      {
        // Member is a property
        val = PropertyInfo.GetGetMethod(true).Invoke(dom, Type.EmptyTypes) as DocumentObject;
      }
      if (val != null && (val.IsNull() && flags == GV.GetNull))
        return null;

      return val;
    }
コード例 #41
0
ファイル: DocumentObject.cs プロジェクト: Sl0vi/MigraDoc
 /// <summary>
 /// Returns the value with the specified name and value flags.
 /// </summary>
 public virtual object GetValue(string name, GV flags)
 {
     return Meta.GetValue(this, name, flags);
 }
コード例 #42
0
ファイル: ValueDescriptor.cs プロジェクト: DavidS/MigraDoc
 public override object GetValue(DocumentObject dom, GV flags)
 {
   object val;
   if (FieldInfo != null)
     val = FieldInfo.GetValue(dom);
   else
     val = PropertyInfo.GetGetMethod(true).Invoke(dom, Type.EmptyTypes);
   INullableValue ival = val as INullableValue;
   if (ival != null && ival.IsNull && flags == GV.GetNull)
     return null;
   return val;
 }
コード例 #43
0
ファイル: ValueDescriptor.cs プロジェクト: DavidS/MigraDoc
    public override object GetValue(DocumentObject dom, GV flags)
    {
      Debug.Assert(this.memberInfo is FieldInfo, "Properties of DocumentObjectCollection not allowed.");
      DocumentObjectCollection val = FieldInfo.GetValue(dom) as DocumentObjectCollection;
      if (val == null && flags == GV.ReadWrite)
      {
        val = CreateValue() as DocumentObjectCollection;
        val.parent = dom;
        FieldInfo.SetValue(dom, val);
        return val;
      }
      if (val != null && val.IsNull() && flags == GV.GetNull)
        return null;

      return val;
    }