示例#1
0
        public Form1()
        {
            InitializeComponent();

            string rootPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
            Factory f = new Factory(100, rootPath, 10000000);
            f.StartWork();

            //string picDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);

            //DirectoryInfo dirInfo = new DirectoryInfo(picDir);
            //Console.WriteLine(dirInfo.Attributes.ToString());

            //// Get the subdirectories directly that is under the root.
            //// See "How to: Iterate Through a Directory Tree" for an example of how to
            //// iterate through an entire tree.
            //System.IO.DirectoryInfo[] dirInfos = dirInfo.GetDirectories("*.*");

            //foreach (System.IO.DirectoryInfo d in dirInfos)
            //{
            //    Console.WriteLine(d.Name);
            //}

            //System.IO.FileInfo[] fileNames = dirInfo.GetFiles("*.*");
            //foreach (System.IO.FileInfo fi in fileNames)
            //{
            //    Console.WriteLine("{0}: {1}: {2}", fi.Name, fi.LastAccessTime, fi.Length);
            //}
        }
示例#2
0
 public void DoSetup()
 {
     mFactory = new Factory(new DefaultModuleConfiguration(), new ITModuleConfiguration());
       mObserver = (RecordingObserver)mFactory.Build<IMessageObserver>();
       mApp = mFactory.Build<IApp>();
       mFile = new DotNetFile();
 }
示例#3
0
        /// <summary>
        /// Gets messages from an SQS queue.
        /// </summary>
        /// <param name="queueUrl">The sqs queue endpoint to get the messages from.</param>
        /// <param name="maxMessages">The maximum number of messages to return (max 10)</param>
        /// <param name="visibilityTimeout">The number of minutes to hide the message from other consumers for (max 12 hours or 720 minutes)</param>
        /// <returns></returns>
        public static Amazon.SQS.Model.ReceiveMessageResponse ReceiveMessages(string queueUrl, int maxMessages = 10, int visibilityTimeout = 0)
        {
            // Check for the maximum number of messages to get.
            if (maxMessages > 10)
                throw new ArgumentException("The maximum number of messages that can be returned is 10");

            // Check that the visibility timeout is okay.
            if (visibilityTimeout > 720)
                throw new ArgumentException("The maximum amount of time that the message can be hidden for is 12 hours.");

            // Get the messages from the queue.
            Amazon.SQS.Model.ReceiveMessageResponse response = new Amazon.SQS.Model.ReceiveMessageResponse();
            using (Amazon.SQS.IAmazonSQS client = new Factory().SQSClient())
            {
                Amazon.SQS.Model.ReceiveMessageRequest request = new Amazon.SQS.Model.ReceiveMessageRequest()
                {
                    QueueUrl = queueUrl,
                    MaxNumberOfMessages = maxMessages
                };

                if (visibilityTimeout > 0)
                {
                    request.VisibilityTimeout = visibilityTimeout;
                }

                response = client.ReceiveMessage(request);
            }
            return response;
        }
 static void Main(string[] args)
 {
     Factory factory = new Factory();
     IVehicle car = factory.CreateVehicle(VehicleType.Car);
     IVehicle bike = factory.CreateVehicle(VehicleType.Bike);
     IVehicle cycle = factory.CreateVehicle(VehicleType.Cycle);
 }
 public static IntPtr ToIntPtr(Factory factory, FontCollectionLoader fontFileEnumerator)
 {
     var shadowPtr = ToIntPtr(fontFileEnumerator);
     var shadow = ToShadow<FontCollectionLoaderShadow>(shadowPtr);
     shadow._factory = factory;
     return shadowPtr;
 }
 public void Register2()
 {
     Factory<string, int> FactoryObject = new Factory<string, int>();
     FactoryObject.Register("A", () => 1);
     Assert.True(FactoryObject.Exists("A"));
     Assert.Equal(1, FactoryObject.Create("A"));
 }
        public static Response<Servicio> Get(this Servicio request,
		                                              Factory factory,
		                                              IHttpRequest httpRequest)
        {
            return factory.Execute(proxy=>{

				long? totalCount=null;

				var paginador= new Paginador(httpRequest);
            	
                var predicate = PredicateBuilder.True<Servicio>();

                var visitor = ReadExtensions.CreateExpression<Servicio>();

				if(!request.Nombre.IsNullOrEmpty()){
					predicate = predicate.AndAlso(q=> q.Nombre.Contains(request.Nombre));
				}

				visitor.Where(predicate).OrderBy(f=>f.Nombre);
                if(paginador.PageNumber.HasValue)
                {
					visitor.Select(r=> Sql.Count(r.Id));
					totalCount= proxy.Count(visitor);
					visitor.Select();
                    int rows= paginador.PageSize.HasValue? paginador.PageSize.Value:BL.ResponsePageSize;
                    visitor.Limit(paginador.PageNumber.Value*rows, rows);
                }
                
				return new Response<Servicio>(){
                	Data=proxy.Get(visitor),
                	TotalCount=totalCount
            	};
            });
  
        }
