Esempio n. 1
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (PlayerId != 0)
        {
            hash ^= PlayerId.GetHashCode();
        }
        if (UserName.Length != 0)
        {
            hash ^= UserName.GetHashCode();
        }
        if (Role != 0)
        {
            hash ^= Role.GetHashCode();
        }
        if (IsReady != false)
        {
            hash ^= IsReady.GetHashCode();
        }
        if (Runes != 0)
        {
            hash ^= Runes.GetHashCode();
        }
        if (Faction != 0)
        {
            hash ^= Faction.GetHashCode();
        }
        if (_unknownFields != null)
        {
            hash ^= _unknownFields.GetHashCode();
        }
        return(hash);
    }
Esempio n. 2
0
        public void DoGenerateDbContext(DTE2 Dte, ITextTemplating textTemplating, string templatePath, string DestinationNameSpace, string DestinationClassName)
        {
            this.GenerateText  = "";
            this.GenerateError = "";
            OnPropertyChanged("GenerateText");
            OnPropertyChanged("GenerateError");
            ITextTemplatingSessionHost textTemplatingSessionHost = (ITextTemplatingSessionHost)textTemplating;

            textTemplatingSessionHost.Session = textTemplatingSessionHost.CreateSession();
            TPCallback tpCallback = new TPCallback();

            textTemplatingSessionHost.Session["DestinationNameSpace"] = DestinationNameSpace;
            textTemplatingSessionHost.Session["DestinationClassName"] = DestinationClassName;

            if (string.IsNullOrEmpty(GenText))
            {
                this.GenerateText = textTemplating.ProcessTemplate(templatePath, File.ReadAllText(templatePath), tpCallback);
            }
            else
            {
                this.GenerateText = textTemplating.ProcessTemplate(templatePath, GenText, tpCallback);
            }
            FileExtension = tpCallback.FileExtension;
            if (tpCallback.ProcessingErrors != null)
            {
                foreach (TPError tpError in tpCallback.ProcessingErrors)
                {
                    this.GenerateError = tpError.ToString() + "\n";
                }
            }
            OnPropertyChanged("GenerateText");
            OnPropertyChanged("GenerateError");
            IsReady.DoNotify(this, string.IsNullOrEmpty(this.GenerateError));
        }
Esempio n. 3
0
        public override bool TryGetLogger(out Common.ILogging logger)
        {
            if (IsReady.Equals(false))
            {
                return(base.TryGetLogger(out logger));
            }

            try
            {
                //Set the logger
                logger = RtpClient.Logger;

                return(true);
            }
            catch
            {
                logger = null;

                return(false);
            }
            finally
            {
                //
            }
        }
        public void DoGenerateViewModel(DTE2 Dte, ITextTemplating textTemplating, SelectedItem DestinationSelectedItem, string T4TempatePath, ModelView modelView)
        {
            this.GenerateText  = "";
            this.GenerateError = "";


            GeneratedModelView = new ModelViewSerializable();
            modelView.ModelViewAssingTo(GeneratedModelView);


            ITextTemplatingSessionHost textTemplatingSessionHost = (ITextTemplatingSessionHost)textTemplating;

            textTemplatingSessionHost.Session = textTemplatingSessionHost.CreateSession();
            TPCallback tpCallback = new TPCallback();

            textTemplatingSessionHost.Session["Model"] = GeneratedModelView;
            if (string.IsNullOrEmpty(GenText))
            {
                this.GenerateText = textTemplating.ProcessTemplate(T4TempatePath, File.ReadAllText(T4TempatePath), tpCallback);
            }
            else
            {
                this.GenerateText = textTemplating.ProcessTemplate(T4TempatePath, GenText, tpCallback);
            }
            FileExtension = tpCallback.FileExtension;
            if (tpCallback.ProcessingErrors != null)
            {
                foreach (TPError tpError in tpCallback.ProcessingErrors)
                {
                    this.GenerateError = tpError.ToString() + "\n";
                }
            }
            IsReady.DoNotify(this, string.IsNullOrEmpty(this.GenerateError));
        }
