Beispiel #1
0
        /// <inheritdoc/>
        protected override void OnAddingNew(System.ComponentModel.AddingNewEventArgs e)
        {
            ILayer newLayer = (e.NewObject as ILayer);

            if (newLayer == null)
            {
                throw new ArgumentNullException("value", "The passed argument is null or not an ILayer");
            }

            lock (this)
            {
                foreach (ILayer layer in this)
                {
                    int comparison = String.Compare(layer.LayerName,
                                                    newLayer.LayerName, StringComparison.CurrentCultureIgnoreCase);

                    if (comparison == 0)
                    {
                        throw new DuplicateLayerException(newLayer.LayerName);
                    }
                }
            }

            base.OnAddingNew(new System.ComponentModel.AddingNewEventArgs(newLayer));
        }
 protected virtual void OnAddingNew(System.ComponentModel.AddingNewEventArgs e)
 {
     if ((this.AddingNew != null))
     {
         this.AddingNew(this, e);
     }
 }
Beispiel #3
0
 private void PrinterSettingBindingSource_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
 {
     PrinterSettingBindingSource.DataSource = null;
     PrinterSettingBindingSource.DataSource = (from setting in ctx.PrinterSettings
                                               where setting.PrinterId == ((Data.Printer)PrinterBindingSource.Current).Id
                                               select setting).ToList();
 }
Beispiel #4
0
        private void 源房涨租协定BindingSource_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            源房涨租协定 obj  = new 源房涨租协定();
            源房     temp = 源房BindingSource.DataSource as 源房;

            //obj.源房ID = temp.ID;
            obj.源房      = temp;//同步外键引用
            e.NewObject = obj;
        }
Beispiel #5
0
        private void 源房涨租协定BindingSource_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            SourceRoomUpRentalAgreement obj = new SourceRoomUpRentalAgreement();
            SourceRoom temp = 源房BindingSource.DataSource as SourceRoom;

            //obj.源房ID = temp.ID;
            obj.SourceRoom = temp;//同步外键引用
            e.NewObject    = obj;
        }
 void Items_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
 {
     if (e.NewObject == null)
     {
         var item = new Item();
         item.SetParent(this);
         e.NewObject = item;
     }
 }
Beispiel #7
0
 private void TableView_AddingNewRow(object sender, System.ComponentModel.AddingNewEventArgs e)
 {
     switch (Game)
     {
     case DoormatCore.Games.Games.Dice: e.NewObject = new PresetDiceBet {
             Amount = 0, Switch = false
     }; break;
     }
 }
Beispiel #8
0
        protected override void OnAddingNew(System.ComponentModel.AddingNewEventArgs e)
        {
            if (e.NewObject != null)
            {
                Player newCore = (Player)e.NewObject;
                hash.Add(newCore.Name, newCore);
            }

            base.OnAddingNew(e);
        }
Beispiel #9
0
        void accountBindingSource_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            var accEventArgs = new AccountEventArgs();

            if (OnAccountCreating != null)
            {
                OnAccountCreating.Invoke(this, accEventArgs);
            }
            e.NewObject = accEventArgs.Account;
        }
Beispiel #10
0
        private void defaultBindingSource_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            string     currlbl   = (defaultBindingSource.Current as ApptStatus).ViewName;
            string     currIntfT = (defaultBindingSource.Current as ApptStatus).UseInterfaceType;
            ApptStatus newStatus = new ApptStatus();

            newStatus.ViewName         = currlbl;
            newStatus.StatusName       = "";
            newStatus.UseInterfaceType = currIntfT;
            e.NewObject = newStatus;
        }
Beispiel #11
0
        protected override void OnAddingNew(System.ComponentModel.AddingNewEventArgs e)
        {
            ILayer newLayer = (e.NewObject as ILayer);

            if (newLayer == null)
            {
                throw new ArgumentNullException("value", "The passed argument is null or not an ILayer");
            }

            TestLayerPresent(_staticLayers, newLayer);

            base.OnAddingNew(e);
        }
 object System.ComponentModel.IBindingList.AddNew()
 {
     ContactManager.Address add = new ContactManager.Address();
     System.ComponentModel.AddingNewEventArgs e = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((ContactManager.Address)(e.NewObject));
     if ((add == null))
     {
         add = new ContactManager.Address();
     }
     this._addNewPos = this.Add(add);
     return(add);
 }
        private void bindingSource_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            ProxyConnection connection = new ProxyConnection
            {
                ConnectionString = "name=New Proxy Connection " + (bindingSource.Count + 1)
            };

            e.NewObject = connection;

            // Adding editing control happens before item is added to binding list so
            // control will be available when connection is inserted
            AddProxyConnectionEditorControl(connection);
        }
