Пример #1
0
        static void Main(string[] args)
        {
            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
            var service = new Sync();
            if (service == null)
            {
                Console.WriteLine("Failed to initialize service");
                return;
            }
            HostFactory.Run(x =>                                 //1
            {
                x.Service<Sync>(s =>                        //2
                {
                    s.ConstructUsing(name => service);     //3
                    s.WhenStarted(tc => tc.Start());              //4
                    s.WhenStopped(tc => tc.Stop());               //5
                });
                x.RunAsLocalSystem();                            //6

                x.SetDescription("M-Files to database syncronization tool");        //7
                x.SetDisplayName("Robb");                       //8
                x.SetServiceName("Robb");                       //9
                x.UseNLog();
                x.AfterInstall(PressKey);
                x.AfterUninstall(PressKey);
                
               
            });   
        }
        private bool m_willStartSound; // will start sound in updateaftersimulation

        #endregion Fields

        #region Constructors

        public MySoundBlock()
            : base()
        {
            #if XB1 // XB1_SYNC_NOREFLECTION
            m_soundRadius = SyncType.CreateAndAddProp<float>();
            m_volume = SyncType.CreateAndAddProp<float>();
            m_cueId = SyncType.CreateAndAddProp<MyCueId>();
            m_loopPeriod = SyncType.CreateAndAddProp<float>();
            #endif // XB1
            CreateTerminalControls();

            m_soundPair = new MySoundPair();

            m_soundEmitterIndex = 0;
            m_soundEmitters = new MyEntity3DSoundEmitter[EMITTERS_NUMBER];
            for (int i = 0; i < EMITTERS_NUMBER; i++)
            {
                m_soundEmitters[i] = new MyEntity3DSoundEmitter(this);
                m_soundEmitters[i].Force3D = true;
            }

            m_volume.ValueChanged += (x) => VolumeChanged();
            m_soundRadius.ValueChanged += (x) => RadiusChanged();
            m_cueId.ValueChanged += (x) => SelectionChanged();
        }
Пример #3
0
        internal void AddFilesFromSync(IList<string> files, Sync.MobeelizerInputData inputData)
        {
            foreach (String guid in files)
            {
                if (application.GetDatabase().IsFileExists(guid))
                {
                    Log.i(TAG, "Skip existing file from sync: " + guid);
                    continue;
                }

                Log.i(TAG, "Add file from sync: " + guid);
                String path = null;
                try
                {
                    path = SavaFile(guid, inputData.GetFile(guid));
                }
                catch (IOException e)
                {
                    Log.i(TAG, e.Message);
                    path = "/unknown";
                }

                application.GetDatabase().AddFileFromSync(guid, path);
            }
        }
Пример #4
0
        /// <summary>
        /// Конструктор класса
        /// </summary>
        /// <param name="app">Ссылка на платформу</param>
        /// <param name="pBios">Ссылка на подсистему ввода/вывода платформы</param>
        public MainForm(IApplication app, IEpromIO pBios, IProtocol protocol)
        {
            InitializeComponent();
            textInserter = new TextInsert(InsertToText);

            oldValue = new object();
            newValue = new object();

            oldValue = "0";
            newValue = "0";

            bios = new BIOS(app, pBios);
            proto = protocol;

            currentState = new ObjectCurrentState();

            for (int i = 0; i < 11; i++)
            {
                DataGridViewRow r = new DataGridViewRow();
                if ((i % 2) == 0) r.DefaultCellStyle.BackColor = Color.WhiteSmoke;
                dataGridViewCalibrationTable.Rows.Add(r);
            }

            syncker = new Sync();
            packetSyncMutex = new Mutex(false);

            gr = new GraphicCalibration(CreateGraphics(), new Rectangle(12, 38, 422, 267));
            gr.CalculateScale();
        }
Пример #5
0
        public MyButtonPanel()
        {
#if XB1 // XB1_SYNC_NOREFLECTION
            m_anyoneCanUse = SyncType.CreateAndAddProp<bool>();
#endif // XB1
            CreateTerminalControls();
            m_openedToolbars = new List<MyToolbar>();
        }
 public MyGravityGeneratorBase()
     : base()
 {
     #if XB1 // XB1_SYNC_NOREFLECTION
     m_gravityAcceleration = SyncType.CreateAndAddProp<float>();
     #endif // XB1
     m_gravityAcceleration.ValueChanged += (x) => AccelerationChanged();
 }
        public MyGravityGeneratorSphere()
        {
#if XB1 // XB1_SYNC_NOREFLECTION
            m_radius = SyncType.CreateAndAddProp<float>();
#endif // XB1
            CreateTerminalControls();
            m_radius.ValueChanged += (x) => UpdateFieldShape();
        }
Пример #8
0
        private void SetSyncStatus(Sync.Statuses syncStatus)
        {
            var server = Model.ServerAccounts.Get(ServerAccountId);

            if (syncStatus == Sync.Statuses.Syncing)
                lblServerName.Text = server.ServerLabel + @" (syncing)";
            else
                lblServerName.Text = server.ServerLabel;
        }
Пример #9
0
        public MyGravityGenerator()
        {
#if XB1 // XB1_SYNC_NOREFLECTION
            m_fieldSize = SyncType.CreateAndAddProp<Vector3>();
#endif // XB1
            CreateTerminalControls();

            m_fieldSize.ValueChanged += (x) => UpdateFieldShape();
        }
Пример #10
0
        public MySpaceBall()
            : base()
        {
            #if XB1 // XB1_SYNC_NOREFLECTION
            m_friction = SyncType.CreateAndAddProp<float>();
            m_virtualMass = SyncType.CreateAndAddProp<float>();
            m_restitution = SyncType.CreateAndAddProp<float>();
            m_broadcastSync = SyncType.CreateAndAddProp<bool>();
            #endif // XB1
            CreateTerminalControls();

            m_baseIdleSound.Init("BlockArtMass");
            m_virtualMass.ValueChanged += (x) => RefreshPhysicsBody();
            m_broadcastSync.ValueChanged += (x) => BroadcastChanged();
        }
Пример #11
0
        private void BroadCastFeedBack(long frame)
        {
            byte[] dataS2C = null;

            UpdateS2C updateS2C = new UpdateS2C();

            updateS2C.battleId  = 0;
            updateS2C.timestamp = frame;

            if (status == LocalBattleStatus.Start)
            {
                NoticeS2C noticeS2C = new NoticeS2C();
                noticeS2C.type = NoticeType.BattleBegin;
                dataS2C        = ProtobufUtils.Serialize(noticeS2C);

                localMessageHandlers[MsgCode.NoticeMessage](dataS2C);
                status = LocalBattleStatus.Normaly;
            }

            for (int i = messageList.Count - 1; i >= 0; i--)
            {
                if (messageList[i].msgCode == MsgCode.UpdateMessage)
                {
                    UpdateC2S updateC2S = ProtobufUtils.Deserialize <UpdateC2S>(messageList[i].data);
                    updateS2C.ops.Add(updateC2S.operation);
                }
                else if (messageList[i].msgCode == MsgCode.NoticeMessage)
                {
                    NoticeC2S noticeC2S = ProtobufUtils.Deserialize <NoticeC2S>(messageList[i].data);

                    NoticeS2C noticeS2C = new NoticeS2C();
                    noticeS2C.type = noticeC2S.type;
                    dataS2C        = ProtobufUtils.Serialize(noticeS2C);

                    DebugUtils.Log(DebugUtils.Type.LocalBattleMessage, string.Format("Send {0} feed back succeed ", messageList[i].msgCode));
                    localMessageHandlers[MsgCode.NoticeMessage](dataS2C);

                    // battle end need to stop send updateS2CS
                    if (noticeC2S.type == NoticeType.BattleResultBlueWin ||
                        noticeC2S.type == NoticeType.BattleResultRedWin ||
                        noticeC2S.type == NoticeType.BattleResultDraw)
                    {
                        status = LocalBattleStatus.End;
                    }
                }
                else if (messageList[i].msgCode == MsgCode.SyncMessage)
                {
                    SyncC2S syncC2S = ProtobufUtils.Deserialize <SyncC2S>(messageList[i].data);

                    Sync s = new Sync();
                    s.syncState        = syncC2S.syncState;
                    s.unitId           = syncC2S.uintId;
                    s.continuedWalkNum = syncC2S.continuedWalkNum;
                    s.timestamp        = frame;
                    foreach (Position item in syncC2S.positions)
                    {
                        s.positions.Add(item);
                    }

                    Operation operation = new Operation();
                    operation.sync   = s;
                    operation.opType = OperationType.SyncPath;

                    updateS2C.ops.Add(operation);
                }
                else if (messageList[i].msgCode == MsgCode.QuitBattleMessage)
                {
                    QuitBattleC2S quitBattleC2S = ProtobufUtils.Deserialize <QuitBattleC2S>(messageList[i].data);
                    QuitBattleS2C quitBattleS2C = new QuitBattleS2C();
                    quitBattleS2C.serverIp   = "127.0.0.1";
                    quitBattleS2C.serverPort = 0;
                    quitBattleS2C.serverType = ServerType.GameServer;
                    dataS2C = ProtobufUtils.Serialize(quitBattleS2C);

                    DebugUtils.Log(DebugUtils.Type.LocalBattleMessage, string.Format("Send {0} feed back succeed ", messageList[i].msgCode));
                    localMessageHandlers[MsgCode.QuitBattleMessage](dataS2C);
                    status = LocalBattleStatus.End;

                    return;
                }
                else if (messageList[i].msgCode == MsgCode.UploadSituationMessage)
                {
                    UploadSituationC2S uploadSituationC2S = ProtobufUtils.Deserialize <UploadSituationC2S>(messageList[i].data);

                    UploadSituationS2C uploadSituationS2C = new UploadSituationS2C();
                    uploadSituationS2C.type = uploadSituationC2S.type;
                    dataS2C = ProtobufUtils.Serialize(uploadSituationS2C);

                    DebugUtils.Log(DebugUtils.Type.LocalBattleMessage, string.Format("Send {0} feed back succeed ", messageList[i].msgCode));

                    Action <byte[]> callback = null;
                    if (localMessageHandlers.TryGetValue(MsgCode.UploadSituationMessage, out callback))
                    {
                        callback.Invoke(dataS2C);
                    }
                }
                else
                {
                    DebugUtils.LogError(DebugUtils.Type.LocalBattleMessage, string.Format("Can't handle this local message now message code = {0} ", messageList[i].msgCode));
                }

                messageList.RemoveAt(i);
            }

            dataS2C = ProtobufUtils.Serialize(updateS2C);

            for (int i = 0; i < updateS2C.ops.Count; i++)
            {
                DebugUtils.Log(DebugUtils.Type.LocalBattleMessage, string.Format("Frame: Send feed back operation {0}", updateS2C.ops[i].opType));
            }

            localMessageHandlers[MsgCode.UpdateMessage](dataS2C);
        }
