상속: MonoBehaviour
예제 #1
0
        private void Initialize()
        {
            Initialize initialize = new Initialize(this.gameSN, this.domainSN, this.domainName);

            this.Transmit(initialize.Serialize());
            Scheduler.Schedule(this.thread, Job.Create(new Action(this.Heartbeat)), new TimeSpan(0, 0, 30));
        }
예제 #2
0
        private void Application_BeginRequest(object sender, EventArgs e)
        {
            var app        = (HttpApplication)sender;
            var authCookie = app.Request.Cookies[FormsAuthentication.FormsCookieName];

            if (authCookie != null && !IsInstallOrUpgradeRequest(app.Request))
            {
                // if the cookie is not in the database, then it is from before upgrading to 9.2.0 and don't fail
                var persisted = AuthCookieController.Instance.Find(authCookie.Value);
                if (persisted != null && persisted.ExpiresOn <= DateTime.UtcNow)
                {
                    app.Request.Cookies.Remove(FormsAuthentication.FormsCookieName);
                }
            }

            var requestUrl = app.Request.Url.LocalPath.ToLowerInvariant();

            if (!requestUrl.EndsWith(".aspx") && !requestUrl.EndsWith("/") && Endings.Any(requestUrl.EndsWith))
            {
                return;
            }

            if (this.IsInstallInProgress(app))
            {
                return;
            }

            Initialize.Init(app);
            Initialize.RunSchedule(app.Request);
        }
예제 #3
0
파일: Program.cs 프로젝트: qhanm/shunshine
        public static void Main(string[] args)
        {
            //CreateWebHostBuilder(args).Build().Run();
            var host = CreateWebHostBuilder(args).Build();

            using (var scope = host.Services.CreateScope())
            {
                var services = scope.ServiceProvider;

                try
                {
                    var context = services.GetService <AppDbContext>();

                    //Initialize initialize = new Initialize(userManager);

                    Initialize.Seed(context);
                }
                catch (Exception ex)
                {
                    var logger = services.GetRequiredService <ILogger <Program> >();
                    logger.LogError(ex, "An error occurred while seeding the database.");
                }
            }
            host.Run();
        }
예제 #4
0
 internal static void OnInitialize()
 {
     if (Initialize != null)
     {
         Initialize.Invoke();
     }
 }
예제 #5
0
        public void reload()
        {
            this.panel_post.Controls.Clear();
            Initialize           initPacket   = parentForm.initialize;
            LinkedList <Article> contentsList = initPacket.account.contents;

            this.panel_post.HorizontalScroll.Enabled = true;

            int profileImageHeight = 30;
            int imageHeight        = this.panel_post.Height - 20;
            int contentHeight      = 100;

            int eachArticleSize = profileImageHeight + imageHeight + contentHeight;

            for (int i = initPacket.account.articleCount - 1; i >= 0; i--)
            {
                int     locationIndex = initPacket.account.articleCount - i - 1;
                Article nextArticle   = contentsList.ElementAt(i);
                initPacket.account.profileImage = this.pictureBox_profile.Image;
                addProfileBox(initPacket.account, locationIndex, eachArticleSize, profileImageHeight);
                addPictureBox(nextArticle, locationIndex, eachArticleSize, profileImageHeight, imageHeight);
                addContentBox(nextArticle, locationIndex, eachArticleSize, profileImageHeight, imageHeight);
            }
            this.panel_post.Visible = true;
        }
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Tools to help stop anti-reversing.
            var settings = new EzLibSettings
            {
                AntiDebug     = false,
                AntiDump      = false,
                AntiVm        = false,
                AntiSandboxie = false
            };

            var init = new Initialize("APP_TOKEN", "APP_VERSION", settings);

            // Have your application be licensed by EZLib and offer a free mode time for your startup.
            if (init.IsFreeMode())
            {
                Application.Run(new MainForm());
            }
            else
            {
                Application.Run(new LoginForm());
            }
        }
