当前位置: 首页>>代码示例>>C#>>正文


C# Object类代码示例

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


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


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