• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Object类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Object的典型用法代码示例。如果您正苦于以下问题:C# Object类的具体用法?C# Object怎么用?C# Object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Object类属于命名空间,在下文中一共展示了Object类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GridView1_RowDataBound

 protected void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)
 {
     GridView gv = (GridView)sender;
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
          DataRowView drv = ((DataRowView)e.Row.DataItem);
          t01_entidade t01 = new t01_entidade();
          {
              t01.t01_cd_entidade = (int)drv["t01_cd_entidade"];
              t01.Retrieve();
              if (!t01.Found)
              {
                  t05_parceiro t05 = new t05_parceiro();
                  {
                      t05.t05_cd_parceiro = (int)drv["t05_cd_parceiro"];
                      t05.Retrieve();
                      if (t05.Found)
                      {
                          t01.t01_cd_entidade = t05.t01_cd_entidade;
                          t01.Retrieve();
                          if (t01.Found)
                          {
                              e.Row.Cells[2].Controls.Add(pb.GetLiteral(t01.nm_entidade + "\\" + t05.nm_parceiro));
                          }
                      }
                  }
              }
          }
      }
 }
开发者ID:samucaguimaraes,项目名称:sigeor,代码行数:30,代码来源:ucColaborador.ascx.cs


示例2: Start

		void Start ()
		{
				if (messageObject == null) {
					messageObject = gameObject;
				}
				spriteRendererComp = GetComponent<SpriteRenderer> ();
		}
开发者ID:finian826,项目名称:Unity-A-Z,代码行数:7,代码来源:Button.cs


示例3: MostrarSeleccao

    protected void MostrarSeleccao(Object obj, EventArgs e)
    {
        saida.Text = "";

        ddlMunicipios.Items.Clear();
        ddlMunicipios.Items.Insert(0, new ListItem("Seleccione...", "0"));

        //if(dDL.SelectedIndex!=0)
        //{
            //ddlMunicipios.DataSource = municipios[dDL.SelectedIndex-1];
            //ddlMunicipios.DataBind();

            SqlDB Bd = new SqlDB("ConStr_DivAdmin");
            string str = "SELECT NomeMunicipio from Municipios where [CodigoDistrito] = @distrito";

            SqlCommand cmd = new SqlCommand(str, Bd.SqlConDB);
            cmd.Parameters.AddWithValue("@distrito",dDL.SelectedItem.Value);
            cmd.Connection = Bd.SqlConDB;

            Bd.SqlConDB.Open();
            SqlDataReader dR = cmd.ExecuteReader();

            //efectuar o data binding
            ddlMunicipios.DataSource = dR;
            ddlMunicipios.DataTextField = "NomeMunicipio";
            ddlMunicipios.DataValueField = "IdMunicipio";
            ddlMunicipios.DataBind();
            dR.Close();
            Bd.SqlConDB.Close();
        //}
    }
开发者ID:carlosbio,项目名称:Web-Programming-Exercises,代码行数:31,代码来源:Default.aspx.cs


示例4: GridViewNews_RowUpdating

 public void GridViewNews_RowUpdating(Object sender, GridViewUpdateEventArgs e)
 {
     int index = GridViewNews.EditIndex;
     GridViewRow row = GridViewNews.Rows[index];
     TextBox description = (TextBox)row.FindControl("TextBoxDescription");
     e.NewValues["description"] = description.Text;
 }
开发者ID:aldrinmg,项目名称:SadPanda-1,代码行数:7,代码来源:EditNews.aspx.cs


示例5: OnPaint

    void OnPaint(Object sender, PaintEventArgs e)
    {
        Graphics g = e.Graphics;
        g.DrawImage(background, 0, 0);

        g.DrawImage(greenPepper2, x2, y2);
    }
开发者ID:mikebanks,项目名称:cSharp-programs,代码行数:7,代码来源:Program.cs


示例6: AddEventHandler

 public sealed override void AddEventHandler(Object target, Delegate handler)
 {
     MethodInfo addMethod = this.AddMethod;
     if (!addMethod.IsPublic)
         throw new InvalidOperationException(SR.InvalidOperation_NoPublicAddMethod);
     addMethod.Invoke(target, new Object[] { handler });
 }
开发者ID:huamichaelchen,项目名称:corert,代码行数:7,代码来源:RuntimeEventInfo.cs


示例7: ClearObjects

 public static void ClearObjects(Object[] objects)
 {
     if (objects == null)
         return;
     for (int n = 0; n < objects.Length; n++)
         objects[n] = null;
 }
开发者ID:hugobozzshih007,项目名称:BattleCard,代码行数:7,代码来源:NgUtil.cs