Esempio n. 5
0
 private void Awake()
 {
     if (Instance != null)
     {
         return;
     }
     Instance = this;
 }
        public void OnSelectedItemChanged()
        {
            bool ready = SelectedTreeViewItem != null;

            if (ready)
            {
                ready = SelectedTreeViewItem is SerializableViewModel;
            }
            else
            {
                SerializableViewModelVisibility           = Visibility.Collapsed;
                SerializableViewModelPropertyVisibility   = Visibility.Collapsed;
                SerializableViewModelForeignKeyVisibility = Visibility.Collapsed;
                HintVisibility = Visibility.Visible;
                VisibilityChangedNotification();
            }
            IsReady.DoNotify(this, ready);
            if (SelectedTreeViewItem == null)
            {
                return;
            }
            if (ready)
            {
                HintVisibility = Visibility.Collapsed;
                SerializableViewModelPropertyVisibility   = Visibility.Collapsed;
                SerializableViewModelForeignKeyVisibility = Visibility.Collapsed;
                SerializableViewModelVisibility           = Visibility.Visible;
            }
            else
            {
                if (SelectedTreeViewItem is SerializableViewModelProperty)
                {
                    HintVisibility = Visibility.Collapsed;
                    SerializableViewModelVisibility           = Visibility.Collapsed;
                    SerializableViewModelForeignKeyVisibility = Visibility.Collapsed;
                    SerializableViewModelPropertyVisibility   = Visibility.Visible;
                }
                else
                {
                    if (SelectedTreeViewItem is SerializableViewModelForeignKey)
                    {
                        HintVisibility = Visibility.Collapsed;
                        SerializableViewModelVisibility           = Visibility.Collapsed;
                        SerializableViewModelPropertyVisibility   = Visibility.Collapsed;
                        SerializableViewModelForeignKeyVisibility = Visibility.Visible;
                    }
                    else
                    {
                        SerializableViewModelVisibility           = Visibility.Collapsed;
                        SerializableViewModelPropertyVisibility   = Visibility.Collapsed;
                        SerializableViewModelForeignKeyVisibility = Visibility.Collapsed;
                        HintVisibility = Visibility.Visible;
                    }
                }
            }
            VisibilityChangedNotification();
        }
Esempio n. 7
0
        public void CheckIsReady()
        {
            bool rslt = (this.SelectedFeature != null) && (DbContext != null) && (AllowedFileTypes != null) && (FeatureItemsList != null);

            if (rslt)
            {
                rslt = (AllowedFileTypes.Items != null);
            }
            if (rslt)
            {
                rslt = (AllowedFileTypes.Items.Count > 0);
            }
            IsReady.DoNotify(this, rslt);
        }
Esempio n. 8
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(this.Name);
            foreach (var item in Sushis)
            {
                sb.Append(item.Name + ",");
            }
            sb.AppendLine();
            sb.AppendLine(IsTaken.ToString());
            sb.AppendLine(IsReady.ToString());
            sb.AppendLine(Time.ToString("HH:mm"));
            return(sb.ToString());
        }
Esempio n. 9
0
        public void CheckIsReady()
        {
            bool ready =
                _IsWebApiSelectAllMethod ||
                _IsWebApiSelectManyWithPaginationMethod ||
                _IsWebApiSelectOneByPrimarykeyMethod ||
                _IsWebApiAddItemMethod ||
                _IsWebApiUpdateItemMethod ||
                _IsWebApiDeleteItemMethod;

            if (ready)
            {
                ready = !string.IsNullOrEmpty(DestinationWebApiServiceName);
            }
            IsReady.DoNotify(this, ready);
        }
Esempio n. 10
0
        public void Ready(double width, double height)
        {
            _dim.Resize(width, height);
            var clientUpdate = new ClientUpdate()
            {
                Drawing   = GetDrawing(),
                Settings  = GetSettings(),
                Transform = GetDisplayTransform(),
            };

            PushUpdate(clientUpdate);
            if (!_readyEventFired)
            {
                _readyEventFired = true;
                IsReady?.Invoke(this, new EventArgs());
            }
        }
