// Use this for initialization
    void Start() {
        messageManager = MessageManager.GetComponent<MessageManager>();
        /*
        levelData = GameData.getLevelData(previousScene);

        timeText.text = levelData.finishTime+"";
        totalCollectiblesText.text = levelData.collectibles.Count+"";
        
        int actualCollectibles = 0;
        foreach (string collId in levelData.collectibles)
        {
            if(GameData.AlreadyCollected(collId))
            {
                actualCollectibles++;
            }
        }

        actualCollectiblesText.text = actualCollectibles + "";
        */
        fader = GetComponent<SceneFade>();
        fader.nextScene = nextScene;
        fader.StartScene();

        Invoke("StartMessages", fader.fadeSpeed * 2);
    }
示例#2
0
 public SoundManager(MessageManager messageManager)
 {
     _cachedEffects = new Dictionary<string, SoundEffectInstance>();
     _messageManager = messageManager;
     _messageManager.AddListener<PlaySoundEffectMessage>(OnPlaySoundEffect);
     _messageManager.AddListener<PlaySongMessage>(OnPlaySong);
 }
    //public StudentManager studentManager;
    //public RopeManager ropeManager;


    void Awake()
    {
        webSocketManager = FindObjectOfType<WebSocketManager>();
        messageManager = FindObjectOfType<MessageManager>();
        roleManager = FindObjectOfType<RoleManager>();
        studentManager = FindObjectOfType<StudentManager>();
    }
示例#4
0
 public static void ClearAllMessages()
 {
     if (_instance == null) {
       _instance = Instance;
     }
     _messages.Clear();
 }
        public void CanFlashOneMessageTest()
        {
            _controller.Flash(Toastr.INFO, "A message");

            var manager = new MessageManager(_controller.TempData);
            manager.Count.Should().Be(1);
        }
    //public CustomDropdown dropdownStandtaskList;

    void Awake()
    {
        webSocketManager = FindObjectOfType<WebSocketManager>();
        messageManager = FindObjectOfType<MessageManager>();
        rayCastManager = FindObjectOfType<RayCastManager>();
		Finished = true;
    }
示例#7
0
        public SceneGraph(MessageManager messageManager)
        {
            this.DebugVisuals = false;
            this._spriteBatch = new SpriteBatch(GraphicsService.Instance.GraphicsDevice);
            this._nonTransformedSpriteBatch = new SpriteBatch(GraphicsService.Instance.GraphicsDevice);

            _messageManager = messageManager;
            _gameObjectLookup = new Dictionary<int, List<IRenderAwareComponent>>();

            _renderComponents = new Dictionary<RenderPass, List<IRenderAwareComponent>>();
            #if WINDOWS_PHONE
            foreach (var val in EnumHelper.GetValues<RenderPass>())
            #else
            foreach (var val in Enum.GetValues(typeof(RenderPass)))
            #endif
            {

                _renderComponents.Add((RenderPass)val, new List<IRenderAwareComponent>());
            }

            _messageManager.AddListener<GameObjectLoadedMessage>(OnGameObjectLoaded);
            _messageManager.AddListener<GameObjectRemovedMessage>(OnGameObjectRemoved);

            _camera = new Camera(_messageManager);
        }
示例#8
0
 public void StartOneReport(Report report, string userId, string instanceId, string branch, bool eodRequest)
 {
     ReportInformation reportInformationByReportName = StaticFunctions.GetReportInformationByReportName(report.ReportName);
     ReportHeader reportHeader = StaticFunctions.GetReportHeader(report.Branch, report.Parameters, reportInformationByReportName.ReportId, 0);
     if (reportHeader == null)
     {
         reportHeader = StaticFunctions.CreateReportHeader(report.Branch, report.Parameters, reportInformationByReportName);
         report.set_RHDR_ReportId(reportHeader.ReportId);
     }
     else
     {
         bool flag = this.ReportInProgress(reportHeader);
         report.set_RHDR_ReportId(reportHeader.ReportId);
         if (flag == 0)
         {
             reportHeader.set_Status(1);
             reportHeader.set_StatusUpdateDateTime(DateTime.Now);
             reportHeader.set_ReportLines(0);
             reportHeader.set_CreateDateTime(DateTime.Now);
             reportHeader.set_PrintDateTime(DateTime.MinValue);
             reportHeader.set_Locator(string.Empty);
             reportHeader.set_ErrorCode(0);
             StaticFunctions.UpdateReportHeader(reportHeader);
             using (MessageManager messageManager = new MessageManager(this.reportManagerSettings.AdapterName))
             {
                 ReportingServiceControlRequest reportingServiceControlRequest = this.BuildControlRequest(reportHeader, reportInformationByReportName, this.reportStartDto, instanceId);
                 reportingServiceControlRequest.set_UserId(userId);
                 reportingServiceControlRequest.set_Branch(branch);
                 this.SendControlRequestToQueue(messageManager, reportingServiceControlRequest);
             }
         }
     }
 }
示例#9
0
 // Use this for references
 void Awake() {
     messageManager = GameObject.FindGameObjectWithTag("MessageManager").GetComponent<MessageManager>();
     cutScene = GetComponent<CutScene>();
     basePosition = transform.position;
     canvas = GetComponentInChildren<Canvas>().gameObject;
     ChangeTooltipStatus(TooltipManager.On);
 }
示例#10
0
 public ChirpRetriever()
 {
     _manager = Singleton<MessageManager>.instance;
     _manager.m_messagesUpdated += ManagerOnMMessagesUpdated;
     _manager.m_newMessages += ManagerOnMNewMessages;
     _messages = new List<ChirperMessage>();
 }
示例#11
0
        public void NoGeodataInFirstMessagePromptsForMoreInfo()
        {
            var convo = new MessageManager(NoResultsGeomock().Object).GetConversation(MyNumber);
            convo.Add("Hey there");

            var nextMessage = convo.GetNext();
            Assert.AreEqual("Could you tell me where that's happening?", nextMessage);
        }
示例#12
0
 public ChatServerContext(Config configManager)
 {
     Config = configManager;
     Actions = new ChatActionContext();
     Users = new UserManager(Actions);
     Messages = new MessageManager(Actions);
     Channels = new ChannelManager(Actions);
 }
        public void CanFlashMultipleMessagesTest()
        {
            _controller.Flash(Toastr.INFO, "A message");
            _controller.Flash(Toastr.INFO, "Another message");

            var manager = new MessageManager(_controller.TempData);
            manager.Count.Should().Be(2);
        }
示例#14
0
        public void TooManyPossibleLocationsPromptsForConfirmation()
        {
            var convo = new MessageManager(ManyResultsGeomock().Object).GetConversation(MyNumber);
            convo.Add("It's all kicking off in Hyde Park!");

            var nextMessage = convo.GetNext();
            Assert.AreEqual("Did you mean Hyde Park, London or Hyde Park, Leeds?", nextMessage);
        }
示例#15
0
 // Use this for references
 void Awake() {
     messageManager = GameObject.FindGameObjectWithTag("MessageManager").GetComponent<MessageManager>();
     cutScene = GetComponent<CutScene>();
     fearCutScene = targets[0].GetComponent<CutScene>();
     canvas = GetComponentInChildren<Canvas>().gameObject;
     animator = GetComponent<Animator>();
     ChangeTooltipStatus(TooltipManager.On);
 }