Пример #12
0
 public override int GetHashCode()
 {
     return(17 ^ Sync.GetHashCode());
 }
Пример #13
0
    protected virtual void PeriodicSync()
    {
        if (gameObject.activeSelf == false)
            return;
        _syncedPos = transform.position;
        _syncedRot = transform.eulerAngles;

        Sync s = new Sync(RPCType.Others, "", "_syncedPos");
        s.signallerID = networkID;
        s.sender = userName;
        Sync(s);

        s = new Sync(RPCType.Others, "", "_syncedRot");
        s.signallerID = networkID;
        s.sender = userName;
        Sync(s);
    }
Пример #14
0
        public static TransCustList GetTransCustListStatistic(Context ctx, Criteria c)
        {
            TransCustList items = new TransCustList();

            using (IConnection conn = Sync.GetConnection(ctx))
            {
                string dateCondition = "";

                if (c.DateFrom > DateTime.MinValue)
                {
                    dateCondition += " AND date(dtrn_date) >= :date_from ";
                }

                if (c.DateTo > DateTime.MinValue)
                {
                    dateCondition += " AND date(dtrn_date) <= :date_to ";
                }

                string query = @" 
SELECT cst_id,
       sum(case when dtrn_type = 1 " + dateCondition + @" then coalesce(dtrn_net_value,0) + coalesce(dtrn_vat_value,0) else 0 end) as credit,
       sum(case when dtrn_type = 2 " + dateCondition + @" then coalesce(dtrn_net_value,0) + coalesce(dtrn_vat_value,0) else 0 end) as debit,
       sum(case when dtrn_type = 1 then coalesce(dtrn_net_value,0) + coalesce(dtrn_vat_value,0) else 0 end) -
       sum(case when dtrn_type = 2 then coalesce(dtrn_net_value,0) + coalesce(dtrn_vat_value,0) else 0 end) as crdb,
       rcustomer.cst_desc
FROM rtranscust
JOIN rcustomer ON rcustomer.id = cst_id
WHERE 1 = 1 ";

                if (c.CustId > 0)
                {
                    query += " AND cst_id = :cst_id ";
                }

                if (c.CustName != "")
                {
                    query += " AND rcustomer.cst_desc like :cst_desc ";
                }

                query += @" 
group by cst_id,
         rcustomer.cst_desc ";

                IPreparedStatement ps = conn.PrepareStatement(query);

                if (c.CustId > 0)
                {
                    ps.Set("cst_id", c.CustId);
                }

                if (c.DateFrom > DateTime.MinValue)
                {
                    ps.Set("date_from", c.DateFrom.Date.ToString("yyyy-MM-dd HH:mm:ss"));
                }

                if (c.DateTo > DateTime.MinValue)
                {
                    ps.Set("date_to", c.DateTo.Date.ToString("yyyy-MM-dd HH:mm:ss"));
                }

                if (c.CustName != "")
                {
                    ps.Set("cst_desc", c.CustName + "%");
                }

//                Log.Debug("rtranscust", query);
                IResultSet result = ps.ExecuteQuery();

                while (result.Next())
                {
                    items.Add(TransCust.GetTransCustStat(result));
                }

                ps.Close();
                conn.Release();
            }

            return(items);
        }
Пример #15
0
 protected override void OnSynced(Sync sync)
 {
     switch(sync.member)
     {
         case "_syncedPos":
             _posError = _syncedPos - transform.position;
             break;
         case "_syncedRot":
             _rotError = _syncedRot - transform.eulerAngles;
             break;
     }
 }
Пример #16
0
 public ISyncMethod RegisterSyncMethod(MethodInfo method, SyncType[] argTypes)
 {
     return(Sync.RegisterSyncMethod(method, argTypes));
 }
Пример #17
0
 protected virtual void OnSynced(Sync sync)
 {
 }
Пример #18
0
 public ISyncField RegisterSyncField(FieldInfo field)
 {
     return(Sync.RegisterSyncField(field));
 }
Пример #19
0
 public ISyncMethod RegisterSyncMethod(Type type, string methodOrPropertyName, SyncType[] argTypes = null)
 {
     return(Sync.RegisterSyncMethod(type, methodOrPropertyName, argTypes));
 }
Пример #20
0
 public ISyncField RegisterSyncField(Type targetType, string memberPath)
 {
     return(Sync.RegisterSyncField(targetType, memberPath));
 }
Пример #21
0
 public void RegisterAll(Assembly assembly)
 {
     Sync.RegisterAllAttributes(assembly);
     PersistentDialog.BindAll(assembly);
 }
Пример #22
0
 public void WatchEnd()
 {
     Sync.FieldWatchPostfix();
 }
Пример #23
0
        static void Main(string[] args)
        {
            string ProviderConnectionString;
            string ClientConnectionString;

            string tempProviderConn = ConfigurationManager.ConnectionStrings["defaultProviderConnectionString"].ConnectionString;
            string tempClientConn   = ConfigurationManager.ConnectionStrings["defaultClientConnectionString"].ConnectionString;

            if (Sync.ConnectionStringIsValid(tempProviderConn))
            {
                ProviderConnectionString = tempProviderConn;

                if (Sync.ConnectionStringIsValid(tempClientConn))
                {
                    ClientConnectionString = tempClientConn;

                    Logs.SyncLog.WriteLine("Sync service begun at " + DateTime.Now);
                    Console.WriteLine(Sync.Synchronise("ProductsScope", ProviderConnectionString, ClientConnectionString) + Sync.Synchronise("OrdersScope", ProviderConnectionString, ClientConnectionString));
                    Logs.SyncLog.WriteLine("Sync completed at " + DateTime.Now);
                }
                else
                {
                    Logs.SyncLog.WriteLine("There was an error whilst connecting to the client database. Please check your connection and check that the client connection string, which is specified " +
                                           "in the app configuration file, is valid.");
                }
            }
            else
            {
                Logs.SyncLog.WriteLine("There was an error whilst connecting to the provider database. Please check your connection and check that the provider connection string, which is specified " +
                                       "in the app configuration file, is valid.");
            }
        }
Пример #24
0
 public ISyncDelegate RegisterSyncDelegate(Type inType, string nestedType, string methodName, string[] fields, Type[] args = null)
 {
     return(Sync.RegisterSyncDelegate(inType, nestedType, methodName, fields, args));
 }
Пример #25
0
        public static ItemInfo GetItem(Context ctx, decimal itemID, bool loadImage)
        {
            ItemInfo info = new ItemInfo();

            using (IConnection conn = Sync.GetConnection(ctx))
            {
                /*IPreparedStatement ps = conn.PrepareStatement(@"SELECT item_id,
                 * item_cod,
                 * item_desc,
                 * item_long_des,
                 * item_ret_val1,
                 * item_sale_val1 ,
                 * item_buy_val1
                 * FROM items WHERE item_id = :ItemID");*/

                IPreparedStatement ps = conn.PrepareStatement(@"SELECT
id,
item_cod,
item_desc,
item_alter_desc,
unit_price,
item_qty_left ,
item_vat,
item_ctg_id,
item_ctg_disc,
item_image
FROM ritems WHERE id = :ItemID");
                ps.Set("ItemID", itemID.ToString());

                IResultSet result = ps.ExecuteQuery();

                if (result.Next())
                {
                    /*info.ItemId = Convert.ToInt64(result.GetDouble("item_id"));
                     * info.item_cod = result.GetString("item_cod");
                     * info.item_desc = result.GetString("item_desc");
                     * info.item_long_desc = result.GetString("item_long_des");
                     * info.item_ret_val1 = Convert.ToDecimal(result.GetDouble("item_ret_val1"));
                     * info.item_sale_val1 = Convert.ToDecimal(result.GetDouble("item_sale_val1"));
                     * info.item_buy_val1 = Convert.ToDecimal(result.GetDouble("item_buy_val1"));*/
                    //info.ItemId = Convert.ToInt64(result.GetDouble("id"));
                    info.ItemId         = result.GetInt("id");
                    info.item_cod       = result.GetString("item_cod");
                    info.ItemDesc       = result.GetString("item_desc");
                    info.item_long_desc = result.GetString("item_alter_desc");
                    info.ItemSaleVal1   = Convert.ToDecimal(result.GetDouble("unit_price"));
                    info.ItemQtyLeft    = Convert.ToDecimal(result.GetDouble("item_qty_left"));
                    info.ItemVatId      = result.GetInt("item_vat");
                    if (loadImage)
                    {
                        byte[] signatureBytes = result.GetBytes("item_image");
                        try
                        {
                            if (signatureBytes.Length > 0)
                            {
                                info.ItemImage = Android.Graphics.BitmapFactory.DecodeByteArray(signatureBytes,
                                                                                                0, signatureBytes.Length);
                            }
                            else
                            {
                                info.ItemImage = null;
                            }
                        }
                        catch (Exception ex)
                        {
                            info.ItemImage = null;
                        }
                    }

                    Log.Debug("item_vat", "item_vat=" + info.ItemVatId);
                }

                result.Close();
                ps.Close();
                conn.Release();
            }

            return(info);
        }
Пример #26
0
		private static void Handle_Sync (
					Shell Dispatch, string[] args, int index) {
			Sync		Options = new Sync ();

			var Registry = new Goedel.Registry.Registry ();

			Options.Portal.Register ("portal", Registry, (int) TagType_Sync.Portal);
			Options.UDF.Register ("udf", Registry, (int) TagType_Sync.UDF);
			Options.Verbose.Register ("verbose", Registry, (int) TagType_Sync.Verbose);
			Options.Report.Register ("report", Registry, (int) TagType_Sync.Report);


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

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

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

				switch (TagType) {
					case TagType_Sync.Portal : {
						int OptionParams = Options.Portal.Tag (Rest);
						
						if (OptionParams>0 && ((i+1) < args.Length)) {
							if 	(!IsFlag (args [i+1][0] )) {
								i++;								
								Options.Portal.Parameter (args[i]);
								}
							}
						break;
						}
					case TagType_Sync.UDF : {
						int OptionParams = Options.UDF.Tag (Rest);
						
						if (OptionParams>0 && ((i+1) < args.Length)) {
							if 	(!IsFlag (args [i+1][0] )) {
								i++;								
								Options.UDF.Parameter (args[i]);
								}
							}
						break;
						}
					case TagType_Sync.Verbose : {
						int OptionParams = Options.Verbose.Tag (Rest);
						
						if (OptionParams>0 && ((i+1) < args.Length)) {
							if 	(!IsFlag (args [i+1][0] )) {
								i++;								
								Options.Verbose.Parameter (args[i]);
								}
							}
						break;
						}
					case TagType_Sync.Report : {
						int OptionParams = Options.Report.Tag (Rest);
						
						if (OptionParams>0 && ((i+1) < args.Length)) {
							if 	(!IsFlag (args [i+1][0] )) {
								i++;								
								Options.Report.Parameter (args[i]);
								}
							}
						break;
						}
					default : throw new System.Exception ("Internal error");
					}
				}

#pragma warning restore 162
			Dispatch.Sync (Options);

			}