Esempio n. 11
0
        public void DoGenerateFeature(DTE2 Dte, ITextTemplating textTemplating, string T4TempatePath, DbContextSerializable SerializableDbContext, FeatureContextSerializable SerializableFeatureContext, FeatureSerializable feature, AllowedFileTypesSerializable AllowedFileTypes, string defaultProjectNameSpace = null)
        {
            this.GenerateText  = "";
            this.GenerateError = "";
            IsReady.DoNotify(this, false);
            if ((feature == null) || (SerializableDbContext == null) || (SerializableFeatureContext == null))
            {
                return;
            }
            GeneratedFeature = feature;

            ITextTemplatingSessionHost textTemplatingSessionHost = (ITextTemplatingSessionHost)textTemplating;

            textTemplatingSessionHost.Session = textTemplatingSessionHost.CreateSession();
            TPCallback tpCallback = new TPCallback();

            textTemplatingSessionHost.Session["AllowedFileTypes"]        = AllowedFileTypes;
            textTemplatingSessionHost.Session["Feature"]                 = GeneratedFeature;
            textTemplatingSessionHost.Session["FeatureContext"]          = SerializableFeatureContext;
            textTemplatingSessionHost.Session["Context"]                 = SerializableDbContext;
            textTemplatingSessionHost.Session["DefaultProjectNameSpace"] = string.IsNullOrEmpty(defaultProjectNameSpace) ? "" : defaultProjectNameSpace;

            if (string.IsNullOrEmpty(GenText))
            {
                this.GenerateText = textTemplating.ProcessTemplate(T4TempatePath, File.ReadAllText(T4TempatePath), tpCallback);
            }
            else
            {
                this.GenerateText = textTemplating.ProcessTemplate(T4TempatePath, GenText, tpCallback);
            }
            FileExtension = tpCallback.FileExtension;
            if (tpCallback.ProcessingErrors != null)
            {
                foreach (TPError tpError in tpCallback.ProcessingErrors)
                {
                    this.GenerateError += tpError.ToString() + "\n";
                }
            }
            IsReady.DoNotify(this, string.IsNullOrEmpty(this.GenerateError));
        }
Esempio n. 12
0
        //It is completely possible to allow another thread here, such a thread would be soley responsible for issuing the data to the handlers of the RtpClient's events and would provide better performance in some cases.
        //It's also possible to Multicast the source resulting in the network handling the aggregation (See Sink)

        #endregion

        #region Unused [Example of how an implementation would begin to propagate the realization that may have to actually do some type of work]

        //Asked by a user here how they would save a rtsp stream to disk....
        //RtpTools, MediaFileWriter, FFMPEG, Media Foundation................................................................
        //http://stackoverflow.com/questions/37285323/how-to-record-a-rtsp-stream-to-disk-using-net7mma

        //System.Drawing.Image m_lastDecodedFrame;
        //internal virtual void DecodeFrame(Rtp.RtpClient sender, Rtp.RtpFrame frame)
        //{
        //    if (RtpClient == null || RtpClient != sender) return;
        //    try
        //    {
        //        //Get the MediaDescription (by ssrc so dynamic payload types don't conflict
        //        Media.Sdp.MediaDescription mediaDescription = RtpClient.GetContextBySourceId(frame.SynchronizationSourceIdentifier).MediaDescription;
        //        if (mediaDescription.MediaType == Sdp.MediaType.audio)
        //        {
        //            //Could have generic byte[] handlers OnAudioData OnVideoData OnEtc
        //            //throw new NotImplementedException();
        //        }
        //        else if (mediaDescription.MediaType == Sdp.MediaType.video)
        //        {
        //            if (mediaDescription.MediaFormat == 26)
        //            {
        //                OnFrameDecoded(m_lastDecodedFrame = (new RFC2435Stream.RFC2435Frame(frame)).ToImage());
        //            }
        //            else if (mediaDescription.MediaFormat >= 96 && mediaDescription.MediaFormat < 128)
        //            {
        //                //Dynamic..
        //                //throw new NotImplementedException();
        //            }
        //            else
        //            {
        //                //0 - 95 || >= 128
        //                //throw new NotImplementedException();
        //            }
        //        }
        //    }
        //    catch
        //    {
        //        return;
        //    }
        //}

        #endregion

        #endregion

        #region ILoggingReference

        public override bool TrySetLogger(Common.ILogging logger)
        {
            if (IsReady.Equals(false))
            {
                return(false);
            }

            try
            {
                //Set the logger
                RtpClient.Logger = logger;

                return(true);
            }
            catch
            {
                return(false);
            }
            finally
            {
                //
            }
        }