예제 #7
0
        public MainViewModel()
        {
            _kitNames        = new List <dynamic>();
            _isScriptLoaded  = false;
            _filesToProcess  = new List <string>();
            InterfaceResults = new BindingList <InterfaceResults>();
            Logs             = new BindingList <LogModel>();
            Configuration    = new Config();
            var appSettings = new Properties.Settings();

            Configuration     = JsonConvert.DeserializeObject <Config>(appSettings.Config);
            _resultDataAccess = new ResultDataAccess(new StatusDataAccess(), new ReferenceRangeDataAccess(), new SampleDataAccess());
            _scriptDataAccess = new ScriptDataAccess();
            ConfigureFileSystemWatcher();

            //BackgroundWorker config
            _backgroundWorker = new BackgroundWorker()
            {
                WorkerReportsProgress = true
            };
            _backgroundWorker.DoWork             += new DoWorkEventHandler(ProcessResults);
            _backgroundWorker.ProgressChanged    += new ProgressChangedEventHandler(ReportProgressChanged);
            _backgroundWorker.RunWorkerCompleted += _backgroundWorker_RunWorkerCompleted;

            //Event subscriptions
            fileSystemWatcher.Created += OnFileDetectedInDirectory;
            _initiateJobTimer.Elapsed += OnInitiateJob;
            Initialize += RunInitalze;


            //invoke events
            Initialize?.Invoke(this, EventArgs.Empty);
        }
        public void ShouldNotBeSlow()
        {
            //List of objects performing slow
            //Entity1
            //Entity17
            //Entity25
            //Entity19
            //Entity15
            //Entity13
            //Entity7
            //Entity5
            //Entity2

            var list       = new List <Entity1>();
            var initialize = new Initialize();

            list.Add(initialize.GenerateAppointment());
            var appointmentsDTO = Mapper.Map <List <EntityDTO1> >(list);
            var list2           = new List <Entity1>();
            var entity          = new Entity1();

            list2.Add(entity);
            var DTOs     = Mapper.Map <List <EntityDTO1> >(list2);
            var list3    = new List <Entity17>();
            var entity17 = new Entity17();

            list3.Add(entity17);
            var DTOs17   = Mapper.Map <List <EntityDTO17> >(list3);
            var list4    = new List <Entity25>();
            var entity25 = new Entity25();

            list4.Add(entity25);
            var DTOs25 = Mapper.Map <List <EntityDTO25> >(list4);
        }
예제 #9
0
        public ActorControllerTest()
        {
            _context = Initialize.CreateNewTestContext();
            Initialize.SeedTestDb(_context);

            _logger = Mock.Of <ILogger <ActorController> >();
        }
예제 #10
0
파일: Read.cs 프로젝트: aminghali/DynamoSAP
        public static Dictionary <string, object> SAPModel(string FilePath, bool read)
        {
            if (read)
            {
                StructuralModel Model = new StructuralModel();
                Model.StructuralElements = new List <Element>();
                cSapModel mySapModel = null;
                string    units      = string.Empty;
                // Open & instantiate SAP file
                Initialize.OpenSAPModel(FilePath, ref mySapModel, ref units);

                // Populate the model's elemets
                StructuralModelFromSapFile(ref mySapModel, ref Model, units);

                // Return outputs
                return(new Dictionary <string, object>
                {
                    { "StructuralModel", Model },
                    { "units", units }
                });
            }
            else
            {
                throw new Exception("Set boolean True to read!");
            }
        }
예제 #11
0
파일: Read.cs 프로젝트: aminghali/DynamoSAP
        public static Dictionary <string, object> SAPModel(bool read)
        {
            if (read)
            {
                StructuralModel Model = new StructuralModel();

                cSapModel mySapModel = null;
                string    modelunits = string.Empty;

                // Open & instantiate SAP file
                Initialize.GrabOpenSAP(ref mySapModel, ref modelunits, "");

                StructuralModelFromSapFile(ref mySapModel, ref Model, modelunits);

                // Return outputs
                return(new Dictionary <string, object>
                {
                    { "StructuralModel", Model },
                    { "units", modelunits }
                });
            }
            else
            {
                throw new Exception("Set boolean True to read!");
            }
        }