示例8: ArgumentNullException

        int IEqualityComparer.GetHashCode ( Object obj ) {
            int hashCode;
            XPathNavigator nav;
            XPathDocumentNavigator xpdocNav;

            if (obj == null) {
                throw new ArgumentNullException("obj");
            }
            else if ( null != (xpdocNav = obj as XPathDocumentNavigator) ) {
                hashCode = xpdocNav.GetPositionHashCode();
            }
            else if( null != (nav = obj as XPathNavigator) ) {
                Object underlyingObject = nav.UnderlyingObject;
                if (underlyingObject != null) {
                    hashCode = underlyingObject.GetHashCode();
                }
                else {
                    hashCode = (int)nav.NodeType;
                    hashCode ^= nav.LocalName.GetHashCode();
                    hashCode ^= nav.Prefix.GetHashCode();
                    hashCode ^= nav.NamespaceURI.GetHashCode();
                }
            } 
            else {
                hashCode = obj.GetHashCode();
            }
            return hashCode;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:28,代码来源:XPathNavigatorKeyComparer.cs


示例9: Page_Load

    protected void Page_Load(Object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(this.Request.QueryString["ob"]) || !string.IsNullOrEmpty(this.Request.QueryString["sb"]))
        {
            OrderBy = (int)Util.Val(Request.QueryString["ob"]);
            SortBy = (int)Util.Val(Request.QueryString["sb"]);
            lblsortname.Text = Util.GetSortOptionName(OrderBy) + Util.GetSortOptionOrderBy(SortBy);
        }
        else
        {
            lblsortname.Text = Util.GetSortOptionName(OrderBy);
        }

        iPage = 1;

        if (!string.IsNullOrEmpty(this.Request.QueryString["page"]))
            iPage = (int)Util.Val(Request.QueryString["page"]);

        int GetPage = (int)Util.Val(Request.QueryString["page"]);

        int Layout = (int)Util.Val(Request.QueryString["layout"]);

        BindList(iPage, GetPage, Layout);

        GetMetaTitleTagKeywords(lblcatname2.Text, iPage);
    }
开发者ID:mangmaytinh,项目名称:vguitar,代码行数:26,代码来源:category.aspx.cs


示例10: PostComment_Click

    protected void PostComment_Click(Object sender, EventArgs e)
    {
        String _id = ViewState["topic"].ToString();
        CustomProfile _profile = (CustomProfile)HttpContext.Current.Profile;
        ForumTopics _newTopic = new ForumTopics(this.ConnectionString);
        _newTopic.Topic = txt_Topic.Text;
        _newTopic.ParentId = Convert.ToInt32(_id);
        _newTopic.Status = Convert.ToInt32(Enums.enumStatuses.Active);
        _newTopic.CultureInfo = _profile.Culture;
        if (_newTopic.Save())
        {
            pnl_Threads.Visible = true;
            pnl_PostForm.Visible = false;
            span_Post.Visible = true;
            txt_Topic.Text = "";

            ForumTopics _topic = new ForumTopics(this.ConnectionString);
            _topic.LitePopulate(_id, true);

            BindData(_topic);
        }
        else
        {
            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", "alert('An unexpected error has occurred. Please try again.');", true);
        }
    }
开发者ID:noximus,项目名称:TopOfTheRock,代码行数:26,代码来源:viewtopic.aspx.cs


示例11: Update_Article

    public void Update_Article(Object s, EventArgs e)
    {
        ArticleRepository Article = new ArticleRepository();

        Article.ID = (int)Util.Val(Request.QueryString["aid"]);
        Article.UID = int.Parse(Request.Form["Userid"]);
        Article.Title = Request.Form["Title"];
        Article.Content = Request.Form["Content"];
        Article.CatID = int.Parse(Request.Form["ddlarticlecategory"]);
        Article.Keyword = Request.Form["Keyword"];
        Article.Summary = Request.Form["Summary"];

        //Refresh cache
        Caching.PurgeCacheItems("Newest_Articles");
        Caching.PurgeCacheItems("ArticleCategory_SideMenu");

        //Notify user if error occured.
        if (Article.Update(Article) != 0)
        {
            JSLiteral.Text = Util.JSProcessingErrorAlert;
            return;
        }

        //Release allocated memory
        Article = null;

        //If success, redirect to article update confirmation page.
        Util.PageRedirect(7);

        Util = null;
    }
开发者ID:mangmaytinh,项目名称:vguitar,代码行数:31,代码来源:updatearticle.aspx.cs


示例12: OnWriteData

 public static Int32 OnWriteData(Byte[] buf, Int32 size, Int32 nmemb,
     Object extraData)
 {
     int nBytes = size * nmemb;
     Console.WriteLine("Obtained {0} bytes from {1}", nBytes, extraData);
     return nBytes;
 }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:7,代码来源:MultiDemo.cs


