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

C# System.Object类代码示例

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

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



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

示例1: ToBytes

 /// <summary>
 /// 将一个对象序列化为字节数组
 /// </summary>
 /// <param name="data">要序列化的对象</param>
 /// <returns>序列化好的字节数组</returns>
 public static byte[] ToBytes(Object data)
 {
     MemoryStream ms = new MemoryStream();
     BinaryFormatter bf = new BinaryFormatter();
     bf.Serialize(ms, data);
     return ms.ToArray();
 }
开发者ID:burstinair,项目名称:burst.net,代码行数:12,代码来源:NetUtil.cs


示例2: Page_Command

 protected void Page_Command(Object sender, CommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "Edit")
         {
             Response.Redirect("edit.aspx?ID=" + gID.ToString());
         }
         else if (e.CommandName == "Cancel")
         {
             Response.Redirect("default.aspx");
         }
         else if (e.CommandName == "Delete")
         {
            
                 SqlProcs.spTQLogisticsInvoice_Delete(gID);
                 Response.Redirect("default.aspx");
             
            
         }
     }
     catch (Exception ex)
     {
         SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex);
         ctlDynamicButtons.ErrorText = ex.Message;
     }
 }
开发者ID:huamouse,项目名称:Taoqi,代码行数:27,代码来源:DetailView.ascx.cs


示例3: addClick

 private void addClick(Object sender, EventArgs e)
 {
     //EditText edit = FindViewById<EditText>(Resource.Id.editText1);
     //DBRepository dbr = new DBRepository();
     ////string result = dbr.insertRecord(edit.Text);
     //Toast.MakeText(this, result, ToastLength.Short).Show();
 }
开发者ID:sujaykodamala,项目名称:XamarinSample,代码行数:7,代码来源:Insert.cs


示例4: TightUnmarshal

    // 
    // Un-marshal an object instance from the data input stream
    // 
    public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) 
    {
        base.TightUnmarshal(wireFormat, o, dataIn, bs);

        ConsumerInfo info = (ConsumerInfo)o;
        info.ConsumerId = (ConsumerId) TightUnmarshalCachedObject(wireFormat, dataIn, bs);
        info.Browser = bs.ReadBoolean();
        info.Destination = (ActiveMQDestination) TightUnmarshalCachedObject(wireFormat, dataIn, bs);
        info.PrefetchSize = dataIn.ReadInt32();
        info.MaximumPendingMessageLimit = dataIn.ReadInt32();
        info.DispatchAsync = bs.ReadBoolean();
        info.Selector = TightUnmarshalString(dataIn, bs);
        info.SubscriptionName = TightUnmarshalString(dataIn, bs);
        info.NoLocal = bs.ReadBoolean();
        info.Exclusive = bs.ReadBoolean();
        info.Retroactive = bs.ReadBoolean();
        info.Priority = dataIn.ReadByte();

        if (bs.ReadBoolean()) {
            short size = dataIn.ReadInt16();
            BrokerId[] value = new BrokerId[size];
            for( int i=0; i < size; i++ ) {
                value[i] = (BrokerId) TightUnmarshalNestedObject(wireFormat,dataIn, bs);
            }
            info.BrokerPath = value;
        }
        else {
            info.BrokerPath = null;
        }
        info.AdditionalPredicate = (BooleanExpression) TightUnmarshalNestedObject(wireFormat, dataIn, bs);
        info.NetworkSubscription = bs.ReadBoolean();
        info.OptimizedAcknowledge = bs.ReadBoolean();
        info.NoRangeAcks = bs.ReadBoolean();

    }
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:38,代码来源:ConsumerInfoMarshaller.cs