예제 #12
0
        public override void InitGrid()
        {
            DropDown dropdown = new DropDown();

            dropdown.ValueField           = "ItemCode";
            dropdown.TextField            = "ItemName";
            dropdown.CustomerDropDownForm = new G.Erp.BaseData.ItemSearch();
            dropdown.RowSelected         += dropdown_RowSelected;
            dropdown.VisibleButtons       = C1.Win.C1Input.DropDownControlButtonFlags.DropDown;
            Initialize.InitDropDown(dropdown, "ITEM", new G.BLL.ERP.BaseData.DM_ITEMLogic());

            gGrid1.AddGridColumn("ITEMCODE", "物品代码", "String", 80, dropdown, "ITEMCODE");
            gGrid1.AddGridColumn("ITEMNAME", "物品名称", "String", 100, true);
            gGrid1.AddGridColumn("JLDW", "单位", "String", 40, true);
            gGrid1.AddGridColumn("QTY", "数量", "Decimal", "#0.00", 60, true);
            gGrid1.AddGridColumn("OTPRICE", "单价", "Decimal", "#0.00", 80, true);
            gGrid1.AddGridColumn("OTMONEY", "货品金额", "Decimal", "#0.00", 60, true);
            gGrid1.AddGridColumn("TAXRATE", "税率", "Decimal", "#0.00", 60);
            gGrid1.AddGridColumn("TAXMONEY", "税金", "Decimal", "#0.00", 60, true);
            gGrid1.AddGridColumn("ATMONEY", "含税金额", "Decimal", "#0.0000", 80, true);
            gGrid1.AddGridColumn("REMARK", "备注", "String", 150);
            gGrid1.AddGridColumn("ORDERID", "订单号", "String", 80, true);
            gGrid1.FrozenCell          = 3;
            gGrid1.AutoGenerateColumns = false;
            gGrid1.InitGrid();
        }
예제 #13
0
 internal static async Task LockWrapperAsync(Initialize func)
 {
     lock (startupLock)
     {
         func();
     }
 }
        public void RestaDeNumeros()
        {
            var operaciones = new Initialize();
            var resultado   = operaciones.Resta(3, 2);

            Assert.AreEqual(1, resultado);
        }
        public void DivisionDeNumeros()
        {
            var operaciones = new Initialize();
            var resultado   = operaciones.Divide(10, 2);

            Assert.AreEqual(5, resultado);
        }
 ///// <summary>
 ///// 建立新的執行個體
 ///// </summary>
 //public object Clone()
 //{
 //    if ( Initiation != null )
 //        Initiation.Invoke(this, new EventArgs());
 //    ImportProcess p = new ImportProcess();
 //    p.Title = this.Title;
 //    foreach ( string var in this.RequiredFields )
 //    {
 //        p.RequiredFields.Add(var);
 //    }
 //    p.PackageLimit = this.PackageLimit;
 //    foreach ( string var in this.ImportableFields )
 //    {
 //        p.ImportableFields.Add(var);
 //    }
 //    p.Image = this.Image;
 //    p.Group = this.Group;
 //    p.Configuration = this.Configuration;
 //    return p;
 //}
 /// <summary>
 ///
 /// </summary>
 public void StartupProcess()
 {
     if (Initialize != null)
     {
         Initialize.Invoke(this, new EventArgs());
     }
 }
예제 #17
0
 /// <summary>
 /// Initializes the test.
 /// </summary>
 private void InitializeTest()
 {
     initialize += (() => { QuestionValue(0); });
     initialize += (() => { ValueOutput(value); });
     initialize += (() => { ShowpbStatus(0); });
     initialize += DispatcherTimer;
 }
        //----HANDLERS----//

        // Actor behaviour handler
        private void InitializeHandler(Initialize init)
        {
            // On new received sentence, process it with TrimmerActor
            Receive <Sentence>(s => OnReceiveSentence(s));

            // On trimmed sentence, pass the object to PickerActor,
            // clean previous content of the list and kill the TrimmerActor
            Receive <TrimmedSentence>(t =>
            {
                OnReceiveTrimmedSentence(t);
                _passwordChunks = new string[t.WordCount];
                _trimmer.Tell(PoisonPill.Instance);
            });

            // On received password chunk, save it in the list
            Receive <PasswordChunk>(p =>
            {
                System.Diagnostics.Debug.WriteLine(p.Id + ">> " + p.Pick);
                _passwordChunks[p.Id] = p.Pick;
            });

            // After all actors have finished, join the newly created
            // password, and publish it into the system stream
            Receive <Terminated>(term =>
            {
                var join = _passwordChunks.Join("");
                Context.System.EventStream.Publish(new GeneratedPassword(join));
            });
        }
예제 #19
0
        public string ClientInit(NetworkStream stream)
        {
            // Send Panel Infomation to Client
            byte[] sendInitBuffer = new byte[Constant.INIT_PACKET_SIZE];

            PanelInit panel = new PanelInit();

            panel.Type     = (int)PacketType.panelInfo;
            panel.mypencil = childForm.mypencil;
            panel.mylines  = childForm.mylines;
            panel.myrect   = childForm.myrect;
            panel.mycircle = childForm.mycircle;
            panel.npencil  = childForm.npencil;
            panel.nline    = childForm.nline;
            panel.nrect    = childForm.nrect;
            panel.ncircle  = childForm.ncircle;
            panel.index    = childForm.index;

            // Serialize
            MemoryStream    ms = new MemoryStream(Constant.INIT_PACKET_SIZE);
            BinaryFormatter bf = new BinaryFormatter();

            bf.Serialize(ms, panel);
            ms.ToArray().CopyTo(sendInitBuffer, 0);
            stream.Write(sendInitBuffer, 0, sendInitBuffer.Length);
            stream.Flush();

            // Receive ClientID from Client
            stream.Read(readBuffer, 0, Constant.PACKET_SIZE);
            m_initializeClass = (Initialize)Packet.Desserialize(readBuffer);

            return(m_initializeClass.clientID);
        }
        public override void Report(TextWriter writer)
        {
            try
            {
                Writer = writer;
                foreach (Node node in MoveInitializeNodes)
                {
                    switch (node.CodeElement.Type)
                    {
                    case CodeElements.CodeElementType.MoveStatement:
                    {
                        Move move = node as Move;
                        ReportVariablesWritten(move);
                    }
                    break;

                    case CodeElements.CodeElementType.InitializeStatement:
                    {
                        Initialize initialize = node as Initialize;
                        ReportVariablesWritten(initialize);
                    }
                    break;
                    }
                }
            }
            catch (Exception e)
            {
                throw new Exception(string.Format(
                                        "Failed to emit report '{0}' on MOVE and INITIALIZE statements that target COPYs! : {1}",
                                        ((writer as StreamWriter).BaseStream as FileStream).Name, e.Message));
            }
        }
        /// <summary>
        /// Create a new unsaved file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void New_File_Click(object sender, RoutedEventArgs e)
        {
            if (!ContinueChange())
            {
                return;
            }

            try
            {
                this.filename = null;

                this.PropertyGroups.Clear();

                PropertyGroup parent = Initialize.Group("");
                PropertyGroup group  = parent.PropertyGroups[0];
                group.Title  = "Master List";
                group.Parent = this;

                this.PropertyGroups.Add(group);

                changedState = true;
            }
            catch
            {
                MessageBox.Show("Unhandled Exception");
            }

            changedState = true;
        }
예제 #22
0
파일: Program.cs 프로젝트: mwawerHub/Pong
        private static void Main(string[] args)
        {
            try {
                var bgMusic = new BackgroundMusic();
                bgMusic.Play();

                Initialize.InitializeGame();
                while (true)
                {
                    Thread.Sleep(10);
                    var key = (Console.KeyAvailable) ? Console.ReadKey(true).Key : 0;
                    Update.UpdateAll(key);
                    if (State.ScreenNeedsRedraw)
                    {
                        Console.Clear();
                    }
                    Draw.DrawAll();
                    State.ScreenNeedsRedraw = false;
                    State.PlayerNeedsRedraw = false;
                    State.BallNeedsRedraw   = false;
                }
            }
            catch (Exception e) {
                Console.WriteLine(e);
                throw;
            }
        }
예제 #23
0
        static void Main(string[] args)
        {
            Initialize.UseKafka();

            var  logger = NLogBuilder.ConfigureNLog($"Nlog.config").GetCurrentClassLogger();
            bool isCon  = true;

            while (isCon)
            {
                isCon = false;
                Console.WriteLine("按I/W 发送消息...");
                var    r = Console.ReadLine();
                string n = Guid.NewGuid().ToString();
                switch (r.ToUpper())
                {
                case "I":
                    isCon = true;
                    logger.Info($"Info AAAAAA {n}");
                    break;

                case "W":
                    isCon = true;
                    logger.Warn($"Warn BBBBBB {n}");
                    break;

                default:
                    isCon = false;
                    break;
                }
            }
            Console.WriteLine("按任意键推出...");
            Console.ReadKey();
        }
 /// <summary>
 /// Invoke the Initialize event
 /// </summary>
 public void FireInitialize()
 {
     if (Initialize != null)
     {
         Initialize.Invoke(this, EventArgs.Empty);
     }
 }
예제 #25
0
파일: Program.cs 프로젝트: Coca162/CocaBot
    static async Task Main()
    {
        ValourConfig config = await GetConfig <ValourConfig>();

        prod = config.Production;
        IEnumerable <string> prefixes = config.Prefix;

        UBIKey = config.JacobUBIKey;

        ValourSharpConfig valourConfig = new()
        {
            Email    = config.Email,
            Password = config.BotPassword,
            Prefixes = prefixes,
            Services = Service
        };

        Registration.RegisterCommands(Assembly.GetExecutingAssembly());

        OnMessageRecieved += MessageHandler;

        await Initialize.Start(valourConfig);

        await Task.Delay(-1);
    }
예제 #26
0
        public async Task <int> ExecAsync()
        {
            await Initialize.ConfigureAwait(false);

            Console.WriteLine(Thread.CurrentThread.ManagedThreadId);
            return(1 * _config.Factor);
        }
        public void SumaDeNumeros()
        {
            var operaciones = new Initialize();
            var resultado   = operaciones.Suma(3, 2);

            Assert.AreEqual(5, resultado);
        }
예제 #28
0
        public void Start()
        {
            Initialize.SetCredentials("testpublickey", "testprivatekey", "http://127.0.0.1:3000");
            PTest.Setup();
            PTestLeaderboards.rnd = PTestPlayerLevels.rnd = PTestAchievements.rnd = RND();

            _tests = new List <Action <Action> >
            {
                PTestGameVars.All,
                PTestGameVars.Single,
                PTestGeoIP.Lookup,
                PTestNewsletter.Subscribe,
                PTestLeaderboards.FirstScore,
                PTestLeaderboards.SecondScore,
                PTestLeaderboards.HighScores,
                PTestLeaderboards.LowScores,
                PTestLeaderboards.AllScores,
                PTestLeaderboards.FriendsScores,
                PTestLeaderboards.OwnScores,
                PTestPlayerLevels.Create,
                PTestPlayerLevels.List,
                PTestPlayerLevels.Load,
                PTestPlayerLevels.Rate,
                PTestAchievements.List,
                PTestAchievements.ListWithFriends,
                PTestAchievements.ListWithPlayer,
                PTestAchievements.ListWithPlayerAndFriends,
                PTestAchievements.Stream,
                PTestAchievements.StreamWithFriends,
                PTestAchievements.StreamWithPlayerAndFriends,
                PTestAchievements.Save
            };
            Next();
        }
        public void MultiplicacionDeNumeros()
        {
            var operaciones = new Initialize();
            var resultado   = operaciones.Multiplica(3, 2);

            Assert.AreEqual(6, resultado);
        }
예제 #30
0
        public static void HandleInitialize(Client client, Initialize packet)
        {
            if (client.EndPoint.Address.ToString() == "255.255.255.255")
            {
                return;
            }

            FrmMain.Instance.Invoke((MethodInvoker) delegate
            {
                try
                {
                    client.Value.Version         = packet.Version;
                    client.Value.OperatingSystem = packet.OperatingSystem;
                    client.Value.AccountType     = packet.AccountType;
                    client.Value.Country         = packet.Country;
                    client.Value.CountryCode     = packet.CountryCode;
                    client.Value.Region          = packet.Region;
                    client.Value.City            = packet.City;
                    client.Value.Id       = packet.Id;
                    client.Value.HostName = packet.HostName;
                    client.Value.Lanip    = packet.Lanip;

                    if (!FrmMain.Instance.ListenServer.AllTimeConnectedClients.ContainsKey(client.Value.Id))
                    {
                        FrmMain.Instance.ListenServer.AllTimeConnectedClients.Add(client.Value.Id, DateTime.Now);
                    }

                    FrmMain.Instance.ListenServer.ConnectedClients++;
                    FrmMain.Instance.UpdateWindowTitle(FrmMain.Instance.ListenServer.ConnectedClients,
                                                       FrmMain.Instance.lstClients.SelectedItems.Count);

                    string country = string.Format("{0} [{1}]", client.Value.Country, client.Value.CountryCode);

                    // this " " leaves some space between the flag-icon and the IP
                    ListViewItem lvi = new ListViewItem(new string[]
                    {
                        " " + client.EndPoint.Address.ToString(), client.EndPoint.Port.ToString(), client.Value.Version,
                        "Connected",
                        "Active", country, client.Value.OperatingSystem, client.Value.AccountType, client.Value.Lanip, client.Value.HostName
                    })
                    {
                        Tag = client, ImageIndex = packet.ImageIndex
                    };


                    FrmMain.Instance.lstClients.Items.Add(lvi);

                    if (XMLSettings.ShowPopup)
                    {
                        ShowPopup(client);
                    }

                    client.Value.IsAuthenticated = true;
                    new Packets.ServerPackets.GetSystemInfo().Execute(client);
                }
                catch
                {
                }
            });
        }
예제 #31
0
 public IActionResult Initialize()
 {
     var initialize = new Initialize()
         .With( connectionStringProvider.GetConnectionString("ConnectionString"))
         .CreateDatabase()
         .PopulateDatabase();
     return RedirectToAction("Index");
 }
예제 #32
0
        //
        public override void Initialize(Initialize Options)
        {
            Console.WriteLine ("Create configuration file {0}", Options.Configuration);
            OmniBroker.Config Config = new OmniBroker.Config (Options.Configuration.Value);

            Connect Connect = Config.GetConnect (Options.Handle.Text);

            Seed NewSeed = new Seed (Convert.ToInt32 (Options.Refresh.Value));
            Connect.Secrets.Insert (0, NewSeed);
            Config.Write (Options.Configuration.Value);
        }
예제 #33
0
        public static void HandleInitialize(Client client, Initialize packet)
        {
            if (client.EndPoint.Address.ToString() == "255.255.255.255" || packet.Id.Length != 64)
                return;

            try
            {
                client.Value.Version = packet.Version;
                client.Value.OperatingSystem = packet.OperatingSystem;
                client.Value.AccountType = packet.AccountType;
                client.Value.Country = packet.Country;
                client.Value.CountryCode = packet.CountryCode;
                client.Value.Region = packet.Region;
                client.Value.City = packet.City;
                client.Value.Id = packet.Id;
                client.Value.Username = packet.Username;
                client.Value.PCName = packet.PCName;

                string userAtPc = string.Format("{0}@{1}", client.Value.Username, client.Value.PCName);

                client.Value.DownloadDirectory = (!Helper.Helper.CheckPathForIllegalChars(userAtPc)) ?
                    Path.Combine(Application.StartupPath, string.Format("Clients\\{0}_{1}\\", userAtPc, client.Value.Id.Substring(0, 7))) :
                    Path.Combine(Application.StartupPath, string.Format("Clients\\{0}_{1}\\", client.EndPoint.Address, client.Value.Id.Substring(0, 7)));

                if (!FrmMain.Instance.ListenServer.AllTimeConnectedClients.ContainsKey(client.Value.Id))
                    FrmMain.Instance.ListenServer.AllTimeConnectedClients.Add(client.Value.Id, DateTime.Now);

                string country = string.Format("{0} [{1}]", client.Value.Country, client.Value.CountryCode);

                // this " " leaves some space between the flag-icon and first item
                ListViewItem lvi = new ListViewItem(new string[]
                {
                    " " + client.EndPoint.Address.ToString(), client.EndPoint.Port.ToString(),
                    userAtPc, client.Value.Version, "Connected", "Active", country,
                    client.Value.OperatingSystem, client.Value.AccountType
                }) { Tag = client, ImageIndex = packet.ImageIndex };

                FrmMain.Instance.AddClientToListview(lvi);

                if (XMLSettings.ShowPopup)
                    FrmMain.Instance.ShowPopup(client);

                client.Value.IsAuthenticated = true;
                if (XMLSettings.ShowToolTip)
                    new Packets.ServerPackets.GetSystemInfo().Execute(client);
            }
            catch
            {
            }
        }
예제 #34
0
        public virtual void Initialize( Initialize Options
				)
        {
            char UsageFlag = '-';
                {
                    Initialize		Dummy = new Initialize ();

                    Console.Write ("{0}init ", UsageFlag);
                    Console.Write ("[{0}] ", Dummy.Configuration.Usage (null, "config", UsageFlag));
                    Console.Write ("[{0}] ", Dummy.Handle.Usage ("id", "value", UsageFlag));
                    Console.Write ("[{0}] ", Dummy.Refresh.Usage ("refresh", "value", UsageFlag));
                    Console.WriteLine ();

                    Console.WriteLine ("    Create and register new master secrets");

                }

                Console.WriteLine ("    {0}\t{1} = [{2}]", "ExistingFile",
                            "Configuration", Options.Configuration);
                Console.WriteLine ("    {0}\t{1} = [{2}]", "String",
                            "Handle", Options.Handle);
                Console.WriteLine ("    {0}\t{1} = [{2}]", "Integer",
                            "Refresh", Options.Refresh);
            Console.WriteLine ("Not Yet Implemented");
        }
예제 #35
0
        private static void Usage()
        {
            Console.WriteLine ("Omnibroker Connection Service");
                Console.WriteLine ("");

                {
                    Server		Dummy = new Server ();

                    Console.Write ("{0}server ", UsageFlag);
                    Console.Write ("[{0}] ", Dummy.Configuration.Usage (null, "config", UsageFlag));
                    Console.Write ("[{0}] ", Dummy.Log.Usage ("log", "value", UsageFlag));
                    Console.Write ("[{0}] ", Dummy.Detach.Usage ("detach", "value", UsageFlag));
                    Console.Write ("[{0}] ", Dummy.Handle.Usage ("id", "value", UsageFlag));
                    Console.WriteLine ();

                    Console.WriteLine ("    Launch omnibroker connection service");

                }

                {
                    PIN		Dummy = new PIN ();

                    Console.Write ("{0}pin ", UsageFlag);
                    Console.Write ("[{0}] ", Dummy.Configuration.Usage (null, "config", UsageFlag));
                    Console.Write ("[{0}] ", Dummy.Account.Usage (null, "account", UsageFlag));
                    Console.Write ("[{0}] ", Dummy.Handle.Usage ("id", "value", UsageFlag));
                    Console.WriteLine ();

                    Console.WriteLine ("    Provide a pin code for the specified account");

                }

                {
                    Initialize		Dummy = new Initialize ();

                    Console.Write ("{0}init ", UsageFlag);
                    Console.Write ("[{0}] ", Dummy.Configuration.Usage (null, "config", UsageFlag));
                    Console.Write ("[{0}] ", Dummy.Handle.Usage ("id", "value", UsageFlag));
                    Console.Write ("[{0}] ", Dummy.Refresh.Usage ("refresh", "value", UsageFlag));
                    Console.WriteLine ();

                    Console.WriteLine ("    Create and register new master secrets");

                }

                {
                    Rollover		Dummy = new Rollover ();

                    Console.Write ("{0}roll ", UsageFlag);
                    Console.WriteLine ();

                    Console.WriteLine ("    Roll over the master secrets");

                }
        }