示例13: ObjectLinkForm

        public ObjectLinkForm(Main main, Project project, Session session, Object obj, int frameNo)
        {
            InitializeComponent();

            this.main = main;
            this.project = project;
            this.session = session;
            this.obj = obj;
            this.frameNo = frameNo;
            this.sessionIndex = project.sessions.IndexOf(session);
            if (sessionIndex == -1)
            {
                MessageBox.Show("Cross session only works inside one project!");
                this.Dispose();
                return;
            }
            this.infoLbl.Text = "Link from object " + obj.id + " of session " + session.sessionName + " at frame " + frameNo;
            this.sessionSelectComboBox.Items.AddRange(project.sessions.Select(s => (s.sessionName.Equals(session.sessionName) ? "(current session)" : s.sessionName)).ToArray());
            this.sessionSelectComboBox.SelectedIndex = sessionIndex;
            this.objectSelectComboBox.Items.AddRange(session.getObjects().Select(o => o.id + (o.name.Equals("") ? "" : (" (\"" + o.name + "\")"))).ToArray());
            this.objectSelectComboBox.SelectedIndex = 0;
            this.qualifiedSelectComboBox.Items.AddRange(new object[] { true, false });
            this.qualifiedSelectComboBox.SelectedIndex = 0;
            this.linkComboBox.Items.AddRange(Options.getOption().objectLinkTypes.ToArray());
            this.linkComboBox.SelectedIndex = 0;
            renderPredicateList();
        }
开发者ID:tuandnvn,项目名称:ecat,代码行数:27,代码来源:ObjectLinkForm.cs


示例14: StringBuilder

 /*protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     StringBuilder stringBuilder = new StringBuilder();
     stringBuilder.Append("<b>Personal Info - </b> <br />");
     stringBuilder.Append("First Name : ");
     stringBuilder.Append(FirstNameTextBox.Text);
     stringBuilder.Append("<br />Last Name : ");
     stringBuilder.Append(LastNameTextBox.Text);
     stringBuilder.Append("<br />DOB : ");
     stringBuilder.Append(DOBTextBox.Text);
     stringBuilder.Append("<br />Website URL : ");
     stringBuilder.Append(WebsiteURLTextBox.Text);
     stringBuilder.Append("<br /><b>Contact Info</b> <br />");
     stringBuilder.Append("City : ");
     stringBuilder.Append(CityTextBox.Text);
     stringBuilder.Append("<br />State : ");
     stringBuilder.Append(StateTextBox.Text);
     stringBuilder.Append("<br />Country : ");
     stringBuilder.Append(CountryTextBox.Text);
     stringBuilder.Append("<br />Zip : ");
     stringBuilder.Append(ZipTextBox.Text);
     Label1.Visible = true;
     Label1.Text = stringBuilder.ToString();
 }*/
 /*public void Next_Interval_Click(Object sender, EventArgs e)
 {
     int currentIntervalNumber = Int32.Parse(intervalNumber.Text);
     if (currentIntervalNumber < 4)
     {
         ++currentIntervalNumber;
         intervalNumber.Text = currentIntervalNumber.ToString();
     }
 }*/
 /*public void Next_Location_Click(Object sender, EventArgs e)
 {
     int currentLocationNumber = Int32.Parse(locationNumber.Text);
     if (currentLocationNumber < 4)
     {
         ++currentLocationNumber;
         locationNumber.Text = currentLocationNumber.ToString();
     }
     intervalNumber.Text = "1";
 }*/
 public void Next_Location_Click(Object sender, EventArgs e)
 {
     Wizard1.ActiveStepIndex--;
     Wizard1.ActiveStepIndex--;
     Wizard1.ActiveStepIndex--;
     Wizard1.MoveTo(Wizard1.ActiveStep);
 }
开发者ID:AjanJayant,项目名称:BikeCountWeb,代码行数:50,代码来源:Add_Data2.aspx.cs


示例15: grdResult_RowDataBound

    protected void grdResult_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            HiddenField hdnstatus = (HiddenField)e.Row.FindControl("hdnstatus");
            LinkButton lnkactive = (LinkButton)e.Row.FindControl("lnkactive");
            if (hdnstatus.Value == "1")
            {
                e.Row.BackColor = System.Drawing.Color.Green;
                lnkactive.Text = "Disabled";
            }
            else
                if (hdnstatus.Value == "0")
                {
                    e.Row.BackColor = System.Drawing.Color.Red;
                    lnkactive.Text = "Enabled";
                }
                else
                {
                    e.Row.BackColor = System.Drawing.Color.Orange;
                }

        }
        //if ((objAdmin.strExpert == false) && (hld.Contains("0 received") || hld.Contains("Received = 0")))
        //if  (hld.Contains("0 received") || hld.Contains("Received = 0"))
        // e.Item.BackColor = System.Drawing.Color.Red;
        //else
        //  if ((objAdmin.strExpert == true) && (!hld.Contains("0 received") || !hld.Contains("Received = 0")))
        //        e.Item.BackColor = System.Drawing.Color.Green;
        //  else
        //     if ((objAdmin.strExpert == false) && (hld.Contains("0 received") || hld.Contains("Received = 0")))
        //         e.Item.BackColor = System.Drawing.Color.Red;
        //}
    }
