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

C# Common类代码示例

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

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



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

示例1: Create

        public static Common.Models.Events.EventMatter Create(Common.Models.Events.EventMatter model,
            Common.Models.Account.Users creator,
            IDbConnection conn = null, bool closeConnection = true)
        {
            DBOs.Events.EventMatter dbo;
            Common.Models.Events.EventMatter currentModel;

            if (!model.Id.HasValue) model.Id = Guid.NewGuid();
            model.Created = model.Modified = DateTime.UtcNow;
            model.CreatedBy = model.ModifiedBy = creator;

            currentModel = Get(model.Event.Id.Value, model.Matter.Id.Value);

            if (currentModel != null) 
                return currentModel;

            dbo = Mapper.Map<DBOs.Events.EventMatter>(model);

            conn = DataHelper.OpenIfNeeded(conn);

            throw new Exception("this is broke");
            conn.Execute("UPDATE \"event_assigned_conttter\" (\"id\", \"event_id\", \"matter_id\", \"utc_created\", \"utc_modified\", \"created_by_user_pid\", \"modified_by_user_pid\") " +
                "VALUES (@Id, @EventId, @MatterId, @UtcCreated, @UtcModified, @CreatedByUserPId, @ModifiedByUserPId)",
                dbo);
            DataHelper.Close(conn, closeConnection);

            return model;
        }
开发者ID:NodineLegal,项目名称:OpenLawOffice.Data,代码行数:28,代码来源:EventMatter.cs


示例2: Create

        public static Common.Models.Documents.DocumentTask Create(Common.Models.Documents.DocumentTask model,
            Common.Models.Account.Users creator)
        {
            model.Created = model.Modified = DateTime.UtcNow;
            model.CreatedBy = model.ModifiedBy = creator;
            DBOs.Documents.DocumentTask dbo = Mapper.Map<DBOs.Documents.DocumentTask>(model);

            using (IDbConnection conn = Database.Instance.GetConnection())
            {
                Common.Models.Documents.DocumentTask currentModel = Get(model.Task.Id.Value, model.Document.Id.Value);

                if (currentModel != null)
                { // Update
                    conn.Execute("UPDATE \"document_task\" SET \"utc_modified\"[email protected], \"modified_by_user_pid\"[email protected] " +
                        "\"utc_disabled\"=null, \"disabled_by_user_pid\"=null WHERE \"id\"[email protected]", dbo);
                    model.Created = currentModel.Created;
                    model.CreatedBy = currentModel.CreatedBy;
                }
                else
                { // Create
                    conn.Execute("INSERT INTO \"document_task\" (\"id\", \"document_id\", \"task_id\", \"utc_created\", \"utc_modified\", \"created_by_user_pid\", \"modified_by_user_pid\") " +
                        "VALUES (@Id, @DocumentId, @TaskId, @UtcCreated, @UtcModified, @CreatedByUserPId, @ModifiedByUserPId)",
                        dbo);
                }
            }

            return model;
        }
开发者ID:ysminnpu,项目名称:OpenLawOffice,代码行数:28,代码来源:DocumentTask.cs


示例3: SendNotification

        protected override void SendNotification(Common.Notification notification)
        {
            var bbn = notification as BlackberryNotification;

            if (bbn != null)
                push(bbn);
        }
开发者ID:rajwilkhu,项目名称:PushSharp,代码行数:7,代码来源:BlackberryPushChannel.cs


示例4: Update

        public int Update(Common.DataContext ctx, IModel.BaseTable baseTable)
        {
            int rel = 0;
            rel = dal.Update(ctx, baseTable);

            return rel;
        }
开发者ID:jxzly229190,项目名称:YrealWeb_Online,代码行数:7,代码来源:BLLBase.cs