Пример #27
0
 /// <summary> 
 ///    Creates an instance of <see cref="BitCoinSharp.Threading.Locks.ReentrantLock"/> with the
 /// given fairness policy.
 /// </summary>
 /// <param name="fair"><c>true</c> if this lock will be fair, else <c>false</c>
 /// </param>
 public ReentrantLock(bool fair)
 {
     _sync = fair ? (Sync) new FairSync() : new NonfairSync();
 }
 public void ThenIChooseTheDetailsOptionFromTheDesiredService(string button)
 {
     Sync.ExplicitWait(1);
     AppointmentManagerPages.MyServicesPage.ButtonsFromSecondRowService(button).Click();
 }
Пример #29
0
 public ISyncDelegate RegisterSyncDelegate(Type type, string nestedType, string method)
 {
     return(Sync.RegisterSyncDelegate(type, nestedType, method));
 }
Пример #30
0
 /// <summary>
 /// Initializes a new instance of the ReentrantLock class, if the parameter is
 /// true then the lock is in Fair mode, otherwise it is in Non-Fair mode.
 /// </summary>
 public ReentrantLock(bool fair) : base()
 {
     if (fair)
     {
         this.sync = new FairSync();
     }
     else
     {
         this.sync = new NotFairSync();
     }
 }
 public void ThenTheApoointmentStateShouldBeUpdatedTo(string status)
 {
     Sync.ExplicitWait(1);
     AppointmentManagerPages.MyServicesPage.AppointmentStatusFirstRow.Text.Should().Be(status);
 }
Пример #32
0
        public void MSASEMAIL_S02_TC01_VoiceAttachment_VerifyAllRelativeElements()
        {
            Site.Assume.AreNotEqual <string>("12.1", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "The UmAttDuration element is not supported when the ActiveSyncProtocolVersion is 12.1.");

            #region Call SendMail command to send a mail with an electronic voice mail attachment
            string emailSubject        = Common.GenerateResourceName(Site, "subject");
            string firstVoiceFilePath  = "testVoice.mp3";
            string secondVoiceFilePath = "secondTestVoice.mp3";
            Sync   mailResult          = this.SendVoiceMail(emailSubject, firstVoiceFilePath, secondVoiceFilePath);
            #endregion

            #region Verify requirements
            foreach (Response.AttachmentsAttachment attachment in mailResult.Email.Attachments.Items)
            {
                Site.Assert.IsNotNull(attachment, "The attachment should not be null.");
                Site.Assert.IsNotNull(attachment.UmAttOrder, "The order of electronic voice mail attachment should not be null.");
            }

            // According to MS-OXCMAIL and MS-OXOUM, the order of attachments is the reverse of the order in which the attachments were added, so the most recent attachment is Email.Attachments.Attachment[1].
            Site.Assert.IsNull(((Response.AttachmentsAttachment)mailResult.Email.Attachments.Items[0]).UmAttDuration, "The duration of the next recent electronic voice mail attachment should be null since this element specifies the duration of the most recent electronic voice mail attachment.");
            Site.Assert.IsNotNull(((Response.AttachmentsAttachment)mailResult.Email.Attachments.Items[1]).UmAttDuration, "The duration of the most recent electronic voice mail attachment should not be null.");

            // If the server response contains Attachment element and UmAttDuration is a child element of the most recent attachment, then MS-ASEMAIL_R799 can be verified
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R799");

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R799
            Site.CaptureRequirement(
                799,
                @"[In UmAttDuration] The email2:UmAttDuration element is an optional child element of the airsyncbase:Attachment element (section 2.2.2.7) that specifies the duration of the most recent electronic voice mail attachment in seconds.");

            // If the server response contains UmAttDuration and UmAttOrder element, the response must contains a MessageClass element which element value that begins with the prefix of "IPM.Note.Microsoft.Voicemail", "IPM.Note.RPMSG.Microsoft.Voicemail", or "IPM.Note.Microsoft.Missed.Voice", then MS-ASEMAIL_R804 and MS-ASEMAIL_R811 can be verified.
            string messageClass      = mailResult.Email.MessageClass;
            bool   verifyR804AndR811 = messageClass.StartsWith("IPM.Note.Microsoft.Voicemail", StringComparison.CurrentCulture) || messageClass.StartsWith("IPM.Note.RPMSG.Microsoft.Voicemail", StringComparison.CurrentCulture) || messageClass.StartsWith("IPM.Note.Microsoft.Missed.Voice", StringComparison.CurrentCulture);

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R804");

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R804
            Site.CaptureRequirementIfIsTrue(
                verifyR804AndR811,
                804,
                @"[In UmAttDuration] This element[email2:UmAttDuration] MUST only be included for messages with a MessageClass element (section 2.2.2.49) value that begins with the prefix of ""IPM.Note.Microsoft.Voicemail"", ""IPM.Note.RPMSG.Microsoft.Voicemail"", or ""IPM.Note.Microsoft.Missed.Voice"".");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R811");

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R811
            Site.CaptureRequirementIfIsTrue(
                verifyR804AndR811,
                811,
                @"[In UmAttOrder] This element[email2:UmAttOrder] MUST only be included for messages with a MessageClass element (section 2.2.2.49) value that begins with the prefix of ""IPM.Note.Microsoft.Voicemail"", ""IPM.Note.RPMSG.Microsoft.Voicemail"", or ""IPM.Note.Microsoft.Missed.Voice"".");

            // If UmAttDuration element is not null means server set the element value then MS-ASEMAIL_R803 is verified.
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R803");

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R803
            Site.CaptureRequirementIfIsNotNull(
                ((Response.AttachmentsAttachment)mailResult.Email.Attachments.Items[1]).UmAttDuration,
                803,
                @"[In UmAttDuration] This value is set by the server [and is read-only for the client].");

            // The display name of the attachment should not be null
            Site.Assert.IsNotNull(((Response.AttachmentsAttachment)mailResult.Email.Attachments.Items[0]).DisplayName, "The name of the attachment file should not be null.");

            // If the value of UmAttOrder for the most recent attachment is 1, and for the next recent is larger than the most recent one, it indicates the UmAttOrder identifies the order of electronic voice mail attachments, then MS-ASEMAIL_R805 can be captured.
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R805");

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R805
            Site.CaptureRequirementIfIsTrue(
                int.Parse(((Response.AttachmentsAttachment)mailResult.Email.Attachments.Items[1]).UmAttOrder) == 1 && int.Parse(((Response.AttachmentsAttachment)mailResult.Email.Attachments.Items[0]).UmAttOrder) > 1,
                805,
                @"[In UmAttOrder] The email2:UmAttOrder element  is an optional child element of the airsyncbase:Attachment element (section 2.2.2.7) that identifies the order of electronic voice mail attachments.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R808");

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R808
            Site.CaptureRequirementIfAreEqual <string>(
                "1",
                ((Response.AttachmentsAttachment)mailResult.Email.Attachments.Items[1]).UmAttOrder,
                808,
                @"[In UmAttOrder] This value is set by the server [and is read-only for the client].");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R809");

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R809
            Site.CaptureRequirementIfAreEqual <int>(
                1,
                int.Parse(((Response.AttachmentsAttachment)mailResult.Email.Attachments.Items[1]).UmAttOrder),
                809,
                @"[In UmAttOrder] The most recent voice mail attachment in an e-mail item MUST have an email2:UmAttOrder value of 1.");

            if (Common.IsRequirementEnabled(829, this.Site))
            {
                // If UmCallerID element is not null, then MS-ASEMAIL_R829 can be verified
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R829");

                // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R829
                Site.CaptureRequirementIfIsNotNull(
                    mailResult.Email.UmCallerID,
                    829,
                    @"[In Appendix B: Product Behavior] Implementation does send this element[email2:UmCallerID] to the client regardless of the client's current VoIP capabilities, in order to enable future VoIP scenarios. (Exchange Server 2007 SP1 and above follow this behavior.)");
            }

            // If UmCallerID element is not null, that means UmCallerID is a telephone number and is sent from the server, then MS-ASEMAIL_R812, MS-ASEMAIL_933 can be verified
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R812");

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R812
            Site.CaptureRequirementIfIsNotNull(
                mailResult.Email.UmCallerID,
                812,
                @"[In UmCallerID] The email2:UmCallerID element is an optional element that specifies the callback telephone number of the person who called or left an electronic voice message.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R933");

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R933
            Site.CaptureRequirementIfIsNotNull(
                mailResult.Email.UmCallerID,
                933,
                @"[In UmCallerID] This element[UmCallID] is sent from the server to the client.");
            #endregion
        }