Beispiel #14
0
 object System.ComponentModel.IBindingList.AddNew()
 {
     SoftFluent.Samples.GED.Security.UserRole add = new SoftFluent.Samples.GED.Security.UserRole();
     System.ComponentModel.AddingNewEventArgs e   = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((SoftFluent.Samples.GED.Security.UserRole)(e.NewObject));
     if ((add == null))
     {
         add = new SoftFluent.Samples.GED.Security.UserRole();
     }
     this._addNewPos = this.Add(add);
     return(add);
 }
Beispiel #15
0
        protected override void OnAddingNew(System.ComponentModel.AddingNewEventArgs e)
        {
            e.NewObject = new SqlDataProxy(this.Property.Model, this.ConFac, LoadType.Complete, this.Con)
            {
                Owner = this.Owner
            };

            foreach (var trigger in this.Property.Triggers.Where(p => p.PropertyTriggerType == PropertyTriggerType.ItemsAdd))
            {
                new ModelMethodContext(this.Con, this.ConFac).ExcuteOperation(e.NewObject as IObjectProxy, trigger as IOperation);
            }
            base.OnAddingNew(e);
        }
 object System.ComponentModel.IBindingList.AddNew()
 {
     SoftFluent.Samples.ReadOnSave.Order      add = new SoftFluent.Samples.ReadOnSave.Order();
     System.ComponentModel.AddingNewEventArgs e   = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((SoftFluent.Samples.ReadOnSave.Order)(e.NewObject));
     if ((add == null))
     {
         add = new SoftFluent.Samples.ReadOnSave.Order();
     }
     add.Id          = 0;
     this._addNewPos = this.Add(add);
     return(add);
 }
 object System.ComponentModel.IBindingList.AddNew()
 {
     SoftFluent.Samples.StoreEnumAsText.Sample add = new SoftFluent.Samples.StoreEnumAsText.Sample();
     System.ComponentModel.AddingNewEventArgs  e   = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((SoftFluent.Samples.StoreEnumAsText.Sample)(e.NewObject));
     if ((add == null))
     {
         add = new SoftFluent.Samples.StoreEnumAsText.Sample();
     }
     add.Id          = System.Guid.NewGuid();
     this._addNewPos = this.Add(add);
     return(add);
 }
 object System.ComponentModel.IBindingList.AddNew()
 {
     SoftFluent.Samples.AspNetIdentity2.UserClaim add = new SoftFluent.Samples.AspNetIdentity2.UserClaim();
     System.ComponentModel.AddingNewEventArgs     e   = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((SoftFluent.Samples.AspNetIdentity2.UserClaim)(e.NewObject));
     if ((add == null))
     {
         add = new SoftFluent.Samples.AspNetIdentity2.UserClaim();
     }
     add.Id          = System.Guid.NewGuid();
     this._addNewPos = this.Add(add);
     return(add);
 }
Beispiel #19
0
 object System.ComponentModel.IBindingList.AddNew()
 {
     SoftFluent.Samples.RedisCache.Category   add = new SoftFluent.Samples.RedisCache.Category();
     System.ComponentModel.AddingNewEventArgs e   = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((SoftFluent.Samples.RedisCache.Category)(e.NewObject));
     if ((add == null))
     {
         add = new SoftFluent.Samples.RedisCache.Category();
     }
     add.Id          = System.Guid.NewGuid();
     this._addNewPos = this.Add(add);
     return(add);
 }
 object System.ComponentModel.IBindingList.AddNew()
 {
     SoftFluent.Samples.AspNetIdentity1.ExternalLogin add = new SoftFluent.Samples.AspNetIdentity1.ExternalLogin();
     System.ComponentModel.AddingNewEventArgs         e   = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((SoftFluent.Samples.AspNetIdentity1.ExternalLogin)(e.NewObject));
     if ((add == null))
     {
         add = new SoftFluent.Samples.AspNetIdentity1.ExternalLogin();
     }
     add.ProviderKey = "AutoNewKey";
     this._addNewPos = this.Add(add);
     return(add);
 }
Beispiel #21
0
 object System.ComponentModel.IBindingList.AddNew()
 {
     SoftFluent.Samples.Thinktecture.IdentityServer.Login add = new SoftFluent.Samples.Thinktecture.IdentityServer.Login();
     System.ComponentModel.AddingNewEventArgs             e   = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((SoftFluent.Samples.Thinktecture.IdentityServer.Login)(e.NewObject));
     if ((add == null))
     {
         add = new SoftFluent.Samples.Thinktecture.IdentityServer.Login();
     }
     add.Id          = System.Guid.NewGuid();
     this._addNewPos = this.Add(add);
     return(add);
 }
 object System.ComponentModel.IBindingList.AddNew()
 {
     SoftFluent.SqlServerInMemory.Customer    add = new SoftFluent.SqlServerInMemory.Customer();
     System.ComponentModel.AddingNewEventArgs e   = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((SoftFluent.SqlServerInMemory.Customer)(e.NewObject));
     if ((add == null))
     {
         add = new SoftFluent.SqlServerInMemory.Customer();
     }
     add.Id          = System.Guid.NewGuid();
     this._addNewPos = this.Add(add);
     return(add);
 }
 object System.ComponentModel.IBindingList.AddNew()
 {
     DigitalPicnik.List add = new DigitalPicnik.List();
     System.ComponentModel.AddingNewEventArgs e = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((DigitalPicnik.List)(e.NewObject));
     if ((add == null))
     {
         add = new DigitalPicnik.List();
     }
     add.Id          = System.Guid.NewGuid();
     this._addNewPos = this.Add(add);
     return(add);
 }
