Esempio n. 1
0
 private void CreateGroup_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     groupPath             = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Properties.Settings.Default.GroupsFolder + "\\" + ((CreateGroup)sender).GroupNameText + ".cnfgroup";
     runtimeConfig         = new GroupSettings(groupPath);
     GroupContainer.Header = ((CreateGroup)sender).GroupNameText;
     RefreshRunTimeList();
 }
Esempio n. 2
0
        public IList <AttributeChange> GetChanges(string dn, ObjectModificationType modType, SchemaType type, object source)
        {
            List <AttributeChange> attributeChanges = new List <AttributeChange>();

            GroupSettings settings = source as GroupSettings;

            if (settings == null)
            {
                GoogleGroup group = source as GoogleGroup;

                if (group == null)
                {
                    throw new InvalidOperationException();
                }
                else
                {
                    settings = group.Settings;
                }
            }


            foreach (IAttributeAdapter typeDef in ManagementAgent.Schema[SchemaConstants.Group].AttributeAdapters.Where(t => t.Api == this.Api))
            {
                foreach (string attributeName in typeDef.MmsAttributeNames)
                {
                    if (type.HasAttribute(attributeName))
                    {
                        attributeChanges.AddRange(typeDef.CreateAttributeChanges(dn, modType, settings));
                    }
                }
            }

            return(attributeChanges);
        }
        protected override void Reset(ConfigurationElement parentElement)
        {
            RootProfilePropertySettingsCollection parent = parentElement as RootProfilePropertySettingsCollection;

            base.Reset(parentElement);
            GroupSettings.InternalReset(parent.GroupSettings);
        }
Esempio n. 4
0
        private static void CreateProc(GroupSettings gSets)
        {
            if (gSets.Process != null)
            {
                try
                {
                    if (!gSets.Process.HasExited)
                    {
                        gSets.Process.Kill();
                    }
                }
                catch
                {
                    // ignored
                }

                gSets.Process = null;
            }

            string fullPath = gSets.PathQueue.Dequeue();

            gSets.Process = new Process
            {
                StartInfo =
                {
                    FileName  = "python3",
                    Arguments =
                        $"{Path.Combine(Domain.CurrentDirectory, "dragon", "dragon-detection.py")} \"{fullPath}\"",
                    CreateNoWindow         = true,
                    UseShellExecute        = false,
                    WindowStyle            = ProcessWindowStyle.Hidden,
                    RedirectStandardOutput = true,
                    RedirectStandardError  = true
                }
            };

            gSets.Process.OutputDataReceived += (sender, e) =>
            {
                Logger.Debug(e.Data);
                if (e.Data != null && e.Data.Trim() != "")
                {
                    gSets.ReceivedString.Add(e.Data);
                }
            };

            gSets.Process.ErrorDataReceived += (sender, e) =>
            {
                Logger.Debug(e.Data);
                if (e.Data != null && e.Data.Trim() != "")
                {
                    gSets.ReceivedString.Add(e.Data);
                }
            };

            gSets.Process.Start();
            gSets.Process.BeginOutputReadLine();
            gSets.Process.BeginErrorReadLine();

            gSets.Process.WaitForExit();
        }
Esempio n. 5
0
            public void ReloadFromStream(Stream stream)
            {
                if (stream.Length > 0)
                {
                    RadGridViewApplicationSettings loaded = (RadGridViewApplicationSettings)serializer.ReadObject(stream);

                    FrozenColumnCount = loaded.FrozenColumnCount;

                    ColumnSettings.Clear();
                    foreach (ColumnSetting cs in loaded.ColumnSettings)
                    {
                        ColumnSettings.Add(cs);
                    }

                    FilterSettings.Clear();
                    foreach (FilterSetting fs in loaded.FilterSettings)
                    {
                        FilterSettings.Add(fs);
                    }

                    GroupSettings.Clear();
                    foreach (GroupSetting gs in loaded.GroupSettings)
                    {
                        GroupSettings.Add(gs);
                    }

                    SortSettings.Clear();
                    foreach (SortSetting ss in loaded.SortSettings)
                    {
                        SortSettings.Add(ss);
                    }
                }
            }
Esempio n. 6
0
        private static void ProcExited(GroupSettings gSets)
        {
            if (gSets.ReceivedString.Count == 0)
            {
                return;
            }
            string line = gSets.ReceivedString[gSets.ReceivedString.Count - 1];
            //Logger.WarningLine(line);

            var tmp = line.Split(' ');

            if (int.TryParse(tmp[0], out int status))
            {
                if (double.TryParse(tmp[1], out double confidence))
                {
                    if (status == 1 && confidence > 50)
                    {
                        gSets.PandaCount++;
                    }
                    return;
                }
            }

            Logger.Error("检测图片失败。");
        }
Esempio n. 7
0
        public void Initialize()
        {
            var inMemoryUserRepository     = new InMemoryUserRepository();
            var inMemoryGroupRepository    = new InMemoryGroupRepository();
            var inMemoryKeyRepository      = new InMemoryKeysRepository();
            var inMemorySanctionRepository = new InMemorySanctionRepository();
            var inMemoryEventRepository    = new InMemoryEventRepository();
            var groupSettings = new GroupSettings(2, 10, 0, 1000);
            var emailSender   = new Mock <IEmailSender>();
            var publisher     = new Mock <IEventPublisher>();

            userSettings = new UserSettings("");

            var adminKey = new Key("email", KeyAppointment.BecomeAdmin);

            inMemoryKeyRepository.AddKey(adminKey);

            _sanctionFacade = new SanctionFacade(inMemorySanctionRepository, inMemoryUserRepository, publisher.Object);
            _groupFacade    = new GroupFacade(inMemoryGroupRepository, inMemoryUserRepository, inMemorySanctionRepository,
                                              new GroupSettings(3, 100, 0, 1000), publisher.Object);
            _userFacade = new UserFacade(inMemoryUserRepository, inMemoryGroupRepository, inMemoryEventRepository,
                                         publisher.Object);
            _accountFacade = new AccountFacade(inMemoryKeyRepository, inMemoryUserRepository,
                                               emailSender.Object, userSettings);
            var creatorId = _accountFacade.RegUser("Alena", new Credentials("email", "password"), true, adminKey.Value);

            _groupCreator = _userFacade.GetUser(creatorId);
        }
Esempio n. 8
0
        /// <summary>
        /// 核心识别by sahuang
        /// </summary>
        private static void RunDetector(GroupSettings gSets)
        {
            while (gSets.PathQueue.Count != 0)
            {
                try
                {
                    CreateProc(gSets);
                    ProcExited(gSets);
                }
                catch (Exception ex)
                {
                    Logger.Exception(ex);
                }
                finally
                {
                    _totalCount--;
                    Logger.Info("(龙图) " + (_totalCount + 1) + " ---> " + _totalCount);
                }
            }

            if (gSets.DragonCount < 1) return;
            Logger.Info("[" + gSets.GroupId + "] (龙图) " + gSets.DragonCount);
            SendMessage(gSets.routeMsg.ToSource("你龙了?"));
            gSets.Clear();
        }
Esempio n. 9
0
 static void Main(string[] args)
 {
     try
     {
         InitSettings();
         //runTimeConfig = LoadConfig(@"C:\Users\Ext-D.Sushchevskii\Documents\Replica2\Groups\1 wave\AST.cnfgroup");
         runTimeConfig = LoadConfig(args[0]);
         if (runTimeConfig.isValid)
         {
             OperateAuto();
         }
         else
         {
             Console.WriteLine("Операция невозможна в ручном режиме");
         }
         if (pullers.Count > 0)
         {
             AsyncSQLConnectPuller puller = pullers.First(x => x.Status == RunningStatusEnum.NotRunning);
             Console.WriteLine("");
             Console.WriteLine("================================================");
             Console.WriteLine(String.Format("Начинается обработка региона {0}", puller.RegionID));
             puller.operatePull();
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception.Message);
     }
     finally
     {
         Console.ReadKey();
     }
 }
Esempio n. 10
0
 public void AcceptChanges()
 {
     CallSettings.AcceptChanges();
     ModemSettings.AcceptChanges();
     GroupSettings.AcceptChanges();
     TelephoneItems.AcceptChanges();
 }
Esempio n. 11
0
 public SpellStealAbility(IActiveAbility ability, GroupSettings settings)
     : base(ability)
 {
     this.settings = new SpellStealSettings(settings.Menu, ability);
     this.handler  = UpdateManager.CreateIngameUpdate(500, false, this.OnUpdate);
     EntityManager9.AbilityAdded += this.OnAbilityAdded;
     this.useInvisible            = settings.UseWhenInvisible;
 }
Esempio n. 12
0
        public static GroupSettings InitGroupSettings()
        {
            GroupSettings Singlep = new GroupSettings("MovieTalk");
            GroupSettings Singlem = new GroupSettings("mTube");

            return(Singlep);
            //return Group62b;
        }
Esempio n. 13
0
        static void Main(string[] args)
        {
            var path = args[0];

            OperationsAPI.initAPI();
            OperationsAPI.StageListPath = @"\Configs\ConnectStageList.xml";
            OperationsAPI.ConfigPath    = @"\Configs\ConnectConfig.xml";
            var globalConf = AsyncReplicaOperations.StageConnectSettings.getInstance();
            var localConf  = new GroupSettings(path);

            if (!localConf.isValid)
            {
                return;
            }

            foreach (RuntimeRegionSettings regionSetting in localConf.EntitiesList)
            {
                SqlConnection sqlConnection = new SqlConnection();
                try
                {
                    var sqlConnectionBuilder = new SqlConnectionStringBuilder();
                    sqlConnectionBuilder.DataSource         = globalConf.FindId(regionSetting.RegionId).ServerName;
                    sqlConnectionBuilder.InitialCatalog     = globalConf.FindId(regionSetting.RegionId).StageDBName;
                    sqlConnectionBuilder.IntegratedSecurity = true;
                    sqlConnection = new SqlConnection(sqlConnectionBuilder.ToString());
                    if (!SqlConnectionChecker.checkConnection(sqlConnection))
                    {
                        throw new Exception("Невозможно подключиться к региону " + regionSetting.RegionId);
                    }
                    var command = new SqlCommand("select FILEPATHSAVE,FILEPATHLOAD from REPLICAS", sqlConnection);
                    sqlConnection.Open();
                    using (var reader = command.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
                    {
                        while (reader.Read())
                        {
                            var flushPath = reader.GetString(0);
                            FlushFolder(flushPath);
                            Console.WriteLine(string.Format("[MESSAGE] {0:HH:mm:ss} Папка {1} успешно очищена", DateTime.Now, flushPath));
                            flushPath = reader.GetString(1);
                            FlushFolder(flushPath);
                            Console.WriteLine(string.Format("[MESSAGE] {0:HH:mm:ss} Папка {1} успешно очищена", DateTime.Now, flushPath));
                        }
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(string.Format("[ERROR] {0:HH:mm:ss} {1}", DateTime.Now, e.Message));
                }
                finally
                {
                    if (sqlConnection.State == System.Data.ConnectionState.Open)
                    {
                        sqlConnection.Close();
                    }
                }
            }
        }
Esempio n. 14
0
        public AttributeShiftStrengthGainAbility(IHealthRestore healthRestore, GroupSettings settings)
            : base(healthRestore)
        {
            this.settings = new AttributeShiftStrengthGainSettings(settings.Menu, healthRestore);
            this.shiftStr = (AttributeShiftStrengthGain)healthRestore;
            this.shiftAgi = this.shiftStr.AttributeShiftAgilityGain;

            this.balanceHealth = this.Owner.Health;
        }
Esempio n. 15
0
 public GroupFacade(IGroupRepository groupRepository, IUserRepository userRepository,
                    ISanctionRepository sanctionRepository, GroupSettings groupSettings, IEventPublisher publisher)
 {
     _groupRepository    = groupRepository;
     _userRepository     = userRepository;
     _sanctionRepository = sanctionRepository;
     _groupSettings      = groupSettings;
     _publisher          = publisher;
 }
Esempio n. 16
0
        private void GroupSettings_Click(object sender, RoutedEventArgs e)
        {
            GroupSettings window = new GroupSettings(groupsNameComboBox.Text);

            if ((bool)window.ShowDialog())
            {
                InitializeGroupList();
                InitializeContent();
            }
        }
Esempio n. 17
0
        public GroupSettings Patch(string mail, GroupSettings item)
        {
            mail.ThrowIfNotEmailAddress();

            using (PoolItem <GroupssettingsService> connection = this.groupSettingsServicePool.Take(NullValueHandling.Ignore))
            {
                GroupSettingsPatchRequest request = new GroupSettingsPatchRequest(connection.Item, item, mail);
                return(request.ExecuteWithRetryOnBackoff());
            }
        }
        protected override void Unmerge(ConfigurationElement sourceElement,
                                        ConfigurationElement parentElement,
                                        ConfigurationSaveMode saveMode)
        {
            RootProfilePropertySettingsCollection parent = parentElement as RootProfilePropertySettingsCollection;
            RootProfilePropertySettingsCollection source = sourceElement as RootProfilePropertySettingsCollection;

            base.Unmerge(sourceElement, parentElement, saveMode);
            GroupSettings.InternalUnMerge(source.GroupSettings, (parent != null) ? parent.GroupSettings : null, saveMode);
        }
Esempio n. 19
0
        public AutocastAbility(OrbAbility orbAbility, GroupSettings settings)
            : base(orbAbility)
        {
            this.OrbAbility    = orbAbility;
            this.settings      = new AutocastSettings(settings.Menu, orbAbility);
            this.groupSettings = settings;

            this.autocastHandler = UpdateManager.Subscribe(this.AutocastOnUpdate, 0, false);
            this.groupSettings.GroupEnabled.ValueChange += this.EnabledOnPropertyChanged;
        }
Esempio n. 20
0
        public ShieldGroup(MultiSleeper sleeper, GroupSettings settings)
            : base(sleeper, settings)
        {
            settings.AddSettingsMenu();
            settings.AbilityToggler.AddAbility("o9k.glyph");

            if (settings.GroupEnabled && settings.AbilityToggler.IsEnabled("o9k.glyph"))
            {
                this.Glyph(true);
            }
        }
        public AutoUsageSpecialGroup(MultiSleeper sleeper, GroupSettings settings)
            : base(sleeper, settings)
        {
            settings.AddSettingsMenu();
            settings.AbilityToggler.AddAbility(AbilityId.courier_burst);

            if (settings.GroupEnabled && settings.AbilityToggler.IsEnabled(nameof(AbilityId.courier_burst)))
            {
                this.SpeedBurst(true);
            }
        }
Esempio n. 22
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        GroupSettings settings = (GroupSettings)target;

        if (GUI.changed && Application.isPlaying)
        {
            settings.UpdateVisuals();
        }
    }
Esempio n. 23
0
    /// <summary>
    /// This method starts the simulation process
    /// </summary>
    public void StartSimulation()
    {
        testerCamera.transform.position = new Vector3(0f, 0f, -5f);
        scenarioStarts = DateTime.Now;
        int index = randomGenerator.Range(0, scenarios.Count);

        var settings = latin.GetNextScenario();

        groupGenerator.GenerateGroups(settings);
        currentSettings = settings;
    }
Esempio n. 24
0
 public SettingsGroupViewModel(Type componentType, IEnumerable <Type> taskSettings, string groupName)
 {
     Misc.FPReset();
     _groupName                  = groupName;
     _settingsTypes              = taskSettings;
     _taskInstance               = Activator.CreateInstance(componentType) as TaskBase;
     _serviceSettings            = GroupSettings.GetGroupSettings(_taskInstance, GroupName);
     RunTaskCommand              = new RelayCommand(arg => RunTask());
     RunTaskCurrentThreadCommand = new RelayCommand(arg => RunTaskCurrentThread());
     SaveCommand                 = new RelayCommand(arg => _serviceSettings.SaveSettings());
 }
        protected override bool SerializeElement(XmlWriter writer, bool serializeCollectionKey)
        {
            bool DataToWrite = false;

            if (base.SerializeElement(null, false) == true ||
                GroupSettings.InternalSerialize(null, false) == true)
            {
                DataToWrite |= base.SerializeElement(writer, false);
                DataToWrite |= GroupSettings.InternalSerialize(writer, false);
            }
            return(DataToWrite);
        }
 /// <summary>
 ///     Loads the groups settings from the specified XML element.
 /// </summary>
 /// <param name="element">The XML element to load from.</param>
 /// <param name="helper">The XML configuration helper being used.</param>
 internal void LoadFromXmlElement(XElement element, ConfigurationFileHelper helper)
 {
     helper.ReadElementCollectionTo(
         element,
         "group",
         e => {
         GroupSettings s = new GroupSettings();
         s.LoadFromXmlElement(e, helper);
         return(s);
     },
         Groups
         );
 }
Esempio n. 27
0
    public void ClearGroups(bool clearListenerSubscription = true)
    {
        foreach (Transform child in groupParent)
        {
            Destroy(child.gameObject);
        }

        if (clearListenerSubscription)
        {
            settingsReference.OnValuesChanged -= UpdateVisualsToMatchData;
            settingsReference = null;
        }
    }
        // LAMESPEC: this is missing from MSDN but is present in 2.0sp1 version of the
        // class.
        protected override bool OnDeserializeUnrecognizedElement(string elementName, XmlReader reader)
        {
            if (elementName == "group")
            {
                ProfileGroupSettings newSettings = new ProfileGroupSettings();
                newSettings.DoDeserialize(reader);
                GroupSettings.AddNewSettings(newSettings);

                return(true);
            }

            return(base.OnDeserializeUnrecognizedElement(elementName, reader));
        }
        protected internal override void Reset(ConfigurationElement parentElement)
        {
            base.Reset(parentElement);

            RootProfilePropertySettingsCollection root = (RootProfilePropertySettingsCollection)parentElement;

            if (root == null)
            {
                return;
            }

            GroupSettings.ResetInternal(root.GroupSettings);
        }
Esempio n. 30
0
    public void SaveRow(GroupSettings settings, float distance, int welcomedFactor, float scenarioLength)
    {
        Debug.Log("Recording Data: MemberCount " + settings.MembersInGroups + " ,GroupSize" + settings.InterGroupDistance + ", GroupOrientation " + settings.OrientationVariance
                  + ", GroupArc " + settings.GroupArc + ", Distance " + distance + ",  WelcomedFactor " + welcomedFactor + ", ScenarioLength " + scenarioLength);

        string[] rowData = new string[7];
        rowData[0] = settings.MembersInGroups.ToString();
        rowData[1] = settings.InterGroupDistance.ToString();
        rowData[2] = settings.OrientationVariance.ToString();
        rowData[3] = settings.GroupArc.ToString();
        rowData[4] = distance.ToString();
        rowData[5] = welcomedFactor.ToString();
        rowData[6] = scenarioLength.ToString();
        this.rowData.Add(rowData);
    }
        static EditorProjectPrefs()
        {
            _path = System.IO.Path.Combine(Application.dataPath, PREFS_PATH);
            try
            {
                _xdoc = XDocument.Load(_path);
            }
            catch
            {
                _xdoc = null;
            }

            if(_xdoc == null)
            {
                _projectId = "SPProj." + ShortGuid.NewGuid().ToString();
                _xdoc = new XDocument(new XElement("root"));
                _xdoc.Root.Add(new XAttribute("projectId", _projectId));

                var sdir = System.IO.Path.GetDirectoryName(_path);
                if (!System.IO.Directory.Exists(sdir)) System.IO.Directory.CreateDirectory(sdir);
                _xdoc.Save(_path);
            }
            else
            {
                var xattrib = _xdoc.Root.Attribute("projectId");
                if (xattrib == null)
                {
                    xattrib = new XAttribute("projectId", "SPProj." + ShortGuid.NewGuid().ToString());
                    _xdoc.Root.Add(xattrib);
                    _xdoc.Save(_path);
                }
                else if (string.IsNullOrEmpty(xattrib.Value))
                {
                    xattrib.Value = "SPProj." + ShortGuid.NewGuid().ToString();
                    _xdoc.Save(_path);
                }
                _projectId = xattrib.Value;
            }

            _local = new LocalSettings();
            _group = new GroupSettings();
        }