示例#16
0
 public MessageManager[] Iterator()
 {
     lock (this)
     {
         MessageManager[] ret = new MessageManager[this.messages.Count];
         this.messages.Values.CopyTo(ret, 0);
         return ret;
     }
 }
示例#17
0
 public int Enqueue(MessageManager message)
 {
     lock (this)
     {
         this.prog++;
         this.messages[this.prog] = message;
         message.Enqueued(this.prog);
         return this.prog;
     }
 }
示例#18
0
 void Awake()
 {
     _instance = this;
     messageLabel = transform.Find("MsgBg/Label").GetComponent<UILabel>();
     messagePanel = this.GetComponent<TweenAlpha>();
     msgTween = this.GetComponent<TweenPosition>();
     EventDelegate ed = new EventDelegate(this,"OnTweenFinished");
     messagePanel.onFinished.Add(ed);
     gameObject.SetActive(false);
 }
示例#19
0
 public static void AddMessage(string message)
 {
     if (_instance == null) {
       _instance = Instance;
     }
     _messages.Add(message);
     if (_messages.Count >= MAX_MESSAGES_COUNT) {
       _messages.RemoveAt(0);
     }
 }
    public static bool DeleteMessage(int id)
    {
        if (Membership.GetUser() == null || !Membership.GetUser().IsApproved)
            return false;

        MessageManager messageMgr = new MessageManager();

        messageMgr.MoveMessage(Membership.GetUser().UserName, id, "Trash");
        messageMgr.Dispose();
        return true;
    }
        private void AddFlashMessages(int number)
        {
            if (number <= 0) return;

            var manager = new MessageManager(_htmlHelper.ViewContext.TempData);

            while (number-- >= 0)
            {
                manager.Add(new FlashMessage(Toastr.INFO, $"Message {number}"));
            }
        }
        public void LoadsExistingMessagesTest()
        {
            var messageList = new List<FlashMessage>();
            messageList.Add(new FlashMessage(Toastr.INFO, "Message 1"));
            messageList.Add(new FlashMessage(Toastr.INFO, "Message 1"));
            _tempData[typeof(MessageManager).FullName] = messageList;

            _manager = new MessageManager(_tempData);

            _manager.Count.Should().Be(2);
        }
示例#23
0
	public static void RegisterListener(Listener listenerToRegister)
	{
		if (Messenger == null) {
			//this should not be null unless the scene is changing and messenger has already been destroyed
			Messenger = GameObject.Find("World").GetComponent<MessageManager>();
		}
		if (Messenger != null) //null checking in case messenger has been destroyed due to change in scene
		{
			Messenger.RegisterListener(listenerToRegister);
		}
	}
示例#24
0
    void Start()
    {
        Messenger = GameObject.Find("World").GetComponent<MessageManager>();
        if(!Messenger) {
            Debug.LogError("World.MessageManager could not be found.  Insure there is a World object with a MessageManager script attached.");
        }else{
            mListener = new Listener("JewelDropListener",gameObject,"collapseIfNeeded");
            Messenger.RegisterListener(mListener);
        }

        transform.position = new Vector3(newPos.x, 10.0f, 0);
        gameObject.GetComponent<ParticleSystem>().enableEmission= false;
    }
示例#25
0
        public override bool Collision(Bullet bullet, ref MessageManager msgManager)
        {
            float x = (float)bullet.Position.X;
            float y = (float)bullet.Position.Y;
            double distance = (Position.X - x) * (Position.X - x) + (Position.Y - y) * (Position.Y - y);
            if (distance > AttckRadiusDouble)
            {
                return false;
            }
            Vector2D vct = new Vector2D(Position.X - x, Position.Y - y);
            vct.Normalize();
            double ag = vct.GetAngle();
            int changecount = currentIndex - firstIndex;
            double oriag = JudgeBegin - AverageAngle * changecount;
            if (oriag < 0)
            {
                oriag = 360 + oriag;
                if (oriag + JudgeArea > 360)
                {
                    if (ag < (oriag - JudgeArea) && ag > (oriag + JudgeArea - 360))
                        return false;
                }
                else
                {
                    if (ag < (oriag - JudgeArea) && ag > (oriag + JudgeArea))
                        return false;
                }
            }
            else
            {
                if (oriag - JudgeArea < 0)
                {
                    if (ag < (360 + oriag - JudgeArea) && ag > (oriag + JudgeArea))
                    {
                        return false;
                    }
                }
                else
                {
                    if (ag < (oriag - JudgeArea) && ag > (oriag + JudgeArea))
                        return false;
                }
            }
            CollisionMessages.CollisionMasseageNormal mess = new CollisionMessages.CollisionMasseageNormal();
            mess.Position.X = Position.X;
            mess.Position.Y = Position.Y;
            mess.SetColor(0);
            msgManager.AcceptMessage(mess);

            return true;
        }
示例#26
0
        public PointerInputHandler(MessageManager messageManager, SceneGraph sceneGraph)
        {
            _sceneGraph = sceneGraph;
            _messageManager = messageManager;

            _oldMouseState = Mouse.GetState();

            var touchCapabilities = TouchPanel.GetCapabilities();
            if (touchCapabilities.IsConnected)
            {
                _touchSupported = true;
                _oldTouchState = TouchPanel.GetState();
            }
        }