示例5: VerifyAccess

        ///<summary>
        /// This method is called to Add a Setter object as a child of the Style.
        ///</summary>
        ///<param name="value">
        /// The object to add as a child; it must be a Setter or subclass.
        ///</param>
        void IAddChild.AddChild (Object value)
        {
            // Verify Context Access
            VerifyAccess();

            Setters.Add(Trigger.CheckChildIsSetter(value));
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:13,代码来源:MultiDataTrigger.cs


示例6: ArgumentCheck

 private static void ArgumentCheck(Side side, int m, int n, int k, int ilo, int ihi, Object A, int lda, Object tau, Object C, int ldc) {
   if ( A == null ) {
     throw new ArgumentNullException("A","A cannot be null.");
   }
   if ( tau == null ) {
     throw new ArgumentNullException("tau","tau cannot be null.");
   }
   if ( C == null ) {
     throw new ArgumentNullException("C","C cannot be null.");
   }
   if ( m<0 ) {
     throw new ArgumentException("m must be at least zero.", "m");
   }
   if ( n<0 ) {
     throw new ArgumentException("n must be at least zero.", "n");
   }
   if( side == Side.Left ){
     if( k < 0 || k > m ){
       throw new ArgumentException("k must be positive and less than or equal to m.", "k");
     }
     if (m>0) {
       if (ilo<1 || ilo>m || ilo>ihi)
         throw new ArgumentException("ilo must be a positive number and less than or equal to min(ihi,m) if m>0", "ilo");
       if (ihi<1 || ihi>m)
         throw new ArgumentException("ihi must be between 1 and m if m>0", "ihi");
     } else {
       if (ilo!=1)
         throw new ArgumentException("ilo must be 1 if m=0", "ilo");
       if (ihi!=0)
         throw new ArgumentException("ihi must be 0 if m=0", "ihi");
     }
   }else{
     if( k < 0 || k > n ){
       throw new ArgumentException("k must be positive and less than or equal to n.", "k");
     }
     if (n>0) {
       if (ilo<1 || ilo>n || ilo>ihi)
         throw new ArgumentException("ilo must be a positive number and less than or equal to min(ihi,n) if n>0", "ilo");
       if (ihi<1 || ihi>n)
         throw new ArgumentException("ihi must be a positive number and less than or equal to n if n>0", "ihi");
     } else {
       if (ilo!=1)
         throw new ArgumentException("ilo must be 1 if n=0", "ilo");
       if (ihi!=0)
         throw new ArgumentException("ihi must be 0 if n=0", "ihi");
     }
   }
   if( side == Side.Left ){
     if ( lda < System.Math.Max(1,m) ) {
       throw new ArgumentException("lda must be at least max(1,m)", "lda");
     }
   }else{
     if ( lda < System.Math.Max(1,n) ) {
       throw new ArgumentException("lda must be at least max(1,n)", "lda");
     }
   }
   if ( ldc < System.Math.Max(1,m) ) {
     throw new ArgumentException("ldc must be at least max(1,m)", "ldc");
   }
 }
开发者ID:Altaxo,项目名称:Altaxo,代码行数:60,代码来源:Unmhr.cs


示例7: ActionEasterEgg

 /* Events' handlers */
 private void ActionEasterEgg(Object sender, EventArgs e)
 {
     if (--easterEgg < 0)
     {
         lAppName.Text = "O_O";
     }
 }
开发者ID:jeka-js,项目名称:MyJobs,代码行数:8,代码来源:FormAbout.cs


示例8: TestDatabaseConnection

 public static void TestDatabaseConnection(Object sender, TestDatabaseConnectionEventArgs e)
 {
     using (var connection = new FbConnection(GetConnectionString(e.DatabaseSettings)))
     {
         connection.Open();
     }
 }
开发者ID:Dennis-Petrov,项目名称:Cash,代码行数:7,代码来源:DatabaseHelper.cs


示例9: OnProcessFileDialog

		private void OnProcessFileDialog(Object sender, FileDialogEventArgs e)
		{
			switch (e.Mode)
			{
				case FileDialogMode.Save:
					using (var saveDialog = new SaveFileDialog())
					{
						saveDialog.Title = e.Title;
						saveDialog.Filter = e.Filter;
						saveDialog.FileName = e.DefaultFileName;
						if (saveDialog.ShowDialog() != DialogResult.Cancel)
						{
							FormProgress.ShowProgress();
							FormProgress.SetTitle("Downloading…", true);
							FormProgress.SetDetails(Path.GetFileName(saveDialog.FileName));
							TabControl.Enabled = false;
							Application.DoEvents();
							e.Continue(saveDialog.FileName);
						}
						else
							e.Cancel();
					}
					break;
			}
			e.Handled = true;
		}
开发者ID:w01f,项目名称:VolgaTeam.Dashboard,代码行数:26,代码来源:WebViewer.cs


示例10: Application_BeginRequest

 protected void Application_BeginRequest(Object sender, EventArgs e) {
     string filePath = HttpContext.Current.Request.PhysicalPath;
     if (!string.IsNullOrEmpty(filePath)
         && (filePath.IndexOf("Images") >= 0) && !System.IO.File.Exists(filePath)) {
         HttpContext.Current.Response.End();
     }
 }
开发者ID:dimajanzen,项目名称:eXpand,代码行数:7,代码来源:Global.asax.cs


示例11: field_DataBinding

 private void field_DataBinding(Object sender, EventArgs e)
 {
     Control c = (Control)sender;
     GridViewRow row = (GridViewRow)c.NamingContainer;
     if (sender.GetType() == typeof(Label))
     {
         (c as Label).Text = DataBinder.Eval(row.DataItem, columnNameData).ToString();
         (c as Label).Font.Size = 7;
         (c as Label).Font.Name = "Arial";
     }
     else if (sender.GetType() == typeof(TextBox))
     {
         (c as TextBox).Text = DataBinder.Eval(row.DataItem, columnNameData).ToString();
         (c as TextBox).Font.Size = 7;
         (c as TextBox).Font.Name = "Arial";
     }
     else if (sender.GetType() == typeof(DropDownList))
     {
         (c as DropDownList).SelectedValue = DataBinder.Eval(row.DataItem, columnNameData).ToString();
         (c as DropDownList).Font.Size = 7;
         (c as DropDownList).Font.Name = "Arial";
     }
     else if (sender.GetType() == typeof(CheckBox))
     {
         (c as CheckBox).Checked = (bool)DataBinder.Eval(row.DataItem, columnNameData);
     }
 }
开发者ID:hoangtung56pm,项目名称:KPINew,代码行数:27,代码来源:GridViewTemplate.cs


示例12: SaveShareButton_Command

 protected void SaveShareButton_Command(Object sender, CommandEventArgs e)
 {
     SaveButton_Command(sender, e);
     var patron = (Patron)Session["Patron"];
     Response.Redirect(string.Format("~/Avatar/View.aspx?AvatarId={0}",
         patron.AvatarState));
 }
开发者ID:haraldnagel,项目名称:greatreadingadventure,代码行数:7,代码来源:MyAvatarControl.ascx.cs


示例13: return

 GetDialogTitle
 (
     Object oObjectBeingSaved
 )
 {
     return (DialogTitle);
 }
开发者ID:2014-sed-team3,项目名称:term-project,代码行数:7,代码来源:SaveGraphMLFileDialog.cs


示例14: AddModuleToPane_Click

        /// <summary>The AddModuleToPane_Click server event handler on this page is used
        /// to add a new portal module into the tab
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void AddModuleToPane_Click(Object sender, EventArgs e)
        {
            // All new modules go to the end of the contentpane
            ModuleItem m = new ModuleItem();
            m.ModuleTitle = moduleTitle.Text;
            m.ModuleDefId = Int32.Parse(moduleType.SelectedItem.Value);
            m.ModuleOrder = 999;

            // save to database
            Configuration config = new Configuration();
            m.ModuleId =
                config.AddModule(tabId, m.ModuleOrder, "ContentPane", m.ModuleTitle, m.ModuleDefId, 0, "Admins", false);

            // Obtain portalId from Current Context
            PortalSettings portalSettings = (PortalSettings) Context.Items["PortalSettings"];

            // reload the portalSettings from the database
            HttpContext.Current.Items["PortalSettings"] = new PortalSettings(portalSettings.PortalId, tabId);

            // reorder the modules in the content pane
            ArrayList modules = GetModules("ContentPane");
            OrderModules(modules);

            // resave the order
            foreach (ModuleItem item in modules)
            {
                config.UpdateModuleOrder(item.ModuleId, item.ModuleOrder, "ContentPane");
            }

            // Redirect to the same page to pick up changes
            Response.Redirect(Request.RawUrl);
        }
开发者ID:pdckxd,项目名称:bugtrackingsystem,代码行数:37,代码来源:TabLayout.aspx.cs


示例15: ObjetoSerializado

 public static string ObjetoSerializado(Object Objeto)
 {
     System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(Objeto.GetType());
     System.IO.StringWriter textWriter = new System.IO.StringWriter();
     x.Serialize(textWriter, Objeto);
     return textWriter.ToString();
 }
开发者ID:pjeconde,项目名称:CedServicios,代码行数:7,代码来源:Funciones.cs


示例16: NodeEventEditor

 public NodeEventEditor(CharEvents _chev, Object[] obj)
 {
     InitializeComponent();
     chev = _chev;
     comboBox1.Items.AddRange(obj);
     comboBox2.Items.AddRange(obj);
 }
开发者ID:KatekovAnton,项目名称:ResourceCollector,代码行数:7,代码来源:NodeEventEditor.cs


示例17: CurrentDomain_UnhandledException

 private static void CurrentDomain_UnhandledException(Object sender, UnhandledExceptionEventArgs e)
 {
     if (e != null && e.ExceptionObject != null)
     {
         log.Error("Error: " + e.ExceptionObject);
     }
 }
开发者ID:knarf7112,项目名称:SocketServer,代码行数:7,代码来源:Program.cs


示例18: TightMarshal2

    // 
    // Write a object instance to data output stream
    //
    public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) {
        base.TightMarshal2(wireFormat, o, dataOut, bs);

        RemoveInfo info = (RemoveInfo)o;
        TightMarshalCachedObject2(wireFormat, (DataStructure)info.ObjectId, dataOut, bs);

    }
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:10,代码来源:RemoveInfoMarshaller.cs


示例19: DrawGraphics

        void DrawGraphics(Object sender, PaintEventArgs PaintNow)
        {
            Rectangle Dot = new Rectangle(SpriteX, SpriteY, SpriteWidth, SpriteHeight); // Create rectangle (start position, and size X & Y)
            SolidBrush WhiteBrush = new SolidBrush(Color.White); // Create Brush(Color) to paint rectangle

            PaintNow.Graphics.FillRectangle(WhiteBrush, Dot);
        }
开发者ID:JeremiahZhang,项目名称:AKA,代码行数:7,代码来源:Program.cs


示例20: Equals

 public override bool Equals(Object obj)
 {
     TestDiagnosisInfo p = obj as TestDiagnosisInfo;
     if ((object)p == null)
     {
         return false;
     }
     if (this.info == p.info)
         return true;
     if ((this.info == null) || (p.info == null))
     {
         return false;
     }
     if ((this.info.Comment == p.info.Comment)&&
     (this.info.DiagnosedDate == p.info.DiagnosedDate)&&
     (this.info.DiagnosisChangeReason == p.info.DiagnosisChangeReason)&&
     (this.info.DiagnosisStage == p.info.DiagnosisStage)&&
     (this.info.IdDiagnosisType == p.info.IdDiagnosisType)&&
     (this.info.IdDiseaseType == p.info.IdDiseaseType)&&
     (this.info.IdDispensaryState == p.info.IdDispensaryState)&&
     (this.info.IdTraumaType == p.info.IdTraumaType)&&
     (this.info.MedicalStandard == p.info.MedicalStandard)&&
     (this.info.MESImplementationFeature == p.info.MESImplementationFeature)&&
     (this.info.MkbCode == p.info.MkbCode))
     {
         return true;
     }
     else
     {
         this.FindMismatch(p);
         Global.errors3.Add("несовпадение TestDiagnosisInfo");
         return false;
     }
 }
开发者ID:nbIxMaN,项目名称:EMKT,代码行数:34,代码来源:TestDiagnosisInfo.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# System.Objects类代码示例发布时间:2022-05-26
下一篇:
C# System.Number类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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