Пример #33
0
        public MorePaymentPageViewModel(INavigationService navigationService,
                                        IAccountingService accountingService,
                                        IDialogService dialogService
                                        ) : base(navigationService, dialogService)
        {
            Title = "选择支付方式";
            _navigationService = navigationService;
            _dialogService     = dialogService;
            _accountingService = accountingService;

            //加载配置
            this.Load = AccountLoader.Load(async() =>
            {
                var results = await Sync.RunResult(async() =>
                {
                    var result = await _accountingService.GetPaymentMethodsAsync((int)BillType, this.ForceRefresh);
                    //绑定Accounts
                    var options = new List <AccountingModel>();
                    switch (BillType)
                    {
                    case BillTypeEnum.SaleBill:
                        {
                            options = result?.Select(a =>
                            {
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountCodeTypeId == a.Number).FirstOrDefault()?.Selected ?? false,
                                    Name = a.Name,
                                    CollectionAmount = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Select(s => s.CollectionAmount).FirstOrDefault(),
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;

                    case BillTypeEnum.SaleReservationBill:
                        {
                            options = result?.Select(a =>
                            {
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountCodeTypeId == a.Number).FirstOrDefault()?.Selected ?? false,
                                    Name = a.Name,
                                    CollectionAmount = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Select(s => s.CollectionAmount).FirstOrDefault(),
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;

                    case BillTypeEnum.ReturnBill:
                        {
                            options = result?.Select(a =>
                            {
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountCodeTypeId == a.Number).FirstOrDefault()?.Selected ?? false,
                                    Name = a.Name,
                                    CollectionAmount = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Select(s => s.CollectionAmount).FirstOrDefault(),
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;

                    case BillTypeEnum.ReturnReservationBill:
                        {
                            options = result?.Select(a =>
                            {
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountCodeTypeId == a.Number).FirstOrDefault()?.Selected ?? false,
                                    Name = a.Name,
                                    CollectionAmount = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Select(s => s.CollectionAmount).FirstOrDefault(),
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;

                    case BillTypeEnum.CashReceiptBill:
                        {
                            options = result?.Select(a =>
                            {
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountCodeTypeId == a.Number).FirstOrDefault()?.Selected ?? false,
                                    Name = a.Name,
                                    CollectionAmount = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Select(s => s.CollectionAmount).FirstOrDefault(),
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;

                    case BillTypeEnum.PaymentReceiptBill:
                        {
                            options = result?.Select(a =>
                            {
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountCodeTypeId == a.Number).FirstOrDefault()?.Selected ?? false,
                                    Name = a.Name,
                                    CollectionAmount = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Select(s => s.CollectionAmount).FirstOrDefault(),
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;

                    case BillTypeEnum.AdvanceReceiptBill:
                        {
                            options = result?.Select(a =>
                            {
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountCodeTypeId == a.Number).FirstOrDefault()?.Selected ?? false,
                                    Name = a.Name,
                                    CollectionAmount = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Select(s => s.CollectionAmount).FirstOrDefault(),
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;

                    case BillTypeEnum.AdvancePaymentBill:
                        {
                            options = result?.Select(a =>
                            {
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountCodeTypeId == a.Number).FirstOrDefault()?.Selected ?? false,
                                    Name = a.Name,
                                    CollectionAmount = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Select(s => s.CollectionAmount).FirstOrDefault(),
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;

                    case BillTypeEnum.PurchaseBill:
                        {
                            options = result?.Select(a =>
                            {
                                var p = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).FirstOrDefault();
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountCodeTypeId == a.Number).FirstOrDefault()?.Selected ?? false,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Name = a.Name,
                                    CollectionAmount = p != null ? p.CollectionAmount : 0,
                                    Balance = (int)AccountingCodeEnum.AdvancePayment == a.AccountCodeTypeId ? AdvancePayment.Balance : 0,
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;

                    case BillTypeEnum.PurchaseReturnBill:
                        {
                            options = result?.Select(a =>
                            {
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Any(),
                                    Name = a.Name,
                                    CollectionAmount = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Select(s => s.CollectionAmount).FirstOrDefault(),
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;

                    case BillTypeEnum.CostExpenditureBill:
                        {
                            options = result?.Select(a =>
                            {
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountCodeTypeId == a.Number).FirstOrDefault()?.Selected ?? false,
                                    Name = a.Name,
                                    CollectionAmount = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Select(s => s.CollectionAmount).FirstOrDefault(),
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;

                    case BillTypeEnum.FinancialIncomeBill:
                        {
                            options = result?.Select(a =>
                            {
                                return(new AccountingModel()
                                {
                                    Default = a.IsDefault,
                                    AccountingOptionId = a.Id,
                                    AccountCodeTypeId = a.AccountCodeTypeId,
                                    Name = a.Name,
                                    Selected = PaymentMethods.Selectes.Where(s => s.AccountCodeTypeId == a.Number).FirstOrDefault()?.Selected ?? false,
                                    CollectionAmount = PaymentMethods.Selectes.Where(s => s.AccountingOptionId == a.Id).Select(s => s.CollectionAmount).FirstOrDefault(),
                                    ParentId = a.ParentId,
                                    Number = a.Number
                                });
                            }).ToList();
                        }
                        break;
                    }
                    return(options);
                });

                //初始
                Accounts = results.Result;

                //RootNodes
                var rootNodes = ProcessXamlItemGroups(GroupData(results.Result));
                //foreach (var node in rootNodes)
                //{
                //    //StackLayout
                //    var xamlItemGroup = (XamlItemGroup)node.BindingContext;
                //}

                this.RootNodes = rootNodes;

                MessagingCenter.Send(rootNodes, Constants.MorePayments);

                return(rootNodes.ToList());
            });


            this.BindBusyCommand(Load);
        }
Пример #34
0
    public void BuyItem(BuyItem rpc)
    {
        money -= rpc.item.price * rpc.amount;
        for (int i = 0; i < rpc.amount; i++)
            AddItem(rpc.item);

        var s = new Sync(RPCType.Others, "", "money");
        s.signallerID = networkID;
        s.sender = userName;
        Sync(s);
    }
Пример #35
0
        public void Sync_CopyUpdatesFrom(string tableName, List <DatabaseColumn> originalColumns, DbDataReader syncReader, SyncLogMessageCallback onMessage, Queue <object> leftovers)
        {
            List <DatabaseColumn> usableColumns = new List <DatabaseColumn>();

            usableColumns.AddRange(originalColumns);

            DatabaseColumn idColumn = Sync.GetIdColumn(usableColumns);

            usableColumns.Remove(idColumn);

            SQLiteConnection connection = GetConnectionForTable(tableName);
            SQLiteCommand    cmd        = connection.CreateCommand();

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE {0} SET ", tableName);
            for (int i = 0; i < usableColumns.Count; i++)
            {
                cmd.Parameters.Add(usableColumns[i].ParameterName, usableColumns[i].DbType);
                sb.AppendFormat("{0} = {1}", usableColumns[i].ColumnName, usableColumns[i].ParameterName);
                if (i != usableColumns.Count - 1)
                {
                    sb.AppendFormat(", ");
                }
            }

            int updatesDone  = 0;
            int nextProgress = 1;

            cmd.Parameters.Add(idColumn.ParameterName, idColumn.DbType);
            sb.AppendFormat(" WHERE {0} = {1}", idColumn.ColumnName, idColumn.ParameterName);
            cmd.CommandText = sb.ToString();

            while (syncReader.Read())
            {
                foreach (DatabaseColumn column in usableColumns)
                {
                    if (column.DbType == DbType.Binary)
                    {
                        byte[] buffer = syncReader.GetByteArray(column.Ordingal);
                        if (buffer != null)
                        {
                            cmd.Parameters[column.ParameterName].Value = buffer;
                        }
                    }
                    else
                    {
                        object o = syncReader.GetValue(column.Ordingal);
                        cmd.Parameters[column.ParameterName].Value = o;
                    }
                }

                cmd.Parameters[idColumn.ParameterName].Value = syncReader.GetValue(idColumn.Ordingal);
                int result = cmd.ExecuteNonQuery();
                switch (result)
                {
                case 0:
                    leftovers.Enqueue(cmd.Parameters[idColumn.ParameterName].Value);
                    break;

                case 1:
                    Console.WriteLine("update ok: {0} {1}", tableName, syncReader.GetValue(idColumn.Ordingal));
                    break;

                default:
                    Console.WriteLine("update failed: {0} {1}", tableName, syncReader.GetValue(idColumn.Ordingal));
                    break;
                }

                if (updatesDone++ == nextProgress)
                {
                    onMessage.Invoke(String.Format("{0} Zeilen in {1} aktualisiert.", nextProgress, tableName));
                    nextProgress *= 2;
                }
            }
            cmd.Dispose();
            syncReader.Dispose();
        }
Пример #36
0
    public void SerializedPlayer(SerializedPlayer rpc)
    {
        if (isLocal)
            return;
        if (rpc.data.Length <= 1)
            return;
        Deserialize(rpc.data);

        //Deserialize only set the field _weapon, not the property weapon. so, we should call this property manually.
        weapon = weapon;
        //Weapon Sync;
        Sync s = new Sync(RPCType.Others | RPCType.Buffered, "", "weapon");
        s.signallerID = networkID;
        s.sender = userName;
        Sync(s);

        //same as weapon
        accessory = accessory;
        s = new Sync(RPCType.Others | RPCType.Buffered, "", "accessory");
        s.signallerID = networkID;
        s.sender = userName;
        Sync(s);

        //itemStack Sync
        s = new Sync(RPCType.Others | RPCType.Buffered, "", "itemStacks");
        s.signallerID = networkID;
        s.sender = userName;
        Sync(s);

        //itemStack Sync
        s = new Sync(RPCType.Others | RPCType.Buffered, "", "gotQuest");
        s.signallerID = networkID;
        s.sender = userName;
        Sync(s);

        //money Sync
        s = new Sync(RPCType.Others | RPCType.Buffered, "", "money");
        s.signallerID = networkID;
        s.sender = userName;
        Sync(s);
    }
Пример #37
0
        public void UpdateDatabaseSyncStatus(int databaseId, Sync.Statuses status)
        {
            if (!ActiveDatabase || ActiveDatabaseId != databaseId)
                return;

            var database = Model.Databases.Get(databaseId);
            var databaseMeta = Model.DatabasesMeta.Get(database.DatabaseMetaId);
            if (status == Sync.Statuses.Syncing)
                lblDatabaseName.Text = databaseMeta.Name + @" (syncing)";
            else if (status == Sync.Statuses.Offline)
                lblDatabaseName.Text = databaseMeta.Name + @" (offline)";
            else
                lblDatabaseName.Text = databaseMeta.Name;
        }
Пример #38
0
 public void Dispose()
 {
     IsInitSuccess = false;
     Sync.Dispose();
 }
        public LoadIngamePlayerOrObserverUILogic(Widget widget, World world)
        {
            var ingameRoot = widget.Get("INGAME_ROOT");
            var worldRoot  = ingameRoot.Get("WORLD_ROOT");
            var menuRoot   = ingameRoot.Get("MENU_ROOT");
            var playerRoot = worldRoot.Get("PLAYER_ROOT");

            if (world.LocalPlayer == null)
            {
                Game.LoadWidget(world, "OBSERVER_WIDGETS", playerRoot, new WidgetArgs());
            }
            else
            {
                var playerWidgets = Game.LoadWidget(world, "PLAYER_WIDGETS", playerRoot, new WidgetArgs());
                var sidebarTicker = playerWidgets.Get <LogicTickerWidget>("SIDEBAR_TICKER");
                var objectives    = world.LocalPlayer.PlayerActor.Info.TraitInfoOrDefault <MissionObjectivesInfo>();

                sidebarTicker.OnTick = () =>
                {
                    // Switch to observer mode after win/loss
                    if (world.LocalPlayer.WinState != WinState.Undefined && !loadingObserverWidgets)
                    {
                        loadingObserverWidgets = true;
                        Game.RunAfterDelay(objectives != null ? objectives.GameOverDelay : 0, () =>
                        {
                            if (!Game.IsCurrentWorld(world))
                            {
                                return;
                            }

                            playerRoot.RemoveChildren();
                            Game.LoadWidget(world, "OBSERVER_WIDGETS", playerRoot, new WidgetArgs());
                        });
                    }
                };
            }

            Game.LoadWidget(world, "CHAT_PANEL", worldRoot, new WidgetArgs());

            world.GameOver += () =>
            {
                Ui.CloseWindow();
                menuRoot.RemoveChildren();

                if (world.LocalPlayer != null)
                {
                    var scriptContext = world.WorldActor.TraitOrDefault <LuaScript>();
                    var missionData   = world.WorldActor.Info.TraitInfoOrDefault <MissionDataInfo>();
                    if (missionData != null && !(scriptContext != null && scriptContext.FatalErrorOccurred))
                    {
                        var video = world.LocalPlayer.WinState == WinState.Won ? missionData.WinVideo : missionData.LossVideo;
                        if (!string.IsNullOrEmpty(video))
                        {
                            Media.PlayFMVFullscreen(world, video, () => { });
                        }
                    }
                }

                var optionsButton = playerRoot.GetOrNull <MenuButtonWidget>("OPTIONS_BUTTON");
                if (optionsButton != null)
                {
                    Sync.CheckSyncUnchanged(world, optionsButton.OnClick);
                }
            };
        }
Пример #40
0
        public async Task ExecuteAsync(Parameter parameter)
        {
            if (!IsInitSuccess)
            {
                return;
            }

            if (parameter.Parameters.Length > MaxParameterCount)
            {
                ShellOut.Error("Too many arguments.");
                return;
            }

            await Sync.WaitAsync().ConfigureAwait(false);

            MorseCore morseCore = GpioMorseTranslator.GetCore();
            string    morse     = string.Empty;

            try {
                if (OnExecuteFunc != null)
                {
                    if (OnExecuteFunc.Invoke(parameter))
                    {
                        return;
                    }
                }

                switch (parameter.ParameterCount)
                {
                case 1 when !string.IsNullOrEmpty(parameter.Parameters[0]):
                    morse = morseCore.ConvertToMorseCode(parameter.Parameters[0]);

                    if (string.IsNullOrEmpty(morse) || !morseCore.IsValidMorse(morse))
                    {
                        ShellOut.Error("Failed to verify generated morse code.");
                        return;
                    }

                    ShellOut.Info(">>> " + morse);
                    return;

                case 2 when !string.IsNullOrEmpty(parameter.Parameters[0]) && !string.IsNullOrEmpty(parameter.Parameters[1]):
                    morse = morseCore.ConvertToMorseCode(parameter.Parameters[0]);

                    if (string.IsNullOrEmpty(morse) || !morseCore.IsValidMorse(morse))
                    {
                        ShellOut.Error("Failed to verify generated morse code.");
                        return;
                    }

                    ShellOut.Info(">>> " + morse);
                    GpioMorseTranslator?translator = PiGpioController.GetMorseTranslator();

                    if (translator == null || !translator.IsTranslatorOnline)
                    {
                        ShellOut.Error("Morse translator might be offline.");
                        return;
                    }

                    if (!int.TryParse(parameter.Parameters[1], out int relayNumber))
                    {
                        ShellOut.Error("Relay number argument is invalid.");
                        return;
                    }

                    if (!PinController.IsValidPin(PiGpioController.AvailablePins.OutputPins[relayNumber]))
                    {
                        ShellOut.Error("The specified pin is invalid.");
                        return;
                    }

                    await translator.RelayMorseCycle(morse, PiGpioController.AvailablePins.OutputPins[relayNumber]);

                    ShellOut.Info("Completed!");
                    return;

                default:
                    ShellOut.Error("Command seems to be in incorrect syntax.");
                    return;
                }
            }
            catch (Exception e) {
                ShellOut.Exception(e);
                return;
            }
            finally {
                Sync.Release();
            }
        }
Пример #41
0
        protected override void ShowPage()
        {
            #region 临时帐号发帖
            //int realuserid = -1;
            //bool tempaccountspost = false;
            //string tempusername = DNTRequest.GetString("tempusername");
            //if (!Utils.StrIsNullOrEmpty(tempusername) && tempusername != username)
            //{
            //    realuserid = Users.CheckTempUserInfo(tempusername, DNTRequest.GetString("temppassword"), DNTRequest.GetInt("question", 0), DNTRequest.GetString("answer"));
            //    if (realuserid == -1)
            //    {
            //        AddErrLine("临时帐号登录失败,无法继续发帖。");
            //        return;
            //    }
            //    else
            //    {
            //        userid = realuserid;
            //        username = tempusername;
            //        tempaccountspost = true;
            //    }
            //}
            #endregion

            if (userid > 0)
            {
                userinfo = Users.GetShortUserInfo(userid);
            }

            #region 判断是否是灌水
            AdminGroupInfo admininfo = AdminGroups.GetAdminGroupInfo(usergroupid);
            if (admininfo != null)
            {
                disablepost = admininfo.Disablepostctrl;
            }

            if (!UserAuthority.CheckPostTimeSpan(usergroupinfo, admininfo, oluserinfo, userinfo, ref msg))
            {
                if (continuereply != "")
                {
                    AddErrLine("<b>回帖成功</b><br />由于" + msg + "后刷新继续");
                }
                else
                {
                    AddErrLine(msg);
                }
                return;
            }
            #endregion

            //获取主题帖信息
            PostInfo postinfo = GetPostAndTopic(admininfo);
            if (IsErr())
            {
                return;
            }

            forum     = Forums.GetForumInfo(forumid);
            smileyoff = 1 - forum.Allowsmilies;
            bbcodeoff = (forum.Allowbbcode == 1 && usergroupinfo.Allowcusbbcode == 1) ? 0 : 1;
            allowimg  = forum.Allowimgcode;
            needaudit = UserAuthority.NeedAudit(forum, useradminid, topic, userid, disablepost, usergroupinfo);
            #region  附件信息绑定
            //得到用户可以上传的文件类型
            string attachmentTypeSelect = Attachments.GetAllowAttachmentType(usergroupinfo, forum);
            attachextensions       = Attachments.GetAttachmentTypeArray(attachmentTypeSelect);
            attachextensionsnosize = Attachments.GetAttachmentTypeString(attachmentTypeSelect);
            //得到今天允许用户上传的附件总大小(字节)
            int MaxTodaySize = (userid > 0 ? MaxTodaySize = Attachments.GetUploadFileSizeByuserid(userid) : 0);
            attachsize = usergroupinfo.Maxsizeperday - MaxTodaySize;//今天可上传得大小
            //是否有上传附件的权限
            canpostattach = UserAuthority.PostAttachAuthority(forum, usergroupinfo, userid, ref msg);

            if (canpostattach && (userinfo != null && userinfo.Uid > 0) && apb != null && config.Enablealbum == 1 &&
                (UserGroups.GetUserGroupInfo(userinfo.Groupid).Maxspacephotosize - apb.GetPhotoSizeByUserid(userid) > 0))
            {
                caninsertalbum = true;
                albumlist      = apb.GetSpaceAlbumByUserId(userid);
            }
            #endregion

            if (!Utils.StrIsNullOrEmpty(forum.Password) && Utils.MD5(forum.Password) != ForumUtils.GetCookie("forum" + forumid + "password"))
            {
                AddErrLine("本版块被管理员设置了密码");
                SetBackLink(base.ShowForumAspxRewrite(forumid, 0));
                return;
            }

            #region 访问和发帖权限校验
            if (!UserAuthority.VisitAuthority(forum, usergroupinfo, userid, ref msg))
            {
                AddErrLine(msg);
                needlogin = true;
                return;
            }
            if (!UserAuthority.PostReply(forum, userid, usergroupinfo, topic))
            {
                AddErrLine(topic.Closed == 1 ? "主题已关闭无法回复" : "您没有发表回复的权限");
                needlogin = (topic.Closed == 1 ? false : true);
                return;
            }

            if (!UserAuthority.CheckPostTimeSpan(usergroupinfo, admininfo, oluserinfo, userinfo, ref msg))
            {
                AddErrLine(msg);
                return;
            }
            #endregion

            // 如果是受灌水限制用户, 则判断是否是灌水
            if (admininfo != null)
            {
                disablepost = admininfo.Disablepostctrl;
            }

            if (forum.Templateid > 0)
            {
                templatepath = Templates.GetTemplateItem(forum.Templateid).Directory;
            }

            AddLinkCss(BaseConfigs.GetForumPath + "templates/" + templatepath + "/editor.css", "css");
            customeditbuttons = Caches.GetCustomEditButtonList();
            //如果是提交...
            if (ispost)
            {
                string backlink = (DNTRequest.GetInt("topicid", -1) > 0 ?
                                   string.Format("postreply.aspx?topicid={0}&restore=1&forumpage=" + forumpageid, topicid) :
                                   string.Format("postreply.aspx?postid={0}&restore=1&forumpage=" + forumpageid, postid));

                if (!DNTRequest.GetString("quote").Equals(""))
                {
                    backlink = string.Format("{0}&quote={1}", backlink, DNTRequest.GetString("quote"));
                }

                SetBackLink(backlink);

                #region 验证提交信息
                //常规项验证
                NormalValidate(admininfo, postmessage, userinfo);

                if (IsErr())
                {
                    return;
                }
                #endregion

                //是否有上传附件的权限
                canpostattach = UserAuthority.PostAttachAuthority(forum, usergroupinfo, userid, ref msg);

                // 产生新帖子
                if (!string.IsNullOrEmpty(DNTRequest.GetFormString("toreplay_user").Trim()))
                {
                    postmessage = DNTRequest.GetFormString("toreplay_user").Trim() + "\n\n" + postmessage;
                }

                postinfo = CreatePostInfo(postmessage);

                //获取被回复帖子的作者uid
                int replyUserid = postid > 0 ? Posts.GetPostInfo(topicid, postid).Posterid : postinfo.Posterid;
                postid = postinfo.Pid;
                if (IsErr())
                {
                    return;
                }

                #region 当回复成功后,发送通知
                if (postinfo.Pid > 0 && DNTRequest.GetString("postreplynotice") == "on")
                {
                    Notices.SendPostReplyNotice(postinfo, topic, replyUserid);
                }
                #endregion

                //向第三方应用同步数据
                Sync.Reply(postid.ToString(), topic.Tid.ToString(), topic.Title, postinfo.Poster, postinfo.Posterid.ToString(), topic.Fid.ToString(), "");

                //更新主题相关信息
                //UpdateTopicInfo(postmessage);

                #region 处理附件
                //处理附件
                StringBuilder    sb             = new StringBuilder();
                AttachmentInfo[] attachmentinfo = null;
                string           attachId       = DNTRequest.GetFormString("attachid");
                if (!string.IsNullOrEmpty(attachId))
                {
                    attachmentinfo = Attachments.GetNoUsedAttachmentArray(userid, attachId);
                    Attachments.UpdateAttachment(attachmentinfo, topic.Tid, postinfo.Pid, postinfo, ref sb, userid, config, usergroupinfo);
                }

                //加入相册
                if (config.Enablealbum == 1 && apb != null)
                {
                    sb.Append(apb.CreateAttachment(attachmentinfo, usergroupid, userid, username));
                }
                #endregion

                OnlineUsers.UpdateAction(olid, UserAction.PostReply.ActionID, forumid, forum.Name, topicid, topictitle);

                #region 设置提示信息和跳转链接
                //辩论地址
                if (topic.Special == 4)
                {
                    SetUrl(Urls.ShowDebateAspxRewrite(topicid));
                }
                else if (infloat == 0)//此处加是否弹窗提交判断是因为在IE6下弹窗提交会造成gettopicinfo, getpostlist(位于showtopic页面)被提交了两次
                {
                    SetUrl(string.Format("showtopic.aspx?forumpage={0}&topicid={1}&page=end&jump=pid#{2}", forumpageid, topicid, postid));
                }

                if (DNTRequest.GetFormString("continuereply") == "on")
                {
                    SetUrl("postreply.aspx?topicid=" + topicid + "&forumpage=" + forumpageid + "&continuereply=yes");
                }

                if (sb.Length > 0)
                {
                    UpdateUserCredits(Forums.GetValues(forum.Replycredits));
                    SetMetaRefresh(5);
                    SetShowBackLink(true);
                    if (infloat == 1)
                    {
                        AddErrLine(sb.ToString());
                        return;
                    }
                    else
                    {
                        AddMsgLine("<table cellspacing=\"0\" cellpadding=\"4\" border=\"0\"><tr><td colspan=2 align=\"left\"><span class=\"bold\"><nobr>发表回复成功,但图片/附件上传出现问题:</nobr></span><br /></td></tr></table>");
                    }
                }
                else
                {
                    SetMetaRefresh();
                    SetShowBackLink(false);
                    //上面已经进行用户组判断
                    if (postinfo.Invisible == 1)
                    {
                        AddMsgLine(string.Format("发表回复成功, 但需要经过审核才可以显示. {0}<br /><br />(<a href=\"" + base.ShowForumAspxRewrite(forumid, 0) + "\">点击这里返回 {1}</a>)", (DNTRequest.GetFormString("continuereply") == "on" ? "继续回复" : "返回该主题"), forum.Name));
                    }
                    else
                    {
                        UpdateUserCredits(Forums.GetValues(forum.Replycredits));
                        MsgForward("postreply_succeed");
                        AddMsgLine(string.Format("发表回复成功, {0}<br />(<a href=\"" + base.ShowForumAspxRewrite(forumid, 0) + "\">点击这里返回 {1}</a>)<br />", (DNTRequest.GetFormString("continuereply") == "on" ? "继续回复" : "返回该主题"), forum.Name));
                    }
                }
                #endregion

                // 删除主题游客缓存
                if (topic.Replies < (config.Ppp + 10))
                {
                    ForumUtils.DeleteTopicCacheFile(topicid);
                }

                //发送邮件通知
                if (DNTRequest.GetString("emailnotify") == "on" && topic.Posterid != -1 && topic.Posterid != userid)
                {
                    SendNotifyEmail(Users.GetShortUserInfo(topic.Posterid).Email.Trim(), postinfo, Utils.GetRootUrl(BaseConfigs.GetForumPath) + string.Format("showtopic.aspx?topicid={0}&page=end&jump=pid#{1}", topicid, postid));
                }
            }
        }
Пример #42
0
        /*
         * Description:
         *      每个用户UID 15秒内只能调用一次该接口,否则无法更新成功
         */
        public override bool Run(CommandParameter commandParam, ref string result)
        {
            if (commandParam.AppInfo.ApplicationType == (int)ApplicationType.DESKTOP)
            {
                if (commandParam.LocalUid < 1)
                {
                    result = Util.CreateErrorMessage(ErrorType.API_EC_SESSIONKEY, commandParam.ParamList);
                    return(false);
                }

                if (Discuz.Forum.Users.GetShortUserInfo(commandParam.LocalUid).Adminid != 1)
                {
                    result = Util.CreateErrorMessage(ErrorType.API_EC_PERMISSION_DENIED, commandParam.ParamList);
                    return(false);
                }
            }

            if (!commandParam.CheckRequiredParams("uids,additional_values"))
            {
                result = Util.CreateErrorMessage(ErrorType.API_EC_PARAM, commandParam.ParamList);
                return(false);
            }

            string[] values = commandParam.GetDNTParam("additional_values").ToString().Split(',');
            string[] uids   = commandParam.GetDNTParam("uids").ToString().Split(',');

            if (!Utils.IsNumericArray(uids) || !Utils.IsNumericArray(values) || uids.Length > 100)
            {
                result = Util.CreateErrorMessage(ErrorType.API_EC_PARAM, commandParam.ParamList);
                return(false);
            }

            if (values.Length != 8)
            {
                result = Util.CreateErrorMessage(ErrorType.API_EC_PARAM, commandParam.ParamList);
                return(false);
            }

            List <float> list = new List <float>();

            for (int i = 0; i < values.Length; i++)
            {
                list.Add(Utils.StrToFloat(values[i], 0));
            }

            foreach (string uId in uids)
            {
                int id = TypeConverter.StrToInt(uId);
                if (id == 0)
                {
                    continue;
                }

                if (!CommandCacheQueue <SetExtCreditItem> .EnQueue(new SetExtCreditItem(id, DateTime.Now.Ticks)))
                {
                    continue;
                }

                CreditsFacade.UpdateUserExtCredits(id, list.ToArray(), true);
                CreditsFacade.UpdateUserCredits(id);

                //向第三方应用同步积分
                for (int i = 0; i < list.Count; i++)
                {
                    if (list[i] != 0.0)
                    {
                        Sync.UpdateCredits(TypeConverter.StrToInt(uId), i + 1, list[i].ToString(), commandParam.AppInfo.APIKey);
                    }
                }
            }

            if (commandParam.Format == FormatType.JSON)
            {
                result = "true";
            }
            else
            {
                SetExtCreditsResponse secr = new SetExtCreditsResponse();
                secr.Successfull = 1;
                result           = SerializationHelper.Serialize(secr);
            }
            return(true);
        }
Пример #43
0
 public OrderHeaderSyncTable(Sync sync)
 {
     table = sync.GetTable <OrderHeader>();
 }
Пример #44
0
 public static void Sync(Uri source, Uri dest, Sync.Mode mode, string logfile, string excludePaths = "", bool verbose = false)
 {
     Services.Sync.Files(source, dest, mode, logfile, excludePaths, verbose);
 }
Пример #45
0
 public ClickSync(Finish finish, Sync sync)
 {
     _finish = finish;
     _sync   = sync;
 }
Пример #46
0
    public void Sync(Sync sync)
    {
        if(isServer)
        {
            sync.receiver = sync.sender;

            var tokens = sync.member.Split(new[] { '.' });
            object instance = null;
            FieldInfo field = null;
            PropertyInfo property = null;
            foreach (var token in tokens)
            {
                if (field == null && property == null)
                {
                    instance = this;
                    field = GetType().GetField(token);
                    property = GetType().GetProperty(token);
                }
                else
                {
                    if (field != null)
                    {
                        instance = field.GetValue(instance);
                        field = field.FieldType.GetField(token);
                        property = field.FieldType.GetProperty(token);
                    }
                    else
                    {
                        instance = property.GetValue(instance, null);
                        field = property.PropertyType.GetField(token);
                        property = property.PropertyType.GetProperty(token);
                    }
                }
            }
            if (field != null)
            {
                var value = field.GetValue(instance);
                var autoSerializable = value as IAutoSerializable;
                if (autoSerializable != null)
                    sync.data = autoSerializable;
                else
                    sync.data = (Body)Activator.CreateInstance(Type.GetType("TeraTaleNet.Serializable" + field.FieldType.Name + ", TeraTaleNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"), field.GetValue(instance));
                Send(sync);
            }
            else
            {
                var value = property.GetValue(instance, null);
                var autoSerializable = value as IAutoSerializable;
                if (autoSerializable != null)
                    sync.data = autoSerializable;
                else
                    sync.data = (Body)Activator.CreateInstance(Type.GetType("TeraTaleNet.Serializable" + property.PropertyType.Name + ", TeraTaleNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"), property.GetValue(instance, null));
                Send(sync);
            }
        }
        else
        {
            var tokens = sync.member.Split(new[] { '.' });
            object instance = null;
            FieldInfo field = null;
            PropertyInfo property = null;
            foreach (var token in tokens)
            {
                if (field == null && property == null)
                {
                    instance = this;
                    field = GetType().GetField(token);
                    property = GetType().GetProperty(token);
                }
                else
                {
                    if (field != null)
                    {
                        instance = field.GetValue(instance);
                        field = field.FieldType.GetField(token);
                        property = field.FieldType.GetProperty(token);
                    }
                    else
                    {
                        instance = property.GetValue(instance, null);
                        field = property.PropertyType.GetField(token);
                        property = property.PropertyType.GetProperty(token);
                    }
                }
            }
            if(field != null)
            {
                var value = field.GetValue(instance);
                var autoSerializable = value as IAutoSerializable;
                if (autoSerializable != null)
                    field.SetValue(instance, sync.data);
                else
                    field.SetValue(instance, sync.data.GetType().GetField("value").GetValue(sync.data));
                OnSynced(sync);
            }
            else
            {
                var value = property.GetValue(instance, null);
                var autoSerializable = value as IAutoSerializable;
                if (autoSerializable != null)
                    property.SetValue(instance, sync.data, null);
                else
                    property.SetValue(instance, sync.data.GetType().GetField("value").GetValue(sync.data), null);
                OnSynced(sync);
            }
        }
    }
        /// <summary>
        /// This method is used to verify requirements related to Sync command.
        /// </summary>
        /// <param name="syncResult">The Sync result returned from the server.</param>
        private void VerifySyncCommandResponse(Sync syncResult)
        {
            // If the schema validation is successful, then following requirements can be captured.
            Site.Assert.IsTrue(this.activeSyncClient.ValidationResult, "Schema validation should be successful.");

            if (syncResult.Email.Subject != null)
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R74");

                // Verify MS-ASCON requirement: MS-ASCON_R74
                // The ConversationId element is not null, so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    syncResult.Email.ConversationId,
                    74,
                    @"[In ConversationId (Sync)] The email2:ConversationId element ([MS-ASEMAIL] section 2.2.2.14) is a required child element of the airsync:ApplicationData element ([MS-ASCMD] section 2.2.3.11) in a Sync command response ([MS-ASCMD] section 2.2.2.19) that specifies the conversation ID of a conversation.");

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R76");

                // Verify MS-ASCON requirement: MS-ASCON_R76
                // The ConversationId element is not null, so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    syncResult.Email.ConversationId,
                    76,
                    @"[In ConversationId (Sync)] The value of this [email2:ConversationId] element is a byte array, as specified in [MS-ASDTYPE] section 2.6.1.");

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R195");

                // Verify MS-ASCON requirement: MS-ASCON_R195
                // The ConversationId element is not null, so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    syncResult.Email.ConversationId,
                    195,
                    @"[In Higher-Layer Triggered Events] The conversation ID is specified by the email2:ConversationId element ([MS-ASEMAIL] section 2.2.2.14) that is included in the Email class.");

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R79");

                // Verify MS-ASCON requirement: MS-ASCON_R79
                // The ConversationIndex element is not null, so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    syncResult.Email.ConversationIndex,
                    79,
                    @"[In ConversationIndex] The email2:ConversationIndex element ([MS-ASEMAIL] section 2.2.2.15) is a required child element of the airsync:ApplicationData element ([MS-ASCMD] section 2.2.3.11) in a Sync command response ([MS-ASCMD] section 2.2.2.19) that specifies the conversation index for an e-mail message.");

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R196");

                // Verify MS-ASCON requirement: MS-ASCON_R196
                // The ConversationIndex element is not null, so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    syncResult.Email.ConversationIndex,
                    196,
                    @"[In Higher-Layer Triggered Events] The conversation index is specified by the email2:ConversationIndex element ([MS-ASEMAIL] section 2.2.2.15) that is included in the Email class.");

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R81");

                // Verify MS-ASCON requirement: MS-ASCON_R81
                // The ConversationIndex element is not null, so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    syncResult.Email.ConversationIndex,
                    81,
                    @"[In ConversationIndex] The value of this element [email2:ConversationIndex] is a byte array, as specified in [MS-ASDTYPE] section 2.6.1.");

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R93");

                // Verify MS-ASCON requirement: MS-ASCON_R93
                // The ConversationIndex element is not null, so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    syncResult.Email.ConversationIndex,
                    93,
                    @"[In ConversationIndex] The content of the email2:ConversationIndex element is transferred as a byte array within the WBXML tags.");

                this.VerifyStringDataType();

                if (syncResult.Email.BodyPart != null)
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R46");

                    // Verify MS-ASCON requirement: MS-ASCON_R46
                    // The schema has been validated, so this requirement can be captured.
                    Site.CaptureRequirement(
                        46,
                        @"[In BodyPart] The airsyncbase:BodyPart element is a container ([MS-ASDTYPE] section 2.2) element.");

                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R47");

                    // Verify MS-ASCON requirement: MS-ASCON_R47
                    // The schema has been validated, so this requirement can be captured.
                    Site.CaptureRequirement(
                        47,
                        @"[In BodyPart] It [airsyncbase:BodyPart element] has the following child elements:
airsyncbase:Status ([MS-ASAIRS] section 2.2.2.19)
airsyncbase:Type ([MS-ASAIRS] section 2.2.2.22.2)
airsyncbase:EstimatedDataSize ([MS-ASAIRS] section 2.2.2.12.3)
airsyncbase:Truncated ([MS-ASAIRS] section 2.2.2.20.2)
airsyncbase:Data ([MS-ASAIRS] section 2.2.2.10.2)
airsyncbase:Preview ([MS-ASAIRS] section 2.2.2.18.2).");

                    this.VerifyContainerDataType();
                }
            }
        }
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            SharedInitialization.Initialize();
            InitializeUWP.Initialize();

            taskInstance.Canceled += TaskInstance_Canceled;

            var deferral = taskInstance.GetDeferral();


            try
            {
                RawNotification notification = (RawNotification)taskInstance.TriggerDetails;

                long accountId = UWPPushExtension.GetAccountIdFromRawNotification(notification);

                if (accountId == 0)
                {
                    return;
                }

                AccountDataItem account = (await AccountsManager.GetAllAccounts()).FirstOrDefault(i => i.AccountId == accountId);

                if (account == null)
                {
                    return;
                }

                var cancellationToken = _cancellationTokenSource.Token;

                try
                {
                    cancellationToken.ThrowIfCancellationRequested();

                    var result = await Sync.SyncAccountAsync(account);

                    // If succeeded
                    if (result != null && result.Error == null)
                    {
                        // Flag as updated by background task so foreground app can update data
                        AccountDataStore.SetUpdatedByBackgroundTask();
                    }

                    // Need to wait for the tile/toast tasks to finish before we release the deferral
                    if (result != null && result.SaveChangesTask != null)
                    {
                        await result.SaveChangesTask.WaitForAllTasksAsync();
                    }
                }

                catch (OperationCanceledException) { }

                // Wait for the calendar integration to complete
                await AppointmentsExtension.Current?.GetTaskForAllCompleted();
            }

            catch (Exception ex)
            {
                TelemetryExtension.Current?.TrackException(ex);
            }

            finally
            {
                deferral.Complete();
            }
        }
 public void ThenTheTheNewServiceNameServiceTestExist(string name)
 {
     Sync.ExplicitWait(1);
     AppointmentManagerPages.MyServicesPage.ServiceNameSecondRow(name).Exists().Should().BeTrue();
 }
Пример #50
0
		private static void Usage () {

				Console.WriteLine ("brief");
				Console.WriteLine ("");

				{
#pragma warning disable 219
					Reset		Dummy = new Reset ();
#pragma warning restore 219

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

					Console.WriteLine ("    Delete all test profiles");

				}

				{
#pragma warning disable 219
					Device		Dummy = new Device ();
#pragma warning restore 219

					Console.Write ("{0}device ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.DeviceID.Usage (null, "id", UsageFlag));
					Console.Write ("[{0}] ", Dummy.DeviceDescription.Usage (null, "dd", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Default.Usage ("default", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Create new device profile");

				}

				{
#pragma warning disable 219
					Personal		Dummy = new Personal ();
#pragma warning restore 219

					Console.Write ("{0}personal ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Portal.Usage (null, "portal", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Description.Usage (null, "pd", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Next.Usage ("next", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.DeviceNew.Usage ("new", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.DeviceUDF.Usage ("dudf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.DeviceID.Usage ("did", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.DeviceDescription.Usage ("dd", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Create new personal profile");

				}

				{
#pragma warning disable 219
					Register		Dummy = new Register ();
#pragma warning restore 219

					Console.Write ("{0}register ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.UDF.Usage (null, "udf", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage (null, "portal", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Register the specified profile at a new portal");

				}

				{
#pragma warning disable 219
					Sync		Dummy = new Sync ();
#pragma warning restore 219

					Console.Write ("{0}sync ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Synchronize local copies of Mesh profiles with the server");

				}

				{
#pragma warning disable 219
					Escrow		Dummy = new Escrow ();
#pragma warning restore 219

					Console.Write ("{0}escrow ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Quorum.Usage ("quorum", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Shares.Usage ("shares", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Create a set of key escrow shares");

				}

				{
#pragma warning disable 219
					Export		Dummy = new Export ();
#pragma warning restore 219

					Console.Write ("{0}export ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.File.Usage (null, "file", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Export the specified profile data to the specified file");

				}

				{
#pragma warning disable 219
					Import		Dummy = new Import ();
#pragma warning restore 219

					Console.Write ("{0}import ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.File.Usage (null, "file", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Import the specified profile data to the specified file");

				}

				{
#pragma warning disable 219
					List		Dummy = new List ();
#pragma warning restore 219

					Console.Write ("{0}list ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    List all profiles on the local machine");

				}

				{
#pragma warning disable 219
					Dump		Dummy = new Dump ();
#pragma warning restore 219

					Console.Write ("{0}dump ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Describe the specified profile");

				}

				{
#pragma warning disable 219
					Pending		Dummy = new Pending ();
#pragma warning restore 219

					Console.Write ("{0}pending ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Get list of pending connection requests");

				}

				{
#pragma warning disable 219
					Connect		Dummy = new Connect ();
#pragma warning restore 219

					Console.Write ("{0}connect ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Portal.Usage (null, "portal", UsageFlag));
					Console.Write ("[{0}] ", Dummy.PIN.Usage ("pin", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.DeviceNew.Usage ("new", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.DeviceUDF.Usage ("dudf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.DeviceID.Usage ("did", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.DeviceDescription.Usage ("dd", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Connect to an existing profile registered at a portal");

				}

				{
#pragma warning disable 219
					Accept		Dummy = new Accept ();
#pragma warning restore 219

					Console.Write ("{0}accept ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.DeviceUDF.Usage (null, "udf", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Accept a pending connection");

				}

				{
#pragma warning disable 219
					Complete		Dummy = new Complete ();
#pragma warning restore 219

					Console.Write ("{0}complete ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Complete a pending connection request");

				}

				{
#pragma warning disable 219
					Password		Dummy = new Password ();
#pragma warning restore 219

					Console.Write ("{0}password ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Add a web application profile to a personal profile");

				}

				{
#pragma warning disable 219
					AddPassword		Dummy = new AddPassword ();
#pragma warning restore 219

					Console.Write ("{0}pwadd ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Site.Usage (null, "site", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Username.Usage (null, "user", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Password.Usage (null, "password", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Add password entry");

				}

				{
#pragma warning disable 219
					GetPassword		Dummy = new GetPassword ();
#pragma warning restore 219

					Console.Write ("{0}pwget ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Site.Usage (null, "site", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Lookup password entry");

				}

				{
#pragma warning disable 219
					DeletePassword		Dummy = new DeletePassword ();
#pragma warning restore 219

					Console.Write ("{0}pwdelete ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Site.Usage (null, "site", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Delete password entry");

				}

				{
#pragma warning disable 219
					DumpPassword		Dummy = new DumpPassword ();
#pragma warning restore 219

					Console.Write ("{0}pwdump ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.JSON.Usage (null, "json", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Describe password entry");

				}

				{
#pragma warning disable 219
					Mail		Dummy = new Mail ();
#pragma warning restore 219

					Console.Write ("{0}mail ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.address.Usage (null, "address", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Add a mail application profile to a personal profile");

				}

				{
#pragma warning disable 219
					SSH		Dummy = new SSH ();
#pragma warning restore 219

					Console.Write ("{0}ssh ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Host.Usage (null, "host", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Client.Usage (null, "client", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Add a ssh application profile to a personal profile");

				}

			} // Usage 
Пример #51
0
 /// <summary> 
 ///	Creates an instance of <see cref="Spring.Threading.Locks.ReentrantLock"/> with the
 /// given fairness policy.
 /// </summary>
 /// <param name="fair"><see lang="true"/> if this lock will be fair, else <see lang="false"/>
 /// </param>
 public ReentrantLock(bool fair)
 {
     sync = (fair) ? (Sync)new FairSync() : new NonfairSync();
 }
Пример #52
0
        public void SetServerSyncStatus(int serverId, Sync.Statuses status)
        {
            foreach (var control in panelContentContainer.Controls)
            {
                var serverControl = (HomePageServer) control;
                if (serverControl.ServerAccountId != serverId)
                    continue;

                serverControl.SyncStatus = status;
            }
        }
Пример #53
0
 private void button2_Click(object sender, EventArgs e)
 {
     OpenFileDialog opfd = new OpenFileDialog();
     string source="";
     string destination="";
     
     opfd.Title = "Select the source of the files";
     if (opfd.ShowDialog() == DialogResult.OK || opfd.ShowDialog() == DialogResult.Yes)
     {
         
         FileInfo file = new FileInfo(opfd.FileName);
         source =file.DirectoryName ;
     }
     opfd.Title = "Select the destination of the files";
     if (opfd.ShowDialog() == DialogResult.OK || opfd.ShowDialog() == DialogResult.Yes)
     {
         FileInfo file = new FileInfo(opfd.FileName);
         destination = file.DirectoryName;
     }
     Sync sync = new Sync();
     sync.Synchronize(source, destination);
 }
Пример #54
0
        private TFF syncFolders(string directory, Sync option, string bkSubDir)
        {
            System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(directory);
            ArrayList dirList = new ArrayList();
            ArrayList dbList = new ArrayList();
            ArrayList buffer = new ArrayList();

            if (!dir.Exists)  //Create directory, if DNE
            {
                try
                {
                    dir.Create();
                }
                catch
                {
                    MessageBox.Show("Error creating folder " + dir.Name);
                    return TFF.FAIL;
                }
            }
            foreach (System.IO.DirectoryInfo y in dir.GetDirectories())  //Fill dirList with directories in "directory"
            {
                dirList.Add(y.Name);
            }
            for (int x = 0; x < bandIDDataGridView.RowCount; x++)  ////Fill DBList with bands in database
            {
                dbList.Add(Convert.ToString(bandIDDataGridView.Rows[x].Cells["dataGridViewTextBoxColumn2"].Value).Trim());
            }
            foreach (string a in dbList)  //Find any folders in dir that match files in database
            {
                foreach (string b in dirList)
                {
                    if (a == b)
                    {
                        buffer.Add(a);
                    }
                }
            }
            foreach (string c in buffer) //Remove any folders added to buffer
            {
                dbList.Remove(c);
                dirList.Remove(c);
            }
            if (option == Sync.MKCHANGE)
            {
                if (syncFoldersHelper(dbList, dirList, directory, bkSubDir))
                    return TFF.TRUE;
                else
                    return TFF.FAIL;
            }
            else if (option == Sync.PROMPT)
            {
                string temp = "Quartz Client folders have been changed ";
                temp += "outside of the program.  Would you like to allow quartz to ";
                temp += "overwrite these changes?";
                if (dbList.Count > 0 || dirList.Count > 0)
                {
                    promptResult = prompt(temp);
                    if (promptResult)
                    {
                        if (syncFoldersHelper(dbList, dirList, directory, bkSubDir))
                            return TFF.TRUE;
                        else
                            return TFF.FAIL;
                    }
                }
                else
                {
                    return TFF.FALSE;  //Nothing in folder
                }
            }
            else if (dbList.Count == 0 && dirList.Count == 0)
            {
                return TFF.TRUE;
            }
            else
            {
                return TFF.FALSE;
            }
            return TFF.FAIL;
        }
 public void ThenIDeleteTheNewCreatedService(string button)
 {
     Sync.ExplicitWait(2);
     AppointmentManagerPages.MyServicesPage.DeteleButtonSecondRow.Click();
     Sync.ExplicitWait(1);
 }
Пример #56
0
		public virtual void Sync ( Sync Options
				) {

			char UsageFlag = '-';
				{
#pragma warning disable 219
					Sync		Dummy = new Sync ();
#pragma warning restore 219

					Console.Write ("{0}sync ", UsageFlag);
					Console.Write ("[{0}] ", Dummy.Portal.Usage ("portal", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.UDF.Usage ("udf", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Verbose.Usage ("verbose", "value", UsageFlag));
					Console.Write ("[{0}] ", Dummy.Report.Usage ("report", "value", UsageFlag));
					Console.WriteLine ();

					Console.WriteLine ("    Synchronize local copies of Mesh profiles with the server");

				}

				Console.WriteLine ("    {0}\t{1} = [{2}]", "String", 
							"Portal", Options.Portal);
				Console.WriteLine ("    {0}\t{1} = [{2}]", "String", 
							"UDF", Options.UDF);
				Console.WriteLine ("    {0}\t{1} = [{2}]", "Flag", 
							"Verbose", Options.Verbose);
				Console.WriteLine ("    {0}\t{1} = [{2}]", "Flag", 
							"Report", Options.Report);
			Console.WriteLine ("Not Yet Implemented");
			}
 public void WhenITickUser()
 {
     Sync.ExplicitWait(1);
     AppointmentManagerPages.ServicesPage.MailLinkSecondRow.Click();
 }
 public void ThenICanTEditOthersUserProfile()
 {
     Sync.ExplicitWait(1);
     AppointmentManagerPages.MyProfilePage.EditProfileButton.Displayed.Should().BeFalse();
 }
        /// <summary>
        /// Verify the rights-managed requirements about Sync response.
        /// </summary>
        /// <param name="sync">The wrapper class of Sync response.</param>
        private void VerifySyncResponse(Sync sync)
        {
            if (sync != null)
            {
                Site.Assert.IsNotNull(sync.Email, "The expected rights-managed e-mail message should not be null.");
                if (sync.Email.RightsManagementLicense != null)
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASRM_R208");

                    // Verify MS-ASRM requirement: MS-ASRM_R208
                    Site.CaptureRequirementIfIsTrue(
                        this.activeSyncClient.ValidationResult,
                        208,
                        @"[In Sending Rights-Managed E-Mail Messages to the Client] To respond to a Sync command request message that includes the RightsManagementSupport element, the server includes the RightsManagementLicense element and its child elements in the Sync command response message.");

                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASRM_R209");

                    // Verify MS-ASRM requirement: MS-ASRM_R209
                    Site.CaptureRequirementIfIsTrue(
                        this.activeSyncClient.ValidationResult,
                        209,
                        @"[In Sending Rights-Managed E-Mail Messages to the Client] In a Sync command response, the RightsManagementLicense element is included as a child of the sync:ApplicationData element ([MS-ASCMD] section 2.2.3.11).");

                    this.VerifyRightsManagementLicense(sync.Email.RightsManagementLicense);
                }
            }
        }
Пример #60
0
 private void manageFolders(Sync option)
 {
     if (syncFolders(deClientDir, option, deBkupClientDir) != TFF.FAIL)
     {
         if (syncFolders(dePublishDir, Sync.MKCHANGE, deBkupPublishDir ) == TFF.FAIL)
         {
            // MessageBox.Show("Failed: " + dePublishDir);
         }
     }
     else
     {
       //  MessageBox.Show("Failed: " + deClientDir);
     }
 }