示例5: FResults

		internal FResults(ref Common.Interface newCommon)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			CommonCode = newCommon;

			Trace.WriteLine("FResults: Creating");
			try
			{
				this.Resize += new EventHandler(FStations_Resize);

				// Databinding
				ddPatrols.DataSource = patrolsDs.Patrols;
				ddPatrols.DisplayMember = "DisplayName";
				ddPatrols.ValueMember = "Id";

				ddCompetitors.DataSource = this.competitorsDs.Shooters;
				ddCompetitors.DisplayMember = "Name";
				ddCompetitors.ValueMember = "Id";
			}
			catch(Exception exc)
			{
				Trace.WriteLine("FResults: Exception" + exc.ToString());
				throw;
			}
			finally
			{
				Trace.WriteLine("FResults: Created.");
			}
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:33,代码来源:FResults.cs


示例6: SymbolEvent

 public SymbolEvent(Common.SafeBitArray bitset, int samplesPerSymbol, bool decision, Shift shift)
 {
     mBitset = bitset;
     mSamplesPerSymbol = samplesPerSymbol;
     mDecision = decision;
     mShift = shift;
 }
开发者ID:JoeGilkey,项目名称:RadioLog,代码行数:7,代码来源:SymbolEvent.cs


示例7: Create

        public static Common.Models.Events.EventNote Create(Common.Models.Events.EventNote model,
            Common.Models.Account.Users creator,
            IDbConnection conn = null, bool closeConnection = true)
        {
            model.Created = model.Modified = DateTime.UtcNow;
            model.CreatedBy = model.ModifiedBy = creator;
            DBOs.Events.EventNote dbo = Mapper.Map<DBOs.Events.EventNote>(model);

            conn = DataHelper.OpenIfNeeded(conn);

            Common.Models.Events.EventNote currentModel = Get(model.Event.Id.Value, model.Note.Id.Value, conn, false);

            if (currentModel != null)
            { // Update
                conn.Execute("UPDATE \"event_note\" SET \"utc_modified\"[email protected], \"modified_by_user_pid\"[email protected] " +
                    "\"utc_disabled\"=null, \"disabled_by_user_pid\"=null WHERE \"id\"[email protected]", dbo);
                model.Created = currentModel.Created;
                model.CreatedBy = currentModel.CreatedBy;
            }
            else
            { // Create
                if (conn.Execute("INSERT INTO \"event_note\" (\"id\", \"note_id\", \"event_id\", \"utc_created\", \"utc_modified\", \"created_by_user_pid\", \"modified_by_user_pid\") " +
                    "VALUES (@Id, @NoteId, @EventId, @UtcCreated, @UtcModified, @CreatedByUserPId, @ModifiedByUserPId)",
                    dbo) > 0)
                    model.Id = conn.Query<DBOs.Events.EventNote>("SELECT currval(pg_get_serial_sequence('event_note', 'id')) AS \"id\"").Single().Id;
            }

            DataHelper.Close(conn, closeConnection);

            return model;
        }
开发者ID:NodineLegal,项目名称:OpenLawOffice.Data,代码行数:31,代码来源:EventNote.cs


示例8: LogEx

        public static void LogEx(this Common.Logging.ILog log, Common.Logging.LogLevel level, Action<TraceRecord> traceAction, [CallerMemberName] string member = "", [CallerLineNumber] int line = 0)
        {
            // Check if this log level is enabled
            if (level == LogLevel.Trace && log.IsTraceEnabled == false ||
                level == LogLevel.Debug && log.IsDebugEnabled == false ||
               level == LogLevel.Info && (log.IsInfoEnabled == false) ||
               level == LogLevel.Warn && (log.IsWarnEnabled == false) ||
               level == LogLevel.Error && (log.IsErrorEnabled == false) ||
               level == LogLevel.Fatal && (log.IsFatalEnabled == false))
            {
                return;
            }

            TraceRecord tr = new TraceRecord() { Level = level };
            traceAction(tr);
            string message = String.Format("{0}() line {1}: {2}.{3}", member, line, tr.Message, (tr.Data != null) ? Newtonsoft.Json.JsonConvert.SerializeObject(tr.Data) : "");

            switch (level)
            {
                case LogLevel.Trace: log.Trace(message, tr.Exception); break;
                case LogLevel.Debug: log.Debug(message, tr.Exception); break;
                case LogLevel.Error: log.Error(message, tr.Exception); break;
                case LogLevel.Fatal: log.Fatal(message, tr.Exception); break;
                case LogLevel.Info: log.Info(message, tr.Exception); break;
                case LogLevel.Warn: log.Warn(message, tr.Exception); break;
            }
        }