开发者ID:wbssergey,项目名称:dot_net_c_sharp,代码行数:34,代码来源:StatusOfMssqlJob.aspx.cs


示例16: SetDestinationRoutine

    private IEnumerator SetDestinationRoutine(Object target)
    {
        //get references
        NavMeshAgent agent = GetComponent<NavMeshAgent>();
        navMove myMove = GetComponent<navMove>();
        GameObject tar = (GameObject)target as GameObject;

        //increase agent speed
        myMove.ChangeSpeed(4);
        //set new destination of the navmesh agent
        agent.SetDestination(tar.transform.position);

        //wait until the path has been calculated
        while (agent.pathPending)
            yield return null;
        //wait until agent reached its destination
        float remain = agent.remainingDistance;
        while (remain == Mathf.Infinity || remain - agent.stoppingDistance > float.Epsilon
        || agent.pathStatus != NavMeshPathStatus.PathComplete)
        {
            remain = agent.remainingDistance;
            yield return null;
        }

        //wait a few seconds at the destination,
        //then decrease agent speed and restart movement routine
        yield return new WaitForSeconds(4);
        myMove.ChangeSpeed(1.5f);
        myMove.moveToPath = true;
        myMove.StartMove();
    }
开发者ID:jlu19,项目名称:UnityEnergyGame,代码行数:31,代码来源:EventReceiver.cs


示例17: grdacrData_Paging

 public void grdacrData_Paging(Object sender, GridViewPageEventArgs e)
 {
     DataTable dtGridData = getTable();
     grdSalesData.PageIndex = e.NewPageIndex;
     grdSalesData.DataSource = dtGridData;
     grdSalesData.DataBind();
 }
开发者ID:krishnakant,项目名称:WMS,代码行数:7,代码来源:SalesPopup.aspx.cs


示例18: PosTest1

    public bool PosTest1()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest1: TrackResurrection will return correct value when construct the WeakReference for an object instance");

        try
        {
            Object obj = new Object();
            WeakReference reference = new WeakReference(obj, true);

            if (!reference.TrackResurrection)
            {
                TestLibrary.TestFramework.LogError("001.1", "TrackResurrection returns false when construct the WeakReference for an object instance");
                retVal = false;
            }

            reference = new WeakReference(obj, false);

            if (reference.TrackResurrection)
            {
                TestLibrary.TestFramework.LogError("001.2", "TrackResurrection returns true when construct the WeakReference for an object instance");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("001.3", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return retVal;
    }
开发者ID:l1183479157,项目名称:coreclr,代码行数:34,代码来源:weakreferencetrackresurrection_cti.cs


示例19: SearchButton_Click

    //Handles search button click
    public void SearchButton_Click(Object s, EventArgs e)
    {
        //Instantiate validation object
        Utility Util = new Utility();

        //Check for minimum keyword character
        int MinuiumSearchWordLength = 2;
        int SearchWordLength;
        SearchWordLength = find.Value.Length;
        if (SearchWordLength <= MinuiumSearchWordLength)
        {
            //Redirect to keyword too short page
            Util.PageRedirect(10);
        }

        if (this.SelectedValue != null)
        {
            SDropName.SelectedValue = this.SelectedValue;
        }

        string targetUrl = "searcharticle.aspx";

        targetUrl += "?find=" + Util.FormatTextForInput(find.Value) + "&catid=" + SDropName.SelectedValue;

        //Redirect to the search page
        Response.Redirect(targetUrl);

        Util = null;
    }
开发者ID:mangmaytinh,项目名称:vguitar,代码行数:30,代码来源:articlesearchtab.ascx.cs


示例20: Equals_ReturnsFalse_ForDifferentObject

        public void Equals_ReturnsFalse_ForDifferentObject()
        {
            Object o1 = new Object();
            Object o2 = new Object();

            Assert.False(ReferenceEqualityComparer.Instance.Equals(o1, o2));
        }
开发者ID:huangw-t,项目名称:aspnetwebstack,代码行数:7,代码来源:ReferenceEqualityComparerTest.cs



注:本文中的Object类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ObjectAceFlags类代码示例发布时间:2022-05-24
下一篇:
C# Obj_AI_Minion类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap