internal FmodSound(PluginControl pc) : base(pc) { playing = new AutoResetEvent(false); speechPlayer = new Speech(); speechPlayer.OnSpeechDone += new Speech.SpeechDoneCallback(SpeechDoneHandler); }
public NotecardReadAction(RadegastInstance inst, PluginControl pc) : base(inst) { control = pc; Label = "Read"; ContextType = typeof(InventoryNotecard); }
internal Surroundings(PluginControl pc) : base(pc) { Title = "surroundings"; Announce = false; obTab = (ObjectsConsole)control.instance.TabConsole.Tabs["objects"].Control; }
private IOrderedEnumerable <Entity> GetAllUsers(PluginControl pluginControl) { EntityCollection users = pluginControl.RetrieveMultiple(FetchQueries.GetUsers); IOrderedEnumerable <Entity> orderedUsers = users.Entities.OrderBy(selector => selector.Attributes[ModelSystemUser.Fields.FullName]); return(orderedUsers); }
public override void PrepareData(ExcelPackage package, PluginControl pluginControl) { ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("Users with Roles"); this.PrepareHeader(worksheet); // Get all users IOrderedEnumerable <Entity> users = this.GetAllUsers(pluginControl); // Number of row from which to start adding user-role pairs int rowNumber = 2; // For each user get roles using fetchxml foreach (Entity user in users) { EntityCollection roles = pluginControl.RetrieveMultiple(FetchQueriesHelper.GetRolesForUser(user.Id)); // For each role insert row to Excel foreach (Entity role in roles.Entities) { this.InsertRow(worksheet, user, role, rowNumber); rowNumber++; } } this.SignExcel(package); }
internal ConferenceIMSession(PluginControl pc, UUID session, string title) : base(pc, session) { AgentID = session; Title = title; Talker.Say("New " + Title, Talk.BeepType.Comm); }
public AvatarSpeechAction(RadegastInstance inst, PluginControl pc) : base(inst) { control = pc; Label = "Speech..."; ContextType = typeof(Avatar); }
public void Init() { using (var writer = new StreamWriter(LogPath, false, Encoding.UTF8)) { SetOut(writer); try { Config.Init(); if (File.Exists(ConfigPath)) { Config.Load(ConfigPath); } else { Config.Save(ConfigPath); } PluginControl = new PluginControl(Config); PluginControl.InitScriptEngineEvent += (sender, e) => InitScriptEngine(); } catch (Exception e) { using (var error_writer = new StreamWriter(ErrorLogPath, false, Encoding.UTF8)) { try { error_writer.WriteLine(Executor.FormatException(e)); } catch { } error_writer.WriteLine(e); } MessageBox.Show(File.ReadAllText(ErrorLogPath), "CurtainFireMakerPlugin", MessageBoxButtons.OK, MessageBoxIcon.Error); } Console.Out.Flush(); SetOut(new StreamWriter(Console.OpenStandardOutput())); } }
private void RunWorld(ProgressForm progress, PresetEditorControl preset) { var addWorlds = new List <World>(); int startFrame = preset.StartFrame; int endFrame = preset.EndFrame; Func <string, World> CreateWorld = (string name) => { var world = new World(ShotTypeProvider, Executor, startFrame, endFrame) { FrameCount = startFrame, ExportFileName = name, }; addWorlds.Add(world); return(world); }; long time = Environment.TickCount; Executor.SetGlobalVariable(("SCENE", Scene), ("CreateWorld", CreateWorld), ("PRESET_FILENAME", preset.FileName), ("EXPORT_DIRECTORY", preset.ExportDirectory), ("STARTFRAME", startFrame), ("ENDFRAME", endFrame)); PluginControl.RunScript(preset, Executor.Engine, Executor.CreateScope()); var worlds = new List <World>(addWorlds); addWorlds.Clear(); if (worlds.Count > 0) { for (int i = 0; i < progress.Maximum; i++) { worlds.ForEach(w => w.Frame()); worlds.AddRange(addWorlds); addWorlds.Clear(); progress.Value = i; Console.Out.Flush(); if (progress.IsCanceled) { return; } } progress.Text = "出力完了"; worlds.ForEach(w => w.FinalizeWorld()); worlds.ForEach(w => w.Export(ScriptDynamic, preset.ExportDirectory)); } Console.WriteLine((Environment.TickCount - time) + "ms"); Console.Out.Flush(); foreach (var world in worlds) { try { world.DropFileToHandle(ApplicationForm.Handle, ScriptDynamic, preset.ExportDirectory); } catch { } } }
private static void RepaintNeighbours(UIDocument uiDoc, Transaction tx) { //! Инфраструктурный код var doc = uiDoc.Document; tx.Start("tName"); var userControl = new PluginControl(); userControl.InitializeComponent(); if (userControl.ShowDialog() == true) { //! Берем элементы документа категории помещение var elems = new FilteredElementCollector(doc); elems.WherePasses(new ElementCategoryFilter(BuiltInCategory.OST_Rooms)); //! Из них берем только помещения относящиеся к квартирам var apartmentRooms = elems.Where(x => x.GetParam("ROM_Зона").Contains("Квартира")).ToList(); //! Группируем по необходимым параметрам var groupedRooms = apartmentRooms.GroupBy(x => x.GetParam("BS_Этаж") + x.GetParam("BS_Блок") + x.GetParam("ROM_Подзона")); //! Меняем цвет помещений, где это необходимо foreach (var room in groupedRooms.SelectMany(x => x.ToList().SelectRepaintRequired())) { room.GetParameters("ROM_Подзона_Index").FirstOrDefault() ?.Set(room.GetParam("ROM_Расчетная_подзона_ID") + ".Полутон"); } tx.Commit(); } else { tx.RollBack(); } }
internal Chat(PluginControl pc) : base(pc) { // We want to process incoming chat control.instance.Client.Self.ChatFromSimulator += new EventHandler <ChatEventArgs>(OnChat); control.instance.Client.Self.AlertMessage += new EventHandler <AlertMessageEventArgs>(OnAlertMessage); Radegast.RadegastTab chatTab = control.instance.TabConsole.Tabs["chat"]; Radegast.ChatConsole chatscreen = (Radegast.ChatConsole)chatTab.Control; nearby = chatscreen.lvwObjects; nearby.SelectedIndexChanged += new EventHandler(nearby_SelectedIndexChanged); nearby.GotFocus += new EventHandler(nearby_GotFocus); chatscreen.ChatInputText.GotFocus += new EventHandler(cbxInput_GotFocus); Title = "chat"; // Make a recognition grammar to improve accuracy. Listener.CreateGrammar("chat", new string[] { MUTE_OBJECTS, UNMUTE_OBJECTS }); }
public static ButtonContainer Button(MethodInfo method, PluginControl pluginControl) { // Get the first attribute var attribute = method.GetCustomAttribute <Button>(); return(new ButtonContainer(attribute.text, method.Name, pluginControl)); }
internal Synthesizer(PluginControl pc) { control = pc; // The following list must be in order of BeepType. BeepNames = new string[] { "ConfirmBeep.wav", "CommBeep.wav", "DialogBeep.wav", "BadBeep.wav", "GoodBeep.wav", "MoneyBeep.wav", "OpenBeep.wav", "CloseBeep.wav" }; if (control.osLayer == null) { return; } control.osLayer.SpeechStart( control, BeepNames); }
internal Control(PluginControl pc) : base(pc) { // Initialize the index to conversations and the list of pending interruptions. interruptions = new LinkedList<Mode>(); conversations = new Dictionary<string,Mode>(); }
internal FmodSound(PluginControl pc) : base(pc) { playing = new AutoResetEvent(false); speechPlayer = new Radegast.Media.Speech(); speechPlayer.OnSpeechDone += new Speech.SpeechDoneCallback(SpeechDoneHandler); }
internal Chat(PluginControl pc) : base(pc) { // We want to process incoming chat control.instance.Client.Self.ChatFromSimulator += new EventHandler<ChatEventArgs>(OnChat); control.instance.Client.Self.AlertMessage += new EventHandler<AlertMessageEventArgs>(OnAlertMessage); Radegast.RadegastTab chatTab = control.instance.TabConsole.Tabs["chat"]; Radegast.ChatConsole chatscreen = (Radegast.ChatConsole)chatTab.Control; nearby = chatscreen.lvwObjects; nearby.SelectedIndexChanged += new EventHandler(nearby_SelectedIndexChanged); nearby.GotFocus += new EventHandler(nearby_GotFocus); chatscreen.ChatInputText.GotFocus += new EventHandler(cbxInput_GotFocus); Title = "chat"; // Make a recognition grammar to improve accuracy. Listener.CreateGrammar("chat", new string[] { MUTE_OBJECTS, UNMUTE_OBJECTS }); }
internal Control(PluginControl pc) : base(pc) { // Initialize the index to conversations and the list of pending interruptions. interruptions = new LinkedList <Mode>(); conversations = new Dictionary <string, Mode>(); }
internal Voice(PluginControl pc) : base(pc) { Title = "voice"; vTab = (VoiceConsole)control.instance.TabConsole.Tabs["voice"].Control; participants = vTab.participants; }
internal TalkingContextMenu(PluginControl pc) { control = pc; RadegastContextMenuStrip.OnContentMenuOpened += OnContentMenuOpened; RadegastContextMenuStrip.OnContentMenuItemSelected += OnContentMenuItemSelected; RadegastContextMenuStrip.OnContentMenuItemClicked += OnContentMenuItemClicked; RadegastContextMenuStrip.OnContentMenuClosing += OnContentMenuClosing; }
internal SingleIMSession(PluginControl pc, string label, UUID agent, UUID session) : base(pc, session) { AgentID = agent; Title = label; Talker.Say("New I.M. from " + Title, Talk.BeepType.Comm); }
internal SingleIMSession(PluginControl pc, string label, UUID agent, UUID session) : base(pc, session) { AgentID = agent; Title = label; Talker.Say("New I.M. from "+Title, Talk.BeepType.Comm ); }
public PluginListView(PluginControl pControl) { PluginCtrl = pControl; InitializeComponent(); lblDesc.Text = pControl.Description; lbMain.Items.Clear(); }
internal Voices(PluginControl pc) { control = pc; configVoices = control.config["voices"] as OSDMap; maleVoiceLibrary = new Dictionary <string, AvailableVoice>(); femaleVoiceLibrary = new Dictionary <string, AvailableVoice>(); assignedVoices = new Dictionary <UUID, AssignedVoice>(); }
internal Voices( PluginControl pc) { control = pc; configVoices = control.config["voices"] as OSDMap; maleVoiceLibrary = new Dictionary<string, AvailableVoice>(); femaleVoiceLibrary = new Dictionary<string, AvailableVoice>(); assignedVoices = new Dictionary<UUID, AssignedVoice>(); }
internal GroupIMSession(PluginControl pc, UUID session) : base(pc, session) { AgentID = session; group = control.instance.Groups[session]; Title = group.Name; shortGroupName = Title.Split(' ')[0]; Talker.Say("New group I.M. from " + Title, Talk.BeepType.Comm); }
public PluginCheckbox(PluginControl pControl) { PluginCtrl = pControl; InitializeComponent(); chkMain.Text = pControl.Description; LoadSettings(); }
internal BlueMenu(PluginControl pc, NotificationEventArgs arg) : base(pc) { note = arg; // Watch for being closed by keyboard before we get to talk about it. note.OnNotificationClicked += new Notification.NotificationClickedCallback(note_OnNotificationClicked); note.OnNotificationClosed += new Notification.NotificationCallback(note_OnNotificationClosed); }
public static OutputPanel DisplayControl(Control c, string panelTitle) { PluginControl control = PluginServer.AddControl(c, panelTitle); if (control == null) { return(null); } return(control.OutputPanel); }
/// <summary> /// The draw controls recursive. /// </summary> /// <param name="s">The s.</param> /// <param name="reflex">The reflex.</param> /// <remarks></remarks> private void DrawControlsRecursive(ref SplitContainer s, ref ReflexiveContainer reflex) { foreach (object o in reflex.Controls) { PluginControl tempbase = (PluginControl)o; bool nospacer = true; switch (tempbase.type) { case ContainerType.Reflexive: ReflexiveContainer r = (ReflexiveContainer)tempbase; DrawControlsRecursive(ref r.Container, ref r); reflex.height += 25; s.Panel2.Controls.Add(r.Container); s.Panel2.Controls[s.Panel2.Controls.Count - 1].BringToFront(); s.Panel2.Controls[s.Panel2.Controls.Count - 1].Update(); break; case ContainerType.Ident: IdentContainer id = (IdentContainer)tempbase; s.Panel2.Controls.Add(id.panel); reflex.height += id.panel.Height; s.Panel2.Controls[s.Panel2.Controls.Count - 1].BringToFront(); s.Panel2.Controls[s.Panel2.Controls.Count - 1].Update(); break; case ContainerType.Int32: Int32Container int32 = (Int32Container)tempbase; s.Panel2.Controls.Add(int32.panel); reflex.height += int32.panel.Height; s.Panel2.Controls[s.Panel2.Controls.Count - 1].BringToFront(); s.Panel2.Controls[s.Panel2.Controls.Count - 1].Update(); break; default: nospacer = true; break; } if (nospacer) { continue; } Panel Spacerx = new Panel(); Spacerx.Height = 10; Spacerx.BackColor = Color.Transparent; Spacerx.Dock = DockStyle.Top; s.Panel2.Controls.Add(Spacerx); s.Panel2.Controls[s.Panel2.Controls.Count - 1].BringToFront(); s.Panel2.Controls[s.Panel2.Controls.Count - 1].Update(); reflex.height += 10; } }
public Paint(Canvas canvaToDraw) { pluginControl = new PluginControl(this); CurrentFactory = new LineFactory(); Canva = canvaToDraw; PrevPos = new Point() { X = -1, Y = -1 }; rewind = new RedoUndoClass(Canva); }
public PluginTextBox(PluginControl pControl) { PluginCtrl = pControl; InitializeComponent(); lblDesc.Text = pControl.Description; txtMain.Clear(); LoadSettings(); }
internal Friends(PluginControl pc) : base(pc) { Title = "friends"; Announce = false; frTab = (FriendsConsole)control.instance.TabConsole.Tabs["friends"].Control; friends = frTab.listFriends; control.instance.Client.Friends.FriendOffline += new EventHandler<FriendInfoEventArgs>(Friends_OnFriendOffline); control.instance.Client.Friends.FriendOnline += new EventHandler<FriendInfoEventArgs>(Friends_OnFriendOnline); }
internal Friends(PluginControl pc) : base(pc) { Title = "friends"; Announce = false; frTab = (FriendsConsole)control.instance.TabConsole.Tabs["friends"].Control; friends = frTab.listFriends; control.instance.Client.Friends.FriendOffline += new EventHandler <FriendInfoEventArgs>(Friends_OnFriendOffline); control.instance.Client.Friends.FriendOnline += new EventHandler <FriendInfoEventArgs>(Friends_OnFriendOnline); }
internal People(PluginControl pc) { control = pc; information = new Dictionary <UUID, AvatarInfo>(); genders = new string[] { "female", "male" }; // Directions are in a few equal-sized sectors directions = new string[] { "to your right", "in front of you", "to your left", "behind you" }; sectorsize = Math.PI * 2.0 / (double)directions.Length; }
internal People(PluginControl pc) { control = pc; information = new Dictionary<UUID,AvatarInfo>(); genders = new string[]{"female","male"}; // Directions are in a few equal-sized sectors directions = new string[] { "to your right", "in front of you", "to your left", "behind you" }; sectorsize = Math.PI * 2.0 / (double)directions.Length; }
internal Closet(PluginControl pc) : base(pc) { Title = "inventory"; inv = control.instance.Client.Inventory.Store; selected = inv.RootNode.Data; control.listener.CreateGrammar( INVNAME, new string[] { "read it", "go there", "close the closet", "describe it" }); }
internal Control(PluginControl pc) : base(pc) { AUDIOFILE = Path.Combine(control.instance.UserDir, "ChatTemp"); // Substitutions from chat-ese to English. subs = new Substitutions(control); syn = new Synthesizer(control); if (syn == null) { return; } voices = new Voices(control); }
/// <summary> /// Get the stored control that matches the supplied if it exists /// </summary> /// <param name="ctrl">The control to match against</param> /// <returns>If no match is found it simply returns the original control</returns> public static PluginControl Load(PluginControl ctrl) { try { if (pSettings == null) { pSettings = new PluginControlSettings(); if (pSettings.UpgradeRequired) { pSettings.Reload(); } else { pSettings.Upgrade(); pSettings.Reload(); pSettings.UpgradeRequired = true; pSettings.Save(); } } if (pSettings.PluginControls == null) { return(ctrl); } if (pSettings.PluginControls.Count == 0) { return(ctrl); } foreach (PluginControl savedCtrl in pSettings.PluginControls) { if (savedCtrl == ctrl) { return(savedCtrl); } } // None found return(ctrl); } catch (Exception ex) { return(ctrl); } }
internal Mode(PluginControl pc) { // One copy of the context menu manager is shared by all conversations. if (menu==null) { menu = new TalkingContextMenu(pc); } control = pc; // Default position right rear SessionPosition = new Vector3(-2.0f, -2.0f, 0.0f); Title = "Un-named conversation"; if (BadNameChars == null) BadNameChars = new Regex(@"[0-9]+", RegexOptions.IgnoreCase); }
public VoiceAssignment( PluginControl pc, string name, UUID id ) { control = pc; avatarName = name; avatarId = id; InitializeComponent(); control.talker.SayMore("Assign a voice for " + avatarName, BeepType.Open); // Inhibit demonstrations until constructore is done. doDemo = false; // Populate the fixed fields avName.Text = avatarName; library = control.talker.voices.voiceLibrary; foreach (string vname in library.Keys) { AvailableVoice v = library[vname]; voiceList.Items.Add(v.Name); } // Set the current name, if any. voiceList.ClearSelected(); voiceName = null; AssignedVoice av = null; // First check the assigned voices. av = control.talker.voices.VoiceFor( id, false ); // A voice has been assigned, so indicate that. if (av != null) { voiceName = av.root.Name; voice = library[voiceName]; rateSelector.SelectedIndex = av.rateModification + 1; pitchSelector.SelectedIndex = av.pitchModification + 1; SelectByName(voiceName); } doDemo = true; Radegast.GUI.GuiHelpers.ApplyGuiFixes(this); }
internal IMSession(PluginControl pc, UUID sess) : base(pc) { SessionID = sess; Title = "IM"; // Each conversation a predictable different location. AssignSlot(); if (firstTime) { firstTime = false; // Make a recognition grammar to improve accuracy. Listener.CreateGrammar("im", new string[] { MUTE_IM, UNMUTE_IM }); } }
public Substitutions( PluginControl pc) { // TODO read this from the config file. patterns = new List<Tuple>(); // Load standard substitutions Add("wb", "welcome back"); Add(@"\^\^", "ha ha"); Add(@"\^\s\^", "ha ha"); Add(@"\^_\^", "ha ha"); Add(@":\)", "ha ha"); Add(@":-\)", "ha ha"); Add("O.O", "wow"); Add("afk", "away from keyboard"); Add("lol", "ha ha"); Add(@":\(", "frowns."); Add(@"\.\.+", ","); Add("lmao", "ha ha ha!"); Add("w00t", "woot"); Add("np", "no problem"); Add("btw", "by the way"); Add(":D", "ha ha"); Add("brb", "Be right back."); Add("omg", "oh my god."); Add(@"http(s)*://[a-z0-9\./=%&?+-]+", ", a URL,"); // Load custom substitutions OSDMap subs = pc.config["substitutions"] as OSDMap; if (subs != null) { foreach (string key in subs.Keys) { Add( key, subs[key].AsString() ); } } // Strip out non-pronouncable characters for now. // TODO more language support. // For some reason \P{IsBasicLatin} matches the letter "i" Add(@"\p{IsHiragana}|p\{IsKatakana}"); Add(@"[*<>-]"); }
internal Synthesizer(PluginControl pc) { control = pc; // The following list must be in order of BeepType. BeepNames = new string[] { "ConfirmBeep.wav", "CommBeep.wav", "DialogBeep.wav", "BadBeep.wav", "GoodBeep.wav", "MoneyBeep.wav", "OpenBeep.wav", "CloseBeep.wav"}; if (control.osLayer == null) return; control.osLayer.SpeechStart( control, BeepNames); }
internal Control(PluginControl pc) : base(pc) { recog = new Recognizer(control); }
internal Control(PluginControl pc) : base(pc) { AUDIOFILE = Path.Combine(control.instance.UserDir, "ChatTemp"); // Substitutions from chat-ese to English. subs = new Substitutions( control ); syn = new Synthesizer(control); if (syn == null) return; voices = new Voices(control); }
internal Control(PluginControl pc) : base(pc) { people = new People(control); }
internal InvLandmark(PluginControl pc, InventoryLandmark a) : base(pc) { asset = a; }
internal Max(PluginControl pc) : base(pc) { }
internal InvNotecard(PluginControl pc, InventoryNotecard a) : base(pc) { asset = a; }
internal Control(PluginControl pc) : base(pc) { }
internal Movement(PluginControl pc) : base(pc) { }
internal Friendship(PluginControl pc, string name, UUID session) : base(pc) { who = name; }