开发者ID:pceftpos,项目名称:pay-at-table,代码行数:27,代码来源:CommonLoggingExtensions.cs


示例9: IncStat

 public void IncStat(string stat, Common.DebugLevel minLevel)
 {
     if (DebuggingLevel >= minLevel)
     {
         IncStat(stat);
     }
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:StatBin.cs


示例10: GetTables

 public override void GetTables(Common.Entities.MetaDataSchema.Project project)
 {
     foreach (Entities.MetaDataSchema.Database dbase in project.Databases)
     {
         System.Data.DataTable tables = new DataTable();
         System.Data.DataTable sqlServerTable = new DataTable();
         tables.Load(project.ExtractorManager.SelectStatement("Select * From " + dbase.Name + ".INFORMATION_SCHEMA.TABLES Where Table_Type = '" + Resources.DataStructure.TableType + "'"), LoadOption.OverwriteChanges);
         sqlServerTable.Load(project.ExtractorManager.SelectStatement("Select * From " + dbase.Name + ".sys.all_objects Where Type_Desc = 'user_table'"), LoadOption.OverwriteChanges);
         OnStartLoading(new Common.Events.LoadingEventArgs(dbase.Name,"Tables","Database"));
         dbase.Tables.Clear();
         foreach (DataRow row in tables.Rows)
         {
             
             Entities.MetaDataSchema.Table tbl = new Common.Entities.MetaDataSchema.Table();
             tbl.ParentDatabase = dbase;
             tbl.Schema = row["Table_Schema"].ToString();
             tbl.Name = row["Table_Name"].ToString();
             DataRow[] sqlRows = sqlServerTable.Select("[name] = '" + tbl.Name + "'");
             if (sqlRows.Length > 0)
             {
                 tbl.TableID = sqlRows[0]["object_id"].ToString();
             }
             if (project.CheckHasData)
             {
                 tbl.DataCount = CountRecordsInTable(tbl);
                 tbl.HasData = tbl.DataCount > 0;
             }
             dbase.Tables.Add(tbl);
         }
         OnEndLoading(new Common.Events.LoadingEventArgs(dbase.Name, "Tables","Database"));
         tables.Dispose();
     }
     GC.Collect();
 }
开发者ID:ramyothman,项目名称:PAMSMigration,代码行数:34,代码来源:SQLServerDatabaseExtractor.cs


示例11: GetUSGameDetails

        private static GameDetails GetUSGameDetails(string psnId, string gameId, Common.Login login)
        {
            Core.US.Collector collector = new US.Collector(psnId);
            collector.GetGameDetails(gameId, login);

            return null;
        }
开发者ID:thiagopa,项目名称:PlaystationNetworkAPI,代码行数:7,代码来源:GameDetails.cs


示例12: Create

 public void Create(Common.Models.Meal meal)
 {
     using (var client = GetClient())
     {
         client.CreateDocumentAsync(GetCollection().DocumentsLink, meal).Wait();
     }
 }
开发者ID:kbaley,项目名称:AzureCodeCamp,代码行数:7,代码来源:MealRepository.cs


示例13: Create

        public static Common.Models.Notes.NoteNotification Create(Common.Models.Notes.NoteNotification model,
            Common.Models.Account.Users creator)
        {
            if (!model.Id.HasValue) model.Id = Guid.NewGuid();
            model.Created = model.Modified = DateTime.UtcNow;
            model.CreatedBy = model.ModifiedBy = creator;
            DBOs.Notes.NoteNotification dbo = Mapper.Map<DBOs.Notes.NoteNotification>(model);

            using (IDbConnection conn = Database.Instance.GetConnection())
            {
                Common.Models.Notes.NoteNotification currentModel = Get(model.Note.Id.Value, model.Contact.Id.Value);

                if (currentModel != null)
                { // Update
                    dbo = Mapper.Map<DBOs.Notes.NoteNotification>(currentModel);
                    conn.Execute("UPDATE \"note_notification\" SET \"utc_modified\"[email protected], \"modified_by_user_pid\"[email protected], " +
                        "\"utc_disabled\"=null, \"disabled_by_user_pid\"=null, \"cleared\"=null WHERE \"id\"[email protected]", dbo);
                    model.Created = currentModel.Created;
                    model.CreatedBy = currentModel.CreatedBy;
                }
                else
                { // Create
                    conn.Execute("INSERT INTO \"note_notification\" (\"id\", \"note_id\", \"contact_id\", \"cleared\", \"utc_created\", \"utc_modified\", \"created_by_user_pid\", \"modified_by_user_pid\") " +
                        "VALUES (@Id, @NoteId, @ContactId, @Cleared, @UtcCreated, @UtcModified, @CreatedByUserPId, @ModifiedByUserPId)",
                        dbo);
                }
            }

            return model;
        }
开发者ID:ysminnpu,项目名称:OpenLawOffice,代码行数:30,代码来源:NoteNotification.cs


示例14: BindList

 private static void BindList(ListControl listControl, Common.Data.Table.MDataTable source)
 {
     listControl.DataSource = source;
     listControl.DataTextField = source.Columns[0].ColumnName;
     listControl.DataValueField = source.Columns[1].ColumnName;
     listControl.DataBind();
 }
开发者ID:Angliy,项目名称:Common,代码行数:7,代码来源:MBindUI.cs


示例15: Turn

        public void Turn(Common.TurnDirection direction)
        {
            int newDirection = 0;
            if (direction == Common.TurnDirection.L)
            {
                newDirection = (int)this.RoverDirection + 1;
            }
            else
            {
                newDirection = (int)this.RoverDirection - 1;
            }

            if (newDirection < 0)
            {
                this.RoverDirection = Common.Direction.S;
            }
            else if (newDirection > 3)
            {
                this.RoverDirection = Common.Direction.E;
            }
            else
            {
                this.RoverDirection = (Common.Direction)newDirection;
            }
        }
开发者ID:gbadhan,项目名称:.net-workshops,代码行数:25,代码来源:Rover.cs


示例16: SetUser

 public void SetUser(Common.UserInfo loginuser)
 {
     _user = loginuser;
     this.usernamelabel.Text = _user.UserName;
     this.whcodelabel.Text = _user.Whcode;
     this.statuslabel.Text = _user.Status;
 }
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:7,代码来源:UserStatusControl.cs


示例17: Save

        public Model.General.ReturnValueInfo Save(Model.IModel.IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);

            ConsumeMachineMaster_cmm_Info objInfo = itemEntity as ConsumeMachineMaster_cmm_Info;

            try
            {
                switch (EditMode)
                {
                    case Common.DefineConstantValue.EditStateEnum.OE_Insert:
                        objInfo.cmm_dAddDate = DateTime.Now;
                        objInfo.cmm_dLastDate = DateTime.Now;
                        objInfo.cmm_dLastAccessTime = DateTime.Now;
                        objInfo.cmm_cRecordID = Guid.NewGuid();
                        returnInfo = _icmDA.InsertRecord(objInfo);
                        break;
                    case Common.DefineConstantValue.EditStateEnum.OE_Update:
                        objInfo.cmm_dLastDate = DateTime.Now;
                        returnInfo = _icmDA.UpdateRecord(objInfo);
                        break;
                }
            }
            catch
            {
                throw;
            }

            return returnInfo;
        }