예제 #36
0
        public static void HandleInitialize(Client client, Initialize packet)
        {
            if (client.EndPoint.Address.ToString() == "255.255.255.255")
                return;

            FrmMain.Instance.Invoke((MethodInvoker) delegate
            {
                try
                {
                    client.Value.Version = packet.Version;
                    client.Value.OperatingSystem = packet.OperatingSystem;
                    client.Value.AccountType = packet.AccountType;
                    client.Value.Country = packet.Country;
                    client.Value.CountryCode = packet.CountryCode;
                    client.Value.Region = packet.Region;
                    client.Value.City = packet.City;
                    client.Value.Id = packet.Id;

                    if (!FrmMain.Instance.ListenServer.AllTimeConnectedClients.ContainsKey(client.Value.Id))
                        FrmMain.Instance.ListenServer.AllTimeConnectedClients.Add(client.Value.Id, DateTime.Now);

                    FrmMain.Instance.ListenServer.ConnectedClients++;
                    FrmMain.Instance.UpdateWindowTitle(FrmMain.Instance.ListenServer.ConnectedClients,
                        FrmMain.Instance.lstClients.SelectedItems.Count);

                    string country = string.Format("{0} [{1}]", client.Value.Country, client.Value.CountryCode);

                    // this " " leaves some space between the flag-icon and the IP
                    ListViewItem lvi = new ListViewItem(new string[]
                    {
                        " " + client.EndPoint.Address.ToString(), client.EndPoint.Port.ToString(), client.Value.Version,
                        "Connected",
                        "Active", country, client.Value.OperatingSystem, client.Value.AccountType
                    }) {Tag = client, ImageIndex = packet.ImageIndex};

                    FrmMain.Instance.lstClients.Items.Add(lvi);

                    if (XMLSettings.ShowPopup)
                        ShowPopup(client);

                    client.Value.IsAuthenticated = true;
                    new Packets.ServerPackets.GetSystemInfo().Execute(client);
                }
                catch
                {
                }
            });
        }
예제 #37
0
        private static void Handle_Initialize(
					OBPConnect Dispatch, string[] args, int index)
        {
            Initialize		Options = new Initialize ();

            Registry Registry = new Registry ();

            Options.Configuration.Register ("config", Registry, (int) TagType_Initialize.Configuration);
            Options.Handle.Register ("id", Registry, (int) TagType_Initialize.Handle);
            Options.Refresh.Register ("refresh", Registry, (int) TagType_Initialize.Refresh);

            // looking for parameter Param.Name}
            if (index < args.Length && !IsFlag (args [index][0] )) {
                // Have got the parameter, call the parameter value method
                Options.Configuration.Parameter (args [index]);
                index++;
                }

            #pragma warning disable 162
            for (int i = index; i< args.Length; i++) {
                if 	(!IsFlag (args [i][0] )) {
                    throw new Exception ("Unexpected parameter: " + args[i]);}
                string Rest = args [i].Substring (1);

                TagType_Initialize TagType = (TagType_Initialize) Registry.Find (Rest);

                // here have the cases for what to do with it.

                switch (TagType) {
                    case TagType_Initialize.Handle : {
                        int OptionParams = Options.Handle.Tag (Rest);

                        if (OptionParams>0 && ((i+1) < args.Length)) {
                            if 	(!IsFlag (args [i+1][0] )) {
                                i++;
                                Options.Handle.Parameter (args[i]);
                                }
                            }
                        break;
                        }
                    case TagType_Initialize.Refresh : {
                        int OptionParams = Options.Refresh.Tag (Rest);

                        if (OptionParams>0 && ((i+1) < args.Length)) {
                            if 	(!IsFlag (args [i+1][0] )) {
                                i++;
                                Options.Refresh.Parameter (args[i]);
                                }
                            }
                        break;
                        }
                    default : throw new Exception ("Internal error");
                    }
                }

            #pragma warning restore 162
            Dispatch.Initialize (Options);
        }