Esempio n. 13
0
        public void DoAnalise(DTE2 Dte)
        {
            Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
            if (Dte == null)
            {
                ErrorText = DteNotDefinedError;
                IsReady.DoNotify(this, false);
                return;
            }

            SelectedItems selItems = Dte.SelectedItems;

            if (selItems == null)
            {
                ErrorText = NoDestinationError;
                IsReady.DoNotify(this, false);
                return;
            }
            if (selItems.Count < 1)
            {
                ErrorText = NoDestinationError;
                IsReady.DoNotify(this, false);
                return;
            }
            if (selItems.MultiSelect)
            {
                ErrorText = OneItemSelectedError;
                IsReady.DoNotify(this, false);
                return;
            }

            SelectedItem selItem = selItems.Item(1); // Number 1 is a first item

            if (selItem.Project != null)
            {
                // the project is selected as a root
                InvitationHint = InvitationHintStr;
                DefineDestinationNameSpace(selItem);
                IsReady.DoNotify(this, true);
                return;
            }
            if (selItem.ProjectItem == null)
            {
                ErrorText = NoDestinationError;
                IsReady.DoNotify(this, false);
                return;
            }
            Guid ItemGuid;

            if (!Guid.TryParse(selItem.ProjectItem.Kind, out ItemGuid))
            {
                ErrorText = ItemTypeError;
                IsReady.DoNotify(this, false);
                return;
            }
            if (!VSConstants.ItemTypeGuid.PhysicalFolder_guid.Equals(ItemGuid))
            {
                ErrorText = ItemTypeError;
                IsReady.DoNotify(this, false);
                return;
            }
            InvitationHint = InvitationHintStr;
            DefineDestinationNameSpace(selItem);
            IsReady.DoNotify(this, true);
        }
Esempio n. 14
0
 public void DisplayInfo(Customer person)
 {
     IsReady?.Invoke($"{person.Id} может забрать заказ.");
 }
Esempio n. 15
0
 public void CheckIsReady()
 {
     IsReady.DoNotify(this, (SelectedDbContext != null) && (SelectedEntity != null) && (SelectedForeignKey != null));
 }
Esempio n. 16
0
 public virtual void CheckIsReady()
 {
     IsReady.DoNotify(this, !string.IsNullOrEmpty(SelectedTemplate));
 }
Esempio n. 17
0
 public void CheckIsReady()
 {
     IsReady.DoNotify(this, (!string.IsNullOrEmpty(this.T4TempateText)) && (!string.IsNullOrEmpty(T4TempatePath)));
 }
Esempio n. 18
0
 public void CheckIsReady()
 {
     IsReady.DoNotify(this, (!string.IsNullOrEmpty(this.T4SelectedFolder)) && (!string.IsNullOrEmpty(FileName)));
 }
Esempio n. 19
0
 public virtual void CheckIsReady()
 {
     IsReady.DoNotify(this, false);
 }
 public override void CheckIsReady()
 {
     IsReady.DoNotify(this, !((!HasPrimKey) || string.IsNullOrEmpty(SelectedClassName) || (SelectedCodeElement == null) || string.IsNullOrEmpty(SelectedProppertyNameCaption)));
 }
 public override void CheckIsReady()
 {
     IsReady.DoNotify(this, !(string.IsNullOrEmpty(SelectedClassName) || (SelectedCodeElement == null) || (ActionUserControl != null)));
 }
 public void CheckIsReady()
 {
     IsReady.DoNotify(this, (SelectedModel != null) || (!IsSelectExisting));
 }
Esempio n. 23
0
 /// <summary>
 /// Raise the 'IsReady' event.
 /// </summary>
 protected void RaiseIsReady()
 {
     IsReady?.Invoke(this, EventArgs.Empty);
 }