示例#8
0
文件: Program.cs 项目: Wetski/Demo04
        static void Main(string[] args)
        {
            Building barn = new Building("Korvenkatu 1", 120, "Barn");
            Console.WriteLine(barn.ToString());

            Factory factory = new Factory();
            factory.Address = "Teollisuustie 18";
            factory.Area = 500;
            factory.Type = "Factory";
            factory.Produce = "Coal Burning";
            factory.Pollution = 100;
            Console.WriteLine(factory.ToString());

            HighRiser savela = new HighRiser();
            savela.Address = "Vehkakatu 12";
            savela.Area = 2000;
            savela.Type = "Apartment building";
            savela.ApartmentCount = 40;
            savela.FloorCount = 8;
            Console.WriteLine(savela.ToString());

            TownHouse heikkila = new TownHouse();
            heikkila.Address = "Heikkiläntie 30";
            heikkila.Area = 200;
            heikkila.Type = "Town House";
            heikkila.YardArea = 300;
            heikkila.MowerType = "Rotary";
            Console.WriteLine(heikkila.ToString());

            Console.Read();
        }
        // Code taken straight from SharpDX\Samples\DirectWrite\FontEnumeration\Program.cs
        public static List<InstalledFont> GetFonts()
        {
            var fontList = new List<InstalledFont>();

            var factory = new Factory();
            var fontCollection = factory.GetSystemFontCollection(false);
            var familyCount = fontCollection.FontFamilyCount;

            for (int i = 0; i < familyCount; i++)
            {
                var fontFamily = fontCollection.GetFontFamily(i);
                var familyNames = fontFamily.FamilyNames;
                int index;

                if (!familyNames.FindLocaleName(CultureInfo.CurrentCulture.Name, out index))
                    familyNames.FindLocaleName("en-us", out index);

                string name = familyNames.GetString(index);
                fontList.Add(new InstalledFont()
                                 {
                                     Name = name,
                                 });
            }

            return fontList;
        }
 public void Process()
 {
     Factory dairyProductFactory = new Factory();
     IDairyProducts products = dairyProductFactory.ProvideDairyProduct("1");
     products = dairyProductFactory.ProvideDairyProduct("2");
     products = dairyProductFactory.ProvideDairyProduct("3");
 }
示例#11
0
        public static void RunTask(Factory factory)
        {
            TaskContextImpl context = new TaskContextImpl(factory);

            Protocol connection;

            string port = Environment.GetEnvironmentVariable("hadoop.pipes.command.port");

            if (port != null)
            {
                TcpClient client = new TcpClient("localhost", Convert.ToInt32(port));
                NetworkStream stream = client.GetStream();
                connection = new BinaryProtocol(stream, context, stream);
            }
            else
            {
                throw new Exception("No pipes command port variable found");
            }

            context.SetProtocol(connection, connection.Uplink);
            context.WaitForTask();

            while (!context.Done)
            {
                context.NextKey();
            }

            context.Close();

            connection.Uplink.Done();
        }
示例#12
0
 public TypeDeclaration(Factory factory, string className, Type baseType)
 {
     this.factory = factory;
     name = className;
     this.baseType = baseType;
     Initialize();
 }
示例#13
0
        public PathGeometry ToDirect2DPathGeometry(Factory factory, System.Windows.Media.MatrixTransform graphToCanvas)
        {
            double xScale, xOffset, yScale, yOffset;
            xScale = graphToCanvas.Matrix.M11;
            xOffset = graphToCanvas.Matrix.OffsetX;
            yScale = graphToCanvas.Matrix.M22;
            yOffset = graphToCanvas.Matrix.OffsetY;

            PathGeometry geometry = new PathGeometry(factory);

            using (GeometrySink sink = geometry.Open())
            {

                float xCanvas = (float)(xTransformed[0] * xScale + xOffset);
                float yCanvas = (float)(yTransformed[0] * yScale + yOffset);
                Vector2 p0 = new Vector2(xCanvas, yCanvas);

                sink.BeginFigure(p0, FigureBegin.Hollow);
                for (int i = 1; i < x.Count(); ++i)
                {
                    if (includeLinePoint[i])
                    {
                        xCanvas = (float)(xTransformed[i] * xScale + xOffset);
                        yCanvas = (float)(yTransformed[i] * yScale + yOffset);
                        sink.AddLine(new Vector2(xCanvas, yCanvas));
                    }
                }
                sink.EndFigure(FigureEnd.Open);
                sink.Close();

            }
            return geometry;
        }
示例#14
0
 public static Factory GetFactory() {
     if (factory == null)
     {
         factory = new Factory();
     }
     return factory;
 }
        public static Response<RolePermission> Get(this RolePermission request,
		                                              Factory factory,
		                                              IHttpRequest httpRequest)
        {
            return factory.Execute(proxy=>{

				long? totalCount=null;

				var paginador= new Paginador(httpRequest);

				var visitor = ReadExtensions.CreateExpression<RolePermission>();
				var predicate = PredicateBuilder.True<RolePermission>();

				predicate= q=>q.AuthRoleId==request.AuthRoleId;
												                
				visitor.Where(predicate).OrderBy(f=>f.Name) ;
                if(paginador.PageNumber.HasValue)
                {
					visitor.Select(r=> Sql.Count(r.Id));
					totalCount= proxy.Count(visitor);
					visitor.Select();
                    int rows= paginador.PageSize.HasValue? paginador.PageSize.Value:BL.ResponsePageSize;
                    visitor.Limit(paginador.PageNumber.Value*rows, rows);
                }
                                
                
				return new Response<RolePermission>(){
                	Data=proxy.Get(visitor),
                	TotalCount=totalCount
            	};
            });
  
        }
示例#16
0
        public static InfanteInfoResponse Get(this InfanteInfo request, Factory factory, IHttpRequest httpRequest)
        {
            return factory.Execute(proxy=>{

				var padres = proxy.Get<InfantePadre>(q=>q.IdInfante==request.Id);
				var acudientes =proxy.Get<InfanteAcudiente>(q=>q.IdInfante==request.Id);
				var matriculas = proxy.Get<Matricula>(
					ev=>ev.Where(q=>q.IdInfante==request.Id).OrderByDescending(q=>q.FechaInicio));

				var predicate= PredicateBuilder.False<Pension>();

				foreach( Matricula m in matriculas)
				{
					var idMatricula= m.Id;
					predicate= predicate.OrElse(q=>q.IdMatricula==idMatricula);
				}

				var pensiones = proxy.Get<Pension>(ev=> ev.Where(predicate).OrderByDescending(q=>q.Periodo));

                return new InfanteInfoResponse{
					InfantePadreList= padres,
					InfanteAcudienteList=acudientes,
					MatriculaList=matriculas,
					PensionList= pensiones
                };
            });
        }
示例#17
0
 public void T60_Factory_Dump()
 {
     Factory f = new Factory();
     f.Name = "Factory 1";
     NamedObjectMaint mt = new NamedObjectMaint();
     Assert.IsTrue(mt.Dump(f));
 }
示例#18
0
 public UnitTestsBase()
 {
     Factory = new Factory();
     Factory.Entities.RegisterFactories(new EntityFactories());
     Factory.ValueObjects.RegisterFactories(new RandomPrimativeGenerator());
     Factory.ValueObjects.RegisterFactories(new ValueObjectFactories());
 }
 public S2cSite(Dictionary<string,dynamic> siteDictionary)
 {
     SubdirectoriesList = new List<string> { "RightRailContent", "ScriptUris", "partials", "img", "css", "scripts" };
     PageUrl = SetPageUrl(siteDictionary["url"]);
     PageObject = SetPageObject(siteDictionary["url"]);
     SiteName = SetSiteName(siteDictionary["siteRouteName"]);
     ViewFolder = SetViewFolder(siteDictionary["siteRouteName"]);
     IsBonnier = siteDictionary["bonnier"];
     IsYahooOnly = siteDictionary["yahooOnly"];
     SiteRoute = SetSiteRoute(siteDictionary["bonnier"], SiteName);
     //ViewsFilepath = "C:\\insp\\site_s2c\\SerpToContent\\Views\\Shared\\" + ViewFolder + "\\";
     //ResourcesFilepath = "C:\\insp\\site_s2c\\SerpToContent\\content\\" + SiteName + "\\";
     //RightRailFilepath = "C:\\insp\\site_s2c\\SerpToContent\\Resources\\RightRailContent\\";
     //ScriptUriFilepath = "C:\\insp\\site_s2c\\SerpToContent\\Resources\\ScriptUris\\";
     RouteFilepath = "C:\\Users\\thernan\\Desktop\\automation\\" + SiteName;
     ViewsFilepath = "C:\\Users\\thernan\\Desktop\\automation\\" + SiteName + "\\partials\\";
     ResourcesFilepath = "C:\\Users\\thernan\\Desktop\\automation\\" + SiteName + "\\";
     RightRailFilepath = "C:\\Users\\thernan\\Desktop\\automation\\" + SiteName + "\\RightRailContent\\";
     ScriptUriFilepath = "C:\\Users\\thernan\\Desktop\\automation\\" + SiteName + "\\ScriptUris\\";
     _pathsAndDirectoriesFactory = new Factory();
     _jsonFilesFactory = new Factory();
     _viewsFactory = new Factory();
     _lessFilesFactory = new Factory();
     _javaScriptFilesFactory = new Factory();
     _imagesFactory = new Factory();
 }
 /// <summary>
 /// Creates a unit.
 /// </summary>
 /// <param name="playerID">The player ID.</param>
 /// <param name="serverID">Server ID.</param>
 /// <param name="type">The type of the unit.</param>
 public void CreateBuilding(int playerID, int serverID, int type, int byID)
 {
     Building building = null;
     Player p = Game1.GetInstance().GetPlayerByMultiplayerID(playerID);
     Engineer engineer = (Engineer)((UnitMultiplayerData)MultiplayerDataManager.GetInstance().GetDataByServerID(byID)).unit;
         switch (type)
         {
             case BuildingHeaders.TYPE_BARRACKS:
                 {
                     building = new Barracks(p, p.color);
                     break;
                 }
             case BuildingHeaders.TYPE_FACTORY:
                 {
                     building = new Factory(p, p.color);
                     break;
                 }
             case BuildingHeaders.TYPE_FORTRESS:
                 {
                     building = new Fortress(p, p.color);
                     break;
                 }
             case BuildingHeaders.TYPE_RESOURCES_GATHER:
                 {
                     building = new ResourceGather(p, p.color);
                     break;
                 }
         }
     building.constructedBy = engineer;
     building.multiplayerData.serverID = serverID;
 }
示例#21
0
        public static void CreateDeviceSwapChainAndRenderTarget(Form form,
            out Device device, out SwapChain swapChain, out RenderTargetView renderTarget)
        {
            try
            {
                // the debug mode requires the sdk to be installed otherwise an exception is thrown
                device = new Device(DeviceCreationFlags.Debug);
            }
            catch (Direct3D10Exception)
            {
                device = new Device(DeviceCreationFlags.None);
            }

            var swapChainDescription = new SwapChainDescription();
            var modeDescription = new ModeDescription();
            var sampleDescription = new SampleDescription();

            modeDescription.Format = Format.R8G8B8A8_UNorm;
            modeDescription.RefreshRate = new Rational(60, 1);
            modeDescription.Scaling = DisplayModeScaling.Unspecified;
            modeDescription.ScanlineOrdering = DisplayModeScanlineOrdering.Unspecified;

            modeDescription.Width = WIDTH;
            modeDescription.Height = HEIGHT;

            sampleDescription.Count = 1;
            sampleDescription.Quality = 0;

            swapChainDescription.ModeDescription = modeDescription;
            swapChainDescription.SampleDescription = sampleDescription;
            swapChainDescription.BufferCount = 1;
            swapChainDescription.Flags = SwapChainFlags.None;
            swapChainDescription.IsWindowed = true;
            swapChainDescription.OutputHandle = form.Handle;
            swapChainDescription.SwapEffect = SwapEffect.Discard;
            swapChainDescription.Usage = Usage.RenderTargetOutput;

            using (var factory = new Factory())
            {
                swapChain = new SwapChain(factory, device, swapChainDescription);
            }

            using (var resource = swapChain.GetBuffer<Texture2D>(0))
            {
                renderTarget = new RenderTargetView(device, resource);
            }

            var viewport = new Viewport
            {
                X = 0,
                Y = 0,
                Width = WIDTH,
                Height = HEIGHT,
                MinZ = 0.0f,
                MaxZ = 1.0f
            };

            device.Rasterizer.SetViewports(viewport);
            device.OutputMerger.SetTargets(renderTarget);
        }
示例#22
0
        public FontLoader(Factory factory)
        {
            _factory = factory;
            foreach (var name in typeof(FontLoader).Assembly.GetManifestResourceNames())
            {
                if (name.EndsWith(".ttf"))
                {
                    var fontBytes = Utilities.ReadStream(typeof(FontLoader).Assembly.GetManifestResourceStream(name));
                    var stream = new DataStream(fontBytes.Length, true, true);
                    stream.Write(fontBytes, 0, fontBytes.Length);
                    stream.Position = 0;
                    _fontStreams.Add(new ResourceFontFileStream(stream));
                }
            }

            // Build a Key storage
            _keyStream = new DataStream(sizeof(int) * _fontStreams.Count, true, true);
            for (int i = 0; i < _fontStreams.Count; i++)
                _keyStream.Write((int)i);
            _keyStream.Position = 0;

            // Register
            _factory.RegisterFontFileLoader(this);
            _factory.RegisterFontCollectionLoader(this);
        }
示例#23
0
文件: Program.cs 项目: krack/notifier
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            String[] args = Environment.GetCommandLineArgs();

            //Register application for too lauch when application start
            RegisteryMethod.addApplicationOnComputerStart();
            //download Registery Manager
            DowloadRegistryManager();
            if (args.Length == 1)
            {
                Factory factory = new Factory();
                Form1 form = factory.Form1;
                Application.Run(form);

                //no saved authentification
             /*   if (!factory.AuthentificationDataManager.IsDefine)
                {
                    factory.ObserverAuthentification.NotifieUnauthorizedException();
                }
              * */
            }
            else
            {
                ConsoleManager consoleManager = new ConsoleManager(args);
                consoleManager.Run();
            }
        }
 protected void SetUp()
 {
     factory = Factory.getInstance();
     o = new Order(1, new List<Burrito>(), DateTime.Now, false, false, Decimal.Parse("17.00"));
     b = new Burrito(1, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, Decimal.Parse("3.00"));
     o.burritos.Add(b);
 }
示例#25
0
 public Form1(Factory factory, SharpDX.Direct3D11.Device device, Object renderLock)
 {
     InitializeComponent();
     this.factory = factory;
     this.device = device;
     this.renderLock = renderLock;
 }
        public ActionResult CreateMech()
        {
            int userId = WebSecurity.GetUserId(User.Identity.Name);
            Gamer gamer = gamerRepository.Gamers.FirstOrDefault(x => x.type == "human" && x.UserId == userId);
            Game game = Session["Game"] as Game;
            if (game == null) {
                game = new Game();
                game.selectedCountry = countryRepository.Countries.FirstOrDefault(x => x.ridgamer == gamer.rid && x.UserId == userId);
            }
            if (game.selectedCountry == null){
                game.selectedCountry = countryRepository.Countries.FirstOrDefault(x => x.ridgamer == gamer.rid && x.UserId == userId);
            }

            Country country = game.selectedCountry;
            Gamer owner = gamerRepository.Gamers.FirstOrDefault(x => x.rid == country.ridgamer && x.UserId == userId);

            Boolean our = false;
            if (gamer.rid == owner.rid) { our = true; }

            Factory factory = new Factory
            {
                designes = designRepository.Designs.Where(x => x.UserId == userId && x.ridgamer == gamer.rid).ToList(),
                qnt = 0,
                ours = our

            };
            return View(factory);
        }
 public Direct2D1DrawingContext(Factory factory, RenderTarget target)
 {
     this.factory = factory;
     this.target = target;
     this.target.BeginDraw();
     this.stack = new Stack<object>();
 }