开发者ID:Klutzdon,项目名称:SIOTS_HHZX,代码行数:30,代码来源:ConsumeMachineBL.cs


示例18: Endpoint

 public Endpoint(Configuration.ISettings configurationSettings, Common.Connection.IFactory connectionFactory, Common.Routing.IKey routingKey, Common.Queue.IName queueName)
 {
     _configurationSettings = configurationSettings;
     _connectionFactory = connectionFactory;
     _routingKey = routingKey;
     _queueName = queueName;
 }
开发者ID:Zananok,项目名称:Harmonize,代码行数:7,代码来源:Endpoint.cs


示例19: SpriteBatch

        /// <summary>
        /// Should always be created through Backend.CreateSpriteBatch
        /// </summary>
        internal SpriteBatch(Backend backend, Renderer.RenderSystem renderSystem, Common.ResourceManager resourceManager)
        {
            if (backend == null)
                throw new ArgumentNullException("backend");
            if (renderSystem == null)
                throw new ArgumentNullException("renderSystem");
            if (resourceManager == null)
                throw new ArgumentNullException("resourceManager");

            Backend = backend;

            Buffer = new BatchBuffer(renderSystem, new Renderer.VertexFormat(new Renderer.VertexFormatElement[]
                {
                    new Renderer.VertexFormatElement(Renderer.VertexFormatSemantic.Position, Renderer.VertexPointerType.Float, 3, 0),
                    new Renderer.VertexFormatElement(Renderer.VertexFormatSemantic.TexCoord, Renderer.VertexPointerType.Float, 2, sizeof(float) * 3),
                    new Renderer.VertexFormatElement(Renderer.VertexFormatSemantic.Color, Renderer.VertexPointerType.Float, 4, sizeof(float) * 5),
                }), 32);

            Shader = resourceManager.Load<Resources.ShaderProgram>("/shaders/sprite");
            ShaderSRGB = resourceManager.Load<Resources.ShaderProgram>("/shaders/sprite", "SRGB");

            Quads = new List<QuadInfo>();
            for (var i = 0; i < 32; i++)
            {
                Quads.Add(new QuadInfo());
            }

            RenderStateAlphaBlend = Backend.CreateRenderState(true, false, false, Renderer.BlendingFactorSrc.SrcAlpha, Renderer.BlendingFactorDest.OneMinusSrcAlpha, Renderer.CullFaceMode.Front);
            RenderStateNoAlphaBlend = Backend.CreateRenderState(false, false, false, Renderer.BlendingFactorSrc.Zero, Renderer.BlendingFactorDest.One, Renderer.CullFaceMode.Front);
        }