示例#27
0
 public ServerForm()
 {
     InitializeComponent();
     try
     {
         manager = new MessageManager("serv", "",viewBox);
         manager.StartObj();
         manager.ServInfo();
     }
     catch (Exception ex)
     {
         //MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#28
0
 public ChatForm()
 {
     InitializeComponent();
     if (MessageBox.Show("Желаете ввести ip сервера?", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         ConnectionDialog getIp = new ConnectionDialog();
         getIp.ShowDialog();
         manager = new MessageManager("clientExt", getIp.ip, viewMessBox);
     }
     else
     {
         manager = new MessageManager("clientLoc", "", viewMessBox);
     }
 }
示例#29
0
	public static void SendToListeners(Message messageToSend)
	{
		if (Messenger == null) { 
			//this should not be null unless the scene is changing and messenger has already been destroyed
			GameObject messObj  = GameObject.Find("World");
			if (messObj != null)
			{
				Messenger = messObj.GetComponent<MessageManager>();
			}
		}
		if (Messenger != null) //null checking in case messenger has been destroyed due to change in scene
		{
			Messenger.SendToListeners(messageToSend);
		}
	}
示例#30
0
文件: Camera.cs 项目: jolson88/Hiromi
        public Camera(MessageManager messageManager)
        {
            _scale = 1f;
            _offset = Vector2.Zero;
            _lookAt = GraphicsService.Instance.DesignedScreenSize / 2.0f;

            RebuildBoundingBox();
            RebuildTransformationMatrix();

            _messageManager = messageManager;
            _messageManager.AddListener<ZoomCameraMessage>(OnZoomCamera);
            _messageManager.AddListener<NudgeCameraMessage>(OnMoveCamera);
            _messageManager.AddListener<RotateCameraMessage>(OnRotateCamera);
            _messageManager.AddListener<ScreenSizeChangedMessage>(OnScreenSizeChanged);
        }
示例#31
0
 private void onUser1Clicked(object sender, RoutedEventArgs e)
 {
     MessageManager.queueMessage(new UserTypeSelectedMessage(UserConfiguration.UserType.Daniel));
 }
示例#32
0
        private SaveToArasCmd(IProjectManager projectManager, IAuthenticationManager authManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, ICodeProviderFactory codeProviderFactory, MessageManager messageManager) : base(authManager, dialogFactory, projectManager, projectConfigurationManager, codeProviderFactory, messageManager)
        {
            if (projectManager.CommandService != null)
            {
                var itemCommandID = new CommandID(ItemCommandSet, ItemCommandId);
                var itemMenu      = new OleMenuCommand(this.ExecuteCommand, itemCommandID);
                itemMenu.BeforeQueryStatus += CheckCommandAccessibility;

                projectManager.CommandService.AddCommand(itemMenu);
            }
        }
        private OpenFromPackageCmd(IProjectManager projectManager, IAuthenticationManager authManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, ICodeProviderFactory codeProviderFactory, MessageManager messageManager)
            : base(projectManager, dialogFactory, projectConfigurationManager, messageManager)
        {
            if (authManager == null)
            {
                throw new ArgumentNullException(nameof(authManager));
            }
            if (projectConfigurationManager == null)
            {
                throw new ArgumentNullException(nameof(projectConfigurationManager));
            }
            if (codeProviderFactory == null)
            {
                throw new ArgumentNullException(nameof(codeProviderFactory));
            }

            this.authManager         = authManager;
            this.codeProviderFactory = codeProviderFactory;

            if (projectManager.CommandService != null)
            {
                var menuCommandID = new CommandID(CommandSet, CommandId);
                var menuItem      = new OleMenuCommand(this.ExecuteCommand, menuCommandID);
                menuItem.BeforeQueryStatus += CheckCommandAccessibility;

                projectManager.CommandService.AddCommand(menuItem);
            }
        }
示例#34
0
 private void Awake()
 {
     _Instantiate = this;
 }
示例#35
0
        public GraphEditorView(EditorWindow editorWindow, GraphData graph, MessageManager messageManager)
        {
            m_Graph          = graph;
            m_MessageManager = messageManager;
            styleSheets.Add(Resources.Load <StyleSheet>("Styles/GraphEditorView"));
            previewManager = new PreviewManager(graph, messageManager);

            string serializedToggle = EditorUserSettings.GetConfigValue(k_ToggleSettings);

            if (!string.IsNullOrEmpty(serializedToggle))
            {
                m_ToggleSettings = JsonUtility.FromJson <ToggleSettings>(serializedToggle);
            }

            string serializedWindowLayout = EditorUserSettings.GetConfigValue(k_FloatingWindowsLayoutKey);

            if (!string.IsNullOrEmpty(serializedWindowLayout))
            {
                m_FloatingWindowsLayout = JsonUtility.FromJson <FloatingWindowsLayout>(serializedWindowLayout);
            }
            else
            {
                m_FloatingWindowsLayout = new FloatingWindowsLayout
                {
                    blackboardLayout =
                    {
                        dockingTop       = true,
                        dockingLeft      = true,
                        verticalOffset   =              16,
                        horizontalOffset =              16,
                        size             = new Vector2(200, 400)
                    }
                };
            }

            if (m_FloatingWindowsLayout.masterPreviewSize.x > 0f && m_FloatingWindowsLayout.masterPreviewSize.y > 0f)
            {
                previewManager.ResizeMasterPreview(m_FloatingWindowsLayout.masterPreviewSize);
            }

            previewManager.RenderPreviews();
            var toolbar = new IMGUIContainer(() =>
            {
                GUILayout.BeginHorizontal(EditorStyles.toolbar);
                if (GUILayout.Button("Save Asset", EditorStyles.toolbarButton))
                {
                    if (saveRequested != null)
                    {
                        saveRequested();
                    }
                }
                GUILayout.Space(6);
                if (GUILayout.Button("Show In Project", EditorStyles.toolbarButton))
                {
                    if (showInProjectRequested != null)
                    {
                        showInProjectRequested();
                    }
                }

                GUILayout.FlexibleSpace();

                EditorGUI.BeginChangeCheck();
                m_ToggleSettings.isBlackboardVisible = GUILayout.Toggle(m_ToggleSettings.isBlackboardVisible, "Blackboard", EditorStyles.toolbarButton);

                GUILayout.Space(6);

                m_ToggleSettings.isPreviewVisible = GUILayout.Toggle(m_ToggleSettings.isPreviewVisible, "Main Preview", EditorStyles.toolbarButton);
                if (EditorGUI.EndChangeCheck())
                {
                    m_MasterPreviewView.visible             = m_ToggleSettings.isPreviewVisible;
                    m_BlackboardProvider.blackboard.visible = m_ToggleSettings.isBlackboardVisible;
                    string serializedToggleables            = JsonUtility.ToJson(m_ToggleSettings);
                    EditorUserSettings.SetConfigValue(k_ToggleSettings, serializedToggleables);
                }
                GUILayout.EndHorizontal();
            });

            Add(toolbar);

            var content = new VisualElement {
                name = "content"
            };

            {
                m_GraphView = new MaterialGraphView(graph)
                {
                    name = "GraphView", viewDataKey = "MaterialGraphView"
                };
                m_GraphView.SetupZoom(0.05f, ContentZoomer.DefaultMaxScale);
                m_GraphView.AddManipulator(new ContentDragger());
                m_GraphView.AddManipulator(new SelectionDragger());
                m_GraphView.AddManipulator(new RectangleSelector());
                m_GraphView.AddManipulator(new ClickSelector());
                m_GraphView.RegisterCallback <KeyDownEvent>(OnSpaceDown);
                m_GraphView.groupTitleChanged        = OnGroupTitleChanged;
                m_GraphView.elementsAddedToGroup     = OnElementsAddedToGroup;
                m_GraphView.elementsRemovedFromGroup = OnElementsRemovedFromGroup;
                content.Add(m_GraphView);

                m_BlackboardProvider = new BlackboardProvider(graph);
                m_GraphView.Add(m_BlackboardProvider.blackboard);

                // Initialize toggle settings if it doesnt exist.
                if (m_ToggleSettings == null)
                {
                    m_ToggleSettings = new ToggleSettings();
                }
                m_BlackboardProvider.blackboard.visible = m_ToggleSettings.isBlackboardVisible;

                m_MasterPreviewView = new MasterPreviewView(previewManager, graph)
                {
                    name = "masterPreview"
                };

                WindowDraggable masterPreviewViewDraggable = new WindowDraggable(null, this);
                m_MasterPreviewView.AddManipulator(masterPreviewViewDraggable);
                m_GraphView.Add(m_MasterPreviewView);

                //m_BlackboardProvider.onDragFinished += UpdateSerializedWindowLayout;
                //m_BlackboardProvider.onResizeFinished += UpdateSerializedWindowLayout;
                masterPreviewViewDraggable.OnDragFinished += UpdateSerializedWindowLayout;
                m_MasterPreviewView.previewResizeBorderFrame.OnResizeFinished += UpdateSerializedWindowLayout;
                m_MasterPreviewView.visible = m_ToggleSettings.isPreviewVisible;

                m_GraphView.graphViewChanged = GraphViewChanged;

                RegisterCallback <GeometryChangedEvent>(ApplySerializewindowLayouts);
            }

            m_SearchWindowProvider = ScriptableObject.CreateInstance <SearchWindowProvider>();
            m_SearchWindowProvider.Initialize(editorWindow, m_Graph, m_GraphView);
            m_GraphView.nodeCreationRequest = (c) =>
            {
                m_SearchWindowProvider.connectedPort = null;
                SearchWindow.Open(new SearchWindowContext(c.screenMousePosition), m_SearchWindowProvider);
            };

            m_EdgeConnectorListener = new EdgeConnectorListener(m_Graph, m_SearchWindowProvider);

            foreach (var graphGroup in graph.groups)
            {
                AddGroup(graphGroup);
            }

            foreach (var node in graph.GetNodes <AbstractMaterialNode>())
            {
                AddNode(node);
            }

            foreach (var edge in graph.edges)
            {
                AddEdge(edge);
            }

            Add(content);
        }
示例#36
0
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 public static void Initialize(IProjectManager projectManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, ICodeProviderFactory codeProviderFactory, MessageManager messageManager)
 {
     Instance = new CreateCodeItemCmd(projectManager, dialogFactory, projectConfigurationManager, codeProviderFactory, messageManager);
 }
示例#37
0
        public static void SendFormData(this UmbracoHelper context, object form, bool saveMessage = true, bool showCcList = false, IEnumerable <IPublishedContent> attachments = null)
        {
            Dictionary <object, object> contextItems = getCurrentContextItems();
            HttpContext Context = HttpContext.Current;

            ISubmitDetails       details = form as ISubmitDetails;
            IConfirmationDetails confirm = form as IConfirmationDetails;

            try
            {
                if (!string.IsNullOrEmpty(details.FieldPattern))
                {
                    if (details.FieldPattern.Contains("{0}"))
                    {
                        Refactored.Email.Email.FieldPattern = details.FieldPattern;
                    }
                    else
                    {
                        Refactored.Email.Email.FieldDelimiters = details.FieldPattern;
                    }
                }
                else
                {
                    Refactored.Email.Email.FieldDelimiters = "[]";
                }

                if (details != null && details.HtmlTemplateId > 0 && details.TextTemplateId > 0)
                {
                    string subject  = string.Empty;
                    string htmlBody = string.Empty;
                    string textBody = string.Empty;
                    if (details.HtmlTemplateId > 0)
                    {
                        htmlBody = Refactored.Email.Email.ParseMessageTemplateContent(
                            context.RenderTemplate(details.HtmlTemplateId).ToString(),
                            form, out subject);
                    }

                    if (details.TextTemplateId > 0)
                    {
                        textBody = Refactored.Email.Email.ParseMessageTemplateContent(
                            context.RenderTemplate(details.TextTemplateId).ToString(),
                            form);

                        if (string.IsNullOrEmpty(subject))
                        {
                            subject = new Node(details.TextTemplateId).Name;
                        }
                    }


                    SendEmail(details.FromEmail, details.ToEmail, subject, htmlBody, textBody,
                              bcc: showCcList?null: details.BccEmail,
                              cc: showCcList ? details.BccEmail : null,
                              attachments: attachments);

                    if (saveMessage)
                    {
                        MessageManager.CreateMessage(confirm == null ? details.FromEmail : confirm.SubmitterEmail, details.ToEmail, subject, htmlBody, textBody);
                    }
                }

                if (confirm != null && (confirm.HtmlConfirmationTemplateId > 0 || confirm.TextConfirmationTemplateId > 0))
                {
                    string htmlBody = string.Empty;
                    string textBody = string.Empty;
                    string subject  = string.Empty;

                    if (confirm.HtmlConfirmationTemplateId > 0)
                    {
                        htmlBody = Refactored.Email.Email.ParseMessageTemplateContent(
                            context.RenderTemplate(confirm.HtmlConfirmationTemplateId).ToString(),
                            form, out subject);
                    }

                    if (confirm.TextConfirmationTemplateId > 0)
                    {
                        textBody = Refactored.Email.Email.ParseMessageTemplateContent(
                            context.RenderTemplate(confirm.TextConfirmationTemplateId).ToString(),
                            form);

                        if (string.IsNullOrEmpty(subject))
                        {
                            subject = new Node(confirm.TextConfirmationTemplateId).Name;
                        }
                    }

                    SendEmail(confirm.FromEmail, confirm.SubmitterEmail, subject, htmlBody, textBody, attachments: attachments);
                }
            }
            finally
            {
                updateLocalContextItems(contextItems, Context);
            }
        }
示例#38
0
 /// <summary>
 /// Override, register a message event
 /// </summary>
 private void OnEnable()
 {
     MessageManager.StartListening("PlayerDie", PlayerDie);
 }
        public Fpxx BlankWasteTaxCardZuoFei(object[] param)
        {
            string str  = param[0].ToString();
            string str2 = param[1].ToString();
            string str3 = param[2].ToString();
            string str4 = param[3].ToString();
            string str5 = param[4].ToString();
            string str6 = param[5].ToString();
            string code = "0000";

            byte[] sourceArray      = Invoice.TypeByte;
            byte[] destinationArray = new byte[0x20];
            Array.Copy(sourceArray, 0, destinationArray, 0, 0x20);
            byte[] buffer3 = new byte[0x10];
            Array.Copy(sourceArray, 0x20, buffer3, 0, 0x10);
            byte[] buffer4 = AES_Crypt.Encrypt(Encoding.Unicode.GetBytes("KP" + DateTime.Now.ToString("F")), destinationArray, buffer3);
            Invoice.IsGfSqdFp_Static = false;
            Invoice invoice = new Invoice(Invoice.ParseFPLX(str), str2, str3, str4, str5, str6, buffer4, "NEW76mmX177mm");

            invoice.Hjje = "0.00";
            invoice.Hjse = "0.00";
            Fpxx fpData = invoice.GetFpData();

            code = invoice.GetCode();
            if (fpData == null)
            {
                MessageManager.ShowMsgBox(invoice.GetCode(), invoice.Params);
                return(fpData);
            }
            fpData.hzfw = (TaxCardFactory.CreateTaxCard().StateInfo.CompanyType != 0) || (fpData.hxm.Length > 0);
            fpData.sLv  = "0.17";
            string str8 = "Aisino.Fwkp.Invoice" + invoice.Fpdm + invoice.Fphm;

            byte[] bytes = Encoding.Unicode.GetBytes(MD5_Crypt.GetHashStr(str8));
            destinationArray = new byte[0x20];
            Array.Copy(bytes, 0, destinationArray, 0, 0x20);
            buffer3 = new byte[0x10];
            Array.Copy(bytes, 0x20, buffer3, 0, 0x10);
            byte[] inArray = AES_Crypt.Encrypt(Encoding.Unicode.GetBytes(DateTime.Now.ToString("F")), destinationArray, buffer3);
            fpData.gfmc = Convert.ToBase64String(AES_Crypt.Encrypt(Encoding.Unicode.GetBytes(Convert.ToBase64String(inArray) + ";" + invoice.Gfmc), destinationArray, buffer3));
            fpData.zfbz = true;
            fpData.bszt = 0;
            if ((int)fpData.fplx == 12)
            {
                fpData.clsbdh = "0";
                fpData.zyspsm = "#%";
                fpData.zyspmc = "";
            }
            fpData.dy_mb = "NEW76mmX177mm";
            if (!invoice.MakeCardInvoice(fpData, false))
            {
                code = invoice.GetCode();
                if (code.StartsWith("TCD_768") || code.StartsWith("TCD_769"))
                {
                    FormMain.CallUpload();
                }
                MessageManager.ShowMsgBox(invoice.GetCode(), invoice.Params);
                return(fpData);
            }
            code = "0000";
            return(fpData);
        }
 public void ZuoFeiMainFunction(int ZuoFeiNum)
 {
     try
     {
         UpLoadCheckState.SetFpxfState(true);
         int num  = 0;
         int num2 = 0;
         int num3 = 0x1770;
         this.FpList.Clear();
         InvCodeNum invCodeNum = new InvCodeNum();
         if (this.progressBar == null)
         {
             this.progressBar = new FPProgressBar();
         }
         this.progressBar.SetTip("正在作废未开发票", "请等待任务完成", "未开发票作废过程");
         this.progressBar.Visible = true;
         this.progressBar.Refresh();
         this.progressBar.Show();
         this.progressBar.Refresh();
         this.ProcessStartThread(this.step);
         this.progressBar.Refresh();
         for (int i = 0; i < ZuoFeiNum; i++)
         {
             if (this.GetTaxCardCurrentFpNum(ref invCodeNum) != "0000")
             {
                 MessageManager.ShowMsgBox("FPZF-000012");
                 this.progressBar.Visible = false;
                 this.progressBar.Refresh();
                 return;
             }
             string dbfpzl = this.GetInvoiceType(this.FaPiaoType).dbfpzl;
             string str3   = this.lab_fpdm.Text.Trim();
             string str4   = ShareMethods.FPHMTo8Wei(invCodeNum.InvNum);
             string str5   = this.IsEmpty_DengYu(base.TaxCardInstance.Address) + " " + base.TaxCardInstance.Telephone;
             string str6   = this.IsEmpty_DengYu(base.TaxCardInstance.BankAccount);
             string title  = "正在作废发票代码:" + str3 + "发票号码:" + str4;
             this.progressBar.SetTip(title, "请等待任务完成", "未开发票作废过程");
             this.ProcessStartThread(num3 / ZuoFeiNum);
             this.progressBar.Refresh();
             object[] param = new object[] { dbfpzl, str3, str4, DingYiZhiFuChuan1._UserMsg.MC, str5, str6 };
             Fpxx     item  = this.BlankWasteTaxCardZuoFei(param);
             if ((item == null) || !(item.retCode == "0000"))
             {
                 break;
             }
             this.FpList.Add(item);
             num++;
         }
         this.xxfpChaXunBll.SaveXxfp(this.FpList);
         this.progressBar.SetTip("正在将作废发票写入数据库", "请等待任务完成", "未开发票作废过程");
         this.ProcessStartThread(this.step);
         this.progressBar.Refresh();
         this.progressBar.Visible = false;
         num2 = ZuoFeiNum - num;
         MessageManager.ShowMsgBox("FPZF-000010", new string[] { ZuoFeiNum.ToString(), num.ToString(), num2.ToString() });
     }
     catch (Exception exception)
     {
         this.loger.Error("[ZuoFeiMainFunction函数异常]" + exception.ToString());
     }
     finally
     {
         if (this.progressBar != null)
         {
             this.progressBar.Visible = false;
             this.progressBar.Close();
             this.progressBar.Dispose();
             this.progressBar = null;
             GC.Collect();
         }
         UpLoadCheckState.SetFpxfState(false);
     }
 }
示例#41
0
 public AbstractMessenger(MessageManager messageManager)
 {
     _messageManager = messageManager;
 }
示例#42
0
 /// <summary>
 /// Override, unregister a message event
 /// </summary>
 private void OnDisable()
 {
     MessageManager.StopListening("PlayerDie", PlayerDie);
 }
示例#43
0
        private static void Main()
        {
            Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));

            Console.Title = Title;
            log.Info("Initialising...");

            ConfigurationManager <WorldServerConfiguration> .Initialise("WorldServer.json");

            DatabaseManager.Initialise(ConfigurationManager <WorldServerConfiguration> .Config.Database);

            DisableManager.Instance.Initialise();

            GameTableManager.Initialise();
            MapManager.Initialise();
            SearchManager.Initialise();
            EntityManager.Initialise();
            EntityCommandManager.Initialise();
            GlobalMovementManager.Initialise();

            AssetManager.Initialise();
            PrerequisiteManager.Initialise();
            GlobalSpellManager.Initialise();
            GlobalQuestManager.Initialise();
            ServerManager.Initialise();

            ResidenceManager.Initialise();
            GlobalStorefrontManager.Initialise();

            // make sure the assigned realm id in the configuration file exists in the database
            RealmId = ConfigurationManager <WorldServerConfiguration> .Config.RealmId;
            if (ServerManager.Servers.All(s => s.Model.Id != RealmId))
            {
                throw new ConfigurationException($"Realm id {RealmId} in configuration file doesn't exist in the database!");
            }

            MessageManager.Initialise();
            SocialManager.Initialise();
            CommandManager.Initialise();
            NetworkManager <WorldSession> .Initialise(ConfigurationManager <WorldServerConfiguration> .Config.Network);

            WorldManager.Initialise(lastTick =>
            {
                NetworkManager <WorldSession> .Update(lastTick);
                MapManager.Update(lastTick);
                ResidenceManager.Update(lastTick);
                BuybackManager.Update(lastTick);
                GlobalQuestManager.Update(lastTick);
            });

            using (WorldServerEmbeddedWebServer.Initialise())
            {
                log.Info("Ready!");

                while (true)
                {
                    Console.Write(">> ");
                    string line = Console.ReadLine();
                    if (!CommandManager.HandleCommand(new ConsoleCommandContext(), line, false))
                    {
                        Console.WriteLine("Invalid command");
                    }
                }
            }
        }
示例#44
0
        public override void OnImportAsset(AssetImportContext ctx)
        {
            var graphAsset   = ScriptableObject.CreateInstance <SubGraphAsset>();
            var subGraphPath = ctx.assetPath;
            var subGraphGuid = AssetDatabase.AssetPathToGUID(subGraphPath);

            graphAsset.assetGuid = subGraphGuid;
            var textGraph      = File.ReadAllText(subGraphPath, Encoding.UTF8);
            var messageManager = new MessageManager();
            var graphData      = new GraphData
            {
                isSubGraph = true, assetGuid = subGraphGuid, messageManager = messageManager
            };

            MultiJson.Deserialize(graphData, textGraph);

            try
            {
                ProcessSubGraph(graphAsset, graphData);
            }
            catch (Exception e)
            {
                graphAsset.isValid = false;
                Debug.LogException(e, graphAsset);
            }
            finally
            {
                if (messageManager.AnyError())
                {
                    graphAsset.isValid = false;
                    foreach (var pair in messageManager.GetNodeMessages())
                    {
                        var node = graphData.GetNodeFromId(pair.Key);
                        foreach (var message in pair.Value)
                        {
                            MessageManager.Log(node, subGraphPath, message, graphAsset);
                        }
                    }
                }
                messageManager.ClearAll();
            }

            Texture2D texture = Resources.Load <Texture2D>("Icons/sg_subgraph_icon");

            ctx.AddObjectToAsset("MainAsset", graphAsset, texture);
            ctx.SetMainObject(graphAsset);

            var metadata = ScriptableObject.CreateInstance <ShaderSubGraphMetadata>();

            metadata.hideFlags         = HideFlags.HideInHierarchy;
            metadata.assetDependencies = new List <UnityEngine.Object>();

            AssetCollection assetCollection = new AssetCollection();

            MinimalGraphData.GatherMinimalDependenciesFromFile(assetPath, assetCollection);

            foreach (var asset in assetCollection.assets)
            {
                if (asset.Value.HasFlag(AssetCollection.Flags.IncludeInExportPackage))
                {
                    // this sucks that we have to fully load these assets just to set the reference,
                    // which then gets serialized as the GUID that we already have here.  :P

                    var dependencyPath = AssetDatabase.GUIDToAssetPath(asset.Key);
                    if (!string.IsNullOrEmpty(dependencyPath))
                    {
                        metadata.assetDependencies.Add(
                            AssetDatabase.LoadAssetAtPath(dependencyPath, typeof(UnityEngine.Object)));
                    }
                }
            }
            ctx.AddObjectToAsset("Metadata", metadata);

            // declare dependencies
            foreach (var asset in assetCollection.assets)
            {
                if (asset.Value.HasFlag(AssetCollection.Flags.SourceDependency))
                {
                    ctx.DependsOnSourceAsset(asset.Key);

                    // I'm not sure if this warning below is actually used or not, keeping it to be safe
                    var assetPath = AssetDatabase.GUIDToAssetPath(asset.Key);

                    // Ensure that dependency path is relative to project
                    if (!string.IsNullOrEmpty(assetPath) && !assetPath.StartsWith("Packages/") && !assetPath.StartsWith("Assets/"))
                    {
                        Debug.LogWarning($"Invalid dependency path: {assetPath}", graphAsset);
                    }
                }

                // NOTE: dependencies declared by GatherDependenciesFromSourceFile are automatically registered as artifact dependencies
                // HOWEVER: that path ONLY grabs dependencies via MinimalGraphData, and will fail to register dependencies
                // on GUIDs that don't exist in the project.  For both of those reasons, we re-declare the dependencies here.
                if (asset.Value.HasFlag(AssetCollection.Flags.ArtifactDependency))
                {
                    ctx.DependsOnArtifact(asset.Key);
                }
            }
        }
示例#45
0
        public static void SendFormData(object form, NameValueCollection formData, bool saveMessage = true)
        {
            ISubmitDetails details = form as ISubmitDetails;

            if (details == null)
            {
                throw new ArgumentException("form must implement ISubmitDetails", "form");
            }

            Dictionary <object, object> items = getCurrentContextItems();
            HttpContext          Context      = HttpContext.Current;
            IConfirmationDetails confirm      = form as IConfirmationDetails;

            try
            {
                if (!string.IsNullOrEmpty(details.FieldPattern))
                {
                    if (details.FieldPattern.Contains("{0}"))
                    {
                        Refactored.Email.Email.FieldPattern = details.FieldPattern;
                    }
                    else
                    {
                        Refactored.Email.Email.FieldDelimiters = details.FieldPattern;
                    }
                }
                else
                {
                    Refactored.Email.Email.FieldDelimiters = "[]";
                }

                string subject  = string.Empty;
                string htmlBody = string.Empty;
                string textBody = string.Empty;
                if (details.HtmlTemplateId > 0)
                {
                    htmlBody = Refactored.Email.Email.ParseMessageTemplateContent(
                        umbraco.library.RenderTemplate(details.HtmlTemplateId).ToString(),
                        formData, out subject);
                }

                if (details.TextTemplateId > 0)
                {
                    textBody = Refactored.Email.Email.ParseMessageTemplateContent(
                        umbraco.library.RenderTemplate(details.TextTemplateId).ToString(),
                        formData);

                    if (string.IsNullOrEmpty(subject))
                    {
                        subject = new Node(details.TextTemplateId).Name;
                    }
                }


                Refactored.Email.Email.SendEmail(details.FromEmail, details.ToEmail, subject, htmlBody, textBody, bcc: details.BccEmail);
                if (saveMessage)
                {
                    MessageManager.CreateMessage(confirm == null ? details.FromEmail : confirm.SubmitterEmail, details.ToEmail, subject, htmlBody, textBody);
                }

                if (confirm != null)
                {
                    if (confirm.HtmlConfirmationTemplateId > 0 || confirm.TextConfirmationTemplateId > 0)
                    {
                        htmlBody = string.Empty;
                        textBody = string.Empty;
                        if (confirm.HtmlConfirmationTemplateId > 0)
                        {
                            htmlBody = Refactored.Email.Email.ParseMessageTemplateContent(
                                umbraco.library.RenderTemplate(confirm.HtmlConfirmationTemplateId).ToString(),
                                formData, out subject);
                        }

                        if (confirm.TextConfirmationTemplateId > 0)
                        {
                            textBody = Refactored.Email.Email.ParseMessageTemplateContent(
                                umbraco.library.RenderTemplate(confirm.TextConfirmationTemplateId).ToString(),
                                formData);

                            if (string.IsNullOrEmpty(subject))
                            {
                                subject = new Node(confirm.TextConfirmationTemplateId).Name;
                            }
                        }

                        Refactored.Email.Email.SendEmail(details.FromEmail, confirm.SubmitterEmail, subject, htmlBody, textBody);
                    }
                }
            }
            finally
            {
                updateLocalContextItems(items, Context);
            }
        }
示例#46
0
 /// <summary>
 /// Creates a new MessageServer instance.
 /// </summary>
 /// <param name="Logger">A logger for recording event information</param>
 private MessageServer(Logger Logger)
 {
     this.Logger    = Logger;
     MessageManager = new MessageManager(Logger);
     LaunchParser();
 }
示例#47
0
 protected override void registerMessages(MessageManager manager)
 {
 }
示例#48
0
        static void OnGlobalError(object sender, ThreadExceptionEventArgs e)
        {
            Exception exception = e.Exception;

            MessageManager.Instance().Alarm("OnGlobalError: " + sender.ToString() + exception.Message + " stack: " + exception.StackTrace);
        }
示例#49
0
 public PackageManager(IAuthenticationManager authenticationManager, MessageManager messageManager)
 {
     this.authenticationManager = authenticationManager ?? throw new ArgumentNullException(nameof(authenticationManager));
     this.messageManager        = messageManager ?? throw new ArgumentNullException(nameof(messageManager));
 }
示例#50
0
        static void OnDomainError(object sender, UnhandledExceptionEventArgs e)
        {
            Exception exception = e.ExceptionObject as Exception;

            MessageManager.Instance().Alarm("OnDomainError: " + sender.ToString() + exception.Message + " stack: " + exception.StackTrace);
        }
 public HitObjInstantiatedMsg(GameObject go)
 {
     this._go = go;
     MessageManager.dispatch(this);
 }
示例#52
0
 private void btnQuery_Click(object sender, EventArgs e)
 {
     try
     {
         if ((this.chkQS.Checked && this.chkJZ.Checked) && (this.data_ksrq.Value > this.data_jsrq.Value))
         {
             MessageManager.ShowMsgBox("INP-441203");
         }
         else
         {
             QueryCondition qCondition = new QueryCondition();
             if (this.chkQS.Checked)
             {
                 qCondition.startTime = this.data_ksrq.Value.ToString("yyyyMMdd");
             }
             else
             {
                 qCondition.startTime = string.Empty;
             }
             if (this.chkJZ.Checked)
             {
                 qCondition.endTime = this.data_jsrq.Value.ToString("yyyyMMdd");
             }
             else
             {
                 qCondition.endTime = string.Empty;
             }
             qCondition.invType = this.cmbInvType.SelectedValue.ToString();
             qCondition.status  = this.cmbStatus.SelectedValue.ToString();
             this.applyQueryList.Clear();
             QueryConfirmCommon.QueryController(qCondition, this.applyQueryList, false);
             DataTable table = new DataTable();
             table.Columns.Add("CLXX", typeof(string));
             table.Columns.Add("SLXH", typeof(string));
             table.Columns.Add("FPZLDM", typeof(string));
             table.Columns.Add("FPZLMC", typeof(string));
             table.Columns.Add("FPZL", typeof(string));
             table.Columns.Add("YSQBH", typeof(string));
             table.Columns.Add("SLSL", typeof(string));
             table.Columns.Add("SQSJ", typeof(string));
             table.Columns.Add("CLSJ", typeof(string));
             table.Columns.Add("FPJMX", typeof(string));
             foreach (OneTypeVolumes volumes in this.applyQueryList)
             {
                 DataRow row = table.NewRow();
                 row["CLXX"]   = volumes.applyStatus + ":" + volumes.applyStatusMsg;
                 row["SLXH"]   = volumes.applyNum;
                 row["FPZLDM"] = volumes.typeCode;
                 row["FPZLMC"] = volumes.typeName;
                 row["FPZL"]   = volumes.invType;
                 row["YSQBH"]  = volumes.dealNum;
                 row["SLSL"]   = volumes.applyAmount;
                 row["SQSJ"]   = volumes.applyTime;
                 row["CLSJ"]   = volumes.dealTime;
                 row["FPJMX"]  = "明细";
                 table.Rows.Add(row);
             }
             this.csdgStatusVolumn.DataSource = table;
         }
     }
     catch (BaseException exception)
     {
         this.loger.Error(exception.Message);
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         this.loger.Error(exception2.Message);
         ExceptionHandler.HandleError(exception2);
     }
 }
示例#53
0
 public ToggleSoundMsg(bool on)
 {
     this._on = on;
     MessageManager.dispatch(this);
 }
示例#54
0
        public async void OnSendMessageClicked()
        {
            if (!string.IsNullOrEmpty(TextToSend) && SelectedUser != null)
            {
                IsBusy = true;
                RestService    restSevice       = new RestService();
                MessageManager myMessageManager = new MessageManager(restSevice);
                Message        newMessage       = new Message
                {
                    Content        = TextToSend,
                    SenderUserId   = user.Id,
                    ReceiverUserId = SelectedUser.Id,
                    State          = MessageState.Sent
                };
                Response response = await myMessageManager.SaveMessageAsync(newMessage);

                switch (response.Status)
                {
                case Constants.Status.Error:
                {
                    switch (response.Message)
                    {
                    case Constants.APIMessages.ErrorAlreadyExists:
                    {
                        DisplayMessageAlreadySent();
                        break;
                    }

                    case Constants.APIMessages.ErrorOnCreating:
                    {
                        DisplayErrorOnSending();
                        break;
                    }

                    case Constants.APIMessages.Success:
                    default:
                    {
                        DisplayFatalError();
                        break;
                    }
                    }
                    IsBusy = false;
                }
                break;

                case Constants.Status.Success:
                {
                    Console.WriteLine("Message sent");
                    newMessage.SenderId         = user;
                    newMessage.ReceiverId       = SelectedUser;
                    newMessage.ColorOfMessage   = ColorOfMessageSent;
                    newMessage.MessageAlignment = AlignmentForMessageSent;
                    Messages.Add(newMessage);
                    AllMessagesReceivedandSentbyUser.Add(newMessage);
                    TextToSend = "";
                    IsBusy     = false;
                    break;
                }

                default:
                {
                    DisplayFatalError();
                    IsBusy = false;
                    break;
                }
                }
            }
        }
示例#55
0
 public static void Initialize(IProjectManager projectManager, IAuthenticationManager authManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, ICodeProviderFactory codeProviderFactory, MessageManager messageManager)
 {
     Instance = new SaveToArasCmd(projectManager, authManager, dialogFactory, projectConfigurationManager, codeProviderFactory, messageManager);
 }
示例#56
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or
        /// resetting unmanaged resources.
        /// </summary>
        /// <param name="disposing"></param>
        private void Dispose(bool disposing)
        {
            lock (this)
            {
                if (SerializationContext != null)
                {
                    CompactFormatterServices.UnregisterAllCustomCompactTypes(SerializationContext);


                    if (this.CompactKnownTypes != null)
                    {
                        this.CompactKnownTypes = null;
                    }

                    if (this.CompactKnownTypesJAVA != null)
                    {
                        this._cmptKnownTypesforJava = null;
                    }

                    if (this._cmptKnownTypesforNet != null)
                    {
                        this._cmptKnownTypesforNet = null;
                    }
                }

                if (PerfStatsColl != null)
                {
                    PerfStatsColl.Dispose();
                    PerfStatsColl = null;
                }

                if (ExpiryMgr != null)
                {
                    ExpiryMgr.Dispose();
                    ExpiryMgr = null;
                }
                if (MessageManager != null)
                {
                    MessageManager.StopMessageProcessing();
                    MessageManager = null;
                }
                if (CacheImpl != null)
                {
                    CacheImpl.Dispose();
                    CacheImpl = null;
                }

                if (AsyncProc != null)
                {
                    AsyncProc.Stop();
                    AsyncProc = null;
                }


                if (TimeSched != null)
                {
                    TimeSched.Dispose();
                    TimeSched = null;
                }
                if (disposing)
                {
                    GC.SuppressFinalize(this);
                }
            }
        }
示例#57
0
            private int OnUOAssistMessage(uint msg, int wParam, int lParam)
            {
                switch ((UOAMessage)msg)
                {
                case UOAMessage.REGISTER:

                    if (_wndRegs.ContainsKey(wParam))
                    {
                        _wndRegs.Remove(wParam);

                        return(2);
                    }

                    _wndRegs.Add(wParam, new WndRegEnt(wParam, lParam == 1 ? 1 : 0));

                    if (lParam == 1 && World.InGame)
                    {
                        foreach (Item item in World.Items.Where(s => s.IsMulti))
                        {
                            PostMessage((IntPtr)wParam, (uint)UOAMessage.ADD_MULTI, (IntPtr)((item.X & 0xFFFF) | ((item.Y & 0xFFFF) << 16)), (IntPtr)item.Graphic);
                        }
                    }

                    return(1);

                case UOAMessage.COUNT_RESOURCES: break;

                case UOAMessage.GET_COORDS:

                    if (World.Player != null)
                    {
                        return((World.Player.X & 0xFFFF) | ((World.Player.Y & 0xFFFF) << 16));
                    }

                    break;

                case UOAMessage.GET_SKILL: break;

                case UOAMessage.GET_STAT:

                    if (World.Player == null || wParam < 0 || wParam > 5)
                    {
                        return(0);
                    }

                    switch (wParam)
                    {
                    case 0: return(World.Player.Strength);

                    case 1: return(World.Player.Intelligence);

                    case 2: return(World.Player.Dexterity);

                    case 3: return(World.Player.Weight);

                    case 4: return(World.Player.HitsMax);

                    case 5: return((int)World.Player.TithingPoints);
                    }

                    return(0);

                case UOAMessage.SET_MACRO: break;

                case UOAMessage.PLAY_MACRO: break;

                case UOAMessage.DISPLAY_TEXT:

                    if (World.Player != null)
                    {
                        ushort        hue = (ushort)(wParam & 0xFFFF);
                        StringBuilder sb  = new StringBuilder(256);

                        if (GlobalGetAtomName((ushort)lParam, sb, 256) == 0)
                        {
                            return(0);
                        }

                        if ((wParam & 0x00010000) != 0)
                        {
                            MessageManager.HandleMessage(null, sb.ToString(), "System", hue, MessageType.Regular, 3, TEXT_TYPE.SYSTEM, true);
                        }
                        else
                        {
                            World.Player.AddMessage(MessageType.Regular, sb.ToString(), 3, hue, true, TEXT_TYPE.OBJECT);
                        }

                        return(1);
                    }

                    break;

                case UOAMessage.REQUEST_MULTIS:

                    return(World.Player != null ? 1 : 0);

                case UOAMessage.ADD_CMD:

                {
                    var sb = new StringBuilder(256);

                    if (GlobalGetAtomName((ushort)lParam, sb, 256) == 0)
                    {
                        return(0);
                    }

                    if (wParam == 0)
                    {
                        CommandManager.UnRegister(sb.ToString());

                        return(0);
                    }

                    new WndCmd(_cmdID, (IntPtr)wParam, sb.ToString());

                    return((int)_cmdID++);
                }

                case UOAMessage.GET_UID: return(World.Player != null ? (int)World.Player.Serial : 0);

                case UOAMessage.GET_SHARDNAME: break;

                case UOAMessage.ADD_USER_2_PARTY: break;

                case UOAMessage.GET_UO_HWND:
                    SDL.SDL_SysWMinfo info = new SDL.SDL_SysWMinfo();
                    SDL.SDL_VERSION(out info.version);
                    SDL.SDL_GetWindowWMInfo(SDL.SDL_GL_GetCurrentWindow(), ref info);

                    IntPtr hwnd = IntPtr.Zero;

                    if (info.subsystem == SDL.SDL_SYSWM_TYPE.SDL_SYSWM_WINDOWS)
                    {
                        hwnd = info.info.win.window;
                    }

                    return((int)hwnd);

                case UOAMessage.GET_POISON:

                    return(World.Player != null && World.Player.IsPoisoned ? 1 : 0);

                case UOAMessage.SET_SKILL_LOCK: break;

                case UOAMessage.GET_ACCT_ID: break;

                case UOAMessage.RES_COUNT_DONE: break;

                case UOAMessage.CAST_SPELL: break;

                case UOAMessage.LOGIN: break;

                case UOAMessage.MAGERY_LEVEL: break;

                case UOAMessage.INT_STATUS: break;

                case UOAMessage.SKILL_LEVEL: break;

                case UOAMessage.MACRO_DONE: break;

                case UOAMessage.LOGOUT: break;

                case UOAMessage.STR_STATUS: break;

                case UOAMessage.DEX_STATUS: break;

                case UOAMessage.ADD_MULTI: break;

                case UOAMessage.REM_MULTI: break;

                case UOAMessage.MAP_INFO: break;

                case UOAMessage.POWERHOUR: break;
                }


                return(0);
            }
示例#58
0
 private void onSharedClick(object sender, RoutedEventArgs e)
 {
     MessageManager.queueMessage(new UserTypeSelectedMessage(UserConfiguration.UserType.Shared));
 }
示例#59
0
 protected override void RunCommand()
 {
     try
     {
         if ((ncpsgIfm == null) || !ncpsgIfm.HasShow())
         {
             SPFLService service = new SPFLService();
             if (FLBM_lock.isFlbm() && (service.GetMaxBMBBBH() == "0.0"))
             {
                 MessageManager.ShowMsgBox("INP-242133");
             }
             else if ((NCPXSInvEntry.ncpxsIfm != null) && NCPXSInvEntry.ncpxsIfm.HasShow())
             {
                 string[] textArray1 = new string[] { "农产品销售发票", "收购发票" };
                 MessageManager.ShowMsgBox("INP-242165", textArray1);
             }
             else if ((CommonInvEntry.commonIfm != null) && CommonInvEntry.commonIfm.HasShow())
             {
                 string[] textArray2 = new string[] { "一般普通发票", "收购发票" };
                 MessageManager.ShowMsgBox("INP-242165", textArray2);
             }
             else
             {
                 IFpManager manager = new FpManager();
                 TaxCardFactory.CreateTaxCard();
                 if (manager.CanInvoice((FPLX)2))
                 {
                     if (manager.GetCurrent((FPLX)2) != null)
                     {
                         if (new JSFPJSelect((FPLX)2).ShowDialog() == DialogResult.OK)
                         {
                             string[] current = manager.GetCurrent((FPLX)2);
                             if (current != null)
                             {
                                 if (new StartConfirmForm((FPLX)2, current).ShowDialog() == DialogResult.OK)
                                 {
                                     ncpsgIfm = new InvoiceForm_ZZS((FPLX)2, (ZYFP_LX)9, current[0], current[1]);
                                     if (ncpsgIfm.InitSuccess)
                                     {
                                         ncpsgIfm.ShowDialog();
                                     }
                                 }
                             }
                             else
                             {
                                 MessageManager.ShowMsgBox(manager.Code());
                             }
                         }
                     }
                     else
                     {
                         MessageManager.ShowMsgBox(manager.Code());
                     }
                 }
                 else
                 {
                     MessageManager.ShowMsgBox(manager.Code());
                 }
             }
         }
     }
     catch (Exception exception)
     {
         this.log.Error("收购发票开具功能加载异常:" + exception.ToString());
         string[] textArray3 = new string[] { exception.ToString() };
         MessageManager.ShowMsgBox("INP-242159", textArray3);
     }
 }
示例#60
0
 public MessageController(MessageManager chatManager)
 {
     _manager = chatManager;
     _chatHub = new MessageHub();
 }