示例#28
0
 public TestAddInBase(Factory factory)
     : base(factory, null, null, null)
 {
     this.factory = (TestFactory) factory;
     Globals.Factory = factory;
     CustomTaskPanes = new CustomTaskPaneCollectionDouble();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="PrivateFontLoader"/> class.
        /// </summary>
        /// <param name="factory">The factory.</param>
        public PrivateFontLoader(Factory factory)
        {
            _factory = factory;


            foreach (var name in System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceNames())
            {
                if (name.ToLower().EndsWith(".ttf"))
                {
                    var fontBytes = Utilities.ReadStream(System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceStream(name));
                    var stream = new DataStream(fontBytes.Length, true, true);
                    stream.Write(fontBytes, 0, fontBytes.Length);
                    stream.Position = 0;
                    _fontStreams.Add(new PrivateFontFileStream(stream));
                }
            }
            // Build a Key storage that stores the index of the font
            _keyStream = new DataStream(sizeof(int) * _fontStreams.Count, true, true);
            for (int i = 0; i < _fontStreams.Count; i++)
                _keyStream.Write((int)i);
            _keyStream.Position = 0;

            // Register the 
            _factory.RegisterFontFileLoader(this);
            _factory.RegisterFontCollectionLoader(this);
        }
示例#30
0
        FontFileEnumerator FontCollectionLoader.CreateEnumeratorFromKey(Factory factory, DataPointer collectionKey)
        {
            var enumerator = new ResourceFontFileEnumerator(factory, this, collectionKey);
            _enumerators.Add(enumerator);

            return enumerator;
        }
示例#31
0
        public static List <object> Import <T>(string catalog, T poco, List <dynamic> entities, EntityView entityView, int userId)
        {
            string         primaryKeyName = PocoHelper.GetKeyName(poco);
            string         tableName      = PocoHelper.GetTableName(poco);
            List <dynamic> items          = new List <dynamic>();
            List <object>  result         = new List <object>();

            int line = 0;

            foreach (dynamic entity in entities)
            {
                if (entity == null)
                {
                    continue;
                }

                ExpandoObject item = new ExpandoObject();


                foreach (dynamic o in entity)
                {
                    string key   = o.Key;
                    object value = o.Value;

                    EntityColumn column = entityView.Columns.FirstOrDefault(c => c.ColumnName.Equals(key));

                    if (column != null)
                    {
                        bool isNullable = column.IsNullable || primaryKeyName.Equals(key);

                        AddProperty(ref item, column.DataType, isNullable, key, value);
                    }
                }

                if (((ICollection <KeyValuePair <string, object> >)item).Count > 1)
                {
                    line++;

                    if (((IDictionary <string, object>)item).ContainsKey("entered_by"))
                    {
                        ((IDictionary <string, object>)item)["entered_by"] = userId;
                    }

                    ((IDictionary <string, object>)item)["audit_user_id"] = userId;
                    ((IDictionary <string, object>)item)["audit_ts"]      = DateTime.UtcNow;

                    items.Add(item);
                }
            }


            line = 0;

            try
            {
                using (Database db = new Database(Factory.GetConnectionString(catalog), Factory.ProviderName))
                {
                    using (Transaction transaction = db.GetTransaction())
                    {
                        foreach (ExpandoObject item in items)
                        {
                            line++;

                            object primaryKeyValue = ((IDictionary <string, object>)item)[primaryKeyName];

                            if (primaryKeyValue != null)
                            {
                                db.Update(tableName, primaryKeyName, item, primaryKeyValue);
                            }
                            else
                            {
                                primaryKeyValue = db.Insert(tableName, primaryKeyName, item);
                            }

                            result.Add(primaryKeyValue);
                        }

                        transaction.Complete();
                    }
                }
            }
            catch (NpgsqlException ex)
            {
                string errorMessage = string.Format(CultureManager.GetCurrent(), "Error on line {0}.", line);

                if (ex.Code.StartsWith("P"))
                {
                    errorMessage += Factory.GetDBErrorResource(ex);

                    throw new MixERPException(errorMessage, ex);
                }

                errorMessage += ex.Message;
                throw new MixERPException(errorMessage, ex);
            }
            catch (Exception ex)
            {
                string errorMessage = string.Format(CultureManager.GetCurrent(), "Error on line {0}.", line);
                throw new MixERPException(errorMessage, ex);
            }

            return(result);
        }
示例#32
0
 public void Draw(Int32 hDC, object x, object y)
 {
     Factory.ExecuteMethod(this, "Draw", hDC, x, y);
 }
示例#33
0
 public void Draw(Int32 hDC)
 {
     Factory.ExecuteMethod(this, "Draw", hDC);
 }
示例#34
0
 public NetOffice.ExcelApi.MenuBar Add()
 {
     return(Factory.ExecuteKnownReferenceMethodGet <NetOffice.ExcelApi.MenuBar>(this, "Add", NetOffice.ExcelApi.MenuBar.LateBindingApiWrapperType));
 }
 public object Select()
 {
     return(Factory.ExecuteVariantMethodGet(this, "Select"));
 }
 public object Delete()
 {
     return(Factory.ExecuteVariantMethodGet(this, "Delete"));
 }
示例#37
0
 public NetOffice.WordApi.OMathFunction ToLimLow()
 {
     return(Factory.ExecuteKnownReferenceMethodGet <NetOffice.WordApi.OMathFunction>(this, "ToLimLow", NetOffice.WordApi.OMathFunction.LateBindingApiWrapperType));
 }
 /// <summary>
 /// Persist this gallery server role to the data store. The list of top-level albums this role applies to, which is stored
 /// in the <see cref="RootAlbumIds"/> property, is also saved. If <see cref="RootAlbumIds"/> was modified, the caller must
 /// repopulate the <see cref="AllAlbumIds"/> and <see cref="Galleries"/> properties.
 /// </summary>
 public void Save()
 {
     Factory.GetDataProvider().Role_Save(this);
 }
示例#39
0
 public bool Remove(string fileName, object section, object displayName)
 {
     return(Factory.ExecuteBoolMethodGet(this, "Remove", fileName, section, displayName));
 }
 /// <summary>
 /// Permanently delete this gallery server role from the data store, including the list of role/album relationships
 /// associated with this role.
 /// </summary>
 public void Delete()
 {
     Factory.GetDataProvider().Role_Delete(this);
 }
示例#41
0
 public bool Add(string fileName, object section)
 {
     return(Factory.ExecuteBoolMethodGet(this, "Add", fileName, section));
 }
示例#42
0
        public static IEnumerable <DbPocoGetTableFunctionDefinitionResult> GetColumns(string schema, string table)
        {
            const string sql = "SELECT * FROM public.poco_get_table_function_definition(@0::text, @1::text)";

            return(Factory.Get <DbPocoGetTableFunctionDefinitionResult>(sql, schema, table));
        }
 public void Delete()
 {
     Factory.ExecuteMethod(this, "Delete");
 }
示例#44
0
 public bool Remove(string fileName)
 {
     return(Factory.ExecuteBoolMethodGet(this, "Remove", fileName));
 }
示例#45
0
 public void DuplicateFormat()
 {
     Factory.ExecuteMethod(this, "DuplicateFormat");
 }
示例#46
0
 public bool Add(string fileName)
 {
     return(Factory.ExecuteBoolMethodGet(this, "Add", fileName));
 }
示例#47
0
 public void SetSpreadsheetData(string dataReference, object seriesByRows)
 {
     Factory.ExecuteMethod(this, "SetSpreadsheetData", dataReference, seriesByRows);
 }
 public NetOffice.ExcelApi.Watch Add(object source)
 {
     return(Factory.ExecuteKnownReferenceMethodGet <NetOffice.ExcelApi.Watch>(this, "Add", NetOffice.ExcelApi.Watch.LateBindingApiWrapperType, source));
 }
示例#49
0
 public string GetDataReference(NetOffice.OWC10Api.Enums.ChartDimensionsEnum dimension)
 {
     return(Factory.ExecuteStringMethodGet(this, "GetDataReference", dimension));
 }
示例#50
0
 public void SetSpreadsheetData(string dataReference)
 {
     Factory.ExecuteMethod(this, "SetSpreadsheetData", dataReference);
 }
示例#51
0
 public void Select()
 {
     Factory.ExecuteMethod(this, "Select");
 }
示例#52
0
 public Int32 GetDataSourceIndex(NetOffice.OWC10Api.Enums.ChartDimensionsEnum dimension)
 {
     return(Factory.ExecuteInt32MethodGet(this, "GetDataSourceIndex", dimension));
 }
示例#53
0
        public static DbGetOfficeInformationModelResult GetOfficeInformationModel(string catalog, int userId)
        {
            const string sql = "SELECT * FROM audit.get_office_information_model(@0::integer);";

            return(Factory.Get <DbGetOfficeInformationModelResult>(catalog, sql, userId).FirstOrDefault());
        }
示例#54
0
 public void SetData(NetOffice.OWC10Api.Enums.ChartDimensionsEnum dimension, Int32 dataSourceIndex)
 {
     Factory.ExecuteMethod(this, "SetData", dimension, dataSourceIndex);
 }
示例#55
0
 /// <summary>
 /// Constructor, only factory can instantiates nodes.
 /// </summary>
 /// <param name="nodeId">[in] The id of the node.</param>
 /// <param name="factory">[in] Poiter to the Factory the node belongs to.</param>
 public TypeConstraintSyntax(uint nodeId, Factory factory) : base(nodeId, factory) {
     m_Type = 0;
 }
示例#56
0
 public NetOffice.OWC10Api.ChScaling get_Scalings(NetOffice.OWC10Api.Enums.ChartDimensionsEnum dimension)
 {
     return(Factory.ExecuteKnownReferencePropertyGet <NetOffice.OWC10Api.ChScaling>(this, "Scalings", NetOffice.OWC10Api.ChScaling.LateBindingApiWrapperType, dimension));
 }
示例#57
0
 public NetOffice.ExcelApi.PivotFilter _Add(NetOffice.ExcelApi.Enums.XlPivotFilterType type, object dataField, object value1, object value2, object order, object name, object description)
 {
     return(Factory.ExecuteKnownReferenceMethodGet <NetOffice.ExcelApi.PivotFilter>(this, "_Add", NetOffice.ExcelApi.PivotFilter.LateBindingApiWrapperType, new object[] { type, dataField, value1, value2, order, name, description }));
 }
示例#58
0
        public static IEnumerable <KeyValuePair <Guid, bool> > QueryOEMContractSettings(IEnumerable <Guid> oemIds)
        {
            var repository = Factory.CreateCompanyRepository();

            return(repository.QueryOEMContractSettings(oemIds));
        }
示例#59
0
 public NetOffice.ExcelApi.PivotFilter _Add(NetOffice.ExcelApi.Enums.XlPivotFilterType type, object dataField, object value1, object value2)
 {
     return(Factory.ExecuteKnownReferenceMethodGet <NetOffice.ExcelApi.PivotFilter>(this, "_Add", NetOffice.ExcelApi.PivotFilter.LateBindingApiWrapperType, type, dataField, value1, value2));
 }
示例#60
0
 public EmployeeRepository()
 {
     this.factory = Factory.Instance();
 }