开发者ID:johang88,项目名称:triton,代码行数:33,代码来源:SpriteBatch.cs


示例20: WallCatalogResource

 public WallCatalogResource(int APIversion,
     uint version,
     uint unknown2,
     Common common,
     Wall wallType,
     Partition partitionType,
     PartitionFlagsType partitionFlags,
     VerticalSpan verticalSpanType,
     PartitionsBlockedFlagsType partitionsBlockedFlags,
     PartitionsBlockedFlagsType adjacentPartitionsBlockedFlags,
     PartitionTool partitionToolMode,
     ToolUsageFlagsType toolUsageFlags,
     uint defaultPatternIndex,
     WallThickness wallThicknessType,
     TGIBlockList ltgib)
     : base(APIversion, version, common, ltgib)
 {
     this.unknown2 = unknown2;
     this.wallType = wallType;
     this.partitionType = partitionType;
     this.partitionFlags = partitionFlags;
     this.verticalSpanType = verticalSpanType;
     this.partitionsBlockedFlags = partitionsBlockedFlags;
     this.adjacentPartitionsBlockedFlags = adjacentPartitionsBlockedFlags;
     this.partitionToolMode = partitionToolMode;
     this.toolUsageFlags = toolUsageFlags;
     this.defaultPatternIndex = defaultPatternIndex;
     this.wallThicknessType = wallThicknessType;
 }
开发者ID:dd-dk,项目名称:s3pi,代码行数:29,代码来源:WallCatalogResource.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Common.CException类代码示例发布时间:2022-05-24
下一篇:
C# Commlink类代码示例发布时间: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