Beispiel #24
0
 object System.ComponentModel.IBindingList.AddNew()
 {
     ModelCodeFluent.Vehicle add = new ModelCodeFluent.Vehicle();
     System.ComponentModel.AddingNewEventArgs e = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((ModelCodeFluent.Vehicle)(e.NewObject));
     if ((add == null))
     {
         add = new ModelCodeFluent.Vehicle();
     }
     add.VehicleId   = System.Guid.NewGuid();
     this._addNewPos = this.Add(add);
     return(add);
 }
Beispiel #25
0
 object System.ComponentModel.IBindingList.AddNew()
 {
     SoftFluent.Samples.ComponentOne.User     add = new SoftFluent.Samples.ComponentOne.User();
     System.ComponentModel.AddingNewEventArgs e   = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((SoftFluent.Samples.ComponentOne.User)(e.NewObject));
     if ((add == null))
     {
         add = new SoftFluent.Samples.ComponentOne.User();
     }
     add.Email       = "AutoNewKey";
     add.Id          = System.Guid.NewGuid();
     this._addNewPos = this.Add(add);
     return(add);
 }
Beispiel #26
0
 object System.ComponentModel.IBindingList.AddNew()
 {
     ModelCodeFluent.Identity.User            add = new ModelCodeFluent.Identity.User();
     System.ComponentModel.AddingNewEventArgs e   = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((ModelCodeFluent.Identity.User)(e.NewObject));
     if ((add == null))
     {
         add = new ModelCodeFluent.Identity.User();
     }
     add.UserName    = "******";
     add.Id          = System.Guid.NewGuid();
     this._addNewPos = this.Add(add);
     return(add);
 }
Beispiel #27
0
 object System.ComponentModel.IBindingList.AddNew()
 {
     SoftFluent.Samples.AspNetIdentity1.Role  add = new SoftFluent.Samples.AspNetIdentity1.Role();
     System.ComponentModel.AddingNewEventArgs e   = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((SoftFluent.Samples.AspNetIdentity1.Role)(e.NewObject));
     if ((add == null))
     {
         add = new SoftFluent.Samples.AspNetIdentity1.Role();
     }
     add.Name        = "AutoNewKey";
     add.Id          = "AutoNewKey";
     this._addNewPos = this.Add(add);
     return(add);
 }
Beispiel #28
0
 object System.ComponentModel.IBindingList.AddNew()
 {
     SoftFluent.Json.NET.Support add            = new SoftFluent.Json.NET.Support();
     System.ComponentModel.AddingNewEventArgs e = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((SoftFluent.Json.NET.Support)(e.NewObject));
     if ((add == null))
     {
         add = new SoftFluent.Json.NET.Support();
     }
     add.Name        = "AutoNewKey";
     add.Id          = 0;
     this._addNewPos = this.Add(add);
     return(add);
 }
Beispiel #29
0
 object System.ComponentModel.IBindingList.AddNew()
 {
     ContactManager.User add = new ContactManager.User();
     System.ComponentModel.AddingNewEventArgs e = new System.ComponentModel.AddingNewEventArgs(add);
     this.OnAddingNew(e);
     add = ((ContactManager.User)(e.NewObject));
     if ((add == null))
     {
         add = new ContactManager.User();
     }
     add.Email       = "AutoNewKey";
     add.Id          = 0;
     this._addNewPos = this.Add(add);
     return(add);
 }
        //添加子项目部件
        private void OnGCZBMXAddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            var zbRow = GetCurrentGczbRow();

            if (zbRow == null)
            {
                MessageBox.Show("请先添加工程项目!");
                return;
            }
            var source = sender as BindingSource;

            if (source != null)
            {
                e.NewObject = dataSet1.PARTS.AddPARTSRow(
                    gCBTableAdapter.GetNewSubProjectDetailId(),
                    zbRow.项目关键字,
                    ProjectKey,
                    (dataSet1.PARTS.Rows.Count + 1).ToString("00"),
                    string.Empty,
                    string.Empty,
                    0f,
                    0f,
                    0f,
                    string.Empty,
                    0d,
                    0f,
                    0f,
                    0f,
                    string.Empty,
                    string.Empty,//图层名称
                    1d,
                    0d,
                    0d,
                    0d,
                    string.Empty,
                    string.Empty);
            }
        }